adjust-icon

SDK 密钥终端

您可以使用 SDK 密钥终端来管理应用的 SDK 密钥。您可以撤销已过期的密钥、撤销特定密钥或重新激活之前被撤销的密钥。

撤销过期密钥

撤销早于指定版本的所有 SDK 密钥。该操作有助于在迁移到更新 SDK 签名版本后清理旧的密钥。

API 协议

终端: https://automate.adjust.com/app-automation/app/{app_token}/secrets/revoke_outdated

方法: POST

请求正文撤销过期请求

响应撤销过期响应

参数

参数数据类型位置必要参数描述
app_tokenStringPathAdjust 应用识别码,
min_active_versionInteger正文 (Body)保持活跃状态的密钥最低版本。早于此版本的密钥将被撤销。默认为 3
forceBoolean正文 (Body)设置为 true,即便撤销后不会有其他活跃密钥,也强制撤销密钥。默认设置为 false

行为

  • 版本低于 min_active_version 的密钥将被撤销。
  • 如果撤销会导致 所有可用密钥失效 ,除非设置了 force: true,否则作业就会失败。
  • 默认 min_active_version 设置为 3,也就是说,v1 和 v2 密钥会被撤销,只保留 v3 密钥。

示例

撤销所有早于 v3 的密钥

请求 - cURL
curl --location 'https://automate.adjust.com/app-automation/app/abc123xyz/secrets/revoke_outdated' \
--header 'Authorization: Bearer {your-adjust-api-token}' \
--header 'Content-Type: application/json' \
--data '{
"min_active_version": 3
}'
响应
{
"combined_secrets": {
"enforce_install_signing": true,
"secrets": [
{
"id": 1001,
"name": "Legacy Secret",
"active": false,
"value": ["secret1", "secret2", "info1", "info2"],
"internal_version": 3,
"version": 2,
"created_at": "2023-01-15T10:30:00Z",
"updated_at": "2024-06-15T14:00:00Z"
},
{
"id": 2001,
"platform": "android",
"label": "Android SDK Secret",
"active": true,
"algorithm": "adj1",
"internal_version": "3.47.0",
"version": 3,
"created_at": "2024-06-01T12:00:00Z",
"updated_at": "2024-06-01T12:00:00Z"
}
]
},
"revoked": 1
}

在无剩余活跃密钥的情况下依然强制撤销

请求 - cURL
curl --location 'https://automate.adjust.com/app-automation/app/abc123xyz/secrets/revoke_outdated' \
--header 'Authorization: Bearer {your-adjust-api-token}' \
--header 'Content-Type: application/json' \
--data '{
"min_active_version": 3,
"force": true
}'

撤销特定密钥

通过 ID 撤销特定 SDK 密钥。此操作会立即禁用密钥。

API 协议

终端: https://automate.adjust.com/app-automation/app/{app_token}/secrets/{secret_id}/revoke

方法: POST

响应: 成功时 HTTP 202 Accepted

参数

参数数据类型位置必要参数描述
app_tokenStringPathAdjust 应用识别码,
secret_idIntegerPath要撤销的密钥 ID。

示例

请求 - cURL
curl --location --request POST 'https://automate.adjust.com/app-automation/app/abc123xyz/secrets/1001/revoke' \
--header 'Authorization: Bearer {your-adjust-api-token}'
响应
HTTP/1.1 202 Accepted

重新激活密钥

重新激活之前被撤销的 SDK 密钥。此操作会再次激活密钥。

API 协议

终端: https://automate.adjust.com/app-automation/app/{app_token}/secrets/{secret_id}/reactivate

方法: POST

响应: 成功时 HTTP 202 Accepted

参数

参数数据类型位置必要参数描述
app_tokenStringPathAdjust 应用识别码,
secret_idIntegerPath要重新激活的密钥 ID。

示例

请求 - cURL
curl --location --request POST 'https://automate.adjust.com/app-automation/app/abc123xyz/secrets/1001/reactivate' \
--header 'Authorization: Bearer {your-adjust-api-token}'
响应
HTTP/1.1 202 Accepted

查看所有密钥

要查看应用的所有 SDK 密钥,请使用带有 combined_secrets 部分的应用设置终端

请求 - cURL
curl --location 'https://automate.adjust.com/app-automation/app/abc123xyz/settings?sections=combined_secrets' \
--header 'Authorization: Bearer {your-adjust-api-token}'
响应
{
"combined_secrets": {
"enforce_install_signing": true,
"secrets": [
{
"id": 1001,
"name": "Legacy Secret v2",
"active": true,
"value": ["secret1", "secret2", "info1", "info2"],
"internal_version": 3,
"version": 2,
"created_at": "2023-01-15T10:30:00Z",
"updated_at": "2023-01-15T10:30:00Z"
},
{
"id": 2001,
"platform": "android",
"label": "Android SDK Secret",
"active": true,
"algorithm": "adj1",
"internal_version": "3.47.0",
"version": 3,
"created_at": "2024-06-01T12:00:00Z",
"updated_at": "2024-06-01T12:00:00Z"
},
{
"id": 2002,
"platform": "ios",
"label": "iOS SDK Secret",
"active": true,
"algorithm": "adj1",
"internal_version": "3.47.0",
"version": 3,
"created_at": "2024-06-01T12:00:00Z",
"updated_at": "2024-06-01T12:00:00Z"
}
]
}
}

数据模型

撤销过期请求

参数数据类型描述
min_active_versionInteger保持活跃状态的密钥最低版本。更早的密钥将被撤销。默认为 3
forceBoolean在没有剩余的活跃密钥的情况下依旧撤销密钥。默认为 false

撤销过期响应

参数数据类型描述
combined_secrets*Object撤销后的已更新密钥状态。
revoked*Integer已撤销的密钥数量。

组合密钥

参数数据类型描述
enforce_install_signing*Boolean是否拒绝签名不符合要求的安装。
secrets*Array[Object]所有 SDK 密钥列表,包括旧版密钥。

旧版密钥

参数数据类型描述
id*Integer密钥 ID。
nameString密钥名称/标签。
active*Boolean密钥是否已激活。
value*Array[String]密钥值 (4 个元素)。
internal_version*IntegerSDK 签名库版本。
version*IntegerSDK 密钥版本 (12)。
created_at*String密钥创建时的日期时间 (ISO 格式)。
updated_at*String密钥最后更新的日期时间 (ISO 格式)。

SDK 密钥 ID

参数数据类型描述
id*Integer密钥 ID。
platform*String定向平台 (androidios)。
label*String人类可读的密钥标签。
active*Boolean密钥是否已激活。
algorithm*String使用的签名算法。
internal_version*StringSDK 签名库版本。
version*IntegerSDK 密钥版本 (3 或更高)。
created_at*String密钥创建时的日期时间 (ISO 格式)。
updated_at*String密钥最后更新的日期时间 (ISO 格式)。