-
Notifications
You must be signed in to change notification settings - Fork 85
feat: remove specific value definition for keyring trace flags #215 #225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
7ed4114
fdb699c
557a75a
202bb59
dd508be
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ | |
import struct | ||
from enum import Enum | ||
|
||
import attr | ||
from cryptography.hazmat.primitives import hashes | ||
from cryptography.hazmat.primitives.asymmetric import ec, padding, rsa | ||
from cryptography.hazmat.primitives.ciphers import algorithms, modes | ||
|
@@ -333,8 +334,14 @@ class ContentAADString(Enum): | |
class KeyringTraceFlag(Enum): | ||
"""KeyRing Trace actions.""" | ||
|
||
WRAPPING_KEY_GENERATED_DATA_KEY = 1 | ||
WRAPPING_KEY_ENCRYPTED_DATA_KEY = 1 << 1 | ||
WRAPPING_KEY_DECRYPTED_DATA_KEY = 1 << 2 | ||
WRAPPING_KEY_SIGNED_ENC_CTX = 1 << 3 | ||
WRAPPING_KEY_VERIFIED_ENC_CTX = 1 << 4 | ||
@attr.s | ||
class KeyringTraceFlagValue(object): | ||
"""Keyring trace flags do not have defined serializable values.""" | ||
|
||
name = attr.ib() | ||
|
||
WRAPPING_KEY_GENERATED_DATA_KEY = KeyringTraceFlagValue("WRAPPING_KEY_GENERATED_DATA_KEY") | ||
WRAPPING_KEY_ENCRYPTED_DATA_KEY = KeyringTraceFlagValue("WRAPPING_KEY_ENCRYPTED_DATA_KEY") | ||
WRAPPING_KEY_DECRYPTED_DATA_KEY = KeyringTraceFlagValue("WRAPPING_KEY_DECRYPTED_DATA_KEY") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could put a comment for each of these, copying the description from the spec, like https://github.com/aws/aws-encryption-sdk-java/blob/930793314224381e37a1331b685069a0bd55e6aa/src/main/java/com/amazonaws/encryptionsdk/keyrings/KeyringTraceFlag.java#L33 |
||
WRAPPING_KEY_SIGNED_ENC_CTX = KeyringTraceFlagValue("WRAPPING_KEY_SIGNED_ENC_CTX") | ||
WRAPPING_KEY_VERIFIED_ENC_CTX = KeyringTraceFlagValue("WRAPPING_KEY_VERIFIED_ENC_CTX") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any reason these need to be appreviated? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See reason for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do these need to all start with "WRAPPING_KEY"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we went with that because that's what the prevailing naming was at the time (last summer). It looks like the names in the spec are now the simpler version. I'll update to use those names instead.