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

Add integration tests for OIDC authentication #801

Merged
merged 28 commits into from
Sep 21, 2022
Merged

Conversation

juanfont
Copy link
Owner

@juanfont juanfont commented Sep 8, 2022

This PR adds basic integration tests for our OIDC code.

For the time being they are pretty basic (just login in), but it is a start :)

We make use of https://github.com/oauth2-proxy/mockoidc for simulating a OIDC Identity Provider.

@juanfont juanfont requested a review from kradalby as a code owner September 8, 2022 17:50
@juanfont
Copy link
Owner Author

Commit b3a53bf also fixes #801

@@ -0,0 +1,22 @@

-----BEGIN CERTIFICATE-----
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you create an issue to have all keys/certs used for testing generated at start? I dont like that we check them in, but its fine for this pr.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

integration_common_test.go Outdated Show resolved Hide resolved
joinWaitGroup sync.WaitGroup
}

func TestOIDCIntegrationTestSuite(t *testing.T) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We really need to improve reusing code here, so much boilerplate 🥲

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes...

integration_oidc_test.go Show resolved Hide resolved
@kradalby
Copy link
Collaborator

Note: This doesnt seem to run on macOS (or my Mac), but for the time being, that can be tackled as a separate issue.

@juanfont juanfont merged commit bd6282d into main Sep 21, 2022
@juanfont juanfont deleted the oidc-integration-testing branch September 21, 2022 15:26
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.

2 participants