接口详情
GET /v1/url-auth-policies
List tenant URL authentication policies
- operationId
listURLAuthPolicies- 认证
- API Key:请求头 Authorization: CdncaKey <key_id>.<secret>。有效权限是 Key 的范围与所有者当前权限的交集。
- 登录会话:主控登录后的 Bearer 会话,由客户本人在自己的主控里使用;插件不能要求客户交出会话。
- 所需权限
契约没有单独标注权限码,权限要求见下方说明与 403 响应。
说明(契约原文)
Requires url_auth_policies.read. Tenant identities are restricted to their active scope and owner metadata is omitted.
参数
listURLAuthPolicies 参数| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|
page | query | integer | 否 | — |
|---|
limit | query | integer | 否 | — |
|---|
status | query | string: enabled / disabled | 否 | — |
|---|
name | query | string | 否 | — |
|---|
site_id | query | string(uuid) | 否 | — |
|---|
响应
listURLAuthPolicies 响应| 状态码 | 说明 |
|---|
200 | Stable page ordered newest first. Secret material is never returned. 字段:items: array<URLAuthPolicy> total: integer(int64) page: integer limit: integer |
|---|
400 | 请求体或参数不合法。 |
|---|
401 | 认证失败或会话已失效。 |
|---|
403 | 当前身份没有执行该操作的权限。 |
|---|
500 | 服务内部故障,请求未完成。 |
|---|
失败时怎么办
400 按字段说明修正参数或请求体再发;不要原样重试。401 检查凭据格式、是否过期或被轮换。403 检查 Key 范围与所有者当前权限、当前租户作用域;不要换更高权限账号绕过。500 结果未知:先按资源 ID 或列表回读确认,再决定是否用原 Idempotency-Key 重试。
↑ 回到列表
POST /v1/url-auth-policies
Create a site-bound HMAC-SHA256 URL authentication policy
- operationId
createURLAuthPolicy- 认证
- API Key:请求头 Authorization: CdncaKey <key_id>.<secret>。有效权限是 Key 的范围与所有者当前权限的交集。
- 登录会话:主控登录后的 Bearer 会话,由客户本人在自己的主控里使用;插件不能要求客户交出会话。
- 所需权限
契约没有单独标注权限码,权限要求见下方说明与 403 响应。
说明(契约原文)
Requires url_auth_policies.manage. The generated key secret is returned exactly once on the first successful request. An identical idempotent replay returns the same policy with replayed=true and no secret. CDNFly Type A, Type B, and MD5 are migration provenance only and cannot be selected for new execution. This endpoint records a deterministic edge-compatible snapshot but does not publish it to Gateway or an edge node.
参数
createURLAuthPolicy 参数| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|
Idempotency-Key | header | string | 是 | — |
|---|
请求体
application/json · 必填:是
createURLAuthPolicy 请求体| 名称 | 类型 | 必填 | 说明 |
|---|
site_id | string(uuid) | 是 | — |
|---|
name | string | 是 | — |
|---|
enabled | boolean | 是 | — |
|---|
algorithm | string | 是 | — |
|---|
signature_parameter | string | 是 | — |
|---|
expiration_parameter | string | 是 | — |
|---|
key_id_parameter | string | 是 | — |
|---|
bind_client_ip | boolean | 是 | — |
|---|
max_clock_skew_seconds | integer | 是 | — |
|---|
max_validity_seconds | integer | 是 | — |
|---|
max_signature_uses | integer | 是 | — |
|---|
excluded_query_parameters | array<string> | 是 | — |
|---|
trusted_proxy_cidrs | array<string> | 是 | — |
|---|
target_scope_id | string(uuid) | 否 | — |
|---|
owner_id | string(uuid) | 否 | — |
|---|
响应
createURLAuthPolicy 响应| 状态码 | 说明 |
|---|
201 | Policy, revision-one snapshot, and first-response-only key secret. 字段:policy: URLAuthPolicy secret?: string replayed: boolean |
|---|
400 | 请求体或参数不合法。 |
|---|
401 | 认证失败或会话已失效。 |
|---|
403 | 当前身份没有执行该操作的权限。 |
|---|
409 | 请求的状态与已有资源或幂等记录冲突。 |
|---|
503 | A required dependency is unavailable. |
|---|
500 | 服务内部故障,请求未完成。 |
|---|
失败时怎么办
400 按字段说明修正参数或请求体再发;不要原样重试。401 检查凭据格式、是否过期或被轮换。403 检查 Key 范围与所有者当前权限、当前租户作用域;不要换更高权限账号绕过。409 先回读资源当前状态;同一操作重试保持原 Idempotency-Key 和原请求内容。503 依赖暂不可用:稍后用原 Idempotency-Key 重试。500 结果未知:先按资源 ID 或列表回读确认,再决定是否用原 Idempotency-Key 重试。
↑ 回到列表
GET /v1/url-auth-policies/{id}
Get URL authentication policy metadata
- operationId
getURLAuthPolicy- 认证
- API Key:请求头 Authorization: CdncaKey <key_id>.<secret>。有效权限是 Key 的范围与所有者当前权限的交集。
- 登录会话:主控登录后的 Bearer 会话,由客户本人在自己的主控里使用;插件不能要求客户交出会话。
- 所需权限
契约没有单独标注权限码,权限要求见下方说明与 403 响应。
参数
getURLAuthPolicy 参数| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|
id | path | string(uuid) | 是 | — |
|---|
响应
getURLAuthPolicy 响应| 状态码 | 说明 |
|---|
200 | Current policy and key metadata without secret, digest, or ciphertext. 字段:site_id: string(uuid) name: string enabled: boolean algorithm: string signature_parameter: string expiration_parameter: string key_id_parameter: string bind_client_ip: boolean max_clock_skew_seconds: integer max_validity_seconds: integer max_signature_uses: integer excluded_query_parameters: array<string> trusted_proxy_cidrs: array<string> id: string(uuid) scope_id: string(uuid) owner?: URLAuthOwner | null site: URLAuthSite migration_marker?: string: cdnfly_type_a_md5 / cdnfly_type_b_md5 current_key: URLAuthKeyMetadata previous_key?: URLAuthKeyMetadata version: integer(int64) created_at: string(date-time) updated_at: string(date-time) |
|---|
400 | 请求体或参数不合法。 |
|---|
401 | 认证失败或会话已失效。 |
|---|
403 | 当前身份没有执行该操作的权限。 |
|---|
404 | 请求的资源不存在。 |
|---|
500 | 服务内部故障,请求未完成。 |
|---|
失败时怎么办
400 按字段说明修正参数或请求体再发;不要原样重试。401 检查凭据格式、是否过期或被轮换。403 检查 Key 范围与所有者当前权限、当前租户作用域;不要换更高权限账号绕过。404 资源不存在或不属于当前租户。500 结果未知:先按资源 ID 或列表回读确认,再决定是否用原 Idempotency-Key 重试。
↑ 回到列表
PATCH /v1/url-auth-policies/{id}
Replace URL authentication policy fields using optimistic concurrency
- operationId
updateURLAuthPolicy- 认证
- API Key:请求头 Authorization: CdncaKey <key_id>.<secret>。有效权限是 Key 的范围与所有者当前权限的交集。
- 登录会话:主控登录后的 Bearer 会话,由客户本人在自己的主控里使用;插件不能要求客户交出会话。
- 所需权限
契约没有单独标注权限码,权限要求见下方说明与 403 响应。
说明(契约原文)
Requires url_auth_policies.manage. The algorithm remains fixed to hmac-sha256 and migration_marker is read-only.
参数
updateURLAuthPolicy 参数| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|
id | path | string(uuid) | 是 | — |
|---|
Idempotency-Key | header | string | 是 | — |
|---|
If-Match | header | string | 是 | — |
|---|
请求体
application/json · 必填:是
updateURLAuthPolicy 请求体| 名称 | 类型 | 必填 | 说明 |
|---|
site_id | string(uuid) | 是 | — |
|---|
name | string | 是 | — |
|---|
enabled | boolean | 是 | — |
|---|
algorithm | string | 是 | — |
|---|
signature_parameter | string | 是 | — |
|---|
expiration_parameter | string | 是 | — |
|---|
key_id_parameter | string | 是 | — |
|---|
bind_client_ip | boolean | 是 | — |
|---|
max_clock_skew_seconds | integer | 是 | — |
|---|
max_validity_seconds | integer | 是 | — |
|---|
max_signature_uses | integer | 是 | — |
|---|
excluded_query_parameters | array<string> | 是 | — |
|---|
trusted_proxy_cidrs | array<string> | 是 | — |
|---|
响应
updateURLAuthPolicy 响应| 状态码 | 说明 |
|---|
200 | Updated policy and immutable snapshot, or a matching replay. 字段:policy: URLAuthPolicy replayed: boolean |
|---|
400 | 请求体或参数不合法。 |
|---|
401 | 认证失败或会话已失效。 |
|---|
403 | 当前身份没有执行该操作的权限。 |
|---|
404 | 请求的资源不存在。 |
|---|
409 | 请求的状态与已有资源或幂等记录冲突。 |
|---|
500 | 服务内部故障,请求未完成。 |
|---|
失败时怎么办
400 按字段说明修正参数或请求体再发;不要原样重试。401 检查凭据格式、是否过期或被轮换。403 检查 Key 范围与所有者当前权限、当前租户作用域;不要换更高权限账号绕过。404 资源不存在或不属于当前租户。409 先回读资源当前状态;同一操作重试保持原 Idempotency-Key 和原请求内容。500 结果未知:先按资源 ID 或列表回读确认,再决定是否用原 Idempotency-Key 重试。
↑ 回到列表
GET /v1/url-auth-policies/{id}/edge-snapshot
Get the deterministic edge-compatible policy snapshot
- operationId
getURLAuthPolicyEdgeSnapshot- 认证
- API Key:请求头 Authorization: CdncaKey <key_id>.<secret>。有效权限是 Key 的范围与所有者当前权限的交集。
- 登录会话:主控登录后的 Bearer 会话,由客户本人在自己的主控里使用;插件不能要求客户交出会话。
- 所需权限
契约没有单独标注权限码,权限要求见下方说明与 403 响应。
说明(契约原文)
Returns the current cdnca.edge.urlauth/v1 document and its SHA-256. Key paths are deterministic references; no key material is returned. Gateway packaging and delivery are intentionally outside this slice.
参数
getURLAuthPolicyEdgeSnapshot 参数| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|
id | path | string(uuid) | 是 | — |
|---|
响应
getURLAuthPolicyEdgeSnapshot 响应| 状态码 | 说明 |
|---|
200 | Current immutable edge snapshot. 字段:policy_id: string(uuid) version: integer(int64) sha256: string document: URLAuthEdgePolicy |
|---|
400 | 请求体或参数不合法。 |
|---|
401 | 认证失败或会话已失效。 |
|---|
403 | 当前身份没有执行该操作的权限。 |
|---|
404 | 请求的资源不存在。 |
|---|
500 | 服务内部故障,请求未完成。 |
|---|
失败时怎么办
400 按字段说明修正参数或请求体再发;不要原样重试。401 检查凭据格式、是否过期或被轮换。403 检查 Key 范围与所有者当前权限、当前租户作用域;不要换更高权限账号绕过。404 资源不存在或不属于当前租户。500 结果未知:先按资源 ID 或列表回读确认,再决定是否用原 Idempotency-Key 重试。
↑ 回到列表
POST /v1/url-auth-policies/{id}/revoke
Revoke the current previous key
- operationId
revokeURLAuthPolicyPreviousKey- 认证
- API Key:请求头 Authorization: CdncaKey <key_id>.<secret>。有效权限是 Key 的范围与所有者当前权限的交集。
- 登录会话:主控登录后的 Bearer 会话,由客户本人在自己的主控里使用;插件不能要求客户交出会话。
- 所需权限
契约没有单独标注权限码,权限要求见下方说明与 403 响应。
说明(契约原文)
The current signing key cannot be revoked. Disable the policy first when URL authentication must stop.
参数
revokeURLAuthPolicyPreviousKey 参数| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|
id | path | string(uuid) | 是 | — |
|---|
Idempotency-Key | header | string | 是 | — |
|---|
If-Match | header | string | 是 | — |
|---|
请求体
application/json · 必填:是
revokeURLAuthPolicyPreviousKey 请求体| 名称 | 类型 | 必填 | 说明 |
|---|
key_id | string | 是 | — |
|---|
响应
revokeURLAuthPolicyPreviousKey 响应| 状态码 | 说明 |
|---|
200 | Previous key revoked and policy version incremented. 字段:policy: URLAuthPolicy replayed: boolean |
|---|
400 | 请求体或参数不合法。 |
|---|
401 | 认证失败或会话已失效。 |
|---|
403 | 当前身份没有执行该操作的权限。 |
|---|
404 | 请求的资源不存在。 |
|---|
409 | 请求的状态与已有资源或幂等记录冲突。 |
|---|
500 | 服务内部故障,请求未完成。 |
|---|
失败时怎么办
400 按字段说明修正参数或请求体再发;不要原样重试。401 检查凭据格式、是否过期或被轮换。403 检查 Key 范围与所有者当前权限、当前租户作用域;不要换更高权限账号绕过。404 资源不存在或不属于当前租户。409 先回读资源当前状态;同一操作重试保持原 Idempotency-Key 和原请求内容。500 结果未知:先按资源 ID 或列表回读确认,再决定是否用原 Idempotency-Key 重试。
↑ 回到列表
POST /v1/url-auth-policies/{id}/rotate
Rotate the current HMAC key
- operationId
rotateURLAuthPolicyKey- 认证
- API Key:请求头 Authorization: CdncaKey <key_id>.<secret>。有效权限是 Key 的范围与所有者当前权限的交集。
- 登录会话:主控登录后的 Bearer 会话,由客户本人在自己的主控里使用;插件不能要求客户交出会话。
- 所需权限
契约没有单独标注权限码,权限要求见下方说明与 403 响应。
说明(契约原文)
Promotes the current key to previous, revokes an older previous key, and returns the new secret exactly once. Matching idempotent replay returns no secret.
参数
rotateURLAuthPolicyKey 参数| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|
id | path | string(uuid) | 是 | — |
|---|
Idempotency-Key | header | string | 是 | — |
|---|
If-Match | header | string | 是 | — |
|---|
响应
rotateURLAuthPolicyKey 响应| 状态码 | 说明 |
|---|
200 | Rotated policy and first-response-only key secret. 字段:policy: URLAuthPolicy secret?: string replayed: boolean |
|---|
400 | 请求体或参数不合法。 |
|---|
401 | 认证失败或会话已失效。 |
|---|
403 | 当前身份没有执行该操作的权限。 |
|---|
404 | 请求的资源不存在。 |
|---|
409 | 请求的状态与已有资源或幂等记录冲突。 |
|---|
503 | A required dependency is unavailable. |
|---|
500 | 服务内部故障,请求未完成。 |
|---|
失败时怎么办
400 按字段说明修正参数或请求体再发;不要原样重试。401 检查凭据格式、是否过期或被轮换。403 检查 Key 范围与所有者当前权限、当前租户作用域;不要换更高权限账号绕过。404 资源不存在或不属于当前租户。409 先回读资源当前状态;同一操作重试保持原 Idempotency-Key 和原请求内容。503 依赖暂不可用:稍后用原 Idempotency-Key 重试。500 结果未知:先按资源 ID 或列表回读确认,再决定是否用原 Idempotency-Key 重试。
↑ 回到列表