-
Notifications
You must be signed in to change notification settings - Fork 16
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
Support for oauth2 authentication #69
Conversation
This is so that we can add retry logic when doing SSO/OAuth2.
Implement support for authentication via OAuth2 using the client credentials "Client Credentials Grant" flow (4.4 of RFC 6749). For this a new configuration section is added to the config file, where the client_id, client_secret and token_url have to be specified. The impelmention does currently not support "refresh tokens", but does support refreshing the token if an `expires_in` is present in the token itself. Corresponding unit tests have been added. [1] https://datatracker.ietf.org/doc/html/rfc6749#section-4.4
Add a new helper script to run the mock open id server that is shipped inside the osbuild-composer-tests package.
Switch the authentication method that the koji builder plugin uses from mTLS to SSO. Since we are using the mock openid server from the `osbuild-composer-tests` package. Make this package a dependency of `koji-osbuild-tests`.
29373b0
to
59dabbb
Compare
I added actual integration tests via the mock open id server provided by Open question, I called the configuration section From the logs, I am pretty sure we get a new instance of the plugin for every request so we should be fine concurrency-wise, but I might have to re-check the actual koji code. |
a23d647
to
913a881
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm :)
Implement support for authentication via OAuth2 using the client credentials "Client Credentials Grant" flow (4.4 of RFC 6749). For this a new configuration section is added to the config file, where the client_id, client_secret and token_url have to be specified.
The implementation does currently not support "refresh tokens", but does support refreshing the token if an
expires_in
is present in the token itself.Corresponding unit tests have been added.