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

Add fake signer that implements KMS interface #361

Merged
merged 2 commits into from Apr 1, 2022

Conversation

haydentherapper
Copy link
Contributor

This allows us to test code that uses kms.Get by importing the fake KMS
package.

Signed-off-by: Hayden Blauzvern hblauzvern@google.com

Summary

Ticket Link

Fixes

Release Note

Added fake KMS signer for testing

@haydentherapper
Copy link
Contributor Author

cc @bobcallaway

hectorj2f
hectorj2f previously approved these changes Mar 31, 2022
Copy link
Contributor

@hectorj2f hectorj2f left a comment

Choose a reason for hiding this comment

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

Lgtm, and it would be useful when adding some tests in cosigned

This allows us to test code that uses kms.Get by importing the fake KMS
package.

Signed-off-by: Hayden Blauzvern <hblauzvern@google.com>
dlorenc
dlorenc previously approved these changes Mar 31, 2022
@haydentherapper
Copy link
Contributor Author

Need to make one quick change before this is submitted, I want to provide a way to pass in a private key to the loader. Otherwise if you call kms.Get() repeatedly, you'll get back different key values each time.

@haydentherapper
Copy link
Contributor Author

Added: A bit of a weird way to do it, but I'm passing a marshalled ECDSA private key via the string ref. If the string ref after fakekms:// is empty, then it'll generate a key for you.

@haydentherapper
Copy link
Contributor Author

You know what, it'd be far easier to just pass the private key in the context. I'll clean this up.

@haydentherapper
Copy link
Contributor Author

Ready for review!

The private key is passed in the context.

Signed-off-by: Hayden Blauzvern <hblauzvern@google.com>
@dlorenc dlorenc merged commit 0e610e3 into sigstore:main Apr 1, 2022
@haydentherapper haydentherapper deleted the fake branch April 1, 2022 16:28
mtrmac pushed a commit to mtrmac/sigstore that referenced this pull request Mar 10, 2023
Signed-off-by: Jake Sanders <jsand@google.com>
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.

None yet

3 participants