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

refactor:support cose signature format #127

Closed
wants to merge 3 commits into from

Conversation

chloeyin
Copy link
Contributor

@chloeyin chloeyin commented Sep 6, 2022

What

Refactor notation-go to support cose envelope
Background can be checked out in notaryproject/notation#278
Currently it uses dependencies from cose branch

Major Changes

  • Use package github.com/notaryproject/notation-core-go/signature to sign and verify
  • Combine runner and signer to a provider for pluginSigner to sign and remove pluginSigProvider
  • Add builtinProvider to support local signing and externalProvider to support signing by plugin
  • Move VerificationPlugin and VerificationPluginMinVersion to ExtendedAttributes
  • Retrieve VerificationPlugin and VerificationPluginMinVersion by calling signerInfo.ExtendedAttribute
  • Add SignatureMediaType to PutSignatureManifest to support different types of signatures
  • Support new keySpec
  • Add GuessSignatureEnvelopeFormat to inspect signature (This function may change later to better inspect a signature)
  • Add sign/verify from file test cases
  • Remove unused code
  • Update go.mod dependency
  • Some minor clean up

Suggested review order

  1. signature/plugin.go and signature/provider.go
  2. signature/signer.go
  3. signature/algorithm.go
  4. All files except tests
  5. signature/plugin_test.go and signature/provider_test.go
  6. All test files left

Signed-off-by: zaihaoyin [email protected]

@codecov-commenter
Copy link

codecov-commenter commented Sep 6, 2022

Codecov Report

Merging #127 (062eea1) into main (a9fb055) will increase coverage by 2.01%.
The diff coverage is 82.14%.

@@            Coverage Diff             @@
##             main     #127      +/-   ##
==========================================
+ Coverage   72.66%   74.68%   +2.01%     
==========================================
  Files          36       39       +3     
  Lines        2491     2666     +175     
==========================================
+ Hits         1810     1991     +181     
+ Misses        544      525      -19     
- Partials      137      150      +13     
Impacted Files Coverage Δ
config/config.go 82.35% <ø> (ø)
plugin/plugin.go 0.00% <ø> (ø)
verification/verifier.go 83.07% <47.05%> (-4.02%) ⬇️
verification/verifier_helpers.go 70.28% <68.25%> (-3.36%) ⬇️
signature/provider.go 74.19% <74.19%> (ø)
signature/verifier.go 58.62% <75.00%> (+20.68%) ⬆️
signature/signer.go 38.23% <80.00%> (-13.58%) ⬇️
signature/plugin.go 83.05% <87.87%> (+14.55%) ⬆️
registry/repository.go 91.53% <100.00%> (ø)
signature/algorithm.go 100.00% <100.00%> (ø)
... and 7 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@shizhMSFT
Copy link
Contributor

shizhMSFT commented Sep 9, 2022

This PR has been split into #131 and other smaller PRs.

@dtzar dtzar added this to the RC-1 milestone Sep 22, 2022
@chloeyin chloeyin closed this Sep 27, 2022
@vaninrao10 vaninrao10 modified the milestones: RC-1, alpha-4 Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

6 participants