Skip to content

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

Merged
merged 5 commits into from
Mar 23, 2020
Merged

feat: remove specific value definition for keyring trace flags #215 #225

merged 5 commits into from
Mar 23, 2020

Conversation

mattsb42-aws
Copy link
Member

Issue #, if available:
resolves: #215

Description of changes:

Addresses the issues discussed in #215.

I went with a custom class rather than just object() because it turns out that copy.deepcopy cannot copy bare instances of object. attrs also gives us a nicer repr value.

>>> class Foo(Enum):
...     @attr.s
...     class FooValue(object):
...             name = attr.ib()
...     BAR = object()
...     BAZ = FooValue("BAZ")
... 
>>> Foo.BAR
<Foo.BAR: <object object at 0x10ceefc50>>
>>> Foo.BAZ
<Foo.BAZ: Foo.FooValue(name='BAZ')>

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Check any applicable:

  • Were any files moved? Moving files changes their URL, which breaks all hyperlinks to the files.

acioc
acioc previously approved these changes Mar 20, 2020
Comment on lines 346 to 347
WRAPPING_KEY_SIGNED_ENC_CTX = KeyringTraceFlagValue("WRAPPING_KEY_SIGNED_ENC_CTX")
WRAPPING_KEY_VERIFIED_ENC_CTX = KeyringTraceFlagValue("WRAPPING_KEY_VERIFIED_ENC_CTX")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason these need to be appreviated?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See reason for WRAPPING_KEY_ prefix.


name = attr.ib()

WRAPPING_KEY_GENERATED_DATA_KEY = KeyringTraceFlagValue("WRAPPING_KEY_GENERATED_DATA_KEY")
Copy link
Contributor

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"?

Copy link
Member Author

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.


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")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mattsb42-aws mattsb42-aws merged commit 31e4e49 into aws:keyring Mar 23, 2020
@mattsb42-aws mattsb42-aws deleted the flag-value branch March 23, 2020 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants