Resource authentication
Requests
HTTP request
POST /apis/authorization.k8s.io/v1/selfsubjectaccessreviews
Request body
Content-Type
application/json
Sample request
verify permissions body
{
"apiVersion": "authorization.k8s.io/v1",
"kind": "SelfSubjectAccessReview",
"spec": {
"resourceAttributes": {
"group": "auth.alauda.io",
"name": "projectview",
"namespace": "default",
"resource": "views",
"verb": "get"
}
}
}Parmeters
| Name | Type | Required | Description |
|---|---|---|---|
| apiVersion | string | True | See common parameters |
| kind | string | True | See common parameters |
| spec | object | True |
verify permissions body spec
Path: spec |
Responses
Content-Type
application/json
Status code: 201
OK
Sample response
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
{
"apiVersion": "authorization.k8s.io/v1",
"kind": "SelfSubjectAccessReview",
"metadata": {
"creationTimestamp": null
},
"spec": {
"resourceAttributes": {
"group": "auth.alauda.io",
"namespace": "default",
"resource": "userbindings",
"verb": "get"
}
},
"status": {
"allowed": true
}
}Parameters
| Name | Type | Description |
|---|---|---|
| apiVersion | string | See common parameters |
| kind | string | See common parameters |
| spec | object |
SelfSubjectAccessReviewSpec is a description of the access request. Exactly one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes must be set
Path: spec |
| status | object |
SubjectAccessReviewStatus
Path: status |
| status.allowed | boolean |
Allowed is required. True if the action would be allowed, false otherwise.
Path: status.allowed |