Skip to content

auth: Refactor the OIDC connector prior to moving out#18892

Merged
camscale merged 2 commits intomasterfrom
camh/refactor-oidc
Dec 1, 2022
Merged

auth: Refactor the OIDC connector prior to moving out#18892
camscale merged 2 commits intomasterfrom
camh/refactor-oidc

Conversation

@camscale
Copy link
Copy Markdown
Contributor

Refactor the OIDC connector to its own type so it is simpler to move out
of the auth.Server struct. This follows the same pattern as was done
with the SAML connector - a new struct that the OIDC request methods are
attached to, plugged into the auth.Server.

Move some small amount of code around so when it comes to removing it
later, it is largely confined to the oidc files and large contiguous
blocks - makes it slightly simpler to review.

Make ValidateACRValues a pure function as it did not use anything from
the struct it was a method on, and move the test for it into
oidc_test.go.

Move isHTTPS() from auth.go to oidc.go as it is only used there
and will later move out.

Export validateOIDCAuthCallbackReq and oidcAuthRawResponse and move
them to oidc.go so the web handler can also be moved to enterprise.

Issue: https://github.com/gravitational/teleport.e/issues/525

Refactor the OIDC connector to its own type so it is simpler to move out
of the `auth.Server` struct. This follows the same pattern as was done
with the SAML connector - a new struct that the OIDC request methods are
attached to, plugged into the `auth.Server`.

Move some small amount of code around so when it comes to removing it
later, it is largely confined to the oidc files and large contiguous
blocks - makes it slightly simpler to review.

Make `ValidateACRValues` a pure function as it did not use anything from
the struct it was a method on, and move the test for it into
`oidc_test.go`.

Move `isHTTPS()` from `auth.go` to `oidc.go` as it is only used there
and will later move out.

Export `validateOIDCAuthCallbackReq` and `oidcAuthRawResponse` and move
them to `oidc.go` so the web handler can also be moved to enterprise.
@github-actions github-actions Bot removed the request for review from timothyb89 December 1, 2022 15:00
@camscale camscale enabled auto-merge (squash) December 1, 2022 22:17
@camscale camscale merged commit 616f6ea into master Dec 1, 2022
@camscale camscale deleted the camh/refactor-oidc branch April 6, 2023 06:37
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.

3 participants