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

Test OAuth2 integration within CI #1652

Closed
tcompa opened this issue Jul 16, 2024 · 1 comment · Fixed by #1665
Closed

Test OAuth2 integration within CI #1652

tcompa opened this issue Jul 16, 2024 · 1 comment · Fixed by #1665

Comments

@tcompa
Copy link
Collaborator

tcompa commented Jul 16, 2024

Right now we are only testing some unit behaviors of the OAuth configuration, but we don't have the actual authentication procedure tested automatically.

We should explore automated testing, in view of when this authentication procedure will be used more.

There are multiple options:

  1. Existing playgrounds (e.g. https://www.oauth.com/playground, https://docs.wiremock.io/oauth2-mock/)
  2. A mock server from within pytest (does it exist?)
  3. A fake FastAPI app that simply sends some expected responses to a set of given API calls.
  4. An actual server from within a container (e.g. https://github.com/navikt/mock-oauth2-server)
  5. ...
@ychiucco ychiucco self-assigned this Jul 17, 2024
@ychiucco ychiucco mentioned this issue Jul 18, 2024
2 tasks
@ychiucco ychiucco linked a pull request Jul 18, 2024 that will close this issue
2 tasks
@tcompa
Copy link
Collaborator Author

tcompa commented Jul 22, 2024

The solution used by @ychiucco in #1665 is to use https://dexidp.io containers. Quoting from the docs

Dex is an identity service that uses OpenID Connect to drive authentication for other apps. Dex acts as a portal to other identity providers through “connectors.” This lets Dex defer authentication to LDAP servers, SAML providers, or established identity providers like GitHub, Google, and Active Directory.

Apart from our testing use case, it's good to be aware of this mainstream tool - in case we'll get back to discussions about authentication in different environments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

2 participants