Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

binding config schema validation for unused properties #929

Merged
merged 11 commits into from
Apr 25, 2024

Conversation

ankitk-me
Copy link
Contributor

Fixes #808

jfallows
jfallows previously approved these changes Apr 18, 2024
@ankitk-me ankitk-me changed the title Kafka binding config schema validation for unused properties binding config schema validation for unused properties Apr 18, 2024
@ankitk-me ankitk-me requested review from a team, akrambek, jfallows, attilakreiner and bmaidics and removed request for a team April 18, 2024 16:00
"additionalProperties": false
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that server options are a superset of client options, is there not a way to specify the common subset once, and then conditionally include the additional options properties for server?

@ankitk-me
Copy link
Contributor Author

Note:

Prior to this change, options & properties declared under options can be configured irrespective of the value configured for kind.
Below mentioned changes are done to restrict the configuration of unused properties.


binding-grpc
if kind: server, options (services) properties are allowed
if kind: client, options properties are not allowed

binding-kafka
if kind: cache_client, options (topics(name, key, value)) properties are allowed
if kind: cache_server, options (bootstrap, topics(name, defaultOffset, defaultOffset, key, value)) properties are allowed
if kind: client, options (servers, sasl) properties are allowed

binding-mqtt
if kind: server, options (versions, authorization, topics) properties are allowed
if kind: client, options properties are not allowed

binding-tls
if kind: server, options properties are allowed
if kind: client, options properties are allowed
if kind: proxy, options properties are not allowed

binding-ws
if kind: server, options properties are not allowed
if kind: client, options(protocol, scheme, authority, path) properties are allowed

binding-http
if kind: server, options(versions, overrides, requests, access-control, authorization) properties are allowed
if kind: client, options(versions, overrides, requests) properties are allowed


net0:
type: test
kind: server
entry: entry0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any reference to entry0 is this expected?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this script is added to test negative scenario(if kind: server, entry property is not allowed). expected output is JsonException. So I thought having an entry defined might not be required.

@jfallows jfallows merged commit 1cca9b7 into aklivity:develop Apr 25, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Report unused properties based on binding definition
5 participants