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

Support managing plugin keys #168

Merged
merged 14 commits into from
May 18, 2022
Merged

Conversation

qmuntal
Copy link
Contributor

@qmuntal qmuntal commented Apr 27, 2022

This PR adds support for:

  • Listing available plugins using notation plugin list:
> notation plugin list  
NAME   DESCRIPTION   VERSION   URL           SUPPORTED CONTRACTS   CAPABILITIES   ERROR                                                                      PATH
foo    friendly      1         example.com   [1]                   [cap]          executable name must be "notation-foo.exe" instead of "notation-baz.exe"   C:\Users\qmuntaldiaz\.notation\plugins\baz\notation-baz.exe
foo    friendly      1         example.com   [1]                   [cap]          <nil>                                                                      C:\Users\qmuntaldiaz\.notation\plugins\foo\notation-foo.exe
  • Adding plugin keys using notation key add --plugin=foo --name=foo-key --id=foo-id.
  • Listing plugin keys using notation key list:
> notation key list
NAME      KEY PATH   CERTIFICATE PATH   ID       PLUGIN NAME   
foo-key                                 foo-id   foo
  • Removing plugin keys using notation key remove.

Other changes:

  • Simplified the types in pkg/config and reduced the API surface.
  • Using go 1.18 Generics to operate on slices.
  • Improved how we are formatting lists to the standard output.

@gokarnm @SteveLasker

Signed-off-by: qmuntal qmuntaldiaz@microsoft.com

Signed-off-by: qmuntal <qmuntaldiaz@microsoft.com>
@qmuntal qmuntal requested a review from a team April 27, 2022 15:45
Signed-off-by: qmuntal <qmuntaldiaz@microsoft.com>
Copy link
Contributor

@SteveLasker SteveLasker left a comment

Choose a reason for hiding this comment

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

👍 on the new notation plugin list output

Signed-off-by: qmuntal <qmuntaldiaz@microsoft.com>
Signed-off-by: qmuntal <qmuntaldiaz@microsoft.com>
Signed-off-by: qmuntal <qmuntaldiaz@microsoft.com>
Copy link
Contributor

@gokarnm gokarnm left a comment

Choose a reason for hiding this comment

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

LGTM. Have a couple of minor comments. I'd ask a review from @shizhMSFT too as he wrote most of this code.

cmd/notation/key.go Outdated Show resolved Hide resolved
cmd/notation/key.go Outdated Show resolved Hide resolved
cmd/notation/verify.go Show resolved Hide resolved
go.sum Outdated Show resolved Hide resolved
Signed-off-by: qmuntal <qmuntaldiaz@microsoft.com>
Signed-off-by: qmuntal <qmuntaldiaz@microsoft.com>
Signed-off-by: qmuntal <qmuntaldiaz@microsoft.com>
internal/slices/slices.go Show resolved Hide resolved
pkg/config/config.go Outdated Show resolved Hide resolved
pkg/config/config.go Show resolved Hide resolved
pkg/config/util.go Outdated Show resolved Hide resolved
internal/cmd/signer.go Show resolved Hide resolved
cmd/notation/key.go Outdated Show resolved Hide resolved
cmd/notation/key.go Outdated Show resolved Hide resolved
cmd/notation/key.go Outdated Show resolved Hide resolved
cmd/notation/key.go Outdated Show resolved Hide resolved
cmd/notation/cert.go Outdated Show resolved Hide resolved
Co-authored-by: Shiwei Zhang <shizh@microsoft.com>
Signed-off-by: qmuntal <qmuntaldiaz@microsoft.com>
Signed-off-by: qmuntal <qmuntaldiaz@microsoft.com>
@qmuntal qmuntal requested a review from shizhMSFT May 9, 2022 08:06
Signed-off-by: qmuntal <qmuntaldiaz@microsoft.com>
Copy link
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.

I've also reopened some comments in the previous review as they are marked resolved without changes.

pkg/config/util.go Outdated Show resolved Hide resolved
Signed-off-by: qmuntal <qmuntaldiaz@microsoft.com>
@qmuntal
Copy link
Contributor Author

qmuntal commented May 16, 2022

I've also reopened some comments in the previous review as they are marked resolved without changes.

@shizhMSFT I think I got them all now.

Signed-off-by: qmuntal <qmuntaldiaz@microsoft.com>
Copy link
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 with one unresolved comment.

Signed-off-by: qmuntal <qmuntaldiaz@microsoft.com>
@qmuntal
Copy link
Contributor Author

qmuntal commented May 17, 2022

LGTM with one unresolved comment.

Resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants