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

Fulcio client #132

Merged
merged 7 commits into from
Oct 5, 2022
Merged

Fulcio client #132

merged 7 commits into from
Oct 5, 2022

Conversation

bobmcwhirter
Copy link
Contributor

Fixes #131

Summary

Creates an async Fulcio client to make working with Fulcio more straightfoward.

Release Note

  • Fulcio client for exchanging public key for signed certificate added.

Documentation

Rust docs provided.

@bobmcwhirter
Copy link
Contributor Author

I want to rework this a bit I think.

@lukehinds
Copy link
Member

This might be better suited for examples/ , it would be very valuable as a guide. In examples you can use unwrap as much as you like as well. Happy to see what other reviewers think though.

@bobmcwhirter
Copy link
Contributor Author

I do still think expanding it and including it in the mainline would be useful, particularly in light of the protobuf-vs-json-vs-whatever discussions. By keeping it in the main tree, downstream users won't have to individually adapt to protocol changes.

I do want to make it all Much Better. Ignore this for now (I'll mark it as a draft) and continue to iterate.

@bobmcwhirter bobmcwhirter marked this pull request as draft September 21, 2022 13:11
@bobmcwhirter bobmcwhirter marked this pull request as ready for review September 21, 2022 16:04
@bobmcwhirter
Copy link
Contributor Author

btw, happy for a review now.

Ok((id_token_claims.clone(), id_token.clone()))
}

pub async fn redirect_listener_async(self) -> Result<(CoreIdTokenClaims, CoreIdToken)> {
Copy link
Member

Choose a reason for hiding this comment

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

Could we could combine redirect_listener_async and redirect_listener, as they are largely the same apart from a single line (calling either http_client or async_http_client

src/oauth/openidflow.rs Outdated Show resolved Hide resolved
This supports usage without spawning blocking tasks, at least with actix_rt.

Signed-off-by: Bob McWhirter <bmcwhirt@redhat.com>
keypair and exchanging the pubkey for a signed certificate.

Signed-off-by: Bob McWhirter <bmcwhirt@redhat.com>
Refactor to allow static or OIDC flow for tokening.

Signed-off-by: Bob McWhirter <bmcwhirt@redhat.com>
Signed-off-by: Bob McWhirter <bmcwhirt@redhat.com>
Signed-off-by: Bob McWhirter <bmcwhirt@redhat.com>
Signed-off-by: Bob McWhirter <bmcwhirt@redhat.com>
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.

Just one more spotted, sorry about the slow reviews from me @bobmcwhirter

use url::Url;

/// Default public Fulcio server root.
pub const FULCIO_ROOT: &str = "https://fulcio.sigstore.dev/";
Copy link
Member

Choose a reason for hiding this comment

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

This should be configurable , someone could be using their own instance of fulcio.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The client takes a URL in the ctor. Const just handy for folks who want to use public fulcio.

lukehinds
lukehinds previously approved these changes Oct 3, 2022
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.

Just a couple of fmt changes to make, but lgtm!

Copy link
Member

@flavio flavio left a comment

Choose a reason for hiding this comment

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

@bobmcwhirter Please fix the rustfmt errors, then we can go ahead and merge it. I'm good with it too

Signed-off-by: Bob McWhirter <bmcwhirt@redhat.com>
@bobmcwhirter
Copy link
Contributor Author

@bobmcwhirter Please fix the rustfmt errors, then we can go ahead and merge it. I'm good with it too

Done!

Copy link
Member

@flavio flavio left a comment

Choose a reason for hiding this comment

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

thanks for the last round of fixes

@flavio flavio merged commit 37ff09d into sigstore:main Oct 5, 2022
flavio added a commit to flavio/sigstore-rs that referenced this pull request Oct 7, 2022
Enhancements
============

* update user-agent value to be specific to sigstore-rs (sigstore#122)
* remove /api/v1/version from client by (sigstore#121)
* crate async fulcio client (sigstore#132)
* Removed ring dependency (sigstore#127)

Others
======

* Update dependencies
* Refactoring and examples for key interface (sigstore#123)
* Fix doc test failures (sigstore#136)

Contributors
============

* Bob Callaway (@bobcallaway)
* Bob McWhirter (@bobmcwhirter)
* Flavio Castelli (@flavio)
* Luke Hinds (@lukehinds)
* Xynnn (@Xynnn007)

Signed-off-by: Flavio Castelli <fcastelli@suse.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.

Fulcio client support
3 participants