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

kube-apiserver: Add oidc-required-claim flag #6453

Merged

Conversation

jmthvt
Copy link
Contributor

@jmthvt jmthvt commented Feb 7, 2019

This PR adds the oidc-required-claim flag for kube-apiserver, that has been released in Kubernetes 1.11.

This would work if we specify one key-value claim, however it would fail for more than one pair.
This is due to the implementation of this flag. More info in this PR
https://github.com/kubernetes/kubernetes/pull/62136/files

I am not sure what would be the best approach? Any input is welcome.

EDIT: Should be all good now!

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Feb 7, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @jeyglk. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 7, 2019
@jmthvt
Copy link
Contributor Author

jmthvt commented Feb 7, 2019

/assign @geojaz

Copy link
Contributor

@gambol99 gambol99 left a comment

Choose a reason for hiding this comment

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

Left the one comment just to check ..

// A key=value pair that describes a required claim in the ID Token.
// If set, the claim is verified to be present in the ID Token with a matching value.
// Repeat this flag to specify multiple claims.
OIDCRequiredClaim map[string]string `json:"oidcRequiredClaim,omitempty" flag:"oidc-required-claim"`
Copy link
Contributor

@gambol99 gambol99 Feb 8, 2019

Choose a reason for hiding this comment

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

Has this been tested with multiple claims?

The documentation

--oidc-required-claim mapStringString
  | A key=value pair that describes a required claim in the ID Token. If set, the claim is verified to be present in the ID Token with a matching value. Repeat this flag to specify multiple claims.

i.e. the Repeat this flag to specify multiple claims ... but the default of the flagbuilder reflection which converts the struct to command line args is to append map[string]string like --node-labels=k1=v1,k2=v2 etc

If it's not supported perhaps use a slice and add the repeat tag to the annotation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, the flag doesn't support multiple claims. Thanks for the suggestion, that makes sense. Will try 👍

@jmthvt jmthvt force-pushed the feature/add-oidc-required-claim-flag branch from b271b74 to 893742f Compare February 8, 2019 17:45
@jmthvt
Copy link
Contributor Author

jmthvt commented Feb 8, 2019

@gambol99 comment addressed, PTAL

@chrislovecnm
Copy link
Contributor

/ok-to-test

@geojaz are we still generating the api docs?

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 9, 2019
@jmthvt
Copy link
Contributor Author

jmthvt commented Feb 9, 2019

/test pull-kops-e2e-kubernetes-aws

1 similar comment
@gambol99
Copy link
Contributor

/test pull-kops-e2e-kubernetes-aws

@gambol99
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 18, 2019
@gambol99
Copy link
Contributor

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gambol99, jeyglk

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 18, 2019
@k8s-ci-robot k8s-ci-robot merged commit c243adc into kubernetes:master Feb 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants