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

clean up references to 'keyless' in ephemeral.Signer #1225

Merged
merged 1 commit into from
Dec 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions internal/pkg/cosign/ephemeral/signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ import (
"github.com/sigstore/sigstore/pkg/signature"
)

type keylessSigner struct {
type ephemeralSigner struct {
signer signature.Signer
}

var _ icosign.Signer = keylessSigner{}
var _ icosign.Signer = ephemeralSigner{}

// Sign implements `Signer`
func (ks keylessSigner) Sign(ctx context.Context, payload io.Reader) (oci.Signature, crypto.PublicKey, error) {
func (ks ephemeralSigner) Sign(ctx context.Context, payload io.Reader) (oci.Signature, crypto.PublicKey, error) {
Copy link
Member

Choose a reason for hiding this comment

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

You should probably use pointer receivers to avoid copies too

Copy link
Member Author

Choose a reason for hiding this comment

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

copies of what? :p

Copy link
Member

Choose a reason for hiding this comment

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

The struct containing the pointer 🙄

pub, err := ks.signer.PublicKey()
if err != nil {
return nil, nil, errors.Wrap(err, "retrieving the static public key somehow failed")
Expand Down Expand Up @@ -71,7 +71,7 @@ func NewSigner() (icosign.Signer, error) {
if err != nil {
return nil, errors.Wrap(err, "creating a SignerVerifier from ephemeral key")
}
return keylessSigner{
return ephemeralSigner{
signer: s,
}, nil
}
2 changes: 1 addition & 1 deletion internal/pkg/cosign/ephemeral/signer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"github.com/sigstore/sigstore/pkg/signature"
)

func TestKeylessSigner(t *testing.T) {
func TestEphemeralSigner(t *testing.T) {
testSigner, err := NewSigner()
if err != nil {
t.Fatalf("NewSigner() returned error: %v", err)
Expand Down