Azure DevOps token source and validator#54667
Conversation
| "strings" | ||
| "time" | ||
|
|
||
| "github.com/coreos/go-oidc/v3/oidc" |
There was a problem hiding this comment.
All my bonusly points if you use zitadel/oidc/v3 instead !!
There was a problem hiding this comment.
Done - I've omitted caching JWKS across joins for now since I figure it'll make more sense to put that in once more than 1 join method uses the new zitadel package.
a8e1d45 to
7972945
Compare
| github.com/ghodss/yaml v1.0.0 | ||
| github.com/go-git/go-git/v5 v5.16.0 | ||
| github.com/go-jose/go-jose/v3 v3.0.4 | ||
| github.com/go-jose/go-jose/v4 v4.0.5 |
There was a problem hiding this comment.
Should we be thinking about moving all uses of go-jose/v3 to go-jose/v4?
There was a problem hiding this comment.
I used go-jose v4 in the tests here since that is what was being used indirectly by the Zitadel OIDC package.
As for if we ought to migrate more fully - it looks like v4 mostly included breaking changes to make it harder to footgun common JWT vulnerabilities (https://github.com/go-jose/go-jose/releases/tag/v4.0.0) - most of these should be pretty easy to adopt. I don't think there's any rush though since they seem to be still releasing new patches for v3.
Co-authored-by: rosstimothy <39066650+rosstimothy@users.noreply.github.com>
f45bfb1 to
75be296
Compare
* Initial impl of token source * Add initial token validator implementation * add join attrs for azure devops * Switch to Zitadel OIDC * Embed zoidc.TokenClaims into main IDTokenClaims struct * Add notes on caching * Expand concept of token validator * Start hacking on test suite * JoinAttrs method * Fix TestIDTokenValidator_Validate suite * Update OIDC doc to match real one * Add TestIDTokenSource * go mod tidy * rearrange go.mod * fix query params * RepositoryReference -> RepositoryRef * Switch to azuredevops * Adjust struct init * Update lib/azuredevops/token_validator.go Co-authored-by: rosstimothy <39066650+rosstimothy@users.noreply.github.com> --------- Co-authored-by: rosstimothy <39066650+rosstimothy@users.noreply.github.com>
* Initial impl of token source * Add initial token validator implementation * add join attrs for azure devops * Switch to Zitadel OIDC * Embed zoidc.TokenClaims into main IDTokenClaims struct * Add notes on caching * Expand concept of token validator * Start hacking on test suite * JoinAttrs method * Fix TestIDTokenValidator_Validate suite * Update OIDC doc to match real one * Add TestIDTokenSource * go mod tidy * rearrange go.mod * fix query params * RepositoryReference -> RepositoryRef * Switch to azuredevops * Adjust struct init * Update lib/azuredevops/token_validator.go Co-authored-by: rosstimothy <39066650+rosstimothy@users.noreply.github.com> --------- Co-authored-by: rosstimothy <39066650+rosstimothy@users.noreply.github.com>
* Azure DevOps token source and validator (#54667) * Initial impl of token source * Add initial token validator implementation * add join attrs for azure devops * Switch to Zitadel OIDC * Embed zoidc.TokenClaims into main IDTokenClaims struct * Add notes on caching * Expand concept of token validator * Start hacking on test suite * JoinAttrs method * Fix TestIDTokenValidator_Validate suite * Update OIDC doc to match real one * Add TestIDTokenSource * go mod tidy * rearrange go.mod * fix query params * RepositoryReference -> RepositoryRef * Switch to azuredevops * Adjust struct init * Update lib/azuredevops/token_validator.go Co-authored-by: rosstimothy <39066650+rosstimothy@users.noreply.github.com> --------- Co-authored-by: rosstimothy <39066650+rosstimothy@users.noreply.github.com> * go mod tidy --------- Co-authored-by: rosstimothy <39066650+rosstimothy@users.noreply.github.com>
Part of #38852
As per: #54341
Depends on #54658
Introduces core implementation for the token source and for the token validator, as well as workload id join attrs.
No backport labels or changelog as all stacked PRs will be backported together.