-
Notifications
You must be signed in to change notification settings - Fork 42
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
Implement generate signature plugin workflow #42
Merged
Merged
Changes from 40 commits
Commits
Show all changes
59 commits
Select commit
Hold shift + click to select a range
d0c0218
implement plugin manager
qmuntal 2943a57
ignore symlinks
qmuntal c33c354
fix Manager.Command
qmuntal 5bfff33
export constants
qmuntal c09b4a1
pr feedback
qmuntal e1f2d49
improve error message
qmuntal 2cacb9f
move manager to its own package
qmuntal 55fc95a
change metadata error messages
qmuntal f0636e1
improve the plugin manager interface
qmuntal b4e505d
implement plugin.Run
qmuntal 295d0bc
add plugin signer
qmuntal e39e8ce
improve Manager.Run
qmuntal 6307514
base64 encode payload
qmuntal d0874d9
fix supported algs
qmuntal 15d7713
create envelope
qmuntal d1f6564
pr feedback
qmuntal 74dc477
remove Command.Capability() and Command.NewResponse()
qmuntal f37ca5b
add DescribeKey command
qmuntal 504ca16
remove command validation
qmuntal 7beb5cd
plugin cleanup
qmuntal a3bdec6
fix compilation
qmuntal 04da321
base64 encode signature
qmuntal 8f78a94
ignore symlinked plugin directories
qmuntal bd10cfe
suuport plugin key spec
qmuntal ceb9b92
pass signing payload as ascii string
qmuntal 26c6b91
fix rsa method
qmuntal 3470557
define KeySpec
qmuntal 4d98f6d
add signing tests
qmuntal 01a45db
Bump actions/setup-go from 2 to 3 (#32)
dependabot[bot] 8ea7512
Bump actions/cache from 2 to 3.0.1 (#31)
dependabot[bot] c6553f8
Bump github.com/golang-jwt/jwt/v4 from 4.3.0 to 4.4.1 (#29)
dependabot[bot] 7891053
Merge branch 'main' of https://github.com/notaryproject/notation-go i…
qmuntal 03b1a43
check extension ID length and add tests
qmuntal 7bbec7e
fail on empty certificate chain
qmuntal c3265c3
create and use spec package
qmuntal f50b242
dedup notaryClaim
qmuntal c9afb7c
remove support for multiple signature envelope
qmuntal 70877b2
move payload creation to where it's needed
qmuntal a4981c0
add missing json tags
qmuntal a2fff48
use correct header encoding
qmuntal eb16900
rename NewManager to New and add root param
qmuntal 2a6e597
remove artifact type from descriptor
qmuntal a453d9e
dedup jwt.Token creation
qmuntal a284a1e
simpligy running plugin command
qmuntal c55f36f
update plugin spec
qmuntal 92366fb
PR feedback
qmuntal fc5592f
check runner response type
qmuntal b2c02f5
remove spec/v1 directory
qmuntal b9246e9
Revert "remove support for multiple signature envelope"
qmuntal cbc16f9
don't check timestamp certificate
qmuntal 5e2d8ca
define SignatureAlgorithm in spec
qmuntal a24ae78
Update plugin implementation with latest spec
qmuntal 35b4fac
improve plugin error report
qmuntal 8177f1c
add x5c comment
qmuntal 979142f
simplify runner interface
qmuntal 6fe2523
remove spec package
qmuntal ddf72d9
pr feedback
qmuntal cca70c9
Apply suggestions from code review
qmuntal 07fe9b8
fix build
qmuntal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I think
Descriptor
should be maintained at thenotation
level, regardless how plugin protocol works.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.
Any particular reason? The descriptor is part of the signing spec, so IMO it should be in the spec package.
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.
Then we have the
Signer
interface to be spec specific, and probably we need to put theSigner
into thespecs/v1
folder. LoL.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.
Signer
is not part of the spec, it's just an interface defined bynotation-go
, so I would put it in/spec
. As we have removed the version subfolders from/spec
, then we have no conflict here anymore.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.
There are two protocols here. One is at the
Signer
interface level, another is at the spec level. We probably need a design doc here.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.
IMO types which are inputs and outputs of Sign/Verify methods in top level package should also be in the same package,
Descriptor
should remain atnotation
level.I think
spec
package is not required, Notation implements one major version of Notary V2 specifications, which can introduce non breaking changes. Breaking changes can be introduced in a new major version of specification and corresponding new major version of Notation.An exception is the plugin contract spec versioning, which is independent of other versioning, but we need not reflect this in package naming, consumers do not directly interact with plugin contract version.
We should also put most types under
internal
package, and selectively move then out as publicly visible types as appropriate for Notation CLI and other consumers . Are we planning to usepkg
folder for public library types? I was looking at Go lang project layout standard, but not sure how widely it's adopted.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.
Can you clarify @shizhMSFT? I didn't understand why two interfaces are required, are you referring to the low level
Signer
interface to be added innotation-core-go
.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.
I will not tire of repeating that mixing the
notation-go
module versioning with the Notary versioning is an artificial restriction that will limitnotation-go
capacity to improve its API. What if in a couple of months, or even years, we find that part of the API is too easy to misuse or has security vulnerabilities? What if we think there is a much better way to implement the Notary spec? We won't be able to react properly if we can't bump the major version ofnottion-go
.About having the
spec
package or putting everything at the root of the module, I think there is value on having a clear separation for types which are defined in the Notary spec and types that are invented bynotation-go
. I'm not a maintainer of this library, so if you don't see it then I can remove it.spec/plugin
package is intended for plugin authors consumption, if we move those types intointernal
they will have to reimplement the whole plugin spec. I can assure you that all types and methods inspec
are relevant for consumers, as I'm implementing thenotation-azure-kv
plugin andnotation
cli in parallel and I'm just exporting what's necessary.Having a package named
pkg
is not idiomatic, it used to be long time ago, and the current best practice is to place packages at the module root, or stack them with care.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.
I agree with the concern, I don't think we have thought enough about versioning of the multiple things (plugins, signature, trust policy) and which ones may reflect in package structure. For example, trust policy document has its own version property, so that policy language in
trustPolicy.json
can be independently revised without impacting anything else. We'll be making a round of refactoring to get it in line with intended separation between notation, notation-go and notation-core-go, we'll also wait for the rest of the specs to be completed. I'll track this as one of the items in a refactoring issue, and an independent issue to clarify versioning. Do you have few examples of projects that expose a spec and spec version to consumers as part of package structure, /image-spec was one, but that's quite stable.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.
To name a few big ones: