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

feat: Create a verifier as a service #182

Merged
merged 20 commits into from
Aug 3, 2022

Conversation

laurentsimon
Copy link
Contributor

See #163

This PR was originally started in #164 . There was a large file accidentally pushed in one of the commits. After removing it, the PR got automatically closed. Hence this new PR.

This is an experimental feature, obviously. This PR does:

  1. Re-factor code to be able to share the verification code between the cli and the service
  2. Implement a simple REST API /v1/verify which takes as input the same as the CLI (except for the artifact which is replaced by its hash):
{
    "source": "github.com/ossf/scorecard",
    "artifactHash": "02e7ac9a2a252a4e57cb2050953e787d095a04b955a41878068d60885bd31a0b",
    "tag": "v4.4.0",
     versionedTag: "bla",
    "printProvenance": true,
    "provenanceContent": "..."
}

Example: curl -s 127.0.0.1:8000/v1/verify -d @./request

and returns:

{
   "error": "some caught error"
   "validation": "failure" / "success"
   "provenanceContent": "base64 intoto"
}

We may want to change some of the names. I have not included unit tests yet. Will do in a follow-up PR. (need to mock the http client).

Let me know what you think about the input / output format. I'm wondering if we should unify the output for both the cli and the service. It would force us to have proper error / log handling

Copy link
Contributor

@asraa asraa left a comment

Choose a reason for hiding this comment

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

lgtm to keep iterating on

README.md Outdated Show resolved Hide resolved
cli/experimental/service/README.md Outdated Show resolved Hide resolved
cli/experimental/service/README.md Outdated Show resolved Hide resolved
Tag *string `json:"tag"`
Branch *string `json:"branch"`
VersionedTag *string `json:"versionedTag"`
PrintProvenance *bool `json:"printProvenance"`
Copy link
Contributor

Choose a reason for hiding this comment

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

I know this matches the CLI options, but do you think the API needs to return provenance at all? this is a service that will be used to just get a pass/fail option. unless maybe someone wants to pipe in the result to other services to do more analysis on the provenance.

Copy link
Contributor Author

@laurentsimon laurentsimon Aug 3, 2022

Choose a reason for hiding this comment

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

Yes, someone may want to check for repository-id and what not. It's an optional argument, so is not needed. Is that OK?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We will iterate, so I'm going to merge. This PR is just to get the ball rolling with something to hack on.

@laurentsimon laurentsimon merged commit caaf1c1 into slsa-framework:main Aug 3, 2022
ramonpetgrave64 pushed a commit to ramonpetgrave64/slsa-verifier that referenced this pull request Apr 18, 2024
Signed-off-by: Asra Ali <asraa@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

2 participants