Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions ucloud/services/ukms/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,11 @@ def create_key(self, req: typing.Optional[dict] = None, **kwargs) -> dict:
- **Region** (str) - (Config) 地域。参见地域和可用区列表。
- **ResourceId** (str) - (Required) UKMS 实例资源 ID。
- **Alias** (str) - 可选密钥别名,格式为 alias/name。
- **DeletionProtection** (str) - 是否开启删除保护。可选值:true、false;默认 false。
- **DeletionProtection** (bool) - 是否开启删除保护。可选值:true、false;默认 false。
- **Description** (str) - 密钥描述,最多 8192 字符。
- **KeySpec** (str) - 密钥规格,默认 SYMMETRIC_DEFAULT(AES_256)。可选值:SYMMETRIC_DEFAULT(AES_256)、RSA_2048、RSA_3072、RSA_4096、ECC_NIST_P256、ECC_NIST_P384、ECC_NIST_P521、HMAC_256、HMAC_384、HMAC_512。
- **KeyUsage** (str) - 密钥用途
- **Origin** (str) - 密钥材料来源,默认 UCLOUD_KMS。当前仅支持 UCLOUD_KMS;EXTERNAL 为 BYOK 规划值,当前传入会返回 100660
- **Origin** (str) - 密钥材料来源,默认 UCLOUD_KMS。当前仅支持 UCLOUD_KMS;EXTERNAL 为 BYOK 规划值,当前传入会返回 1230

**Response**

Expand Down Expand Up @@ -139,7 +139,7 @@ def decrypt(self, req: typing.Optional[dict] = None, **kwargs) -> dict:
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子账号必须填写。
- **Region** (str) - (Config) 地域。参见地域和可用区列表。
- **CiphertextBlob** (str) - (Required) 待解密密文。
- **EncryptionAlgorithm** (str) - 解密算法。可选值:SYMMETRIC_DEFAULT、RSAES_OAEP_SHA_1、RSAES_OAEP_SHA_256;非对称密钥解密时必填或使用默认 RSAES_OAEP_SHA_256
- **EncryptionAlgorithm** (str) - 解密算法。可选值:SYMMETRIC_DEFAULT、RSAES_OAEP_SHA_1、RSAES_OAEP_SHA_256;非对称密钥解密时必填
- **EncryptionContext** (str) - 加密上下文,JSON Object。该参数内容会记录在日志中,请勿传入密码、密钥、令牌等敏感信息。
- **KeyId** (str) - 主密钥 KeyId;对称密钥可空,从 CiphertextBlob 自动识别;非对称必填。
- **ResourceId** (str) - UKMS 实例资源 ID。
Expand Down Expand Up @@ -204,6 +204,7 @@ def describe_key(self, req: typing.Optional[dict] = None, **kwargs) -> dict:
**Response Model**

**KeyMetadata**
- **Arn** (str) - ucs:ukms:{Region}:{CompanyId}:key/{KeyId}
- **CreationDate** (int) - 创建时间,Unix 时间戳。
- **DeletionDate** (int) - 计划删除时间,Unix 时间戳。
- **DeletionProtection** (bool) - 是否开启删除保护。取值:true、false。
Expand All @@ -214,8 +215,9 @@ def describe_key(self, req: typing.Optional[dict] = None, **kwargs) -> dict:
- **KeyState** (str) - 密钥对外状态。取值:Enabled、Disabled、PendingDeletion、PendingImport、Unavailable。
- **KeyUsage** (list) - 密钥用途。取值:ENCRYPT_DECRYPT、SIGN_VERIFY、GENERATE_VERIFY_MAC、KEY_AGREEMENT。
- **KeyVersion** (int) - 当前密钥版本。
- **OrganizationId** (int) - 所属组织数字 ID
- **Origin** (str) - 密钥材料来源。取值:UCLOUD_KMS、EXTERNAL;当前 CreateKey 仅支持 UCLOUD_KMS。
- **ProjectId** (str) - 密钥所属项目的对外别名,格式为 org-xxx。该值由项目数字 ID 解析得到,可能因项目别名查询失败而为空
- **ProjectId** (str) - 密钥所属项目ID
- **ResourceId** (str) - 密钥所属的 UKMS 实例资源 ID。


Expand All @@ -238,7 +240,7 @@ def disable_key(self, req: typing.Optional[dict] = None, **kwargs) -> dict:

- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子账号必须填写。
- **Region** (str) - (Config) 地域。参见地域和可用区列表。
- **KeyId** (str) - (Required) 密钥 DB 数字 ID。
- **KeyId** (str) - (Required) 密钥资源长 ID
- **ResourceId** (str) - UKMS 实例资源 ID。

**Response**
Expand Down Expand Up @@ -266,7 +268,7 @@ def disable_key_rotation(
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子账号必须填写。
- **Region** (str) - (Config) 地域。参见地域和可用区列表。
- **KeyId** (str) - (Required) 密钥 ID、ARN 或别名。
- **ResourceId** (str) - UKMS 实例资源 ID。
- **ResourceId** (str) - (Required) UKMS 实例资源 ID。

**Response**

Expand All @@ -290,7 +292,7 @@ def enable_key(self, req: typing.Optional[dict] = None, **kwargs) -> dict:

- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子账号必须填写。
- **Region** (str) - (Config) 地域。参见地域和可用区列表。
- **KeyId** (str) - (Required) 密钥 DB 数字 ID。
- **KeyId** (str) - (Required) 密钥资源长 ID
- **ResourceId** (str) - UKMS 实例资源 ID。

**Response**
Expand Down Expand Up @@ -706,7 +708,7 @@ def list_keys(self, req: typing.Optional[dict] = None, **kwargs) -> dict:
- **KeyUsage** (list) - 按 KeySpec 派生的密钥用途。取值:ENCRYPT_DECRYPT、SIGN_VERIFY、GENERATE_VERIFY_MAC、KEY_AGREEMENT。
- **NextRotationDate** (int) - 下次自动轮转时间(Unix 时间戳,秒);仅在已开启自动轮转时返回。
- **OrganizationId** (int) - 密钥所属组织的数字 ID,来源于密钥关联的资源交易记录。
- **Origin** (str) - 密钥来源,由 Origin 派生。取值:ucloud、import。当前 CreateKey 仅支持 ucloud
- **Origin** (str) - 密钥来源,由 Origin 派生。取值:UCLOUD_KMS、EXTERNAL。当前 CreateKey 仅支持 UCLOUD_KMS
- **PlanDeleteTime** (int) - 计划删除时间,Unix 时间戳。
- **ProjectId** (str) - 密钥所属项目的对外别名,格式为 org-xxx。该值由项目数字 ID 解析得到,可能因项目别名查询失败而为空。
- **ResourceId** (str) - 密钥所属的 UKMS 实例资源 ID。
Expand Down Expand Up @@ -789,7 +791,7 @@ def rotate_key_on_demand(
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子账号必须填写。
- **Region** (str) - (Config) 地域。参见地域和可用区列表。
- **KeyId** (str) - (Required) 密钥 ID、ARN 或别名。
- **ResourceId** (str) - UKMS 实例资源 ID。
- **ResourceId** (str) - (Required) UKMS 实例资源 ID。

**Response**

Expand All @@ -816,7 +818,7 @@ def schedule_key_deletion(

- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子账号必须填写。
- **Region** (str) - (Config) 地域。参见地域和可用区列表。
- **KeyId** (str) - (Required) 密钥 DB 数字 ID。
- **KeyId** (str) - (Required) 密钥资源长 ID
- **DeleteDay** (int) - 删除等待天数,取值范围为 7~30 天;未填写时默认为 30 天。
- **ResourceId** (str) - UKMS 实例资源 ID。

Expand Down
6 changes: 3 additions & 3 deletions ucloud/services/ukms/schemas/apis.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class CreateKeyRequestSchema(schema.RequestSchema):

fields = {
"Alias": fields.Str(required=False, dump_to="Alias"),
"DeletionProtection": fields.Str(
"DeletionProtection": fields.Bool(
required=False, dump_to="DeletionProtection"
),
"Description": fields.Str(required=False, dump_to="Description"),
Expand Down Expand Up @@ -237,7 +237,7 @@ class DisableKeyRotationRequestSchema(schema.RequestSchema):
"KeyId": fields.Str(required=True, dump_to="KeyId"),
"ProjectId": fields.Str(required=False, dump_to="ProjectId"),
"Region": fields.Str(required=True, dump_to="Region"),
"ResourceId": fields.Str(required=False, dump_to="ResourceId"),
"ResourceId": fields.Str(required=True, dump_to="ResourceId"),
}


Expand Down Expand Up @@ -711,7 +711,7 @@ class RotateKeyOnDemandRequestSchema(schema.RequestSchema):
"KeyId": fields.Str(required=True, dump_to="KeyId"),
"ProjectId": fields.Str(required=False, dump_to="ProjectId"),
"Region": fields.Str(required=True, dump_to="Region"),
"ResourceId": fields.Str(required=False, dump_to="ResourceId"),
"ResourceId": fields.Str(required=True, dump_to="ResourceId"),
}


Expand Down
3 changes: 2 additions & 1 deletion ucloud/services/ukms/schemas/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class KeyMetadataSchema(schema.ResponseSchema):
"""KeyMetadata - DescribeKey 返回的密钥元数据"""

fields = {
"Arn": fields.Str(required=False, load_from="Arn"),
"CreationDate": fields.Int(required=True, load_from="CreationDate"),
"DeletionDate": fields.Int(required=False, load_from="DeletionDate"),
"DeletionProtection": fields.Bool(
Expand All @@ -21,7 +22,7 @@ class KeyMetadataSchema(schema.ResponseSchema):
"KeyVersion": fields.Int(required=True, load_from="KeyVersion"),
"OrganizationId": fields.Int(
required=False, load_from="OrganizationId"
), # Deprecated, will be removed at 1.0
),
"Origin": fields.Str(required=True, load_from="Origin"),
"ProjectId": fields.Str(required=False, load_from="ProjectId"),
"ResourceId": fields.Str(required=True, load_from="ResourceId"),
Expand Down
2 changes: 1 addition & 1 deletion ucloud/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = "0.11.126"
version = "0.11.127"