SelfSubjectAccessReview

SelfSubjectAccessReview 检查当前用户是否可以执行操作。

apiVersion: authorization.k8s.io/v1

import "k8s.io/api/authorization/v1"

SelfSubjectAccessReview

SelfSubjectAccessReview 检查当前用户是否可以执行操作。不填写 spec.namespace 表示“在所有命名空间中”。Self 是一个特殊情况,因为用户应该始终能够检查他们是否可以执行操作


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

参数

响应

200 (SelfSubjectAccessReview): OK

201 (SelfSubjectAccessReview): 已创建

202 (SelfSubjectAccessReview): 已接受

401: 未授权

此页面是自动生成的。

如果您打算报告此页面的问题,请在您的问题描述中提及该页面是自动生成的。修复可能需要在 Kubernetes 项目的其他地方进行。

上次修改时间:2021 年 12 月 8 日上午 9:34 PST:Kubernetes 1.23 的参考文档 (02445930e5)