SelfSubjectAccessReview
apiVersion: authorization.k8s.io/v1
import "k8s.io/api/authorization/v1"
SelfSubjectAccessReview
SelfSubjectAccessReview 检查当前用户是否可以执行操作。未填写 spec.namespace 表示“在所有命名空间中”。Self 是一个特殊情况,因为用户应该始终能够检查他们是否可以执行操作
apiVersion: authorization.k8s.io/v1
kind: SelfSubjectAccessReview
metadata (ObjectMeta)
标准列表元数据。更多信息:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
spec (SelfSubjectAccessReviewSpec), required
Spec 包含有关正在评估的请求的信息。user 和 groups 必须为空
status (SubjectAccessReviewStatus)
Status 由服务器填充,并指示请求是否被允许
SelfSubjectAccessReviewSpec
SelfSubjectAccessReviewSpec 是对访问请求的描述。ResourceAuthorizationAttributes 和 NonResourceAuthorizationAttributes 中必须且只能设置一个
nonResourceAttributes (NonResourceAttributes)
NonResourceAttributes 描述了非资源访问请求的信息
NonResourceAttributes 包含可用于对 Authorizer 接口的非资源请求的授权属性
nonResourceAttributes.path (string)
Path 是请求的 URL 路径
nonResourceAttributes.verb (string)
Verb 是标准的 HTTP 动词
resourceAttributes (ResourceAttributes)
ResourceAuthorizationAttributes 描述了资源访问请求的信息
ResourceAttributes 包含可用于对 Authorizer 接口的资源请求的授权属性
resourceAttributes.group (string)
Group 是资源的 API 组。"*" 表示所有。
resourceAttributes.name (string)
Name 是为“get”请求的资源的名称,或为“delete”请求的被删除的资源的名称。""(空)表示所有。
resourceAttributes.namespace (string)
Namespace 是请求操作的命名空间。目前,没有命名空间和所有命名空间之间的区别 ""(空)对于 LocalSubjectAccessReviews 来说是默认的 ""(空)对于集群范围的资源来说是空的 ""(空)对于来自 SubjectAccessReview 或 SelfSubjectAccessReview 的命名空间范围的资源来说意味着“所有”
resourceAttributes.resource (string)
Resource 是现有的资源类型之一。"*" 表示所有。
resourceAttributes.subresource (string)
Subresource 是现有的资源类型之一。"" 表示没有。
resourceAttributes.verb (string)
Verb 是 kubernetes 资源 API 动词,例如:get、list、watch、create、update、delete、proxy。"*" 表示所有。
resourceAttributes.version (string)
Version 是资源的 API 版本。"*" 表示所有。
操作
create
创建一个 SelfSubjectAccessReview
HTTP 请求
POST /apis/authorization.k8s.io/v1/selfsubjectaccessreviews
参数
body: SelfSubjectAccessReview, required
dryRun (in query): string
fieldManager (in query): string
fieldValidation (in query): string
pretty (in query): string
响应
200 (SelfSubjectAccessReview): OK
201 (SelfSubjectAccessReview): Created
202 (SelfSubjectAccessReview): Accepted
401: Unauthorized
此页面是自动生成的。
如果您计划报告此页面的问题,请在您的问题描述中提及该页面是自动生成的。修复可能需要在 Kubernetes 项目中的其他地方进行。