#[non_exhaustive]pub struct AuthenticationRule {
    pub selector: String,
    pub oauth: Option<OAuthRequirements>,
    pub allow_without_credential: bool,
    pub requirements: Vec<AuthRequirement>,
}Expand description
Authentication rules for the service.
By default, if a method has any authentication requirements, every request must include a valid credential matching one of the requirements. It’s an error to include more than one kind of credential in a single request.
If a method doesn’t have any auth requirements, request credentials will be ignored.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.selector: StringSelects the methods to which this rule applies.
Refer to selector for syntax details.
oauth: Option<OAuthRequirements>The requirements for OAuth credentials.
allow_without_credential: boolIf true, the service accepts API keys without any other credential. This flag only applies to HTTP and gRPC requests.
requirements: Vec<AuthRequirement>Requirements for additional authentication providers.
Implementations§
Source§impl AuthenticationRule
 
impl AuthenticationRule
Sourcepub fn set_selector<T: Into<String>>(self, v: T) -> Self
 
pub fn set_selector<T: Into<String>>(self, v: T) -> Self
Sets the value of selector.
Sourcepub fn set_oauth<T: Into<Option<OAuthRequirements>>>(self, v: T) -> Self
 
pub fn set_oauth<T: Into<Option<OAuthRequirements>>>(self, v: T) -> Self
Sets the value of oauth.
Sourcepub fn set_allow_without_credential<T: Into<bool>>(self, v: T) -> Self
 
pub fn set_allow_without_credential<T: Into<bool>>(self, v: T) -> Self
Sets the value of allow_without_credential.
Sourcepub fn set_requirements<T, V>(self, v: T) -> Self
 
pub fn set_requirements<T, V>(self, v: T) -> Self
Sets the value of requirements.
Trait Implementations§
Source§impl Clone for AuthenticationRule
 
impl Clone for AuthenticationRule
Source§fn clone(&self) -> AuthenticationRule
 
fn clone(&self) -> AuthenticationRule
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
source. Read more