Struct Enrollment
pub struct Enrollment { /* private fields */ }Implementations§
Source§impl Enrollment
impl Enrollment
Sourcepub fn new(alias: &str, config: OidcConfig) -> Result<Self>
pub fn new(alias: &str, config: OidcConfig) -> Result<Self>
Build an enrollment client for the [oidc.<alias>] entry.
The entry is validated first (the same canonical issuer policy the
daemon enforces: https, or http for an exact loopback host), and
the HTTP client never follows a redirect: a credential-bearing
request is sent to exactly the endpoint that was validated, and a
redirect answer is refused rather than forwarded anywhere.
Sourcepub async fn device_grant_start(&self) -> Result<DeviceGrantStart>
pub async fn device_grant_start(&self) -> Result<DeviceGrantStart>
Start the Device Authorization Grant: returns the user code and verification URI to show the human, plus the polling parameters.
Sourcepub async fn device_grant_poll(
&self,
device_code: &str,
) -> Result<DevicePollOutcome>
pub async fn device_grant_poll( &self, device_code: &str, ) -> Result<DevicePollOutcome>
One poll of the token endpoint for an in-flight device grant.
Sourcepub async fn client_credentials(&self) -> Result<EnrolledToken>
pub async fn client_credentials(&self) -> Result<EnrolledToken>
Confidential-client client_credentials grant for headless service
principals. Requires the entry’s client_secret.
Source§impl Enrollment
impl Enrollment
Sourcepub async fn pkce_start(&self, redirect_uri: &str) -> Result<PkceFlow>
pub async fn pkce_start(&self, redirect_uri: &str) -> Result<PkceFlow>
Begin an Authorization Code + PKCE flow (S256 only): returns the
authorize URL to open in a browser plus the client-held secrets
for the exchange. Refuses issuers that do not advertise S256
(RFC 8414 defaults the advertisement to plain when the field is
absent): there is no downgrade path.
Sourcepub async fn pkce_exchange(
&self,
flow: &PkceFlow,
code: &str,
) -> Result<EnrolledToken>
pub async fn pkce_exchange( &self, flow: &PkceFlow, code: &str, ) -> Result<EnrolledToken>
Exchange the authorization code from the callback. When the response bundles an id_token it is validated against this flow (issuer, audience, expiry, nonce) before anything is returned; a present but malformed id_token fails the exchange.
Auto Trait Implementations§
impl !RefUnwindSafe for Enrollment
impl !UnwindSafe for Enrollment
impl Freeze for Enrollment
impl Send for Enrollment
impl Sync for Enrollment
impl Unpin for Enrollment
impl UnsafeUnpin for Enrollment
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more