-
Notifications
You must be signed in to change notification settings - Fork 7
Added Utils unit tests - envelope and crypto #103
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Effi-S <[email protected]>
Signed-off-by: Effi-S <[email protected]>
return nil, nil, err | ||
} | ||
|
||
if payload.Header == nil { |
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.
Graceful failure
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.
Pull Request Overview
This PR adds comprehensive unit tests for two utility modules - envelope wrapper and crypto - while adding nil checks for improved error handling. The changes enhance test coverage for cryptographic key serialization/parsing functions and envelope wrapping/unwrapping operations.
- Added nil input validation to crypto functions with corresponding error messages
- Created comprehensive test suites covering both valid and invalid input scenarios
- Refactored envelope wrapper to separate payload wrapping from full envelope wrapping
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
File | Description |
---|---|
utils/signature/sigtest/crypto_test.go | New comprehensive test suite for crypto functions with edge cases |
utils/signature/sigtest/crypto.go | Added nil check for signing key serialization |
utils/serialization/envelope_wrapper_test.go | New test suite for envelope operations with error scenarios |
utils/serialization/envelope_wrapper.go | Added nil header validation and refactored envelope wrapping |
Co-authored-by: Copilot <[email protected]> Signed-off-by: Effi-S <[email protected]>
Co-authored-by: Copilot <[email protected]> Signed-off-by: Effi-S <[email protected]>
Co-authored-by: Copilot <[email protected]> Signed-off-by: Effi-S <[email protected]>
Co-authored-by: Copilot <[email protected]> Signed-off-by: Effi-S <[email protected]>
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
envelope wrapper
: nil check + unit tests + minor refactorcrypto
: nil check + unit testsSee: Issue 11