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

Validate the provider configuration on create #3510

Closed
jhrozek opened this issue Jun 3, 2024 · 0 comments · Fixed by #3535
Closed

Validate the provider configuration on create #3510

jhrozek opened this issue Jun 3, 2024 · 0 comments · Fixed by #3535
Assignees

Comments

@jhrozek
Copy link
Contributor

jhrozek commented Jun 3, 2024

When #3334 is merged, we'll have a way to create a provider with a configuration. But we need to validate the configuration on create as well or else we won't be able to use the provider - in fact not even delete it as deleting a project requires to instantiate a project which validates.

@jhrozek jhrozek self-assigned this Jun 3, 2024
jhrozek added a commit to jhrozek/minder that referenced this issue Jun 3, 2024
Not validating provider config before provider creation can have bad
consequences such as not being able to delete such provider because a
provider must be instantiated before it's deleted.

Related: mindersec#3510
jhrozek added a commit that referenced this issue Jun 4, 2024
Not validating provider config before provider creation can have bad
consequences such as not being able to delete such provider because a
provider must be instantiated before it's deleted.

Related: #3510
jhrozek added a commit to jhrozek/minder that referenced this issue Jun 5, 2024
Adds a new error ErrProviderInvalidConfig that is returned if the
ValidateConfig method of the provider Manager fails. This allows the
handlers to catch this error and display its details.

Fixes: mindersec#3510
jhrozek added a commit to jhrozek/minder that referenced this issue Jun 5, 2024
Adds the call to clients.ParseV1AppConfig to the code that creates GH
apps and returns the providers.ErrProviderInvalidConfig if the parsing
fails.

Catches the providers.ErrProviderInvalidConfig in the handler code to
display a user-friendly message.

Fixes: mindersec#3510
jhrozek added a commit that referenced this issue Jun 5, 2024
…ub App provider. (#3535)

* Handle validation errors for OAuth providers

Adds a new error ErrProviderInvalidConfig that is returned if the
ValidateConfig method of the provider Manager fails. This allows the
handlers to catch this error and display its details.

Fixes: #3510

* Validate GitHub App provider configuration on create

Adds the call to clients.ParseV1AppConfig to the code that creates GH
apps and returns the providers.ErrProviderInvalidConfig if the parsing
fails.

Catches the providers.ErrProviderInvalidConfig in the handler code to
display a user-friendly message.

Fixes: #3510
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 a pull request may close this issue.

1 participant