Jsonnet flag to skip triggering of web hook
Preflight checklist
- [X] I could not find a solution in the existing issues, docs, nor discussions.
- [X] I agree to follow this project's Code of Conduct.
- [X] I have read and am following this repository's Contribution Guidelines.
- [ ] I have joined the Ory Community Slack.
- [ ] I am signed up to the Ory Security Patch Newsletter.
Ory Network Project
No response
Describe your problem
Our project needs to run a web hook for a specific identity schema only.
Describe your ideal solution
Setting a specific key in jsonnet to skip triggering of the web hook, for example:
function(ctx) {
ory.sh/kratos/skip: ctx.identity.schema_id != "specific_schema_id",
}
Then the web hook will be skipped if schema_id isn't "specific_schema_id".
Workarounds or alternatives
Alternative solution would be adding a list of allowed schemas to web hook config:
- hook: web_hook
config:
url: <web_hook_url>
method: POST
body: request-data.jsonnet
+ allowed_schemas: ["schema_id_1", "schema_id_2", ...]
Version
1.3.0
Additional Context
No response
Sorry, it seems "interrupting" is a wrong word to describe what I meant here. It should be more like skipping of triggering web hook remote url, without actual interrupting of flow. E.g. a remote url is triggered only for specific schemas, while for the others a web hook will be just skipped without an error or interrupting of the flow. I'll update the description of the issue.
Done.
You can work around this by returning 204 from your webhook endpoint.
You can also return a cancel error (it’s in the docs) to cancel webhook exectuion.