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

update: Package notation refactoring #191

Merged
merged 32 commits into from
Nov 11, 2022
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
219e11b
update
Two-Hearts Nov 8, 2022
1862c7e
notation refactoring
Two-Hearts Nov 8, 2022
f8f1b59
update
Two-Hearts Nov 8, 2022
e56be2b
refactored notation
Two-Hearts Nov 8, 2022
1f5a10c
updates
Two-Hearts Nov 8, 2022
7775782
update
Two-Hearts Nov 8, 2022
223b4e6
Merge branch 'notaryproject:main' into notation
Two-Hearts Nov 9, 2022
293d7a7
update
Two-Hearts Nov 9, 2022
7a40295
resolve conflicts
Two-Hearts Nov 9, 2022
f01fa86
update
Two-Hearts Nov 9, 2022
9b8ed37
update
Two-Hearts Nov 9, 2022
53fa4a4
update
Two-Hearts Nov 9, 2022
e1a4497
update
Two-Hearts Nov 9, 2022
5fc3cc0
updated per code review
Two-Hearts Nov 9, 2022
6cd2b89
updated per code review
Two-Hearts Nov 9, 2022
e496e5c
update
Two-Hearts Nov 9, 2022
5a77b81
updated per code review
Two-Hearts Nov 9, 2022
aeea620
updated per code review
Two-Hearts Nov 9, 2022
8409a45
resolve conflicts
Two-Hearts Nov 10, 2022
f192a8c
update
Two-Hearts Nov 10, 2022
81eeafc
update
Two-Hearts Nov 10, 2022
af27f20
updated per code review
Two-Hearts Nov 10, 2022
c9e4409
update
Two-Hearts Nov 10, 2022
537851b
updated per code review
Two-Hearts Nov 10, 2022
8b7066e
updated per code review
Two-Hearts Nov 10, 2022
4032f5e
Merge branch 'notaryproject:main' into notation
Two-Hearts Nov 10, 2022
55aee1a
updated per code review
Two-Hearts Nov 10, 2022
01df7de
updated per code review
Two-Hearts Nov 11, 2022
631731b
updated per code review
Two-Hearts Nov 11, 2022
73e2c5f
update
Two-Hearts Nov 11, 2022
70a1cf9
updated per code review
Two-Hearts Nov 11, 2022
23a6feb
updated per code review
Two-Hearts Nov 11, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions errors.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package notation

// ErrorVerificationInconclusive is used when signature verification fails due to a runtime error (e.g. a network error)
type ErrorVerificationInconclusive struct {
Msg string
}

func (e ErrorVerificationInconclusive) Error() string {
if e.Msg != "" {
return e.Msg
}
return "signature verification was inclusive due to an unexpected error"
}

// ErrorNoApplicableTrustPolicy is used when there is no trust policy that applies to the given artifact
type ErrorNoApplicableTrustPolicy struct {
Msg string
}

func (e ErrorNoApplicableTrustPolicy) Error() string {
if e.Msg != "" {
return e.Msg
}
return "there is no applicable trust policy for the given artifact"
}

// ErrorSignatureRetrievalFailed is used when notation is unable to retrieve the digital signature/s for the given artifact
type ErrorSignatureRetrievalFailed struct {
Msg string
}

func (e ErrorSignatureRetrievalFailed) Error() string {
if e.Msg != "" {
return e.Msg
}
return "unable to retrieve the digital signature from the registry"
}

// ErrorVerificationFailed is used when it is determined that the digital signature/s is not valid for the given artifact
type ErrorVerificationFailed struct {
Msg string
}

func (e ErrorVerificationFailed) Error() string {
if e.Msg != "" {
return e.Msg
}
return "signature verification failed"
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ require (
github.com/golang-jwt/jwt/v4 v4.4.2 // indirect
github.com/x448/float16 v0.8.4 // indirect
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f // indirect
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcY
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d h1:sK3txAijHtOK88l68nt020reeT1ZdKLIYetKl95FzVY=
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f h1:Ax0t5p6N38Ga0dThY21weqDEyz2oklo4IvDkpigvkD8=
golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
Expand Down
52 changes: 29 additions & 23 deletions internal/mock/mocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ import (
_ "embed"

"github.com/notaryproject/notation-core-go/signature"
"github.com/notaryproject/notation-go"
"github.com/notaryproject/notation-go/internal/plugin"
"github.com/notaryproject/notation-go/internal/plugin/manager"
"github.com/notaryproject/notation-go/internal/registry"
"github.com/opencontainers/go-digest"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
)

//go:embed testdata/ca_valid_sig_env.json
Expand Down Expand Up @@ -40,13 +39,19 @@ var (
SampleArtifactUri = "registry.acme-rockets.io/software/net-monitor@sha256:60043cf45eaebc4c0867fea485a039b598f52fd09fd5b07b0b2d2f88fad9d74e"
SampleDigest = digest.Digest("sha256:60043cf45eaebc4c0867fea485a039b598f52fd09fd5b07b0b2d2f88fad9d74e")
Annotations = map[string]string{"key": "value"}
ImageDescriptor = notation.Descriptor{
ImageDescriptor = ocispec.Descriptor{
MediaType: "application/vnd.docker.distribution.manifest.v2+json",
Digest: SampleDigest,
Size: 528,
Annotations: nil,
}
JwsSigEnvDescriptor = notation.Descriptor{
SigManfiestDescriptor = ocispec.Descriptor{
MediaType: "application/vnd.cncf.oras.artifact.manifest.v1+json",
Digest: SampleDigest,
Size: 300,
Annotations: Annotations,
}
JwsSigEnvDescriptor = ocispec.Descriptor{
MediaType: "application/jose+json",
Digest: SampleDigest,
Size: 100,
Expand All @@ -60,39 +65,40 @@ var (
)

type Repository struct {
ResolveResponse notation.Descriptor
ResolveError error
ListSignatureManifestsResponse []registry.SignatureManifest
ListSignatureManifestsError error
GetResponse []byte
GetError error
ResolveResponse ocispec.Descriptor
ResolveError error
ListSignaturesResponse []ocispec.Descriptor
ListSignaturesError error
FetchSignatureBlobResponse []byte
FetchSignatureBlobError error
}

func NewRepository() Repository {
return Repository{
ResolveResponse: ImageDescriptor,
ListSignatureManifestsResponse: []registry.SignatureManifest{{
Blob: JwsSigEnvDescriptor,
Annotations: Annotations,
}},
GetResponse: MockCaValidSigEnv,
ResolveResponse: ImageDescriptor,
ListSignaturesResponse: []ocispec.Descriptor{SigManfiestDescriptor},
FetchSignatureBlobResponse: MockCaValidSigEnv,
}
}

func (t Repository) Resolve(ctx context.Context, reference string) (notation.Descriptor, error) {
func (t Repository) Resolve(ctx context.Context, reference string) (ocispec.Descriptor, error) {
return t.ResolveResponse, t.ResolveError
}

func (t Repository) ListSignatureManifests(ctx context.Context, manifestDigest digest.Digest) ([]registry.SignatureManifest, error) {
return t.ListSignatureManifestsResponse, t.ListSignatureManifestsError
func (t Repository) ListSignatures(ctx context.Context, desc ocispec.Descriptor, fn func(signatureManifests []ocispec.Descriptor) error) error {
err := fn(t.ListSignaturesResponse)
if err != nil {
return err
}
patrickzheng200 marked this conversation as resolved.
Show resolved Hide resolved
return t.ListSignaturesError
}

func (t Repository) GetBlob(ctx context.Context, digest digest.Digest) ([]byte, error) {
return t.GetResponse, t.GetError
func (t Repository) FetchSignatureBlob(ctx context.Context, desc ocispec.Descriptor) ([]byte, ocispec.Descriptor, error) {
return t.FetchSignatureBlobResponse, JwsSigEnvDescriptor, t.FetchSignatureBlobError
}

func (t Repository) PutSignatureManifest(ctx context.Context, signature []byte, signatureMediaType string, manifest notation.Descriptor, annotaions map[string]string) (notation.Descriptor, registry.SignatureManifest, error) {
return notation.Descriptor{}, registry.SignatureManifest{}, nil
func (t Repository) PushSignature(ctx context.Context, mediaType string, blob []byte, subject ocispec.Descriptor, annotations map[string]string) (blobDesc, manifestDesc ocispec.Descriptor, err error) {
return ocispec.Descriptor{}, ocispec.Descriptor{}, nil
}

type PluginManager struct {
Expand Down
134 changes: 134 additions & 0 deletions internal/mock_origin/mocks.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
package mock

import (
"context"
_ "embed"

"github.com/notaryproject/notation-core-go/signature"
notation "github.com/notaryproject/notation-go/internal"
"github.com/notaryproject/notation-go/internal/plugin"
"github.com/notaryproject/notation-go/internal/plugin/manager"
"github.com/notaryproject/notation-go/internal/registry"
"github.com/opencontainers/go-digest"
)

//go:embed testdata/ca_valid_sig_env.json
var MockCaValidSigEnv []byte

//go:embed testdata/ca_invalid_sig_env.json
var MockCaInvalidSigEnv []byte

//go:embed testdata/sa_valid_sig_env.json
var MockSaValidSigEnv []byte

//go:embed testdata/ca_plugin_sig_env.json
var MockCaPluginSigEnv []byte // extended attributes are "SomeKey":"SomeValue", "io.cncf.notary.verificationPlugin":"plugin-name"

//go:embed testdata/sa_invalid_sig_env.json
var MockSaInvalidSigEnv []byte

//go:embed testdata/ca_expired_sig_env.json
var MockCaExpiredSigEnv []byte

//go:embed testdata/sa_expired_sig_env.json
var MockSaExpiredSigEnv []byte

//go:embed testdata/sa_plugin_sig_env.json
var MockSaPluginSigEnv []byte // extended attributes are "SomeKey":"SomeValue", "io.cncf.notary.verificationPlugin":"plugin-name"

var (
SampleArtifactUri = "registry.acme-rockets.io/software/net-monitor@sha256:60043cf45eaebc4c0867fea485a039b598f52fd09fd5b07b0b2d2f88fad9d74e"
SampleDigest = digest.Digest("sha256:60043cf45eaebc4c0867fea485a039b598f52fd09fd5b07b0b2d2f88fad9d74e")
Annotations = map[string]string{"key": "value"}
ImageDescriptor = notation.Descriptor{
MediaType: "application/vnd.docker.distribution.manifest.v2+json",
Digest: SampleDigest,
Size: 528,
Annotations: nil,
}
JwsSigEnvDescriptor = notation.Descriptor{
MediaType: "application/jose+json",
Digest: SampleDigest,
Size: 100,
Annotations: Annotations,
}
PluginExtendedCriticalAttribute = signature.Attribute{
Key: "SomeKey",
Critical: true,
Value: "SomeValue",
}
)

type Repository struct {
ResolveResponse notation.Descriptor
ResolveError error
ListSignatureManifestsResponse []registry.SignatureManifest
ListSignatureManifestsError error
GetResponse []byte
GetError error
}

func NewRepository() Repository {
return Repository{
ResolveResponse: ImageDescriptor,
ListSignatureManifestsResponse: []registry.SignatureManifest{{
Blob: JwsSigEnvDescriptor,
Annotations: Annotations,
}},
GetResponse: MockCaValidSigEnv,
}
}

func (t Repository) Resolve(ctx context.Context, reference string) (notation.Descriptor, error) {
return t.ResolveResponse, t.ResolveError
}

func (t Repository) ListSignatureManifests(ctx context.Context, manifestDigest digest.Digest) ([]registry.SignatureManifest, error) {
return t.ListSignatureManifestsResponse, t.ListSignatureManifestsError
}

func (t Repository) GetBlob(ctx context.Context, digest digest.Digest) ([]byte, error) {
return t.GetResponse, t.GetError
}

func (t Repository) PutSignatureManifest(ctx context.Context, signature []byte, signatureMediaType string, manifest notation.Descriptor, annotaions map[string]string) (notation.Descriptor, registry.SignatureManifest, error) {
return notation.Descriptor{}, registry.SignatureManifest{}, nil
}

type PluginManager struct {
PluginCapabilities []plugin.Capability
GetPluginError error
PluginRunnerLoadError error
PluginRunnerExecuteResponse interface{}
PluginRunnerExecuteError error
}

type PluginRunner struct {
Response interface{}
Error error
}

func (pr PluginRunner) Run(ctx context.Context, req plugin.Request) (interface{}, error) {
return pr.Response, pr.Error
}

func (pm PluginManager) Get(ctx context.Context, name string) (*manager.Plugin, error) {
return &manager.Plugin{
Metadata: plugin.Metadata{
Name: "plugin-name",
Description: "for mocking in unit tests",
Version: "1.0.0",
URL: ".",
SupportedContractVersions: []string{"1.0"},
Capabilities: pm.PluginCapabilities,
},
Path: ".",
Err: nil,
}, pm.GetPluginError
}
func (pm PluginManager) Runner(name string) (plugin.Runner, error) {
return PluginRunner{
Response: pm.PluginRunnerExecuteResponse,
Error: pm.PluginRunnerExecuteError,
}, pm.PluginRunnerLoadError
}
12 changes: 12 additions & 0 deletions internal/mock_origin/testdata/ca_expired_sig_env.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"payload": "eyJ0YXJnZXRBcnRpZmFjdCI6eyJtZWRpYVR5cGUiOiJhcHBsaWNhdGlvbi92bmQuZG9ja2VyLmRpc3RyaWJ1dGlvbi5tYW5pZmVzdC52Mitqc29uIiwiZGlnZXN0Ijoic2hhMjU2OjYwMDQzY2Y0NWVhZWJjNGMwODY3ZmVhNDg1YTAzOWI1OThmNTJmZDA5ZmQ1YjA3YjBiMmQyZjg4ZmFkOWQ3NGUiLCJzaXplIjo1Mjh9fQ",
"protected": "eyJhbGciOiJQUzM4NCIsImNyaXQiOlsiaW8uY25jZi5ub3Rhcnkuc2lnbmluZ1NjaGVtZSIsImlvLmNuY2Yubm90YXJ5LmV4cGlyeSJdLCJjdHkiOiJhcHBsaWNhdGlvbi92bmQuY25jZ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4oTOSDCos2WFoC+8TZS6r583OtFLmywl1HRgQkobGgw"
],
"io.cncf.notary.SigningAgent": "Notation/1.0.0"
},
"signature": "RZtqCD4KGh5_CD8wjG69TJIzzB4Cr-cxQhKTvZJYsRVIJyl3s5D0215GhBrggomVk9-LGD2FdWd2VfuaLd4bmhW3rSV3ltmAext7DNQFg2xtMeYSeCL2U_ygN2j4bc80RDaX8w_zOTVOmuhW6i2jgwRjWXdDaJeYTbZA2syA5R38tYYewVcZJ6U057Wsflt5yPWJCdxZLuTago5CkbLASL8HHnmlUkDvKKB1Y9SNDOQ3AmGP4-XJykcX_MfPo5RGRvZE-zHUJOEKj3ryfC0UTUT7V1ISTagqOt7zOa1BEzgQ-1GQk1MbaPPZWkiOZX4RqMXMV3hVqtDuZxlpT25KzZPm1USwWwJkycv7YB69fc2aoHJAPo-39uEV9fdAz_03whnrQSpfJbmHHTXMJkWKrZ5ozU-8zlEttWyL5D85zAouSMVXWm22zMrDW-XxST9QoeV4b1_BedW1PwJDbeU6P1hhobnQh3jHmSueVl_WZ5_g8_iVepSmSBcR1e4WpoPi"
}
12 changes: 12 additions & 0 deletions internal/mock_origin/testdata/ca_invalid_sig_env.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"payload": "eyJ0YXJnZXRBcnRpZmFjdCI6eyJtZWRpYVR5cGUiOiJhcHBsaWNhdGlvbi92bmQuZG9ja2VyLmRpc3RyaWJ1dGlvbi5tYW5pZmVzdC52Mitqc29uIiwiZGlnZXN0Ijoic2hhMjU2OjYwMDQzY2Y0NWVhZWJjNGMwODY3ZmVhNDg1YTAzOWI1OThmNTJmZDA5ZmQ1YjA3YjBiMmQyZjg4ZmFkOWQ3NGUiLCJzaXplIjo1Mjh9fQ=",
"protected": "eyJhbGciOiJQUzM4NCIsImNyaXQiOlsiaW8uY25jZi5ub3Rhcnkuc2lnbmluZ1NjaGVtZSIsImlvLmNuY2Yubm90YXJ5LmV4cGlyeSJdLCJjdHkiOiJhcHBsaWN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