Skip to content

feat: add signatureFormat config field#400

Merged
shizhMSFT merged 5 commits intonotaryproject:mainfrom
JeyJeyGao:junjiegao/dev-rc.1
Oct 31, 2022
Merged

feat: add signatureFormat config field#400
shizhMSFT merged 5 commits intonotaryproject:mainfrom
JeyJeyGao:junjiegao/dev-rc.1

Conversation

@JeyJeyGao
Copy link
Copy Markdown
Contributor

@JeyJeyGao JeyJeyGao commented Oct 17, 2022

  1. Add signatureFormat field providing the default value for --signature-format flag in config.json.
  2. move GetEnvelopeMediaType() from internal/cmd/signer.go to internal/envelope/envelope.go

Test:

  1. signatureFormat = jws, OK
  2. signatureFormat = cose, OK
  3. signatureFormat = jws, --signature-format=cose, OK
  4. signatureFormat = cose, --signature-format=jws, OK
  5. signatureFormat = cose2, cause an Error: signature format cose2 not supported
  6. signatureFormat = cose2, --signature-format=jws, OK

Signed-off-by: Junjie Gao junjiegao@microsoft.com

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Oct 18, 2022

Codecov Report

Merging #400 (a79df05) into main (080c6bb) will increase coverage by 0.74%.
The diff coverage is 60.00%.

@@            Coverage Diff             @@
##             main     #400      +/-   ##
==========================================
+ Coverage   32.03%   32.78%   +0.74%     
==========================================
  Files          26       26              
  Lines        1670     1632      -38     
==========================================
  Hits          535      535              
+ Misses       1122     1084      -38     
  Partials       13       13              
Impacted Files Coverage Δ
internal/cmd/flags.go 50.00% <0.00%> (-2.75%) ⬇️
internal/cmd/signer.go 0.00% <0.00%> (ø)
internal/envelope/envelope.go 100.00% <100.00%> (ø)
pkg/configutil/once.go 100.00% <100.00%> (ø)
cmd/notation/verify.go 29.16% <0.00%> (+2.27%) ⬆️

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

Copy link
Copy Markdown
Contributor

@patrickzheng200 patrickzheng200 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Contributor

@rgnote rgnote left a comment

Choose a reason for hiding this comment

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

The current implementation does not take plugins into consideration. I will address that in #325 and update the specs. Just FYI, there will be some additional work apart this PR to fully support envelope types.

@yizha1 yizha1 added this to the beta-1 milestone Oct 26, 2022
@yizha1 yizha1 removed this from the beta-1 milestone Oct 27, 2022
@FeynmanZhou FeynmanZhou requested a review from rgnote October 28, 2022 04:54
@yizha1 yizha1 requested review from a team, priteshbandi and shizhMSFT October 30, 2022 12:35
@JeyJeyGao JeyJeyGao changed the title feat: add envelope type config field feat: add signatureFormat config field Oct 31, 2022
Signed-off-by: Junjie Gao <junjiegao@microsoft.com>
Signed-off-by: Junjie Gao <junjiegao@microsoft.com>
Signed-off-by: Junjie Gao <junjiegao@microsoft.com>
Signed-off-by: Junjie Gao <junjiegao@microsoft.com>
@JeyJeyGao JeyJeyGao force-pushed the junjiegao/dev-rc.1 branch 2 times, most recently from 6afdd27 to 25ec953 Compare October 31, 2022 08:58
Copy link
Copy Markdown
Contributor

@shizhMSFT shizhMSFT left a comment

Choose a reason for hiding this comment

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

LGTM

Signed-off-by: Junjie Gao <junjiegao@microsoft.com>
Copy link
Copy Markdown
Contributor

@shizhMSFT shizhMSFT left a comment

Choose a reason for hiding this comment

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

LGTM

@shizhMSFT shizhMSFT merged commit 8d1d4dc into notaryproject:main Oct 31, 2022
7h3-3mp7y-m4n pushed a commit to 7h3-3mp7y-m4n/notation that referenced this pull request Mar 29, 2025
1. Add signatureFormat field providing the default value for
--signature-format flag in config.json.
2. move GetEnvelopeMediaType() from internal/cmd/signer.go to
internal/envelope/envelope.go


Test:
1. signatureFormat = jws, OK
3. signatureFormat = cose, OK
4. signatureFormat = jws, --signature-format=cose, OK
5. signatureFormat = cose, --signature-format=jws, OK
6. signatureFormat = cose2, cause an `Error: signature format cose2 not
supported`
7. signatureFormat = cose2, --signature-format=jws, OK

Signed-off-by: Junjie Gao <junjiegao@microsoft.com>
FeynmanZhou pushed a commit to FeynmanZhou/notation that referenced this pull request May 15, 2025
1. Add signatureFormat field providing the default value for
--signature-format flag in config.json.
2. move GetEnvelopeMediaType() from internal/cmd/signer.go to
internal/envelope/envelope.go


Test:
1. signatureFormat = jws, OK
3. signatureFormat = cose, OK
4. signatureFormat = jws, --signature-format=cose, OK
5. signatureFormat = cose, --signature-format=jws, OK
6. signatureFormat = cose2, cause an `Error: signature format cose2 not
supported`
7. signatureFormat = cose2, --signature-format=jws, OK

Signed-off-by: Junjie Gao <junjiegao@microsoft.com>
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.

Implementation for configure & persist signature envelope format for signing.

7 participants