mirror of
https://github.com/rancher/steve.git
synced 2025-09-15 23:08:26 +00:00
* adding NonResourceURLs support to access_store * added tests to AccessSet NonResourceURLs handling * change on test script suggested by @tomleb + go mod tidy * added nonresource to ext api authorization * added NonResourceURLs implementation in Authorizes + test * removed non-resource-url tests from the main test * added new tests for non-resource-urls * removed unused test data * changed nonResourceKey to point to struct{} * addressed comments from @tomleb * addressed more comments * fixing typo * check for empty accessSet
This commit is contained in:
@@ -22,8 +22,8 @@ type subjectGrants struct {
|
||||
|
||||
// roleRef contains information from a Role or ClusterRole
|
||||
type roleRef struct {
|
||||
namespace, roleName, resourceVersion string
|
||||
rules []rbacv1.PolicyRule
|
||||
namespace, roleName, resourceVersion, kind string
|
||||
rules []rbacv1.PolicyRule
|
||||
}
|
||||
|
||||
// hash calculates a unique identifier from all the grants for a user
|
||||
@@ -51,11 +51,11 @@ func (b subjectGrants) toAccessSet() *AccessSet {
|
||||
result := new(AccessSet)
|
||||
|
||||
for _, binding := range b.roleBindings {
|
||||
addAccess(result, binding.namespace, binding.rules)
|
||||
addAccess(result, binding.namespace, binding)
|
||||
}
|
||||
|
||||
for _, binding := range b.clusterRoleBindings {
|
||||
addAccess(result, All, binding.rules)
|
||||
addAccess(result, All, binding)
|
||||
}
|
||||
|
||||
return result
|
||||
|
Reference in New Issue
Block a user