-
Notifications
You must be signed in to change notification settings - Fork 39.8k
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
authn: extend authenticator.Token to support audience validation #62692
Conversation
mikedanese
commented
Apr 17, 2018
•
edited
Loading
edited
a28b61f
to
2071d9f
Compare
staging/src/k8s.io/apiserver/pkg/endpoints/filters/authentication.go
Outdated
Show resolved
Hide resolved
staging/src/k8s.io/apiserver/pkg/authentication/authenticator/interfaces.go
Outdated
Show resolved
Hide resolved
This is to let TokenReview start handling audiences, right? |
@ericchiang that's the goal. |
d913e4d
to
e99d1c0
Compare
e75aa0a
to
595ba18
Compare
@@ -147,6 +149,8 @@ func (s *DelegatingAuthenticationOptions) AddFlags(fs *pflag.FlagSet) { | |||
if s.RemoteKubeConfigFileOptional { | |||
optionalKubeConfigSentence = " This is optional. If empty, all token requests are considered to be anonymous and no client CA is looked up in the cluster." | |||
} | |||
fs.StringSliceVar(&s.APIAudiences, "api-audiences", s.APIAudiences, "Identifiers of this API server. Authenticators will validate that tokens used against this API server are bound to at least one of these audiences.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indicate what happens if unset
9e17d8b
to
31ba622
Compare
@liggitt PTAL |
if len(auds) == 0 { | ||
auds = r.apiAudiences | ||
} | ||
if len(auds) == 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if len >= 0, right? (and if tests passed with this, add a test that would have caught this)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch. This area is covered by integration tests which failed. https://gubernator.k8s.io/build/kubernetes-jenkins/pr-logs/pull/62692/pull-kubernetes-integration/36093/
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: liggitt, mikedanese 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 |
/retest |
@mikedanese: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. I understand the commands that are listed here. |
/retest |
Adding labels per https://kubernetes.slack.com/archives/C2C40FMNF/p1542418440380400 |
can you link the docs PR for the relevant docs update against the dev-1.13 branch? |