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

examples: This adds example code on how to fetch a fulcio certificate #324

Merged
merged 4 commits into from
Apr 14, 2022

Conversation

Foxboron
Copy link
Contributor

Summary

The API isn't super clearly documented and the workflow how to fetch certificates is not well explained. There are no simple code examples nor examples around that makes fulcio easy to pick up. This is a start at providing examples for how to utilize fulcio and something we should look at adopting for the other sigstore projects as well.

Signed-off-by: Morten Linderud morten@linderud.pw

@dlorenc
Copy link
Member

dlorenc commented Jan 13, 2022

This is really cool! Do you think we could toss a small readme next to it explaining the overall usage?

@Foxboron
Copy link
Contributor Author

We could have a README in the examples directory that would explain each code snippet in the directory?

@cpanato
Copy link
Member

cpanato commented Jan 13, 2022

We could have a README in the examples directory that would explain each code snippet in the directory?

that is perfect!

@lukehinds
Copy link
Member

Good idea, I think with a README.md alongside the code works well too.

@Foxboron
Copy link
Contributor Author

After a little discussion on slack last week I was contemplating just moving this pull-request to the https://github.com/sigstore/examples project. It seems fairly unmaintained at the moment and we could probably have project monitors along with code examples for utilizing sigstore/fulcio/rekor there.

If that requires a bit more planning I'll just finish up this PR and get it ready for a merge.

@bobcallaway
Copy link
Member

After a little discussion on slack last week I was contemplating just moving this pull-request to the https://github.com/sigstore/examples project. It seems fairly unmaintained at the moment and we could probably have project monitors along with code examples for utilizing sigstore/fulcio/rekor there.

If that requires a bit more planning I'll just finish up this PR and get it ready for a merge.

I'd vote to merge this here and then move later if desired.

@lukehinds
Copy link
Member

lukehinds commented Jan 27, 2022

echo what bob says, I think we should remove sigstore/examples to be honest. for me it makes sense to have relevant examples under each respective project.

@Foxboron
Copy link
Contributor Author

Sorry for the delay!

Added the license header and wrote a README. If it's a bit on the spare side we can iterate on it now or expand on it later when we get more examples.

Copy link
Member

@lukehinds lukehinds left a comment

Choose a reason for hiding this comment

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

lgtm now, just CI has a dep breakage, a quick rebase might resolve that.

@Foxboron
Copy link
Contributor Author

Any reason this was never merged?

@dlorenc
Copy link
Member

dlorenc commented Apr 11, 2022

Any reason this was never merged?

The build looks broken: https://github.com/sigstore/fulcio/runs/5066358179?check_suite_focus=true

It might just need a rebase and go mod tidy

@Foxboron
Copy link
Contributor Author

Weird!

Rebased and updated the example to account for the new redirect variable that was added.

@codecov-commenter
Copy link

Codecov Report

Merging #324 (b6dcb36) into main (8fca631) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #324   +/-   ##
=======================================
  Coverage   43.57%   43.57%           
=======================================
  Files          18       18           
  Lines        1221     1221           
=======================================
  Hits          532      532           
  Misses        615      615           
  Partials       74       74           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8fca631...b6dcb36. Read the comment docs.

Copy link
Member

@bobcallaway bobcallaway left a comment

Choose a reason for hiding this comment

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

I think we've deprecated the v1 endpoint so would be good to remove that but otherwise LGTM

examples/request-certificate/main.go Outdated Show resolved Hide resolved
Signed-off-by: Morten Linderud <morten@linderud.pw>
Signed-off-by: Morten Linderud <morten@linderud.pw>
Signed-off-by: Morten Linderud <morten@linderud.pw>
Signed-off-by: Morten Linderud <morten@linderud.pw>
@Foxboron
Copy link
Contributor Author

Patched, rebased and pushed :)

@bobcallaway bobcallaway merged commit 2605dbf into sigstore:main Apr 14, 2022
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.

7 participants