Skip to content

Commit a052591

Browse files
Generator: Update SDK /services/kms (#2232)
Co-authored-by: Benjosh95 <[email protected]>
1 parent 6cbe542 commit a052591

File tree

12 files changed

+141
-4
lines changed

12 files changed

+141
-4
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
## Release (2025-xx-xx)
2+
- `kms`: [v0.3.0](services/kms/CHANGELOG.md#v030)
3+
- **Breaking Change:** Updated `create_key()` and `create_wrapping_key()` method signatures to require new `access_scope` parameter
4+
- **Breaking Change:** Added new required `access_scope` field to `Key` and `WrappingKey` models
5+
- **Feature:** Add new `AccessScope` enum with values `PUBLIC` and `SNA` for managing key access permissions
6+
- **Feature:** Add new `Protection` enum with value `SOFTWARE` as a replacement for the deprecated `backend` field
7+
- **Deprecation:** The `backend` field is now deprecated in all relevant models. Use the new `protection` field instead
28
- `iaas`: [v0.8.1](services/iaas/CHANGELOG.md#v081)
39
- **Internal:** Add workaround to fix upstream OpenAPI generator issue where regex patterns include leading/trailing slashes that need to be removed for validation in `AllowedAddressesInner`, `AreaId`, and `CreateProtocol` models
410
- `observability`: [v0.9.0](services/observability/CHANGELOG.md#v090)

services/kms/CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
## v0.3.0
2+
- **Breaking Change:** Updated `create_key()` and `create_wrapping_key()` method signatures to require new `access_scope` parameter
3+
- **Breaking Change:** Added new required `access_scope` field to `Key` and `WrappingKey` models
4+
- **Feature:** Add new `AccessScope` enum with values `PUBLIC` and `SNA` for managing key access permissions
5+
- **Feature:** Add new `Protection` enum with value `SOFTWARE` as a replacement for the deprecated `backend` field
6+
- **Feature:** Add new `access_scope` field to `CreateKeyPayload` and `CreateWrappingKeyPayload` models
7+
- **Feature:** Add new `protection` field to `CreateKeyPayload`, `CreateWrappingKeyPayload`, `Key`, and `WrappingKey` models
8+
- **Deprecation:** The `backend` field is now deprecated in all relevant models. Use the new `protection` field instead
9+
110
## v0.2.0
211
- **Breaking Change:** Change return type from `Key` to `Version` for `import_key()` and `rotate_key()` methods
312
- **Internal:** Add HTTP 409 (Conflict) error handling to API methods

services/kms/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "stackit-kms"
33

44
[tool.poetry]
55
name = "stackit-kms"
6-
version = "v0.2.0"
6+
version = "v0.3.0"
77
authors = [
88
"STACKIT Developer Tools <[email protected]>",
99
]

services/kms/src/stackit/kms/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"ApiKeyError",
2929
"ApiAttributeError",
3030
"ApiException",
31+
"AccessScope",
3132
"Algorithm",
3233
"Backend",
3334
"CreateKeyPayload",
@@ -43,6 +44,7 @@
4344
"KeyList",
4445
"KeyRing",
4546
"KeyRingList",
47+
"Protection",
4648
"Purpose",
4749
"SignPayload",
4850
"SignedData",
@@ -71,6 +73,7 @@
7173
from stackit.kms.exceptions import OpenApiException as OpenApiException
7274

7375
# import models into sdk package
76+
from stackit.kms.models.access_scope import AccessScope as AccessScope
7477
from stackit.kms.models.algorithm import Algorithm as Algorithm
7578
from stackit.kms.models.backend import Backend as Backend
7679
from stackit.kms.models.create_key_payload import CreateKeyPayload as CreateKeyPayload
@@ -90,6 +93,7 @@
9093
from stackit.kms.models.key_list import KeyList as KeyList
9194
from stackit.kms.models.key_ring import KeyRing as KeyRing
9295
from stackit.kms.models.key_ring_list import KeyRingList as KeyRingList
96+
from stackit.kms.models.protection import Protection as Protection
9397
from stackit.kms.models.purpose import Purpose as Purpose
9498
from stackit.kms.models.sign_payload import SignPayload as SignPayload
9599
from stackit.kms.models.signed_data import SignedData as SignedData

services/kms/src/stackit/kms/models/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515

1616
# import models into model package
17+
from stackit.kms.models.access_scope import AccessScope
1718
from stackit.kms.models.algorithm import Algorithm
1819
from stackit.kms.models.backend import Backend
1920
from stackit.kms.models.create_key_payload import CreateKeyPayload
@@ -29,6 +30,7 @@
2930
from stackit.kms.models.key_list import KeyList
3031
from stackit.kms.models.key_ring import KeyRing
3132
from stackit.kms.models.key_ring_list import KeyRingList
33+
from stackit.kms.models.protection import Protection
3234
from stackit.kms.models.purpose import Purpose
3335
from stackit.kms.models.sign_payload import SignPayload
3436
from stackit.kms.models.signed_data import SignedData
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# coding: utf-8
2+
3+
"""
4+
STACKIT Key Management Service API
5+
6+
This API provides endpoints for managing keys and key rings.
7+
8+
The version of the OpenAPI document: 1beta.0.0
9+
Generated by OpenAPI Generator (https://openapi-generator.tech)
10+
11+
Do not edit the class manually.
12+
""" # noqa: E501
13+
14+
from __future__ import annotations
15+
16+
import json
17+
from enum import Enum
18+
19+
from typing_extensions import Self
20+
21+
22+
class AccessScope(str, Enum):
23+
"""
24+
The access scope of the key.
25+
"""
26+
27+
"""
28+
allowed enum values
29+
"""
30+
PUBLIC = "PUBLIC"
31+
SNA = "SNA"
32+
33+
@classmethod
34+
def from_json(cls, json_str: str) -> Self:
35+
"""Create an instance of AccessScope from a JSON string"""
36+
return cls(json.loads(json_str))

services/kms/src/stackit/kms/models/backend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
class Backend(str, Enum):
2323
"""
24-
The backend that is responsible for maintaining this key.
24+
The backend that is responsible for maintaining this key. Deprecated - use `protection`.
2525
"""
2626

2727
"""

services/kms/src/stackit/kms/models/create_key_payload.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@
2020
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
2121
from typing_extensions import Annotated, Self
2222

23+
from stackit.kms.models.access_scope import AccessScope
2324
from stackit.kms.models.algorithm import Algorithm
2425
from stackit.kms.models.backend import Backend
26+
from stackit.kms.models.protection import Protection
2527
from stackit.kms.models.purpose import Purpose
2628

2729

@@ -30,6 +32,7 @@ class CreateKeyPayload(BaseModel):
3032
CreateKeyPayload
3133
""" # noqa: E501
3234

35+
access_scope: Optional[AccessScope] = AccessScope.PUBLIC
3336
algorithm: Algorithm
3437
backend: Backend
3538
description: Optional[StrictStr] = Field(
@@ -41,8 +44,18 @@ class CreateKeyPayload(BaseModel):
4144
import_only: Optional[StrictBool] = Field(
4245
default=False, description="States whether versions can be created or only imported.", alias="importOnly"
4346
)
47+
protection: Optional[Protection] = None
4448
purpose: Purpose
45-
__properties: ClassVar[List[str]] = ["algorithm", "backend", "description", "displayName", "importOnly", "purpose"]
49+
__properties: ClassVar[List[str]] = [
50+
"access_scope",
51+
"algorithm",
52+
"backend",
53+
"description",
54+
"displayName",
55+
"importOnly",
56+
"protection",
57+
"purpose",
58+
]
4659

4760
model_config = ConfigDict(
4861
populate_by_name=True,
@@ -94,11 +107,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
94107

95108
_obj = cls.model_validate(
96109
{
110+
"access_scope": obj.get("access_scope") if obj.get("access_scope") is not None else AccessScope.PUBLIC,
97111
"algorithm": obj.get("algorithm"),
98112
"backend": obj.get("backend"),
99113
"description": obj.get("description"),
100114
"displayName": obj.get("displayName"),
101115
"importOnly": obj.get("importOnly") if obj.get("importOnly") is not None else False,
116+
"protection": obj.get("protection"),
102117
"purpose": obj.get("purpose"),
103118
}
104119
)

services/kms/src/stackit/kms/models/create_wrapping_key_payload.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
from pydantic import BaseModel, ConfigDict, Field, StrictStr
2121
from typing_extensions import Annotated, Self
2222

23+
from stackit.kms.models.access_scope import AccessScope
2324
from stackit.kms.models.backend import Backend
25+
from stackit.kms.models.protection import Protection
2426
from stackit.kms.models.wrapping_algorithm import WrappingAlgorithm
2527
from stackit.kms.models.wrapping_purpose import WrappingPurpose
2628

@@ -30,6 +32,7 @@ class CreateWrappingKeyPayload(BaseModel):
3032
CreateWrappingKeyPayload
3133
""" # noqa: E501
3234

35+
access_scope: Optional[AccessScope] = AccessScope.PUBLIC
3336
algorithm: WrappingAlgorithm
3437
backend: Backend
3538
description: Optional[StrictStr] = Field(
@@ -38,8 +41,17 @@ class CreateWrappingKeyPayload(BaseModel):
3841
display_name: Annotated[str, Field(strict=True, max_length=64)] = Field(
3942
description="The display name to distinguish multiple wrapping keys.", alias="displayName"
4043
)
44+
protection: Optional[Protection] = None
4145
purpose: WrappingPurpose
42-
__properties: ClassVar[List[str]] = ["algorithm", "backend", "description", "displayName", "purpose"]
46+
__properties: ClassVar[List[str]] = [
47+
"access_scope",
48+
"algorithm",
49+
"backend",
50+
"description",
51+
"displayName",
52+
"protection",
53+
"purpose",
54+
]
4355

4456
model_config = ConfigDict(
4557
populate_by_name=True,
@@ -91,10 +103,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
91103

92104
_obj = cls.model_validate(
93105
{
106+
"access_scope": obj.get("access_scope") if obj.get("access_scope") is not None else AccessScope.PUBLIC,
94107
"algorithm": obj.get("algorithm"),
95108
"backend": obj.get("backend"),
96109
"description": obj.get("description"),
97110
"displayName": obj.get("displayName"),
111+
"protection": obj.get("protection"),
98112
"purpose": obj.get("purpose"),
99113
}
100114
)

services/kms/src/stackit/kms/models/key.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@
2828
)
2929
from typing_extensions import Annotated, Self
3030

31+
from stackit.kms.models.access_scope import AccessScope
3132
from stackit.kms.models.algorithm import Algorithm
3233
from stackit.kms.models.backend import Backend
34+
from stackit.kms.models.protection import Protection
3335
from stackit.kms.models.purpose import Purpose
3436

3537

@@ -38,6 +40,7 @@ class Key(BaseModel):
3840
Key
3941
""" # noqa: E501
4042

43+
access_scope: AccessScope
4144
algorithm: Algorithm
4245
backend: Backend
4346
created_at: datetime = Field(
@@ -61,9 +64,11 @@ class Key(BaseModel):
6164
key_ring_id: StrictStr = Field(
6265
description="The unique id of the key ring this key is assigned to.", alias="keyRingId"
6366
)
67+
protection: Optional[Protection] = None
6468
purpose: Purpose
6569
state: StrictStr = Field(description="The current state of the key.")
6670
__properties: ClassVar[List[str]] = [
71+
"access_scope",
6772
"algorithm",
6873
"backend",
6974
"createdAt",
@@ -73,6 +78,7 @@ class Key(BaseModel):
7378
"id",
7479
"importOnly",
7580
"keyRingId",
81+
"protection",
7682
"purpose",
7783
"state",
7884
]
@@ -136,6 +142,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
136142

137143
_obj = cls.model_validate(
138144
{
145+
"access_scope": obj.get("access_scope") if obj.get("access_scope") is not None else AccessScope.PUBLIC,
139146
"algorithm": obj.get("algorithm"),
140147
"backend": obj.get("backend"),
141148
"createdAt": obj.get("createdAt"),
@@ -145,6 +152,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
145152
"id": obj.get("id"),
146153
"importOnly": obj.get("importOnly") if obj.get("importOnly") is not None else False,
147154
"keyRingId": obj.get("keyRingId"),
155+
"protection": obj.get("protection"),
148156
"purpose": obj.get("purpose"),
149157
"state": obj.get("state"),
150158
}

0 commit comments

Comments
 (0)