Skip to content
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

Add Support for Control Your Own Key (CYOK) and Bring Your Own Key (BYOK) Features with New EncryptionKeyManager #435

Merged

Conversation

developerkunal
Copy link
Contributor

@developerkunal developerkunal commented Aug 21, 2024

🔧 Changes

This PR introduces a new EncryptionKeyManager to manage encryption keys using the Auth0 Management API, with added support for Control Your Own Key (CYOK) and Bring Your Own Key (BYOK) features. The following methods have been added:

  • Create: Creates a new encryption key.
  • List: Lists all existing encryption keys.
  • Read: Reads an encryption key by its key ID.
  • Rekey: Performs a rekeying operation on the key hierarchy.
  • Delete: Deletes an encryption key by its key ID.
  • ImportWrappedKey: Imports wrapped key material and activates the encryption key.
  • CreatePublicWrappingKey: Creates a public wrapping key to wrap encryption key material.

📚 References

Each method integrates directly with the Auth0 Management API, allowing for full lifecycle management of encryption keys.

🔬 Testing

Test Summaries for EncryptionKeyManager

  1. TestEncryptionKeyManager_Create: Verifies that an encryption key can be created successfully.

  2. TestEncryptionKeyManager_List: Confirms that the List method retrieves all encryption keys.

  3. TestEncryptionKeyManager_Read: Ensures that an encryption key can be read by its key ID.

  4. TestEncryptionKeyManager_Rekey: Validates that the Rekey method correctly rekeys the key hierarchy.

  5. TestEncryptionKeyManager_Delete: Tests that an encryption key can be deleted and its state becomes "destroyed."

  6. TestEncryptionKeyManager_CreatePublicWrappingKey: Checks that a public wrapping key is generated successfully.

  7. TestEncryptionKeyManager_ImportWrappedKey: Confirms that wrapped key material can be imported and activated.

📝 Checklist

  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A)

@codecov-commenter
Copy link

codecov-commenter commented Aug 21, 2024

Codecov Report

Attention: Patch coverage is 96.10390% with 3 lines in your changes missing coverage. Please review.

Project coverage is 95.64%. Comparing base (88dff30) to head (fc9c263).

Files Patch % Lines
management/encryption_key.go 91.17% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #435   +/-   ##
=======================================
  Coverage   95.64%   95.64%           
=======================================
  Files          48       49    +1     
  Lines        8081     8158   +77     
=======================================
+ Hits         7729     7803   +74     
- Misses        235      238    +3     
  Partials      117      117           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@developerkunal developerkunal changed the title Add Support for Bring Your Own Key & Customer Key-Lifecycle Management Add Support for Customer Key-Lifecycle Management and Bring Your Own Key (BYOK) Features Aug 21, 2024
@developerkunal developerkunal changed the title Add Support for Customer Key-Lifecycle Management and Bring Your Own Key (BYOK) Features Add Support for Control Your Own Key (CYOK) and Bring Your Own Key (BYOK) Features with New EncryptionKeyManager Aug 21, 2024
@developerkunal developerkunal changed the title Add Support for Control Your Own Key (CYOK) and Bring Your Own Key (BYOK) Features with New EncryptionKeyManager Add Support for Control Your Own Key (CYOK) and Bring Your Own Key (BYOK) Features with New EncryptionKeyManager Aug 21, 2024
acwest
acwest previously approved these changes Aug 21, 2024
Copy link
Contributor

@acwest acwest left a comment

Choose a reason for hiding this comment

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

other than the default: coming first in switch statements, which seems odd, it looks pretty good.

@developerkunal developerkunal merged commit e219463 into main Aug 23, 2024
9 checks passed
@developerkunal developerkunal deleted the SDK-4860-go-auth0-SDK-support-for-Bring-Your-Own-Key branch August 23, 2024 08:57
@developerkunal developerkunal mentioned this pull request Sep 3, 2024
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