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
d657261f
Unverified
Commit
d657261f
authored
Oct 02, 2017
by
Jordan Liggitt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add /swagger.json and /swagger-2.0.0.pb-v1 to discovery role
parent
5e2ce3aa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
policy.go
plugin/pkg/auth/authorizer/rbac/bootstrappolicy/policy.go
+10
-1
cluster-roles.yaml
...thorizer/rbac/bootstrappolicy/testdata/cluster-roles.yaml
+2
-0
No files found.
plugin/pkg/auth/authorizer/rbac/bootstrappolicy/policy.go
View file @
d657261f
...
@@ -152,7 +152,16 @@ func ClusterRoles() []rbac.ClusterRole {
...
@@ -152,7 +152,16 @@ func ClusterRoles() []rbac.ClusterRole {
// a role which provides just enough power to determine if the server is ready and discover API versions for negotiation
// a role which provides just enough power to determine if the server is ready and discover API versions for negotiation
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
"system:discovery"
},
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
"system:discovery"
},
Rules
:
[]
rbac
.
PolicyRule
{
Rules
:
[]
rbac
.
PolicyRule
{
rbac
.
NewRule
(
"get"
)
.
URLs
(
"/healthz"
,
"/version"
,
"/swaggerapi"
,
"/swaggerapi/*"
,
"/api"
,
"/api/*"
,
"/apis"
,
"/apis/*"
)
.
RuleOrDie
(),
rbac
.
NewRule
(
"get"
)
.
URLs
(
"/healthz"
,
"/version"
,
// remove once swagger 1.2 support is removed
"/swaggerapi"
,
"/swaggerapi/*"
,
// do not expand this pattern for openapi discovery docs
// move to a single openapi endpoint that takes accept/accept-encoding headers
"/swagger.json"
,
"/swagger-2.0.0.pb-v1"
,
"/api"
,
"/api/*"
,
"/apis"
,
"/apis/*"
,
)
.
RuleOrDie
(),
},
},
},
},
{
{
...
...
plugin/pkg/auth/authorizer/rbac/bootstrappolicy/testdata/cluster-roles.yaml
View file @
d657261f
...
@@ -434,6 +434,8 @@ items:
...
@@ -434,6 +434,8 @@ items:
-
/apis
-
/apis
-
/apis/*
-
/apis/*
-
/healthz
-
/healthz
-
/swagger-2.0.0.pb-v1
-
/swagger.json
-
/swaggerapi
-
/swaggerapi
-
/swaggerapi/*
-
/swaggerapi/*
-
/version
-
/version
...
...
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