Skip to content

Commit b51dcf4

Browse files
authored
feat(key_manager): hide protection level (#1910)
1 parent 0ee4aea commit b51dcf4

8 files changed

Lines changed: 0 additions & 100 deletions

File tree

scaleway-async/scaleway_async/key_manager/v1alpha1/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from .types import KeyAlgorithmAsymmetricSigning
66
from .types import KeyAlgorithmSymmetricEncryption
77
from .types import KeyOrigin
8-
from .types import KeyProtectionLevel
98
from .types import KeyState
109
from .types import ListAlgorithmsRequestUsage
1110
from .types import ListKeysRequestOrderBy
@@ -50,7 +49,6 @@
5049
"KeyAlgorithmAsymmetricSigning",
5150
"KeyAlgorithmSymmetricEncryption",
5251
"KeyOrigin",
53-
"KeyProtectionLevel",
5452
"KeyState",
5553
"ListAlgorithmsRequestUsage",
5654
"ListKeysRequestOrderBy",

scaleway-async/scaleway_async/key_manager/v1alpha1/api.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
from .types import (
1515
DataKeyAlgorithmSymmetricEncryption,
1616
KeyOrigin,
17-
KeyProtectionLevel,
1817
ListAlgorithmsRequestUsage,
1918
ListKeysRequestOrderBy,
2019
ListKeysRequestUsage,
@@ -76,7 +75,6 @@ async def create_key(
7675
tags: Optional[list[str]] = None,
7776
rotation_policy: Optional[KeyRotationPolicy] = None,
7877
origin: Optional[KeyOrigin] = None,
79-
protection_level: Optional[KeyProtectionLevel] = None,
8078
) -> Key:
8179
"""
8280
Create a key.
@@ -90,7 +88,6 @@ async def create_key(
9088
:param tags: (Optional) List of the key's tags.
9189
:param rotation_policy: If not specified, no rotation policy will be applied to the key.
9290
:param origin: Refer to the `Key.Origin` enum for a description of values.
93-
:param protection_level: Refer to the `Key.Protection` enum for a description of values.
9491
:return: :class:`Key <Key>`
9592
9693
Usage:
@@ -119,7 +116,6 @@ async def create_key(
119116
tags=tags,
120117
rotation_policy=rotation_policy,
121118
origin=origin,
122-
protection_level=protection_level,
123119
),
124120
self.client,
125121
),
@@ -469,7 +465,6 @@ async def list_keys(
469465
tags: Optional[list[str]] = None,
470466
name: Optional[str] = None,
471467
usage: Optional[ListKeysRequestUsage] = None,
472-
protection_level: Optional[KeyProtectionLevel] = None,
473468
) -> ListKeysResponse:
474469
"""
475470
List keys.
@@ -484,7 +479,6 @@ async def list_keys(
484479
:param tags: (Optional) List of tags to filter on.
485480
:param name: (Optional) Filter by key name.
486481
:param usage: Select from symmetric encryption, asymmetric encryption, or asymmetric signing.
487-
:param protection_level: Select from software or hsm.
488482
:return: :class:`ListKeysResponse <ListKeysResponse>`
489483
490484
Usage:
@@ -510,7 +504,6 @@ async def list_keys(
510504
"page": page,
511505
"page_size": page_size or self.client.default_page_size,
512506
"project_id": project_id or self.client.default_project_id,
513-
"protection_level": protection_level,
514507
"scheduled_for_deletion": scheduled_for_deletion,
515508
"tags": tags,
516509
"usage": usage,
@@ -533,7 +526,6 @@ async def list_keys_all(
533526
tags: Optional[list[str]] = None,
534527
name: Optional[str] = None,
535528
usage: Optional[ListKeysRequestUsage] = None,
536-
protection_level: Optional[KeyProtectionLevel] = None,
537529
) -> list[Key]:
538530
"""
539531
List keys.
@@ -548,7 +540,6 @@ async def list_keys_all(
548540
:param tags: (Optional) List of tags to filter on.
549541
:param name: (Optional) Filter by key name.
550542
:param usage: Select from symmetric encryption, asymmetric encryption, or asymmetric signing.
551-
:param protection_level: Select from software or hsm.
552543
:return: :class:`list[Key] <list[Key]>`
553544
554545
Usage:
@@ -574,7 +565,6 @@ async def list_keys_all(
574565
"tags": tags,
575566
"name": name,
576567
"usage": usage,
577-
"protection_level": protection_level,
578568
},
579569
)
580570

scaleway-async/scaleway_async/key_manager/v1alpha1/marshalling.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
KeyAlgorithmAsymmetricSigning,
1616
KeyAlgorithmSymmetricEncryption,
1717
KeyOrigin,
18-
KeyProtectionLevel,
1918
KeyState,
2019
KeyRotationPolicy,
2120
KeyUsage,
@@ -180,12 +179,6 @@ def unmarshal_Key(data: Any) -> Key:
180179
else:
181180
args["origin"] = KeyOrigin.UNKNOWN_ORIGIN
182181

183-
field = data.get("protection_level", None)
184-
if field is not None:
185-
args["protection_level"] = field
186-
else:
187-
args["protection_level"] = KeyProtectionLevel.UNKNOWN_PROTECTION_LEVEL
188-
189182
field = data.get("region", None)
190183
if field is not None:
191184
args["region"] = field
@@ -533,9 +526,6 @@ def marshal_CreateKeyRequest(
533526
if request.origin is not None:
534527
output["origin"] = request.origin
535528

536-
if request.protection_level is not None:
537-
output["protection_level"] = request.protection_level
538-
539529
return output
540530

541531

scaleway-async/scaleway_async/key_manager/v1alpha1/types.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,6 @@ def __str__(self) -> str:
6868
return str(self.value)
6969

7070

71-
class KeyProtectionLevel(str, Enum, metaclass=StrEnumMeta):
72-
UNKNOWN_PROTECTION_LEVEL = "unknown_protection_level"
73-
SOFTWARE = "software"
74-
HSM = "hsm"
75-
76-
def __str__(self) -> str:
77-
return str(self.value)
78-
79-
8071
class KeyState(str, Enum, metaclass=StrEnumMeta):
8172
UNKNOWN_STATE = "unknown_state"
8273
ENABLED = "enabled"
@@ -202,11 +193,6 @@ class Key:
202193
Refer to the `Key.Origin` enum for a description of values.
203194
"""
204195

205-
protection_level: KeyProtectionLevel
206-
"""
207-
Refer to the `Key.ProtectionLevel` enum for a description of values.
208-
"""
209-
210196
region: ScwRegion
211197
"""
212198
Region where the key is stored.
@@ -295,13 +281,6 @@ class CreateKeyRequest:
295281
Refer to the `Key.Origin` enum for a description of values.
296282
"""
297283

298-
protection_level: Optional[KeyProtectionLevel] = (
299-
KeyProtectionLevel.UNKNOWN_PROTECTION_LEVEL
300-
)
301-
"""
302-
Refer to the `Key.Protection` enum for a description of values.
303-
"""
304-
305284

306285
@dataclass
307286
class DataKey:
@@ -596,13 +575,6 @@ class ListKeysRequest:
596575
Select from symmetric encryption, asymmetric encryption, or asymmetric signing.
597576
"""
598577

599-
protection_level: Optional[KeyProtectionLevel] = (
600-
KeyProtectionLevel.UNKNOWN_PROTECTION_LEVEL
601-
)
602-
"""
603-
Select from software or hsm.
604-
"""
605-
606578

607579
@dataclass
608580
class ListKeysResponse:

scaleway/scaleway/key_manager/v1alpha1/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from .types import KeyAlgorithmAsymmetricSigning
66
from .types import KeyAlgorithmSymmetricEncryption
77
from .types import KeyOrigin
8-
from .types import KeyProtectionLevel
98
from .types import KeyState
109
from .types import ListAlgorithmsRequestUsage
1110
from .types import ListKeysRequestOrderBy
@@ -50,7 +49,6 @@
5049
"KeyAlgorithmAsymmetricSigning",
5150
"KeyAlgorithmSymmetricEncryption",
5251
"KeyOrigin",
53-
"KeyProtectionLevel",
5452
"KeyState",
5553
"ListAlgorithmsRequestUsage",
5654
"ListKeysRequestOrderBy",

scaleway/scaleway/key_manager/v1alpha1/api.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
from .types import (
1515
DataKeyAlgorithmSymmetricEncryption,
1616
KeyOrigin,
17-
KeyProtectionLevel,
1817
ListAlgorithmsRequestUsage,
1918
ListKeysRequestOrderBy,
2019
ListKeysRequestUsage,
@@ -76,7 +75,6 @@ def create_key(
7675
tags: Optional[list[str]] = None,
7776
rotation_policy: Optional[KeyRotationPolicy] = None,
7877
origin: Optional[KeyOrigin] = None,
79-
protection_level: Optional[KeyProtectionLevel] = None,
8078
) -> Key:
8179
"""
8280
Create a key.
@@ -90,7 +88,6 @@ def create_key(
9088
:param tags: (Optional) List of the key's tags.
9189
:param rotation_policy: If not specified, no rotation policy will be applied to the key.
9290
:param origin: Refer to the `Key.Origin` enum for a description of values.
93-
:param protection_level: Refer to the `Key.Protection` enum for a description of values.
9491
:return: :class:`Key <Key>`
9592
9693
Usage:
@@ -119,7 +116,6 @@ def create_key(
119116
tags=tags,
120117
rotation_policy=rotation_policy,
121118
origin=origin,
122-
protection_level=protection_level,
123119
),
124120
self.client,
125121
),
@@ -469,7 +465,6 @@ def list_keys(
469465
tags: Optional[list[str]] = None,
470466
name: Optional[str] = None,
471467
usage: Optional[ListKeysRequestUsage] = None,
472-
protection_level: Optional[KeyProtectionLevel] = None,
473468
) -> ListKeysResponse:
474469
"""
475470
List keys.
@@ -484,7 +479,6 @@ def list_keys(
484479
:param tags: (Optional) List of tags to filter on.
485480
:param name: (Optional) Filter by key name.
486481
:param usage: Select from symmetric encryption, asymmetric encryption, or asymmetric signing.
487-
:param protection_level: Select from software or hsm.
488482
:return: :class:`ListKeysResponse <ListKeysResponse>`
489483
490484
Usage:
@@ -510,7 +504,6 @@ def list_keys(
510504
"page": page,
511505
"page_size": page_size or self.client.default_page_size,
512506
"project_id": project_id or self.client.default_project_id,
513-
"protection_level": protection_level,
514507
"scheduled_for_deletion": scheduled_for_deletion,
515508
"tags": tags,
516509
"usage": usage,
@@ -533,7 +526,6 @@ def list_keys_all(
533526
tags: Optional[list[str]] = None,
534527
name: Optional[str] = None,
535528
usage: Optional[ListKeysRequestUsage] = None,
536-
protection_level: Optional[KeyProtectionLevel] = None,
537529
) -> list[Key]:
538530
"""
539531
List keys.
@@ -548,7 +540,6 @@ def list_keys_all(
548540
:param tags: (Optional) List of tags to filter on.
549541
:param name: (Optional) Filter by key name.
550542
:param usage: Select from symmetric encryption, asymmetric encryption, or asymmetric signing.
551-
:param protection_level: Select from software or hsm.
552543
:return: :class:`list[Key] <list[Key]>`
553544
554545
Usage:
@@ -574,7 +565,6 @@ def list_keys_all(
574565
"tags": tags,
575566
"name": name,
576567
"usage": usage,
577-
"protection_level": protection_level,
578568
},
579569
)
580570

scaleway/scaleway/key_manager/v1alpha1/marshalling.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
KeyAlgorithmAsymmetricSigning,
1616
KeyAlgorithmSymmetricEncryption,
1717
KeyOrigin,
18-
KeyProtectionLevel,
1918
KeyState,
2019
KeyRotationPolicy,
2120
KeyUsage,
@@ -180,12 +179,6 @@ def unmarshal_Key(data: Any) -> Key:
180179
else:
181180
args["origin"] = KeyOrigin.UNKNOWN_ORIGIN
182181

183-
field = data.get("protection_level", None)
184-
if field is not None:
185-
args["protection_level"] = field
186-
else:
187-
args["protection_level"] = KeyProtectionLevel.UNKNOWN_PROTECTION_LEVEL
188-
189182
field = data.get("region", None)
190183
if field is not None:
191184
args["region"] = field
@@ -533,9 +526,6 @@ def marshal_CreateKeyRequest(
533526
if request.origin is not None:
534527
output["origin"] = request.origin
535528

536-
if request.protection_level is not None:
537-
output["protection_level"] = request.protection_level
538-
539529
return output
540530

541531

scaleway/scaleway/key_manager/v1alpha1/types.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,6 @@ def __str__(self) -> str:
6868
return str(self.value)
6969

7070

71-
class KeyProtectionLevel(str, Enum, metaclass=StrEnumMeta):
72-
UNKNOWN_PROTECTION_LEVEL = "unknown_protection_level"
73-
SOFTWARE = "software"
74-
HSM = "hsm"
75-
76-
def __str__(self) -> str:
77-
return str(self.value)
78-
79-
8071
class KeyState(str, Enum, metaclass=StrEnumMeta):
8172
UNKNOWN_STATE = "unknown_state"
8273
ENABLED = "enabled"
@@ -202,11 +193,6 @@ class Key:
202193
Refer to the `Key.Origin` enum for a description of values.
203194
"""
204195

205-
protection_level: KeyProtectionLevel
206-
"""
207-
Refer to the `Key.ProtectionLevel` enum for a description of values.
208-
"""
209-
210196
region: ScwRegion
211197
"""
212198
Region where the key is stored.
@@ -295,13 +281,6 @@ class CreateKeyRequest:
295281
Refer to the `Key.Origin` enum for a description of values.
296282
"""
297283

298-
protection_level: Optional[KeyProtectionLevel] = (
299-
KeyProtectionLevel.UNKNOWN_PROTECTION_LEVEL
300-
)
301-
"""
302-
Refer to the `Key.Protection` enum for a description of values.
303-
"""
304-
305284

306285
@dataclass
307286
class DataKey:
@@ -596,13 +575,6 @@ class ListKeysRequest:
596575
Select from symmetric encryption, asymmetric encryption, or asymmetric signing.
597576
"""
598577

599-
protection_level: Optional[KeyProtectionLevel] = (
600-
KeyProtectionLevel.UNKNOWN_PROTECTION_LEVEL
601-
)
602-
"""
603-
Select from software or hsm.
604-
"""
605-
606578

607579
@dataclass
608580
class ListKeysResponse:

0 commit comments

Comments
 (0)