feat: Enable offline encryption cert listing and version selection support during contract encryption#118
Conversation
What's ChangedNew Features1. Certificate Version Selection (--ver flag)
2. New Command: list-encryptioncert-versions
Examples: Dependencies
Test coverage includes:
|
|
Hey @Rohit-Singh43-1 @vikas-sharma24 , Please review this PR. |
Rohit-Singh43-1
left a comment
There was a problem hiding this comment.
Thanks @Priyanga-M-001 for feature update, Changes overall Looks good to me , Just added few readme comments , Please have look of those
|
|
||
| Output: | ||
| ```yaml | ||
| ccco: |
There was a problem hiding this comment.
@Priyanga-M-001 for CCCO in contract-go only 2 certs are uploaded , Can you please update the example out here it show one extra 25.7.1
https://github.com/ibm-hyper-protect/contract-go/tree/main/encryption/ccco
There was a problem hiding this comment.
Good catch !, thanks for bringing this up. I'll update it
|
|
||
| #### Use Cases | ||
|
|
||
| 1. **Discover Available Versions**: Find out which certificate versions are embedded in your CLI installation |
There was a problem hiding this comment.
certificates are embedded in contract-go library , Please update
embedded in your CLI installation --> embedded in contract-go library
There was a problem hiding this comment.
@Rohit-Singh43-1 , all the functions internally call contract-go, but for a user, contract-cli is the front face. Hence, I hope no changes are needed here.
@Sashwat-K can confirm once.
There was a problem hiding this comment.
Hey @Rohit-Singh43-1 , make @Priyanga-M-001 said makes sense. The customer only sees the CLI documentation.
| "github.com/spf13/cobra" | ||
| ) | ||
|
|
||
| // listCertVersionsCmd represents the list-cert-versions command |
There was a problem hiding this comment.
update comment with correct command list-encryptioncert-versions
| if err != nil { | ||
| log.Fatal(err) | ||
| } | ||
| fmt.Println("Successfully stored certificate versions") |
There was a problem hiding this comment.
maybe we can mention encryption certificate as in future will have one more command to store attestation certificate.
| "", | ||
| "", | ||
| listCertVersions.FormatFlagDescription, | ||
| ) |
There was a problem hiding this comment.
Need to add SetCustomHelpTemplate and SetCustomErrorTemplate function as well.
Take reference of other command.
This is used if someone give wrong command or flag
| sampleListCcrvCertVersionsCommand = []string{listCertVersions.ParameterName, "--os", "ccrv"} | ||
| sampleListCccoCertVersionsCommand = []string{listCertVersions.ParameterName, "--os", "ccco"} | ||
| sampleListInvalidPlatformCommand = []string{listCertVersions.ParameterName, "--os", "invalid"} | ||
| sampleListCaseInsensitiveCommand = []string{listCertVersions.ParameterName, "--os", "CCRT"} |
There was a problem hiding this comment.
we can add one testcase for hpvs flag as well
|
|
||
| #### Examples | ||
|
|
||
| **List all available certificate versions in JSON format (default):** |
There was a problem hiding this comment.
encryption certificate
| --in docker-compose.yaml \ | ||
| --os ccco \ | ||
| --ver 25.12.0 \ | ||
| --encrypt |
There was a problem hiding this comment.
there is no --encrypt flag in base64-tgz command
There was a problem hiding this comment.
Good catch, thanks, updating it
|
@Sashwat-K @vikas-sharma24 @Rohit-Singh43-1 , I have pushed the changes made for addressing the review comments. Please review and resolve the conversation if all expected changes are good |
Rohit-Singh43-1
left a comment
There was a problem hiding this comment.
LGTM , Thanks @Priyanga-M-001 for the changes.
Sashwat-K
left a comment
There was a problem hiding this comment.
Looks to good @Priyanga-M-001 . @vikas-sharma24 would you confirm as well?
|
🎉 This PR is included in version 1.23.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
|
Thank you @Priyanga-M-001 for this feature! |
|
Thanks everyone for the approvals and thank you @Sashwat-K for merging the PR |
Description
This PR adds support for specifying encryption certificate versions in contract-cli commands while encrypting a contract and introduces a new command to list available certificate versions.
Related Issue
Fixes #116
Type of Change
Testing
Describe the tests you ran and how to reproduce them
The functionality is tested using CLI tool and here are the results :
Checklist