feat(idtoken-auth): add auth validator using google idtoken#349
feat(idtoken-auth): add auth validator using google idtoken#349mabdh merged 27 commits intoraystack:0.6.xfrom
Conversation
|
@swallowstalker can you create an issue along with details what this feature is about and what it will solve, and link it with this PR ? |
sure, will create it shortly. sorry if there's only very short description and background about this PR |
|
@bsushmith here is the issue #350 |
b45d454 to
2e9c4a1
Compare
I have moved OIDCValidator mock to |
|
@swallowstalker Please see if you can find some time to fix test and the above mentioned comment. We can go ahead and merge it then |
sorry i was oncall last week. will fix that in few days |
… different context key for oidc email
…der (it's only used for logrus)
…trieve its value from context
|
@swallowstalker I've created v0.6.0-alpha.1 release, you can use this to test from your side 🙂 |
|
@swallowstalker Thanks a lot for your contribution :) |
* feat(idtoken-auth): add auth validator using google idtoken (#349) * docs: add idtoken validation on sample config.yaml * feat: add auth config to replace idtoken validator config, and refactor default auth header key * refactor: move auth interceptor to pkg/auth * chore: delete idtoken validator mock * feat: keep config.AuthenticatedUserHeaderKey for backward-compatibility * chore: re-order import * refactor: change sample config.yaml for auth config * chore: make auth user header key sample and default config consistent * chore: re-order import on oidc test * fix: change oidc initialism * fix: oidc validator mocks renaming * fix: avoid using params with pointer, as it will lead to panic if params is nil * fix: detect old auth user header key using empty string instead of default tag * refactor: move OIDCAuth to pkg/auth * refactor: move oidc validator mocks into pkg/auth/mocks * chore: add deprecation notes on AuthenticatedUserHeaderKey * refactor: make default auth email context key back to unexported, use different context key for oidc email * refactor: do not use default header key on oidc auth, use its own header (it's only used for logrus) * refactor: move logrus context custom fields to new interceptor and retrieve its value from context * refactor: auth email context key mapping for default and oidc used for grpc server * test: change ways of getting user email from request header to context * refactor: use auth.OIDCAuth instead of OIDCValidatorParams * feat(gcs): support import grants for gcs provider (#360) * feat(gcs): support import grants for gcs provider * refactor(gcs): use projectID value from struct field and remove from GetBuckets' param * refactor(gcs): refactor repeated logic to retrieve gcs client * refactor(gcs): improve code readability * fix(gcs): exclude deleted principals (#364) * refactor(gcs): use account type whitelisting * fix(gcs): exclude deleted principals * fix(gcs): fix timeout by running getPolicy in parallel (#365) --------- Co-authored-by: Pulung Ragil <[email protected]>
Add google idtoken (OIDC) auth validator on grpc interceptor, to provide login via google SSO
How to use it
Just add this line to config.yaml (sample is on internal/server/config.yaml)
Tests
Without any request header
Response:
401 UnauthorizedWith
Authorizationheader containingidtokenfrom google SSOResponse:
200 OK(no list of appeals yet because it's empty)