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

Extend ID_TOKEN mutator with custom claims #243

Closed
wants to merge 1 commit into from

Conversation

jakkab
Copy link
Contributor

@jakkab jakkab commented Aug 14, 2019

Related issue

#228

Proposed changes

  • Mutator ID_TOKEN now supports go templates
  • Users can define custom claims in rule configuration

Checklist

  • I have read the contributing guidelines
  • I have read the security policy
  • I confirm that this pull request does not address a security vulnerability. If this pull request addresses a security
    vulnerability, I confirm that I got green light (please contact [email protected]) from the maintainers to push the changes.
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation within the code base (if appropriate)
  • I have documented my changes in the developer guide (if appropriate)

@jakkab jakkab changed the title extend id_token Extend ID_TOKEN mutator with custom claims Aug 14, 2019
@@ -41,23 +44,29 @@ type MutatorIDTokenRegistry interface {
}

type CredentialsIDTokenConfig struct {
Audience []string `json:"aud"`
Audience []string `json:"aud"`
Copy link
Member

Choose a reason for hiding this comment

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

I guess the question is if we want to keep this or not. As now we can use the claims portion instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True. Do you want me to delete it?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I think that makes sense - but we have to document that in the upgrade guide .)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure! I'm on it!

UPGRADE.md Show resolved Hide resolved
@jakkab jakkab force-pushed the feature/id-token-custom-claims branch from 19af64c to 4826011 Compare August 20, 2019 08:10
@aeneasr
Copy link
Member

aeneasr commented Aug 20, 2019

If you need help with the e2e tests lmk

pipeline/mutate/mutator_id_token.go Outdated Show resolved Hide resolved
pipeline/mutate/mutator_id_token.go Outdated Show resolved Hide resolved
pipeline/mutate/mutator_id_token.go Outdated Show resolved Hide resolved
pipeline/mutate/mutator_id_token.go Outdated Show resolved Hide resolved
pipeline/mutate/mutator_id_token.go Outdated Show resolved Hide resolved
pipeline/mutate/mutator_id_token.go Outdated Show resolved Hide resolved
pipeline/mutate/mutator_id_token.go Outdated Show resolved Hide resolved
templateID := rl.GetID()
tmpl = a.t.Lookup(templateID)
if tmpl == nil {
tmpl, err = a.t.New(templateID).Parse(string(config))
Copy link
Member

Choose a reason for hiding this comment

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

This should be Prase(string(CredentialsIDTokenConfig.Claims)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wait, are you sure? I thought we execute the template first to avoid those parsing errors!

@jakkab jakkab force-pushed the feature/id-token-custom-claims branch from f3f3ac2 to 92aa903 Compare August 20, 2019 09:53
@jakkab jakkab marked this pull request as ready for review August 20, 2019 09:58
@aeneasr
Copy link
Member

aeneasr commented Aug 22, 2019

Thank you so much for your work - I've made some changes to this PR and merged it with #246 :)

@aeneasr aeneasr closed this Aug 22, 2019
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