Proposal: Add support for admission webhook #797
-
ContextThis is a proposal to add support for admission webhook in the same way that have in Kubernetes. Use cases
Implementation idea
RepresentationsErrorsAny status code != 200 will be treated as error and response should follow representation bellow: {
"error": "error message"
} Input for mutation and validation webhook{
"database":"db name",
"schema":"schema name",
"table":"table name",
"body":{
"field1":"value1"
}
} Output for mutation{
"field1":"value1"
} Output for validationIf status code is 200 body will be ignored Configuration file example[[admissionWebhooks]]
kind = "mutation"
database = "database name"
schema = "schema name"
table = "table name"
address = "http://localhost:9090/mutate"
verbs = [ "POST", "PATCH" ]
[[admissionWebhooks]]
kind = "validation"
database = "database name"
schema = "schema name"
table = "table name"
address = "http://localhost:9090/validation"
verbs = [ "POST", "PATCH" ] |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
I don't know if this feature would be used in most projects (apis), although it is excellent. Could it be time to implement support for writing middleware via a plugin? And have a plugin with this feature
|
Beta Was this translation helpful? Give feedback.
-
Let me put an exemple here: I have a table Category and the properties
table and category default values changes based on properties. I do not
want to create a New route to perform this kind of manipulation.
|
Beta Was this translation helpful? Give feedback.
-
We are making prestd more stencil by using the existing plugin architecture for endpoint (http), where it is possible to make prestd plugin by writing operating system library We implemented the first middleware version in this pull request #798
|
Beta Was this translation helpful? Give feedback.
We are making prestd more stencil by using the existing plugin architecture for endpoint (http), where it is possible to make prestd plugin by writing operating system library
We implemented the first middleware version in this pull request #798