pub struct OidcClientAssertionBuilder { /* private fields */ }
Expand description
Builder for OidcClientAssertion
.
Implementations§
Source§impl OidcClientAssertionBuilder
impl OidcClientAssertionBuilder
Sourcepub fn audience(&mut self, value: Vec<String>) -> &mut Self
pub fn audience(&mut self, value: Vec<String>) -> &mut Self
Audience is/are who will be processing the assertion.
Defaults to the parent ACLAuthMethodConfig
’s OIDCDiscoveryURL
Sourcepub fn key_source(&mut self, value: OidcClientAssertionKeySource) -> &mut Self
pub fn key_source(&mut self, value: OidcClientAssertionKeySource) -> &mut Self
KeySource is where to get the private key to sign the JWT. It is the one field that must be set to enable client assertions. Available sources:
- “nomad”: Use current active key in Nomad’s keyring
- “private_key”: Use key material in the
PrivateKey
field - “client_secret”: Use the
OIDCClientSecret
inherited from the parentACLAuthMethodConfig
as an HMAC key
Sourcepub fn key_algorithm(&mut self, value: String) -> &mut Self
pub fn key_algorithm(&mut self, value: String) -> &mut Self
KeyAlgorithm is the key’s algorithm.
Its default values are based on the KeySource
:
- “nomad”: “RS256” (from Nomad’s keyring, must not be changed)
- “private_key”: “RS256” (must be RS256, RS384, or RS512)
- “client_secret”: “HS256” (must be HS256, HS384, or HS512)
Sourcepub fn private_key(
&mut self,
value: Option<OidcClientAssertionKey>,
) -> &mut Self
pub fn private_key( &mut self, value: Option<OidcClientAssertionKey>, ) -> &mut Self
PrivateKey contains external key material provided by users.
KeySource
must be “private_key” to enable this.
Sourcepub fn extra_headers(&mut self, value: HashMap<String, String>) -> &mut Self
pub fn extra_headers(&mut self, value: HashMap<String, String>) -> &mut Self
ExtraHeaders are added to the JWT headers, alongside “kid” and “type”
Setting the “kid” header here is not allowed; use PrivateKey.KeyID
.
Sourcepub fn build(
&self,
) -> Result<OidcClientAssertion, OidcClientAssertionBuilderError>
pub fn build( &self, ) -> Result<OidcClientAssertion, OidcClientAssertionBuilderError>
Trait Implementations§
Source§impl Clone for OidcClientAssertionBuilder
impl Clone for OidcClientAssertionBuilder
Source§fn clone(&self) -> OidcClientAssertionBuilder
fn clone(&self) -> OidcClientAssertionBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for OidcClientAssertionBuilder
impl RefUnwindSafe for OidcClientAssertionBuilder
impl Send for OidcClientAssertionBuilder
impl Sync for OidcClientAssertionBuilder
impl Unpin for OidcClientAssertionBuilder
impl UnwindSafe for OidcClientAssertionBuilder
Blanket Implementations§
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
Mutably borrows from an owned value. Read more