第 18 章 DebugService


18.1. StreamAuthzTraces

GET /v1/debug/authz/trace

为所有传入请求流授权跟踪。

18.1.1. 描述

18.1.2. 参数

18.1.3. 返回类型

Stream_result_of_v1AuthorizationTraceResponse

18.1.4. 内容类型

  • application/json

18.1.5. 响应

表 18.1. HTTP 响应代码
代码消息datatype

200

成功响应。(流响应)

Stream_result_of_v1AuthorizationTraceResponse

0

意外错误响应。

RuntimeError

18.1.6. Samples

18.1.7. 常规对象参考

18.1.7.1. AuthorizationTraceResponseResponseStatus

Enum 值

UNKNOWN_STATUS

SUCCESS

失败

18.1.7.2. AuthorizationTraceResponseTrace

字段名称必填nullable类型描述格式

scopeCheckerType

  

字符串

  

builtIn

  

TraceBuiltInAuthorizer

  

18.1.7.3. AuthorizationTraceResponseUserRole

字段名称必填nullable类型描述格式

名称

  

字符串

  

权限

  

StorageAccess的映射

  

accessScopeName

  

字符串

  

accessScope

  

SimpleAccessScopeRules

  

18.1.7.4. ProtobufAny

any 包含任意序列化协议缓冲区消息,以及一个描述序列化消息的类型的 URL。

protobuf 库以实用程序函数形式提供对 pack/unpack Any 值的支持,或者对 Any 类型的其他生成的方法提供其他生成的方法。

示例 1: Pack 并在 C++ 中解包信息。

Foo foo = ...;
Any any;
any.PackFrom(foo);
...
if (any.UnpackTo(&foo)) {
  ...
}

示例 2:打包并解压缩 Java 消息。

Foo foo = ...;
Any any = Any.pack(foo);
...
if (any.is(Foo.class)) {
  foo = any.unpack(Foo.class);
}
// or ...
if (any.isSameTypeAs(Foo.getDefaultInstance())) {
  foo = any.unpack(Foo.getDefaultInstance());
}
Example 3: Pack and unpack a message in Python.
foo = Foo(...)
any = Any()
any.Pack(foo)
...
if any.Is(Foo.DESCRIPTOR):
  any.Unpack(foo)
  ...
Example 4: Pack and unpack a message in Go
foo := &pb.Foo{...}
any, err := anypb.New(foo)
if err != nil {
  ...
}
...
foo := &pb.Foo{}
if err := any.UnmarshalTo(foo); err != nil {
  ...
}

默认情况下,protobuf 库提供的软件包方法将使用 'type.googleapis.com/full.type.name' 作为类型 URL,解包方法只使用类型 URL 中的完全限定类型名称,如 "foo.bar.com/x/x/y.z"。

18.1.7.4.1. JSON 表示

any 值的 JSON 表示使用反序列化的、嵌入式消息的常规表示,以及包含类型 URL 的附加字段 @type。Example:

package google.profile;
message Person {
  string first_name = 1;
  string last_name = 2;
}
{
  "@type": "type.googleapis.com/google.profile.Person",
  "firstName": <string>,
  "lastName": <string>
}

如果嵌入式消息类型是知名且具有自定义 JSON 表示法,则该表示将被嵌入一个字段值,该值 除 @type 字段外还包含自定义 JSON。示例(用于消息 [google.protobuf.Duration][]):

{
  "@type": "type.googleapis.com/google.protobuf.Duration",
  "value": "1.212s"
}
字段名称必填nullable类型描述格式

typeUrl

  

字符串

唯一标识序列化协议缓冲消息的 URL/资源名称。此字符串必须至少包含一个 \"/\" 字符。URL 路径的最后一部分必须代表类型的完全限定名称(如 path/google.protobuf.Duration)。名称应采用规范形式(例如,未接受前面的 \".\")。在实践中,团队通常会预编译到期望其在任意上下文中使用的所有类型的二进制代码。但是,对于使用方案 http、https 或无方案的 URL,可以选择设置一个类型服务器,将类型 URL 映射到消息定义,如下所示:* 如果没有提供方案,则假设 https。* URL 上的 HTTP GET 必须以二进制格式生成一个 [google.protobuf.Type][] 值,或者产生错误。* 应用程序允许根据 URL 缓存查找结果,或者预先编译到二进制文件以避免出现任何查找。因此,为了更改类型,二进制兼容性需要保留。(使用版本控制类型名称来管理中断的更改。)注意:这个功能目前在官方 protobuf 版本中可用,它不用于以 type.googleapis.com 开头的类型 URL。自 2023 年 5 月起,没有广泛使用的类型服务器实施,没有计划实施。http 之外的方案(或空方案)可以与实施特定语义一起使用。

 

value

  

byte[]

必须是上述指定类型的有效序列化协议缓冲。

BYTE

18.1.7.5. RuntimeError

字段名称必填nullable类型描述格式

错误

  

字符串

  

code

  

整数

 

int32

message

  

字符串

  

详情

  

ProtobufAny列表

  

18.1.7.6. RuntimeStreamError

字段名称必填nullable类型描述格式

grpcCode

  

整数

 

int32

httpCode

  

整数

 

int32

message

  

字符串

  

httpStatus

  

字符串

  

详情

  

ProtobufAny列表

  

18.1.7.7. SimpleAccessScopeRules

任何重复字段的每个元素都是单独的规则。规则通过逻辑 OR 连接:如果存在允许资源 x 的规则,x 在访问范围内。

字段名称必填nullable类型描述格式

includedClusters

  

字符串列表

  

includedNamespaces

  

SimpleAccessScopeRulesNamespace列表

  

clusterLabelSelectors

  

StorageSetBasedLabelSelector列表

  

namespaceLabelSelectors

  

StorageSetBasedLabelSelector列表

  

18.1.7.8. SimpleAccessScopeRulesNamespace

字段名称必填nullable类型描述格式

clusterName

  

字符串

必须设置这两个字段。

 

namespaceName

  

字符串

  

18.1.7.9. StorageAccess

Enum 值

NO_ACCESS

READ_ACCESS

READ_WRITE_ACCESS

18.1.7.10. StorageSetBasedLabelSelector

SetBasedLabelSelector 只允许基于集合的标签要求。

下一个可用标签:3

字段名称必填nullable类型描述格式

要求

  

List of StorageSetBasedLabelSelectorRequirement

  

18.1.7.11. StorageSetBasedLabelSelectorOperator

Enum 值

UNKNOWN

IN

NOT_IN

EXISTS

NOT_EXISTS

18.1.7.12. StorageSetBasedLabelSelectorRequirement

Next available tag: 4
字段名称必填nullable类型描述格式

key

  

字符串

  

op

  

StorageSetBasedLabelSelectorOperator

 

UNKNOWN, IN, NOT_IN, EXISTS, NOT_EXISTS,

values

  

字符串列表

  

18.1.7.13. StreamResultOfV1AuthorizationTraceResponse

Stream result of v1AuthorizationTraceResponse
字段名称必填nullable类型描述格式

result

  

V1AuthorizationTraceResponse

  

错误

  

RuntimeStreamError

  

18.1.7.14. TraceBuiltInAuthorizer

字段名称必填nullable类型描述格式

clustersTotalNum

  

整数

 

int32

namespacesTotalNum

  

整数

 

int32

deniedAuthzDecisions

  

整数映射

 

int32

allowedAuthzDecisions

  

整数映射

 

int32

effectiveAccessScopes

  

字符串映射

  

18.1.7.15. V1AuthorizationTraceResponse

字段名称必填nullable类型描述格式

arrivedAt

  

Date

 

date-time

processedAt

  

Date

 

date-time

request

  

V1AuthorizationTraceResponseRequest

  

响应

  

V1AuthorizationTraceResponseResponse

  

user

  

V1AuthorizationTraceResponseUser

  

trace

  

AuthorizationTraceResponseTrace

  

18.1.7.16. V1AuthorizationTraceResponseRequest

字段名称必填nullable类型描述格式

端点

  

字符串

  

方法

  

字符串

  

18.1.7.17. V1AuthorizationTraceResponseResponse

字段名称必填nullable类型描述格式

status

  

AuthorizationTraceResponseResponseStatus

 

未知_STATUS, 成功,失败,

错误

  

字符串

  

18.1.7.18. V1AuthorizationTraceResponseUser

字段名称必填nullable类型描述格式

username

  

字符串

  

friendlyName

  

字符串

  

aggregatedPermissions

  

StorageAccess的映射

  

roles

  

AuthorizationTraceResponseUserRole列表

  
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

关于红帽文档

Legal Notice

Theme

© 2026 Red Hat
返回顶部