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 rekor client method to upload a record #23

Merged
merged 1 commit into from
May 23, 2022
Merged

Conversation

loosebazooka
Copy link
Member

@loosebazooka loosebazooka commented May 19, 2022

  • Also adds a cert generator to bypass fulcio/dex in testing

@loosebazooka loosebazooka force-pushed the rekor-request branch 2 times, most recently from 5000681 to 1864084 Compare May 19, 2022 23:50
@loosebazooka loosebazooka changed the title WIP rekor client impl Add rekor client method to upload a record May 19, 2022
@loosebazooka loosebazooka requested a review from patflynn May 19, 2022 23:51
@loosebazooka loosebazooka marked this pull request as ready for review May 19, 2022 23:52
@loosebazooka loosebazooka requested a review from jvanzyl May 20, 2022 12:25
- Also adds a cert generator to bypass fulcio/dex in testing

Signed-off-by: Appu Goundan <appu@google.com>

public class HashedRekordRequest {

private final Hashedrekord hashedrekord;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is the (lackof) camecase a typo here or unavoidable code gen artifact?

Copy link
Member Author

Choose a reason for hiding this comment

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

hrmm... yeah I think so. It should be an internal value, so users wont see it. There's probably a way to make it more "java-like".

* Create a new HashedRekorRequest.
*
* @param artifactDigest the sha256 digest of the artifact (not hex/base64 encoded)
* @param leafCert the leaf certificate used to verify {@code signature}, usually obtained from
Copy link
Collaborator

Choose a reason for hiding this comment

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

for custom key signed artifacts (not using fulcio), is there a leaf cert to submit, or do you just use the singer's public key? It's all still a little muddled for me so asking out of curiosity,

Copy link
Member Author

Choose a reason for hiding this comment

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

So presumably there's two ways to do this.

  1. with a certificate
  2. with a public key

this code just doesn't support (2) yet. But that would be a new factory method

support for public key hashedrekord: #25

var req = HashedRekordRequest.newHashedRekordRequest(artifactDigest, cert, signature);

// this tests directly against rekor in staging, it's a bit hard to bring up a rekor instance
// without docker compose.
Copy link
Collaborator

Choose a reason for hiding this comment

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

todo? I think Jason was working on doing this for his maven testing.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't know what the right solution is. I think sigstore-scaffolding is fine, but it's super heavy weight.

Issue: #27

/**
* A certificate generator, useful when trying to talk to rekor without actually using fulcio/oidc.
*/
public class CertGenerator {
Copy link
Collaborator

Choose a reason for hiding this comment

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

ah so would this be used for the custom key flow 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.

if you use a custom key, you probably don't want a certificate -- you just use a pem encoded public key?

@loosebazooka loosebazooka merged commit 15cf055 into main May 23, 2022
@loosebazooka loosebazooka deleted the rekor-request branch May 23, 2022 19:29
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.

2 participants