-
Notifications
You must be signed in to change notification settings - Fork 86
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
Notation CLI baseline #83
Conversation
This is a joint commit of - Shiwei Zhang - Steve Lasker - Aviral Takkar Signed-off-by: Shiwei Zhang <shizh@microsoft.com>
Signed-off-by: Steve Lasker <stevenlasker@hotmail.com>
Signed-off-by: Steve Lasker <stevenlasker@hotmail.com>
Signed-off-by: Steve Lasker <stevenlasker@hotmail.com>
Signed-off-by: Shiwei Zhang <shizh@microsoft.com>
Signed-off-by: Steve Lasker <stevenlasker@hotmail.com>
Signed-off-by: Steve Lasker <stevenlasker@hotmail.com>
Signed-off-by: Steve Lasker <stevenlasker@hotmail.com>
Based on our [Notary v2 call this week](https://hackmd.io/_vrqBGAOSUC_VWvFzWruZw?view), we agreed to merge this into a `prototype-1` branch. This will give us a baseline to which we can open issues and submit new PRs.
Signed-off-by: Steve Lasker <stevenlasker@hotmail.com>
Signed-off-by: Steve Lasker <stevenlasker@hotmail.com>
Signed-off-by: Steve Lasker <stevenlasker@hotmail.com>
Signed-off-by: Steve Lasker <stevenlasker@hotmail.com>
Signed-off-by: Steve Lasker <stevenlasker@hotmail.com>
Signed-off-by: Steve Lasker <stevenlasker@hotmail.com>
Distribution options for persistence & discovery Renaming the PR and file to capture the design discussions. As this fork represents a prototype, we'll merge this in, clearing the root README.md for the current implementation.
Signed-off-by: Steve Lasker <stevenlasker@hotmail.com>
Signed-off-by: Steve Lasker <stevenlasker@hotmail.com>
Signed-off-by: Steve Lasker <stevenlasker@hotmail.com>
Signed-off-by: Steve Lasker <stevenlasker@hotmail.com>
Signed-off-by: Steve Lasker <stevenlasker@hotmail.com>
Signed-off-by: Steve Lasker <stevenlasker@hotmail.com>
Prototype 2 Demo Script
Signed-off-by: Shiwei Zhang <shizh@microsoft.com>
Signed-off-by: Shiwei Zhang <shizh@microsoft.com>
Signed-off-by: Shiwei Zhang <shizh@microsoft.com>
Signed-off-by: Shiwei Zhang <shizh@microsoft.com>
Signed-off-by: Shiwei Zhang <shizh@microsoft.com>
Signed-off-by: Shiwei Zhang <shizh@microsoft.com>
Signed-off-by: Shiwei Zhang <shizh@microsoft.com>
Signed-off-by: Shiwei Zhang <shizh@microsoft.com>
Signed-off-by: Shiwei Zhang <shizh@microsoft.com>
return ocispec.Descriptor{}, err | ||
} | ||
insecure := config.IsRegistryInsecure(ref.Registry) | ||
if host, _, _ := net.SplitHostPort(ref.Registry); host == "localhost" { |
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.
Do we need to include 127.0.0.1?
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.
all loopback interfaces
} | ||
|
||
insecure := config.IsRegistryInsecure(hostname) | ||
if host, _, _ := net.SplitHostPort(hostname); host == "localhost" { |
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.
maybe worth having it as util for determining insecure property from hostname
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 we create an issue to track, and merge?
Per the notation call today, we've agreed to merge this as a baseline to create issues and continue iterations. |
Signed-off-by: Shiwei Zhang <shizh@microsoft.com>
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.
Some high-level comments:
- For better readability, we need to add some documentation for packages and exported names.
- We should also add unit tests. At minimum we need test which exercises positive scenario(successful signing and verification) to avoid breaking changes.
- The Commit history doesn't look right; also, can we please update the commit message?
- We need better error messages
- The cli should exit with proper exit code(non zero for failures) Ref
- The package structure should be reorganized for better readability.
cmd
|->docker-generate --> contains cmd to generates docker artifact
|->docker-notation -->
|->crypto --> not a cli file but a implementation of signer and verifier; shouldn’t be inside cmd
|->docker --> contains docker related helper method; shouldn’t be inside cmd
|->notation --> contains docker pull,push,etc commands
internal
|->docker --> it’s a cli helper; should go to cmd
|->io
|->os
|->version --> it’s a cli helper; should go to cmd
pkg --> What's the difference between internal and pkg?
|->cache --> contains signature related methods; why its named cache?
|->config --> contains user config
|->docker --> Docker related helper to get image; should this go to registry?
|->registry --> Docker related helper
Tracking issue #93
Signed-off-by: Shiwei Zhang <shizh@microsoft.com>
Signed-off-by: Shiwei Zhang <shizh@microsoft.com>
Signed-off-by: Shiwei Zhang <shizh@microsoft.com>
Signed-off-by: Shiwei Zhang <shizh@microsoft.com>
Signed-off-by: Shiwei Zhang <shizh@microsoft.com>
Signed-off-by: Shiwei Zhang <shizh@microsoft.com>
@@ -0,0 +1,40 @@ | |||
package crypto |
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.
should service.go
be added as default implementation in notation-lib?
passwordFlag = &cli.StringFlag{ | ||
Name: "password", | ||
Aliases: []string{"p"}, | ||
Usage: "password for generic remote access", | ||
EnvVars: []string{"NOTATION_PASSWORD"}, | ||
} |
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.
Taking password from cli in plain text is a security risk as its visible while typing and can be seen in shell history.
VerificationCertificates VerificationCertificates `json:"verificationCerts"` | ||
SigningKeys SigningKeys `json:"signingKeys,omitempty"` | ||
InsecureRegistries []string `json:"insecureRegistries"` |
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.
instead of exporting types can we export routines so that underlying implementation can be changed without affecting callers.
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.
As per morning call we will have issues tracking things called out above by @mnltejaswini @priteshbandi and others.
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.
Approving with comments tracked in issues.
Notation CLI alpha based on notaryproject/notation-go#5 and the prototype-2 branch.
This PR is an accumulated contribution.
Related PRs: