-
Notifications
You must be signed in to change notification settings - Fork 120
Add encryption/decryption logic #11114
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
Conversation
3127633 to
4c307c6
Compare
4c307c6 to
9e8f3cf
Compare
9e8f3cf to
de309ab
Compare
| for version, key := range keys { | ||
| versionStr := string(rune('0' + version)) | ||
| if version >= 10 { | ||
| versionStr = string(rune('0'+version/10)) + string(rune('0'+version%10)) |
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.
This might only work for versions between 0-99. Might be worth using strconv.Itoa(version) so we don't run into errors if we update tests
Signed-off-by: lakshmimsft <[email protected]>
Signed-off-by: lakshmimsft <[email protected]>
Signed-off-by: lakshmimsft <[email protected]>
0e95e18 to
d3e8f33
Compare
Radius functional test overviewClick here to see the test run details
Test Status⌛ Building Radius and pushing container images for functional tests... |
This pr introduces a encryption subsystem, providing the core encryption logic along with comprehensive tests. The main changes include the implementation of a ChaCha20-Poly1305-based encryption module, key provider interfaces and implementations (for both Kubernetes and in-memory usage), and thorough unit and integration tests to ensure reliability and correct behavior.
ref: design doc
Encryption functionality:
Encryptortype inencryption.go, providing methods for encrypting and decrypting data using ChaCha20-Poly1305 with support for associated data (AD) binding, and includes utility methods for key generation and encrypted data validation.Key management:
KeyProviderinterface and provides two implementations inkeyprovider.go:KubernetesKeyProvider(retrieves keys from Kubernetes Secrets with configurable options) andInMemoryKeyProvider(for testing and development), along with error handling for key retrieval and validation.Testing and validation:
keyprovider_test.gowith comprehensive tests for both key provider implementations, covering success and error cases.Type of change
Fixes: #11071
Contributor checklist
Please verify that the PR meets the following requirements, where applicable: