Authorization APIs
Reference guide for authorization APIs
Abstract
Chapter 1. Authorization APIs
1.1. LocalResourceAccessReview [authorization.openshift.io/v1]
- Description
LocalResourceAccessReview is a means to request a list of which users and groups are authorized to perform the action specified by spec in a particular namespace
Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
- Type
-
object
1.2. LocalSubjectAccessReview [authorization.openshift.io/v1]
- Description
LocalSubjectAccessReview is an object for requesting information about whether a user or group can perform an action in a particular namespace
Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
- Type
-
object
1.3. ResourceAccessReview [authorization.openshift.io/v1]
- Description
ResourceAccessReview is a means to request a list of which users and groups are authorized to perform the action specified by spec
Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
- Type
-
object
1.4. SelfSubjectRulesReview [authorization.openshift.io/v1]
- Description
SelfSubjectRulesReview is a resource you can create to determine which actions you can perform in a namespace
Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
- Type
-
object
1.5. SubjectAccessReview [authorization.openshift.io/v1]
- Description
SubjectAccessReview is an object for requesting information about whether a user or group can perform an action
Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
- Type
-
object
1.6. SubjectRulesReview [authorization.openshift.io/v1]
- Description
SubjectRulesReview is a resource you can create to determine which actions another user can perform in a namespace
Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
- Type
-
object
1.7. SelfSubjectReview [authentication.k8s.io/v1]
- Description
- SelfSubjectReview contains the user information that the kube-apiserver has about the user making this request. When using impersonation, users will receive the user info of the user being impersonated. If impersonation or request header authentication is used, any extra keys will have their case ignored and returned as lowercase.
- Type
-
object
1.8. TokenRequest [authentication.k8s.io/v1]
- Description
- TokenRequest requests a token for a given service account.
- Type
-
object
1.9. TokenReview [authentication.k8s.io/v1]
- Description
- TokenReview attempts to authenticate a token to a known user. Note: TokenReview requests may be cached by the webhook token authenticator plugin in the kube-apiserver.
- Type
-
object
1.10. LocalSubjectAccessReview [authorization.k8s.io/v1]
- Description
- LocalSubjectAccessReview checks whether or not a user or group can perform an action in a given namespace. Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions checking.
- Type
-
object
1.11. SelfSubjectAccessReview [authorization.k8s.io/v1]
- Description
- SelfSubjectAccessReview checks whether or the current user can perform an action. Not filling in a spec.namespace means "in all namespaces". Self is a special case, because users should always be able to check whether they can perform an action
- Type
-
object
1.12. SelfSubjectRulesReview [authorization.k8s.io/v1]
- Description
- SelfSubjectRulesReview enumerates the set of actions the current user can perform within a namespace. The returned list of actions may be incomplete depending on the server’s authorization mode, and any errors experienced during the evaluation. SelfSubjectRulesReview should be used by UIs to show/hide actions, or to quickly let an end user reason about their permissions. It should NOT Be used by external systems to drive authorization decisions as this raises confused deputy, cache lifetime/revocation, and correctness concerns. SubjectAccessReview, and LocalAccessReview are the correct way to defer authorization decisions to the API server.
- Type
-
object
1.13. SubjectAccessReview [authorization.k8s.io/v1]
- Description
- SubjectAccessReview checks whether or not a user or group can perform an action.
- Type
-
object
Chapter 2. LocalResourceAccessReview [authorization.openshift.io/v1]
- Description
LocalResourceAccessReview is a means to request a list of which users and groups are authorized to perform the action specified by spec in a particular namespace
Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
- Type
-
object
- Required
-
namespace
-
verb
-
resourceAPIGroup
-
resourceAPIVersion
-
resource
-
resourceName
-
path
-
isNonResourceURL
-
2.1. Specification
Property | Type | Description |
---|---|---|
|
| APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources |
| Content is the actual content of the request for create and update | |
|
| IsNonResourceURL is true if this is a request for a non-resource URL (outside of the resource hierarchy) |
|
| Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds |
|
| Namespace is the namespace of the action being requested. Currently, there is no distinction between no namespace and all namespaces |
|
| Path is the path of a non resource URL |
|
| Resource is one of the existing resource types |
|
| Group is the API group of the resource Serialized as resourceAPIGroup to avoid confusion with the 'groups' field when inlined |
|
| Version is the API version of the resource Serialized as resourceAPIVersion to avoid confusion with TypeMeta.apiVersion and ObjectMeta.resourceVersion when inlined |
|
| ResourceName is the name of the resource being requested for a "get" or deleted for a "delete" |
|
| Verb is one of: get, list, watch, create, update, delete |
2.2. API endpoints
The following API endpoints are available:
/apis/authorization.openshift.io/v1/namespaces/{namespace}/localresourceaccessreviews
-
POST
: create a LocalResourceAccessReview
-
2.2.1. /apis/authorization.openshift.io/v1/namespaces/{namespace}/localresourceaccessreviews
Parameter | Type | Description |
---|---|---|
|
| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed |
|
| fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. |
- HTTP method
-
POST
- Description
- create a LocalResourceAccessReview
Parameter | Type | Description |
---|---|---|
|
|
HTTP code | Reponse body |
---|---|
200 - OK |
|
201 - Created |
|
202 - Accepted |
|
401 - Unauthorized | Empty |
Chapter 3. LocalSubjectAccessReview [authorization.openshift.io/v1]
- Description
LocalSubjectAccessReview is an object for requesting information about whether a user or group can perform an action in a particular namespace
Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
- Type
-
object
- Required
-
namespace
-
verb
-
resourceAPIGroup
-
resourceAPIVersion
-
resource
-
resourceName
-
path
-
isNonResourceURL
-
user
-
groups
-
scopes
-
3.1. Specification
Property | Type | Description |
---|---|---|
|
| APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources |
| Content is the actual content of the request for create and update | |
|
| Groups is optional. Groups is the list of groups to which the User belongs. |
|
| IsNonResourceURL is true if this is a request for a non-resource URL (outside of the resource hierarchy) |
|
| Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds |
|
| Namespace is the namespace of the action being requested. Currently, there is no distinction between no namespace and all namespaces |
|
| Path is the path of a non resource URL |
|
| Resource is one of the existing resource types |
|
| Group is the API group of the resource Serialized as resourceAPIGroup to avoid confusion with the 'groups' field when inlined |
|
| Version is the API version of the resource Serialized as resourceAPIVersion to avoid confusion with TypeMeta.apiVersion and ObjectMeta.resourceVersion when inlined |
|
| ResourceName is the name of the resource being requested for a "get" or deleted for a "delete" |
|
| Scopes to use for the evaluation. Empty means "use the unscoped (full) permissions of the user/groups". Nil for a self-SAR, means "use the scopes on this request". Nil for a regular SAR, means the same as empty. |
|
| User is optional. If both User and Groups are empty, the current authenticated user is used. |
|
| Verb is one of: get, list, watch, create, update, delete |
3.2. API endpoints
The following API endpoints are available:
/apis/authorization.openshift.io/v1/namespaces/{namespace}/localsubjectaccessreviews
-
POST
: create a LocalSubjectAccessReview
-
3.2.1. /apis/authorization.openshift.io/v1/namespaces/{namespace}/localsubjectaccessreviews
Parameter | Type | Description |
---|---|---|
|
| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed |
|
| fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. |
- HTTP method
-
POST
- Description
- create a LocalSubjectAccessReview
Parameter | Type | Description |
---|---|---|
|
|
HTTP code | Reponse body |
---|---|
200 - OK |
|
201 - Created |
|
202 - Accepted |
|
401 - Unauthorized | Empty |
Chapter 4. ResourceAccessReview [authorization.openshift.io/v1]
- Description
ResourceAccessReview is a means to request a list of which users and groups are authorized to perform the action specified by spec
Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
- Type
-
object
- Required
-
namespace
-
verb
-
resourceAPIGroup
-
resourceAPIVersion
-
resource
-
resourceName
-
path
-
isNonResourceURL
-
4.1. Specification
Property | Type | Description |
---|---|---|
|
| APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources |
| Content is the actual content of the request for create and update | |
|
| IsNonResourceURL is true if this is a request for a non-resource URL (outside of the resource hierarchy) |
|
| Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds |
|
| Namespace is the namespace of the action being requested. Currently, there is no distinction between no namespace and all namespaces |
|
| Path is the path of a non resource URL |
|
| Resource is one of the existing resource types |
|
| Group is the API group of the resource Serialized as resourceAPIGroup to avoid confusion with the 'groups' field when inlined |
|
| Version is the API version of the resource Serialized as resourceAPIVersion to avoid confusion with TypeMeta.apiVersion and ObjectMeta.resourceVersion when inlined |
|
| ResourceName is the name of the resource being requested for a "get" or deleted for a "delete" |
|
| Verb is one of: get, list, watch, create, update, delete |
4.2. API endpoints
The following API endpoints are available:
/apis/authorization.openshift.io/v1/resourceaccessreviews
-
POST
: create a ResourceAccessReview
-
4.2.1. /apis/authorization.openshift.io/v1/resourceaccessreviews
Parameter | Type | Description |
---|---|---|
|
| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed |
|
| fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. |
- HTTP method
-
POST
- Description
- create a ResourceAccessReview
Parameter | Type | Description |
---|---|---|
|
|
HTTP code | Reponse body |
---|---|
200 - OK |
|
201 - Created |
|
202 - Accepted |
|
401 - Unauthorized | Empty |
Chapter 5. SelfSubjectRulesReview [authorization.openshift.io/v1]
- Description
SelfSubjectRulesReview is a resource you can create to determine which actions you can perform in a namespace
Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
- Type
-
object
- Required
-
spec
-
5.1. Specification
Property | Type | Description |
---|---|---|
|
| APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources |
|
| Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds |
|
| SelfSubjectRulesReviewSpec adds information about how to conduct the check |
|
| SubjectRulesReviewStatus is contains the result of a rules check |
5.1.1. .spec
- Description
- SelfSubjectRulesReviewSpec adds information about how to conduct the check
- Type
-
object
- Required
-
scopes
-
Property | Type | Description |
---|---|---|
|
| Scopes to use for the evaluation. Empty means "use the unscoped (full) permissions of the user/groups". Nil means "use the scopes on this request". |
5.1.2. .status
- Description
- SubjectRulesReviewStatus is contains the result of a rules check
- Type
-
object
- Required
-
rules
-
Property | Type | Description |
---|---|---|
|
| EvaluationError can appear in combination with Rules. It means some error happened during evaluation that may have prevented additional rules from being populated. |
|
| Rules is the list of rules (no particular sort) that are allowed for the subject |
|
| PolicyRule holds information that describes a policy rule, but does not contain information about who the rule applies to or which namespace the rule applies to. |
5.1.3. .status.rules
- Description
- Rules is the list of rules (no particular sort) that are allowed for the subject
- Type
-
array
5.1.4. .status.rules[]
- Description
- PolicyRule holds information that describes a policy rule, but does not contain information about who the rule applies to or which namespace the rule applies to.
- Type
-
object
- Required
-
verbs
-
resources
-
Property | Type | Description |
---|---|---|
|
| APIGroups is the name of the APIGroup that contains the resources. If this field is empty, then both kubernetes and origin API groups are assumed. That means that if an action is requested against one of the enumerated resources in either the kubernetes or the origin API group, the request will be allowed |
| AttributeRestrictions will vary depending on what the Authorizer/AuthorizationAttributeBuilder pair supports. If the Authorizer does not recognize how to handle the AttributeRestrictions, the Authorizer should report an error. | |
|
| NonResourceURLsSlice is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path This name is intentionally different than the internal type so that the DefaultConvert works nicely and because the ordering may be different. |
|
| ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. |
|
| Resources is a list of resources this rule applies to. ResourceAll represents all resources. |
|
| Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions contained in this rule. VerbAll represents all kinds. |
5.2. API endpoints
The following API endpoints are available:
/apis/authorization.openshift.io/v1/namespaces/{namespace}/selfsubjectrulesreviews
-
POST
: create a SelfSubjectRulesReview
-
5.2.1. /apis/authorization.openshift.io/v1/namespaces/{namespace}/selfsubjectrulesreviews
Parameter | Type | Description |
---|---|---|
|
| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed |
|
| fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. |
- HTTP method
-
POST
- Description
- create a SelfSubjectRulesReview
Parameter | Type | Description |
---|---|---|
|
|
HTTP code | Reponse body |
---|---|
200 - OK |
|
201 - Created |
|
202 - Accepted |
|
401 - Unauthorized | Empty |
Chapter 6. SubjectAccessReview [authorization.openshift.io/v1]
- Description
SubjectAccessReview is an object for requesting information about whether a user or group can perform an action
Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
- Type
-
object
- Required
-
namespace
-
verb
-
resourceAPIGroup
-
resourceAPIVersion
-
resource
-
resourceName
-
path
-
isNonResourceURL
-
user
-
groups
-
scopes
-
6.1. Specification
Property | Type | Description |
---|---|---|
|
| APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources |
| Content is the actual content of the request for create and update | |
|
| GroupsSlice is optional. Groups is the list of groups to which the User belongs. |
|
| IsNonResourceURL is true if this is a request for a non-resource URL (outside of the resource hierarchy) |
|
| Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds |
|
| Namespace is the namespace of the action being requested. Currently, there is no distinction between no namespace and all namespaces |
|
| Path is the path of a non resource URL |
|
| Resource is one of the existing resource types |
|
| Group is the API group of the resource Serialized as resourceAPIGroup to avoid confusion with the 'groups' field when inlined |
|
| Version is the API version of the resource Serialized as resourceAPIVersion to avoid confusion with TypeMeta.apiVersion and ObjectMeta.resourceVersion when inlined |
|
| ResourceName is the name of the resource being requested for a "get" or deleted for a "delete" |
|
| Scopes to use for the evaluation. Empty means "use the unscoped (full) permissions of the user/groups". Nil for a self-SAR, means "use the scopes on this request". Nil for a regular SAR, means the same as empty. |
|
| User is optional. If both User and Groups are empty, the current authenticated user is used. |
|
| Verb is one of: get, list, watch, create, update, delete |
6.2. API endpoints
The following API endpoints are available:
/apis/authorization.openshift.io/v1/subjectaccessreviews
-
POST
: create a SubjectAccessReview
-
6.2.1. /apis/authorization.openshift.io/v1/subjectaccessreviews
Parameter | Type | Description |
---|---|---|
|
| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed |
|
| fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. |
- HTTP method
-
POST
- Description
- create a SubjectAccessReview
Parameter | Type | Description |
---|---|---|
|
|
HTTP code | Reponse body |
---|---|
200 - OK |
|
201 - Created |
|
202 - Accepted |
|
401 - Unauthorized | Empty |
Chapter 7. SubjectRulesReview [authorization.openshift.io/v1]
- Description
SubjectRulesReview is a resource you can create to determine which actions another user can perform in a namespace
Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
- Type
-
object
- Required
-
spec
-
7.1. Specification
Property | Type | Description |
---|---|---|
|
| APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources |
|
| Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds |
|
| SubjectRulesReviewSpec adds information about how to conduct the check |
|
| SubjectRulesReviewStatus is contains the result of a rules check |
7.1.1. .spec
- Description
- SubjectRulesReviewSpec adds information about how to conduct the check
- Type
-
object
- Required
-
user
-
groups
-
scopes
-
Property | Type | Description |
---|---|---|
|
| Groups is optional. Groups is the list of groups to which the User belongs. At least one of User and Groups must be specified. |
|
| Scopes to use for the evaluation. Empty means "use the unscoped (full) permissions of the user/groups". |
|
| User is optional. At least one of User and Groups must be specified. |
7.1.2. .status
- Description
- SubjectRulesReviewStatus is contains the result of a rules check
- Type
-
object
- Required
-
rules
-
Property | Type | Description |
---|---|---|
|
| EvaluationError can appear in combination with Rules. It means some error happened during evaluation that may have prevented additional rules from being populated. |
|
| Rules is the list of rules (no particular sort) that are allowed for the subject |
|
| PolicyRule holds information that describes a policy rule, but does not contain information about who the rule applies to or which namespace the rule applies to. |
7.1.3. .status.rules
- Description
- Rules is the list of rules (no particular sort) that are allowed for the subject
- Type
-
array
7.1.4. .status.rules[]
- Description
- PolicyRule holds information that describes a policy rule, but does not contain information about who the rule applies to or which namespace the rule applies to.
- Type
-
object
- Required
-
verbs
-
resources
-
Property | Type | Description |
---|---|---|
|
| APIGroups is the name of the APIGroup that contains the resources. If this field is empty, then both kubernetes and origin API groups are assumed. That means that if an action is requested against one of the enumerated resources in either the kubernetes or the origin API group, the request will be allowed |
| AttributeRestrictions will vary depending on what the Authorizer/AuthorizationAttributeBuilder pair supports. If the Authorizer does not recognize how to handle the AttributeRestrictions, the Authorizer should report an error. | |
|
| NonResourceURLsSlice is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path This name is intentionally different than the internal type so that the DefaultConvert works nicely and because the ordering may be different. |
|
| ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. |
|
| Resources is a list of resources this rule applies to. ResourceAll represents all resources. |
|
| Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions contained in this rule. VerbAll represents all kinds. |
7.2. API endpoints
The following API endpoints are available:
/apis/authorization.openshift.io/v1/namespaces/{namespace}/subjectrulesreviews
-
POST
: create a SubjectRulesReview
-
7.2.1. /apis/authorization.openshift.io/v1/namespaces/{namespace}/subjectrulesreviews
Parameter | Type | Description |
---|---|---|
|
| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed |
|
| fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. |
- HTTP method
-
POST
- Description
- create a SubjectRulesReview
Parameter | Type | Description |
---|---|---|
|
|
HTTP code | Reponse body |
---|---|
200 - OK |
|
201 - Created |
|
202 - Accepted |
|
401 - Unauthorized | Empty |
Chapter 8. SelfSubjectReview [authentication.k8s.io/v1]
- Description
- SelfSubjectReview contains the user information that the kube-apiserver has about the user making this request. When using impersonation, users will receive the user info of the user being impersonated. If impersonation or request header authentication is used, any extra keys will have their case ignored and returned as lowercase.
- Type
-
object
8.1. Specification
Property | Type | Description |
---|---|---|
|
| APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources |
|
| Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds |
| Standard object’s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata | |
|
| SelfSubjectReviewStatus is filled by the kube-apiserver and sent back to a user. |
8.1.1. .status
- Description
- SelfSubjectReviewStatus is filled by the kube-apiserver and sent back to a user.
- Type
-
object
Property | Type | Description |
---|---|---|
|
| UserInfo holds the information about the user needed to implement the user.Info interface. |
8.1.2. .status.userInfo
- Description
- UserInfo holds the information about the user needed to implement the user.Info interface.
- Type
-
object
Property | Type | Description |
---|---|---|
|
| Any additional information provided by the authenticator. |
|
| |
|
| The names of groups this user is a part of. |
|
| A unique value that identifies this user across time. If this user is deleted and another user by the same name is added, they will have different UIDs. |
|
| The name that uniquely identifies this user among all active users. |
8.1.3. .status.userInfo.extra
- Description
- Any additional information provided by the authenticator.
- Type
-
object
8.2. API endpoints
The following API endpoints are available:
/apis/authentication.k8s.io/v1/selfsubjectreviews
-
POST
: create a SelfSubjectReview
-
8.2.1. /apis/authentication.k8s.io/v1/selfsubjectreviews
Parameter | Type | Description |
---|---|---|
|
| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed |
|
| fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. |
- HTTP method
-
POST
- Description
- create a SelfSubjectReview
Parameter | Type | Description |
---|---|---|
|
|
HTTP code | Reponse body |
---|---|
200 - OK |
|
201 - Created |
|
202 - Accepted |
|
401 - Unauthorized | Empty |
Chapter 9. TokenRequest [authentication.k8s.io/v1]
- Description
- TokenRequest requests a token for a given service account.
- Type
-
object
- Required
-
spec
-
9.1. Specification
Property | Type | Description |
---|---|---|
|
| APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources |
|
| Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds |
| Standard object’s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata | |
|
| TokenRequestSpec contains client provided parameters of a token request. |
|
| TokenRequestStatus is the result of a token request. |
9.1.1. .spec
- Description
- TokenRequestSpec contains client provided parameters of a token request.
- Type
-
object
- Required
-
audiences
-
Property | Type | Description |
---|---|---|
|
| Audiences are the intendend audiences of the token. A recipient of a token must identify themself with an identifier in the list of audiences of the token, and otherwise should reject the token. A token issued for multiple audiences may be used to authenticate against any of the audiences listed but implies a high degree of trust between the target audiences. |
|
| BoundObjectReference is a reference to an object that a token is bound to. |
|
| ExpirationSeconds is the requested duration of validity of the request. The token issuer may return a token with a different validity duration so a client needs to check the 'expiration' field in a response. |
9.1.2. .spec.boundObjectRef
- Description
- BoundObjectReference is a reference to an object that a token is bound to.
- Type
-
object
Property | Type | Description |
---|---|---|
|
| API version of the referent. |
|
| Kind of the referent. Valid kinds are 'Pod' and 'Secret'. |
|
| Name of the referent. |
|
| UID of the referent. |
9.1.3. .status
- Description
- TokenRequestStatus is the result of a token request.
- Type
-
object
- Required
-
token
-
expirationTimestamp
-
Property | Type | Description |
---|---|---|
| ExpirationTimestamp is the time of expiration of the returned token. | |
|
| Token is the opaque bearer token. |
9.2. API endpoints
The following API endpoints are available:
/api/v1/namespaces/{namespace}/serviceaccounts/{name}/token
-
POST
: create token of a ServiceAccount
-
9.2.1. /api/v1/namespaces/{namespace}/serviceaccounts/{name}/token
Parameter | Type | Description |
---|---|---|
|
| name of the TokenRequest |
Parameter | Type | Description |
---|---|---|
|
| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed |
|
| fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. |
- HTTP method
-
POST
- Description
- create token of a ServiceAccount
Parameter | Type | Description |
---|---|---|
|
|
HTTP code | Reponse body |
---|---|
200 - OK |
|
201 - Created |
|
202 - Accepted |
|
401 - Unauthorized | Empty |
Chapter 10. TokenReview [authentication.k8s.io/v1]
- Description
- TokenReview attempts to authenticate a token to a known user. Note: TokenReview requests may be cached by the webhook token authenticator plugin in the kube-apiserver.
- Type
-
object
- Required
-
spec
-
10.1. Specification
Property | Type | Description |
---|---|---|
|
| APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources |
|
| Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds |
| Standard object’s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata | |
|
| TokenReviewSpec is a description of the token authentication request. |
|
| TokenReviewStatus is the result of the token authentication request. |
10.1.1. .spec
- Description
- TokenReviewSpec is a description of the token authentication request.
- Type
-
object
Property | Type | Description |
---|---|---|
|
| 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. |
|
| Token is the opaque bearer token. |
10.1.2. .status
- Description
- TokenReviewStatus is the result of the token authentication request.
- Type
-
object
Property | Type | Description |
---|---|---|
|
| 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. |
|
| Authenticated indicates that the token was associated with a known user. |
|
| Error indicates that the token couldn’t be checked |
|
| UserInfo holds the information about the user needed to implement the user.Info interface. |
10.1.3. .status.user
- Description
- UserInfo holds the information about the user needed to implement the user.Info interface.
- Type
-
object
Property | Type | Description |
---|---|---|
|
| Any additional information provided by the authenticator. |
|
| |
|
| The names of groups this user is a part of. |
|
| A unique value that identifies this user across time. If this user is deleted and another user by the same name is added, they will have different UIDs. |
|
| The name that uniquely identifies this user among all active users. |
10.1.4. .status.user.extra
- Description
- Any additional information provided by the authenticator.
- Type
-
object
10.2. API endpoints
The following API endpoints are available:
/apis/oauth.openshift.io/v1/tokenreviews
-
POST
: create a TokenReview
-
/apis/authentication.k8s.io/v1/tokenreviews
-
POST
: create a TokenReview
-
10.2.1. /apis/oauth.openshift.io/v1/tokenreviews
Parameter | Type | Description |
---|---|---|
|
| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed |
|
| fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. |
- HTTP method
-
POST
- Description
- create a TokenReview
Parameter | Type | Description |
---|---|---|
|
|
HTTP code | Reponse body |
---|---|
200 - OK |
|
201 - Created |
|
202 - Accepted |
|
401 - Unauthorized | Empty |
10.2.2. /apis/authentication.k8s.io/v1/tokenreviews
Parameter | Type | Description |
---|---|---|
|
| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed |
|
| fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. |
- HTTP method
-
POST
- Description
- create a TokenReview
Parameter | Type | Description |
---|---|---|
|
|
HTTP code | Reponse body |
---|---|
200 - OK |
|
201 - Created |
|
202 - Accepted |
|
401 - Unauthorized | Empty |
Chapter 11. LocalSubjectAccessReview [authorization.k8s.io/v1]
- Description
- LocalSubjectAccessReview checks whether or not a user or group can perform an action in a given namespace. Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions checking.
- Type
-
object
- Required
-
spec
-
11.1. Specification
Property | Type | Description |
---|---|---|
|
| APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources |
|
| Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds |
| Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata | |
|
| SubjectAccessReviewSpec is a description of the access request. Exactly one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes must be set |
|
| SubjectAccessReviewStatus |
11.1.1. .spec
- Description
- SubjectAccessReviewSpec is a description of the access request. Exactly one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes must be set
- Type
-
object
Property | Type | Description |
---|---|---|
|
| Extra corresponds to the user.Info.GetExtra() method from the authenticator. Since that is input to the authorizer it needs a reflection here. |
|
| |
|
| Groups is the groups you’re testing for. |
|
| NonResourceAttributes includes the authorization attributes available for non-resource requests to the Authorizer interface |
|
| ResourceAttributes includes the authorization attributes available for resource requests to the Authorizer interface |
|
| UID information about the requesting user. |
|
| User is the user you’re testing for. If you specify "User" but not "Groups", then is it interpreted as "What if User were not a member of any groups |
11.1.2. .spec.extra
- Description
- Extra corresponds to the user.Info.GetExtra() method from the authenticator. Since that is input to the authorizer it needs a reflection here.
- Type
-
object
11.1.3. .spec.nonResourceAttributes
- Description
- NonResourceAttributes includes the authorization attributes available for non-resource requests to the Authorizer interface
- Type
-
object
Property | Type | Description |
---|---|---|
|
| Path is the URL path of the request |
|
| Verb is the standard HTTP verb |
11.1.4. .spec.resourceAttributes
- Description
- ResourceAttributes includes the authorization attributes available for resource requests to the Authorizer interface
- Type
-
object
Property | Type | Description |
---|---|---|
|
| Group is the API Group of the Resource. "*" means all. |
|
| Name is the name of the resource being requested for a "get" or deleted for a "delete". "" (empty) means all. |
|
| Namespace is the namespace of the action being requested. Currently, there is no distinction between no namespace and all namespaces "" (empty) is defaulted for LocalSubjectAccessReviews "" (empty) is empty for cluster-scoped resources "" (empty) means "all" for namespace scoped resources from a SubjectAccessReview or SelfSubjectAccessReview |
|
| Resource is one of the existing resource types. "*" means all. |
|
| Subresource is one of the existing resource types. "" means none. |
|
| Verb is a kubernetes resource API verb, like: get, list, watch, create, update, delete, proxy. "*" means all. |
|
| Version is the API Version of the Resource. "*" means all. |
11.1.5. .status
- Description
- SubjectAccessReviewStatus
- Type
-
object
- Required
-
allowed
-
Property | Type | Description |
---|---|---|
|
| Allowed is required. True if the action would be allowed, false otherwise. |
|
| Denied is optional. True if the action would be denied, otherwise false. If both allowed is false and denied is false, then the authorizer has no opinion on whether to authorize the action. Denied may not be true if Allowed is true. |
|
| EvaluationError is an indication that some error occurred during the authorization check. It is entirely possible to get an error and be able to continue determine authorization status in spite of it. For instance, RBAC can be missing a role, but enough roles are still present and bound to reason about the request. |
|
| Reason is optional. It indicates why a request was allowed or denied. |
11.2. API endpoints
The following API endpoints are available:
/apis/authorization.k8s.io/v1/namespaces/{namespace}/localsubjectaccessreviews
-
POST
: create a LocalSubjectAccessReview
-
11.2.1. /apis/authorization.k8s.io/v1/namespaces/{namespace}/localsubjectaccessreviews
Parameter | Type | Description |
---|---|---|
|
| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed |
|
| fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. |
- HTTP method
-
POST
- Description
- create a LocalSubjectAccessReview
Parameter | Type | Description |
---|---|---|
|
|
HTTP code | Reponse body |
---|---|
200 - OK |
|
201 - Created |
|
202 - Accepted |
|
401 - Unauthorized | Empty |
Chapter 12. SelfSubjectAccessReview [authorization.k8s.io/v1]
- Description
- SelfSubjectAccessReview checks whether or the current user can perform an action. Not filling in a spec.namespace means "in all namespaces". Self is a special case, because users should always be able to check whether they can perform an action
- Type
-
object
- Required
-
spec
-
12.1. Specification
Property | Type | Description |
---|---|---|
|
| APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources |
|
| Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds |
| Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata | |
|
| SelfSubjectAccessReviewSpec is a description of the access request. Exactly one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes must be set |
|
| SubjectAccessReviewStatus |
12.1.1. .spec
- Description
- SelfSubjectAccessReviewSpec is a description of the access request. Exactly one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes must be set
- Type
-
object
Property | Type | Description |
---|---|---|
|
| NonResourceAttributes includes the authorization attributes available for non-resource requests to the Authorizer interface |
|
| ResourceAttributes includes the authorization attributes available for resource requests to the Authorizer interface |
12.1.2. .spec.nonResourceAttributes
- Description
- NonResourceAttributes includes the authorization attributes available for non-resource requests to the Authorizer interface
- Type
-
object
Property | Type | Description |
---|---|---|
|
| Path is the URL path of the request |
|
| Verb is the standard HTTP verb |
12.1.3. .spec.resourceAttributes
- Description
- ResourceAttributes includes the authorization attributes available for resource requests to the Authorizer interface
- Type
-
object
Property | Type | Description |
---|---|---|
|
| Group is the API Group of the Resource. "*" means all. |
|
| Name is the name of the resource being requested for a "get" or deleted for a "delete". "" (empty) means all. |
|
| Namespace is the namespace of the action being requested. Currently, there is no distinction between no namespace and all namespaces "" (empty) is defaulted for LocalSubjectAccessReviews "" (empty) is empty for cluster-scoped resources "" (empty) means "all" for namespace scoped resources from a SubjectAccessReview or SelfSubjectAccessReview |
|
| Resource is one of the existing resource types. "*" means all. |
|
| Subresource is one of the existing resource types. "" means none. |
|
| Verb is a kubernetes resource API verb, like: get, list, watch, create, update, delete, proxy. "*" means all. |
|
| Version is the API Version of the Resource. "*" means all. |
12.1.4. .status
- Description
- SubjectAccessReviewStatus
- Type
-
object
- Required
-
allowed
-
Property | Type | Description |
---|---|---|
|
| Allowed is required. True if the action would be allowed, false otherwise. |
|
| Denied is optional. True if the action would be denied, otherwise false. If both allowed is false and denied is false, then the authorizer has no opinion on whether to authorize the action. Denied may not be true if Allowed is true. |
|
| EvaluationError is an indication that some error occurred during the authorization check. It is entirely possible to get an error and be able to continue determine authorization status in spite of it. For instance, RBAC can be missing a role, but enough roles are still present and bound to reason about the request. |
|
| Reason is optional. It indicates why a request was allowed or denied. |
12.2. API endpoints
The following API endpoints are available:
/apis/authorization.k8s.io/v1/selfsubjectaccessreviews
-
POST
: create a SelfSubjectAccessReview
-
12.2.1. /apis/authorization.k8s.io/v1/selfsubjectaccessreviews
Parameter | Type | Description |
---|---|---|
|
| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed |
|
| fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. |
- HTTP method
-
POST
- Description
- create a SelfSubjectAccessReview
Parameter | Type | Description |
---|---|---|
|
|
HTTP code | Reponse body |
---|---|
200 - OK |
|
201 - Created |
|
202 - Accepted |
|
401 - Unauthorized | Empty |
Chapter 13. SelfSubjectRulesReview [authorization.k8s.io/v1]
- Description
- SelfSubjectRulesReview enumerates the set of actions the current user can perform within a namespace. The returned list of actions may be incomplete depending on the server’s authorization mode, and any errors experienced during the evaluation. SelfSubjectRulesReview should be used by UIs to show/hide actions, or to quickly let an end user reason about their permissions. It should NOT Be used by external systems to drive authorization decisions as this raises confused deputy, cache lifetime/revocation, and correctness concerns. SubjectAccessReview, and LocalAccessReview are the correct way to defer authorization decisions to the API server.
- Type
-
object
- Required
-
spec
-
13.1. Specification
Property | Type | Description |
---|---|---|
|
| APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources |
|
| Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds |
| Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata | |
|
| SelfSubjectRulesReviewSpec defines the specification for SelfSubjectRulesReview. |
|
| SubjectRulesReviewStatus contains the result of a rules check. This check can be incomplete depending on the set of authorizers the server is configured with and any errors experienced during evaluation. Because authorization rules are additive, if a rule appears in a list it’s safe to assume the subject has that permission, even if that list is incomplete. |
13.1.1. .spec
- Description
- SelfSubjectRulesReviewSpec defines the specification for SelfSubjectRulesReview.
- Type
-
object
Property | Type | Description |
---|---|---|
|
| Namespace to evaluate rules for. Required. |
13.1.2. .status
- Description
- SubjectRulesReviewStatus contains the result of a rules check. This check can be incomplete depending on the set of authorizers the server is configured with and any errors experienced during evaluation. Because authorization rules are additive, if a rule appears in a list it’s safe to assume the subject has that permission, even if that list is incomplete.
- Type
-
object
- Required
-
resourceRules
-
nonResourceRules
-
incomplete
-
Property | Type | Description |
---|---|---|
|
| EvaluationError can appear in combination with Rules. It indicates an error occurred during rule evaluation, such as an authorizer that doesn’t support rule evaluation, and that ResourceRules and/or NonResourceRules may be incomplete. |
|
| Incomplete is true when the rules returned by this call are incomplete. This is most commonly encountered when an authorizer, such as an external authorizer, doesn’t support rules evaluation. |
|
| NonResourceRules is the list of actions the subject is allowed to perform on non-resources. The list ordering isn’t significant, may contain duplicates, and possibly be incomplete. |
|
| NonResourceRule holds information that describes a rule for the non-resource |
|
| ResourceRules is the list of actions the subject is allowed to perform on resources. The list ordering isn’t significant, may contain duplicates, and possibly be incomplete. |
|
| ResourceRule is the list of actions the subject is allowed to perform on resources. The list ordering isn’t significant, may contain duplicates, and possibly be incomplete. |
13.1.3. .status.nonResourceRules
- Description
- NonResourceRules is the list of actions the subject is allowed to perform on non-resources. The list ordering isn’t significant, may contain duplicates, and possibly be incomplete.
- Type
-
array
13.1.4. .status.nonResourceRules[]
- Description
- NonResourceRule holds information that describes a rule for the non-resource
- Type
-
object
- Required
-
verbs
-
Property | Type | Description |
---|---|---|
|
| NonResourceURLs is a set of partial urls that a user should have access to. s are allowed, but only as the full, final step in the path. "" means all. |
|
| Verb is a list of kubernetes non-resource API verbs, like: get, post, put, delete, patch, head, options. "*" means all. |
13.1.5. .status.resourceRules
- Description
- ResourceRules is the list of actions the subject is allowed to perform on resources. The list ordering isn’t significant, may contain duplicates, and possibly be incomplete.
- Type
-
array
13.1.6. .status.resourceRules[]
- Description
- ResourceRule is the list of actions the subject is allowed to perform on resources. The list ordering isn’t significant, may contain duplicates, and possibly be incomplete.
- Type
-
object
- Required
-
verbs
-
Property | Type | Description |
---|---|---|
|
| APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of the enumerated resources in any API group will be allowed. "*" means all. |
|
| ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. "*" means all. |
|
| Resources is a list of resources this rule applies to. "" means all in the specified apiGroups. "/foo" represents the subresource 'foo' for all resources in the specified apiGroups. |
|
| Verb is a list of kubernetes resource API verbs, like: get, list, watch, create, update, delete, proxy. "*" means all. |
13.2. API endpoints
The following API endpoints are available:
/apis/authorization.k8s.io/v1/selfsubjectrulesreviews
-
POST
: create a SelfSubjectRulesReview
-
13.2.1. /apis/authorization.k8s.io/v1/selfsubjectrulesreviews
Parameter | Type | Description |
---|---|---|
|
| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed |
|
| fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. |
- HTTP method
-
POST
- Description
- create a SelfSubjectRulesReview
Parameter | Type | Description |
---|---|---|
|
|
HTTP code | Reponse body |
---|---|
200 - OK |
|
201 - Created |
|
202 - Accepted |
|
401 - Unauthorized | Empty |
Chapter 14. SubjectAccessReview [authorization.k8s.io/v1]
- Description
- SubjectAccessReview checks whether or not a user or group can perform an action.
- Type
-
object
- Required
-
spec
-
14.1. Specification
Property | Type | Description |
---|---|---|
|
| APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources |
|
| Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds |
| Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata | |
|
| SubjectAccessReviewSpec is a description of the access request. Exactly one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes must be set |
|
| SubjectAccessReviewStatus |
14.1.1. .spec
- Description
- SubjectAccessReviewSpec is a description of the access request. Exactly one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes must be set
- Type
-
object
Property | Type | Description |
---|---|---|
|
| Extra corresponds to the user.Info.GetExtra() method from the authenticator. Since that is input to the authorizer it needs a reflection here. |
|
| |
|
| Groups is the groups you’re testing for. |
|
| NonResourceAttributes includes the authorization attributes available for non-resource requests to the Authorizer interface |
|
| ResourceAttributes includes the authorization attributes available for resource requests to the Authorizer interface |
|
| UID information about the requesting user. |
|
| User is the user you’re testing for. If you specify "User" but not "Groups", then is it interpreted as "What if User were not a member of any groups |
14.1.2. .spec.extra
- Description
- Extra corresponds to the user.Info.GetExtra() method from the authenticator. Since that is input to the authorizer it needs a reflection here.
- Type
-
object
14.1.3. .spec.nonResourceAttributes
- Description
- NonResourceAttributes includes the authorization attributes available for non-resource requests to the Authorizer interface
- Type
-
object
Property | Type | Description |
---|---|---|
|
| Path is the URL path of the request |
|
| Verb is the standard HTTP verb |
14.1.4. .spec.resourceAttributes
- Description
- ResourceAttributes includes the authorization attributes available for resource requests to the Authorizer interface
- Type
-
object
Property | Type | Description |
---|---|---|
|
| Group is the API Group of the Resource. "*" means all. |
|
| Name is the name of the resource being requested for a "get" or deleted for a "delete". "" (empty) means all. |
|
| Namespace is the namespace of the action being requested. Currently, there is no distinction between no namespace and all namespaces "" (empty) is defaulted for LocalSubjectAccessReviews "" (empty) is empty for cluster-scoped resources "" (empty) means "all" for namespace scoped resources from a SubjectAccessReview or SelfSubjectAccessReview |
|
| Resource is one of the existing resource types. "*" means all. |
|
| Subresource is one of the existing resource types. "" means none. |
|
| Verb is a kubernetes resource API verb, like: get, list, watch, create, update, delete, proxy. "*" means all. |
|
| Version is the API Version of the Resource. "*" means all. |
14.1.5. .status
- Description
- SubjectAccessReviewStatus
- Type
-
object
- Required
-
allowed
-
Property | Type | Description |
---|---|---|
|
| Allowed is required. True if the action would be allowed, false otherwise. |
|
| Denied is optional. True if the action would be denied, otherwise false. If both allowed is false and denied is false, then the authorizer has no opinion on whether to authorize the action. Denied may not be true if Allowed is true. |
|
| EvaluationError is an indication that some error occurred during the authorization check. It is entirely possible to get an error and be able to continue determine authorization status in spite of it. For instance, RBAC can be missing a role, but enough roles are still present and bound to reason about the request. |
|
| Reason is optional. It indicates why a request was allowed or denied. |
14.2. API endpoints
The following API endpoints are available:
/apis/authorization.k8s.io/v1/subjectaccessreviews
-
POST
: create a SubjectAccessReview
-
14.2.1. /apis/authorization.k8s.io/v1/subjectaccessreviews
Parameter | Type | Description |
---|---|---|
|
| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed |
|
| fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. |
- HTTP method
-
POST
- Description
- create a SubjectAccessReview
Parameter | Type | Description |
---|---|---|
|
|
HTTP code | Reponse body |
---|---|
200 - OK |
|
201 - Created |
|
202 - Accepted |
|
401 - Unauthorized | Empty |