Skip to content

Commit

Permalink
Merge pull request #49 from project-flogo/chore-descriptor
Browse files Browse the repository at this point in the history
Added descriptors Closes #48
  • Loading branch information
pointlander committed Jul 8, 2019
2 parents 35451b2 + f95cd7f commit c54f135
Show file tree
Hide file tree
Showing 6 changed files with 262 additions and 0 deletions.
34 changes: 34 additions & 0 deletions activity/anomaly/descriptor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "anomaly",
"type": "flogo:activity",
"version": "0.0.1",
"title": "Anomaly",
"description": "Anomaly detection",
"homepage": "https://github.com/project-flogo/microgateway/tree/master/activity/anomaly",
"settings": [
{
"name": "depth",
"type": "string",
"description": "The size of the statistical model. Defaults to 2"
}
],
"input": [
{
"name": "payload",
"type": "any",
"description": "A payload to do anomaly detection on"
}
],
"output": [
{
"name": "complexity",
"type": "float32",
"description": "How unusual the payload is in terms of standard deviations from the mean"
},
{
"name": "count",
"type": "int",
"description": "The number of payloads that have been processed"
}
]
}
46 changes: 46 additions & 0 deletions activity/circuitbreaker/descriptor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"name": "circuitbreaker",
"type": "flogo:activity",
"version": "0.0.1",
"title": "Circuit Breaker",
"description": "Adds protection for a service",
"homepage": "https://github.com/project-flogo/microgateway/tree/master/activity/circuitbreaker",
"settings": [
{
"name": "mode",
"type": "string",
"allowed": [ "a", "b", "c", "d"],
"description": "The tripping mode: 'a' for contiguous errors, 'b' for errors within a time period, 'c' for contiguous errors within a time period, and 'd' for a probabilistic smart circuit breaker mode. Defaults to mode 'a'"
},
{
"name": "threshold",
"type": "int",
"description": "The number of errors required for tripping. Defaults to 5 errors"
},
{
"name": "period",
"type": "int",
"description": "Number of seconds in which errors have to occur for the circuit breaker to trip. Applies to modes 'b' and 'c'. Defaults to 60 seconds"
},
{
"name": "timeout",
"type": "int",
"description": "Number of seconds that the circuit breaker will remain tripped. Applies to modes 'a', 'b', 'c'. Defaults to 60 seconds"
}
],
"input": [
{
"name": "operation",
"type": "string",
"allowed": ["counter", "reset"],
"description": "An operation to perform: '' for protecting a service, 'counter' for processing errors, and 'reset' for processing non-errors. Defaults to ''"
}
],
"output": [
{
"name": "tripped",
"type": "bool",
"description": "The state of the circuit breaker"
}
]
}
68 changes: 68 additions & 0 deletions activity/jwt/descriptor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"name": "jwt",
"type": "flogo:activity",
"version": "0.0.1",
"title": "JSON Web Token",
"description": "JSON web token authentication",
"homepage": "https://github.com/project-flogo/microgateway/tree/master/activity/jwt",
"settings": [],
"input": [
{
"name": "token",
"type": "string",
"description": "The raw token"
},
{
"name": "key",
"type": "string",
"description": "The key used to sign the token"
},
{
"name": "signingMethod",
"type": "string",
"description": "The signing method used (HMAC, ECDSA, RSA, RSAPSS)"
},
{
"name": "iss",
"type": "string",
"description": "The 'iss' standard claim to match against"
},
{
"name": "sub",
"type": "string",
"description": "The 'sub' standard claim to match against"
},
{
"name": "aud",
"type": "string",
"description": "The 'aud' standard claim to match against"
}
],
"output": [
{
"name": "valid",
"type": "bool",
"description": "If the token is valid or not"
},
{
"name": "token",
"type": "any",
"description": "The parsed token"
},
{
"name": "validationMessage",
"type": "string",
"description": "The validation failure message"
},
{
"name": "error",
"type": "bool",
"description": "If an error occurred when parsing the token"
},
{
"name": "errorMessage",
"type": "string",
"description": "The error message"
}
]
}
56 changes: 56 additions & 0 deletions activity/ratelimiter/descriptor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"name": "ratelimiter",
"type": "flogo:activity",
"version": "0.0.1",
"title": "Rate Limiter",
"description": "Limits the rate a which a service is called",
"homepage": "https://github.com/project-flogo/microgateway/tree/master/activity/ratelimiter",
"settings": [
{
"name": "limit",
"type": "string",
"required": true,
"description": "Limit can be specifed in the format of \"limit-period\". Valid periods are 'S', 'M' & 'H' to represent Second, Minute & Hour. Example: \"10-S\" represents 10 request/second"
},
{
"name": "spikeThreshold",
"type": "float64",
"description": "Multiple above base traffic load which triggers the spike block logic. Spike blocking is disabled by default."
},
{
"name": "decayRate",
"type": "float64",
"description": "Exponential decay rate for the spike blocking probability. Default .01"
}
],
"input": [
{
"name": "token",
"type": "string",
"required": true,
"description": "Token for which rate limit has to be applied"
}
],
"output": [
{
"name": "limitReached",
"type": "bool",
"description": "If the limit exceeds"
},
{
"name": "limitAvailable",
"type": "int64",
"description": "Available limit"
},
{
"name": "error",
"type": "bool",
"description": "If any error occured while applying the rate limit"
},
{
"name": "errorMessage",
"type": "string",
"description": "The error message"
}
]
}
35 changes: 35 additions & 0 deletions activity/sqld/descriptor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"name": "sqld",
"type": "flogo:activity",
"version": "0.0.1",
"title": "SQL Detector",
"description": "Detects SQL injection attacks",
"homepage": "https://github.com/project-flogo/microgateway/tree/master/activity/sqld",
"settings": [
{
"name": "file",
"type": "string",
"description": "An optional file name for custom neural network weights"
}
],
"input": [
{
"name": "payload",
"type": "object",
"required": true,
"description": "A payload to do SQL injection attack detection on"
}
],
"output": [
{
"name": "attack",
"type": "float32",
"description": "The probability that the payload is a SQL injection attack"
},
{
"name": "attackValues",
"type": "object",
"description": "The SQL injection attack probability for each string in the payload"
}
]
}
23 changes: 23 additions & 0 deletions descriptor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "microgateway",
"type": "flogo:action",
"version": "0.0.1",
"title": "Microgateway Action",
"description": "Microgateway action for routing traffic",
"homepage": "https://github.com/project-flogo/microgateway",
"settings": [
{
"name": "uri",
"type": "string",
"required": true,
"description" : "The location of the microgateway resource"
},
{
"name": "async",
"type": "bool",
"description" : "Execute the resource in an asynchronous manner"
}
],
"input": [],
"output": []
}

0 comments on commit c54f135

Please sign in to comment.