Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
04837fde
Commit
04837fde
authored
Apr 17, 2018
by
Mike Danese
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
authn: add Audiences to TokenReview
parent
3ea3cfc3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
0 deletions
+52
-0
types.go
pkg/apis/authentication/types.go
+16
-0
types.go
staging/src/k8s.io/api/authentication/v1/types.go
+18
-0
types.go
staging/src/k8s.io/api/authentication/v1beta1/types.go
+18
-0
No files found.
pkg/apis/authentication/types.go
View file @
04837fde
...
@@ -59,6 +59,12 @@ type TokenReview struct {
...
@@ -59,6 +59,12 @@ type TokenReview struct {
type
TokenReviewSpec
struct
{
type
TokenReviewSpec
struct
{
// Token is the opaque bearer token.
// Token is the opaque bearer token.
Token
string
Token
string
// Audiences is a list of the identifiers that the resource server presented
// with the token identifies as. Audience-aware token authenticators will
// verify that the token was intended for at least one of the audiences in
// this list. If no audiences are provided, the audience will default to the
// audience of the Kubernetes apiserver.
Audiences
[]
string
}
}
// TokenReviewStatus is the result of the token authentication request.
// TokenReviewStatus is the result of the token authentication request.
...
@@ -68,6 +74,16 @@ type TokenReviewStatus struct {
...
@@ -68,6 +74,16 @@ type TokenReviewStatus struct {
Authenticated
bool
Authenticated
bool
// User is the UserInfo associated with the provided token.
// User is the UserInfo associated with the provided token.
User
UserInfo
User
UserInfo
// Audiences are audience identifiers chosen by the authenticator that are
// compatible with both the TokenReview and token. An identifier is any
// identifier in the intersection of the TokenReviewSpec audiences and the
// token's audiences. A client of the TokenReview API that sets the
// spec.audiences field should validate that a compatible audience identifier
// is returned in the status.audiences field to ensure that the TokenReview
// server is audience aware. If a TokenReview returns an empty
// status.audience field where status.authenticated is "true", the token is
// valid against the audience of the Kubernetes API server.
Audiences
[]
string
// Error indicates that the token couldn't be checked
// Error indicates that the token couldn't be checked
Error
string
Error
string
}
}
...
...
staging/src/k8s.io/api/authentication/v1/types.go
View file @
04837fde
...
@@ -64,6 +64,13 @@ type TokenReviewSpec struct {
...
@@ -64,6 +64,13 @@ type TokenReviewSpec struct {
// Token is the opaque bearer token.
// Token is the opaque bearer token.
// +optional
// +optional
Token
string
`json:"token,omitempty" protobuf:"bytes,1,opt,name=token"`
Token
string
`json:"token,omitempty" protobuf:"bytes,1,opt,name=token"`
// Audiences is a list of the identifiers that the resource server presented
// with the token identifies as. Audience-aware token authenticators will
// verify that the token was intended for at least one of the audiences in
// this list. If no audiences are provided, the audience will default to the
// audience of the Kubernetes apiserver.
// +optional
Audiences
[]
string
`json:"audiences,omitempty" protobuf:"bytes,2,rep,name=audiences"`
}
}
// TokenReviewStatus is the result of the token authentication request.
// TokenReviewStatus is the result of the token authentication request.
...
@@ -74,6 +81,17 @@ type TokenReviewStatus struct {
...
@@ -74,6 +81,17 @@ type TokenReviewStatus struct {
// User is the UserInfo associated with the provided token.
// User is the UserInfo associated with the provided token.
// +optional
// +optional
User
UserInfo
`json:"user,omitempty" protobuf:"bytes,2,opt,name=user"`
User
UserInfo
`json:"user,omitempty" protobuf:"bytes,2,opt,name=user"`
// Audiences are audience identifiers chosen by the authenticator that are
// compatible with both the TokenReview and token. An identifier is any
// identifier in the intersection of the TokenReviewSpec audiences and the
// token's audiences. A client of the TokenReview API that sets the
// spec.audiences field should validate that a compatible audience identifier
// is returned in the status.audiences field to ensure that the TokenReview
// server is audience aware. If a TokenReview returns an empty
// status.audience field where status.authenticated is "true", the token is
// valid against the audience of the Kubernetes API server.
// +optional
Audiences
[]
string
`json:"audiences,omitempty" protobuf:"bytes,4,rep,name=audiences"`
// Error indicates that the token couldn't be checked
// Error indicates that the token couldn't be checked
// +optional
// +optional
Error
string
`json:"error,omitempty" protobuf:"bytes,3,opt,name=error"`
Error
string
`json:"error,omitempty" protobuf:"bytes,3,opt,name=error"`
...
...
staging/src/k8s.io/api/authentication/v1beta1/types.go
View file @
04837fde
...
@@ -48,6 +48,13 @@ type TokenReviewSpec struct {
...
@@ -48,6 +48,13 @@ type TokenReviewSpec struct {
// Token is the opaque bearer token.
// Token is the opaque bearer token.
// +optional
// +optional
Token
string
`json:"token,omitempty" protobuf:"bytes,1,opt,name=token"`
Token
string
`json:"token,omitempty" protobuf:"bytes,1,opt,name=token"`
// Audiences is a list of the identifiers that the resource server presented
// with the token identifies as. Audience-aware token authenticators will
// verify that the token was intended for at least one of the audiences in
// this list. If no audiences are provided, the audience will default to the
// audience of the Kubernetes apiserver.
// +optional
Audiences
[]
string
`json:"audiences,omitempty" protobuf:"bytes,2,rep,name=audiences"`
}
}
// TokenReviewStatus is the result of the token authentication request.
// TokenReviewStatus is the result of the token authentication request.
...
@@ -58,6 +65,17 @@ type TokenReviewStatus struct {
...
@@ -58,6 +65,17 @@ type TokenReviewStatus struct {
// User is the UserInfo associated with the provided token.
// User is the UserInfo associated with the provided token.
// +optional
// +optional
User
UserInfo
`json:"user,omitempty" protobuf:"bytes,2,opt,name=user"`
User
UserInfo
`json:"user,omitempty" protobuf:"bytes,2,opt,name=user"`
// Audiences are audience identifiers chosen by the authenticator that are
// compatible with both the TokenReview and token. An identifier is any
// identifier in the intersection of the TokenReviewSpec audiences and the
// token's audiences. A client of the TokenReview API that sets the
// spec.audiences field should validate that a compatible audience identifier
// is returned in the status.audiences field to ensure that the TokenReview
// server is audience aware. If a TokenReview returns an empty
// status.audience field where status.authenticated is "true", the token is
// valid against the audience of the Kubernetes API server.
// +optional
Audiences
[]
string
`json:"audiences,omitempty" protobuf:"bytes,4,rep,name=audiences"`
// Error indicates that the token couldn't be checked
// Error indicates that the token couldn't be checked
// +optional
// +optional
Error
string
`json:"error,omitempty" protobuf:"bytes,3,opt,name=error"`
Error
string
`json:"error,omitempty" protobuf:"bytes,3,opt,name=error"`
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment