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

feat: OIDC authentication support #4427

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

var-i
Copy link

@var-i var-i commented May 28, 2024

What problem does this PR solve?

Close #4141

What's changed and how it works?

Adds frontend and backend support for Kubernetes OIDC authentication

Related changes

  • This change also requires further updates to the website (e.g. docs)
  • This change also requires further updates to the UI interface

Cherry-pick to release branches (optional)

This PR should be cherry-picked to the following release branches:

  • release-2.6
  • release-2.5

Checklist

CHANGELOG

Must include at least one of them.

  • I have updated the CHANGELOG.md
  • I have labeled this PR with "no-need-update-changelog"

Tests

Must include at least one of them.

  • Unit test
  • E2E test
  • Manual test

Side effects

  • Breaking backward compatibility

DCO

If you find the DCO check fails, please run commands like below (Depends on the actual situations. For example, if the failed commit isn't the most recent) to fix it:

git commit --amend --signoff
git push --force

Signed-off-by: Ivar Cmrecak <ivar.cmrecak@lego.com>
@var-i var-i changed the title OIDC authentication support feat: OIDC authentication support May 28, 2024
@STRRL STRRL self-assigned this May 28, 2024
@g1eny0ung g1eny0ung self-requested a review June 11, 2024 06:58
@g1eny0ung g1eny0ung self-assigned this Jun 11, 2024
@g1eny0ung g1eny0ung added the feature/new Introduce a new feature label Jun 11, 2024
Copy link
Member

@g1eny0ung g1eny0ung left a comment

Choose a reason for hiding this comment

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

@var-i Thanks for contributions! As this PR is implemented based on the GCP authentication, there are some areas that could be further refined and I will continue to give comments.

"golang.org/x/oauth2"
)

func setCookie(c *gin.Context, token *oauth2.Token) {
Copy link
Member

Choose a reason for hiding this comment

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

The setCookie has already been defined in gcp package, it's better to extract a public method instead of making a copy of it.

ctx := c.Request.Context()

s.logger.Info("handling oidc middleware")
if c.Request.Header.Get("X-Authorization-Method") != "gcp" {
Copy link
Member

Choose a reason for hiding this comment

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

This part of the code should be updated. We can use oidc as the X-Authorization-Method. At the same time, we also need to update the frontend to adapt it.

Copy link
Member

Choose a reason for hiding this comment

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

Or we can use oauth to unify all OAuth-based authorization.

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

Successfully merging this pull request may close these issues.

OIDC Authentication in Chaos-Mesh Dashboard
4 participants