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

feat: enhance jsonschema for third_party config #1990

Merged
merged 1 commit into from
Dec 5, 2024

Conversation

lfleischmann
Copy link
Member

Description

The JSON schema for the third_party configuration currently does not accurately represent dependencies between properties. These changes address the following issues:

  1. the schema validates against a configuration where any of the built-in providers or at least one provider in custom_providers is enabled but any one of third_party.redirect_url/third_party.error_redirect_url/third_party.allowed_redirect_urls is omitted - this should not happen, i.e. if a provider is enabled then third_party.redirect_url,third_party.error_redirect_url,third_party.allowed_redirect_urls are required
  2. the schema does not validate against a configuration where any disabled custom_provider omits a property that would only be required if the provider was enabled (display_name, client_id, secret, scopes) - this should not happen, if a custom_provider is not enabled then all other configurations are optional

How to test

Generate the JSON schema for the configuration using the schema generate config cmd. Then do one of the following:

  • let your IDE (tested with JetBrains GoLand) validate the schema against a configuration document (e.g. backend/config/config.yaml)
  • use an online validator like https://www.jsonschemavalidator.net/ (you have to convert the config YAML to JSON for this one)

@lfleischmann lfleischmann merged commit efbfc7d into main Dec 5, 2024
8 checks passed
@lfleischmann lfleischmann deleted the feat-enhance-thirdparty-schema branch December 5, 2024 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants