forked from mindersec/minder
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Creating providers with config (mindersec#3334)
* Make the providerClassManager reusable by adding an intermediate providerTracker In order to be able to add the providerAuthManager in the next step and avoid code duplication, let's make the providerClassManager a little more reusable by extracting the code that tracks registered classes. * Add providerAuthManager Adds the providerAuthManager interface that exposes per-provider OAuth settings. This allows the provider creation in an OAuth callback to let the provider specific code sit in the provider codebase and let the creation be provider agnostic. ALso creates a sessionService that currently allows to create a provider from a session record that is created before the OAuth conversation. Fixes: mindersec#3263 * Enroll providers with OAuth flow and config Adds the CLI support for creating an OAuth provider with a config. * Reduce code duplication in handlers_oauth.go Two or more, use a for. * Pass providerConfig to GH app on creation Allows to pass provider configuration when creating a GH app. This will be useful for creating providers with repository auto-enrollment. Fixes: mindersec#3263 Unlike the OAuth flow which is reusable for any provider, the GH App flow is quite GH-app specific and thus uses the original GH app handler. * Only rewrite fallback OAuth config values if set We added a ProviderConfig-based structure but then in a subsequent patch we overwrite its values unconditionally. Let's only overwrite them when set. * Move fallback OAuth configuration to be instantiated on startup Based on review feedback, to isolate the fallback code. * Adjust tests after recent config validation changes
- Loading branch information
Showing
17 changed files
with
1,432 additions
and
320 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.