Skip to content

Instantly share code, notes, and snippets.

@MichaelDrogalis
Last active November 8, 2023 20:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MichaelDrogalis/6d75219afa606ef7a8308123a7c1f6ff to your computer and use it in GitHub Desktop.
Save MichaelDrogalis/6d75219afa606ef7a8308123a7c1f6ff to your computer and use it in GitHub Desktop.
{
"generators": [
{
"topic": "passwordResetFlow",
"vars": {
"username": {
"_gen": "oneOf",
"choices": [
{ "_gen" : "string", "expr" : "#{Name.username}" },
{
"_gen": "lookup",
"topic": "passwordResetFlow",
"path": [ "value", "username" ]
}
]
}
},
"value": {
"username": { "_gen" : "var", "var" : "username" }
},
"stateMachine": {
"_gen": "stateMachine",
"for" : {
"_gen" : "var",
"var" : "username"
},
"initial": "passwordReset",
"transitions": {
"passwordReset": {
"_gen": "weightedOneOf",
"choices": [
{ "weight": 1, "value": "loginSuccessful" },
{ "weight": 3, "value": "passwordReset" }
]
}
},
"states": {
"passwordReset": {
"value": {
"action": "resetRequested"
}
},
"loginSuccessful": {
"value": {
"action": "loggedIn",
"captchaAttempts": {
"_gen": "integer",
"n": {
"_gen": "normalDistribution",
"mean": 2,
"sd": 5
}
}
}
}
}
},
"localConfigs": {
"throttle": {
"ms": {
"_gen": "normalDistribution",
"mean": 500,
"sd": 50
}
}
}
}
],
"connections": {
"kafka": {
"kind": "kafka",
"producerConfigs": {
"bootstrap.servers": "localhost:9092",
"key.serializer": "io.shadowtraffic.kafka.serdes.JsonSerializer",
"value.serializer": "io.shadowtraffic.kafka.serdes.JsonSerializer"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment