Skip to content

Commit 7ed4114

Browse files
committed
feat: remove specific value definition for keyring trace flags #215
1 parent 1bd5fa6 commit 7ed4114

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/aws_encryption_sdk/identifiers.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import struct
1515
from enum import Enum
1616

17+
import attr
1718
from cryptography.hazmat.primitives import hashes
1819
from cryptography.hazmat.primitives.asymmetric import ec, padding, rsa
1920
from cryptography.hazmat.primitives.ciphers import algorithms, modes
@@ -333,8 +334,13 @@ class ContentAADString(Enum):
333334
class KeyringTraceFlag(Enum):
334335
"""KeyRing Trace actions."""
335336

336-
WRAPPING_KEY_GENERATED_DATA_KEY = 1
337-
WRAPPING_KEY_ENCRYPTED_DATA_KEY = 1 << 1
338-
WRAPPING_KEY_DECRYPTED_DATA_KEY = 1 << 2
339-
WRAPPING_KEY_SIGNED_ENC_CTX = 1 << 3
340-
WRAPPING_KEY_VERIFIED_ENC_CTX = 1 << 4
337+
@attr.s
338+
class KeyringTraceFlagValue(object):
339+
"""Keyring trace flags do not have defined serializable values."""
340+
name = attr.ib()
341+
342+
WRAPPING_KEY_GENERATED_DATA_KEY = KeyringTraceFlagValue("WRAPPING_KEY_GENERATED_DATA_KEY")
343+
WRAPPING_KEY_ENCRYPTED_DATA_KEY = KeyringTraceFlagValue("WRAPPING_KEY_ENCRYPTED_DATA_KEY")
344+
WRAPPING_KEY_DECRYPTED_DATA_KEY = KeyringTraceFlagValue("WRAPPING_KEY_DECRYPTED_DATA_KEY")
345+
WRAPPING_KEY_SIGNED_ENC_CTX = KeyringTraceFlagValue("WRAPPING_KEY_SIGNED_ENC_CTX")
346+
WRAPPING_KEY_VERIFIED_ENC_CTX = KeyringTraceFlagValue("WRAPPING_KEY_VERIFIED_ENC_CTX")

0 commit comments

Comments
 (0)