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

Move provider OAuth config under server.Config #3410

Merged
merged 6 commits into from
May 23, 2024

Conversation

jhrozek
Copy link
Contributor

@jhrozek jhrozek commented May 23, 2024

Summary

In the next PR (#3334) we need to move the OAuth config under providers
themselves, but in order to do that, we need to get rid of the oauth client
config code calling viper.Get directly or else we'll break all our tests.

This PR does that and gets rid of the Google OAuth configuration and other
now-unused code.

Because the next PR will move the OAuth client code around to providers, I
didn't get overboard with testing here.

Fixes #2798

Change Type

  • Bug fix (resolves an issue without affecting existing features)
  • Feature (adds new functionality without breaking changes)
  • Breaking change (may impact existing functionalities or require documentation updates)
  • Documentation (updates or additions to documentation)
  • Refactoring or test improvements (no bug fixes or new functionality)

Testing

make test and provider enroll

Review Checklist:

  • Reviewed my own code for quality and clarity.
  • Added comments to complex or tricky code sections.
  • Updated any affected documentation.
  • Included tests that validate the fix or feature.
  • Checked that related changes are merged.

@jhrozek jhrozek requested a review from a team as a code owner May 23, 2024 11:16
Let's remove this code, it's unused and we're moving to keeping the data
in a structure.
The next patch will add yet another place where this pattern is used,
let's not add yet another repeated piece of code.
Add a config structure to keep the OAuth client configuration so that we
can pass a structure to providers instead of reading the config
attributes directly with viber.
@coveralls
Copy link

coveralls commented May 23, 2024

Coverage Status

coverage: 51.96% (+0.05%) from 51.915%
when pulling 9a4eee3 on jhrozek:oauth_config
into 2749c31 on stacklok:main.

@jhrozek jhrozek merged commit 071adde into mindersec:main May 23, 2024
20 checks passed
JAORMX added a commit that referenced this pull request May 27, 2024
#3410 removed manually-registered
command line flags we were using to set these. Let's set them as env
variables instead.

Signed-off-by: Juan Antonio Osorio <ozz@stacklok.com>
jhrozek pushed a commit to jhrozek/minder that referenced this pull request May 27, 2024
mindersec#3410 removed manually-registered
command line flags we were using to set these. Let's set them as env
variables instead.

Signed-off-by: Juan Antonio Osorio <ozz@stacklok.com>
jhrozek added a commit that referenced this pull request May 27, 2024
…3429)

* Fix reading fallback values for the GH providers

* Pass in github provider settings from env variables

#3410 removed manually-registered
command line flags we were using to set these. Let's set them as env
variables instead.

Signed-off-by: Juan Antonio Osorio <ozz@stacklok.com>

---------

Signed-off-by: Juan Antonio Osorio <ozz@stacklok.com>
Co-authored-by: Juan Antonio Osorio <ozz@stacklok.com>
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.

Move provider credentials under ProviderConfig
3 participants