#[non_exhaustive]pub struct AuthRequirement {
pub provider_id: String,
pub audiences: String,
/* private fields */
}
Expand description
User-defined authentication requirements, including support for JSON Web Token (JWT).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.provider_id: String
§audiences: String
NOTE: This will be deprecated soon, once AuthProvider.audiences is implemented and accepted in all the runtime components.
The list of JWT
audiences.
that are allowed to access. A JWT containing any of these audiences will
be accepted. When this setting is absent, only JWTs with audience
“https://Service_name/API_name”
will be accepted. For example, if no audiences are in the setting,
LibraryService API will only accept JWTs with the following audience
https://library-example.googleapis.com/google.example.library.v1.LibraryService
.
Example:
audiences: bookstore_android.apps.googleusercontent.com,
bookstore_web.apps.googleusercontent.com
Implementations§
Source§impl AuthRequirement
impl AuthRequirement
pub fn new() -> Self
Sourcepub fn set_provider_id<T: Into<String>>(self, v: T) -> Self
pub fn set_provider_id<T: Into<String>>(self, v: T) -> Self
Sets the value of provider_id.
Sourcepub fn set_audiences<T: Into<String>>(self, v: T) -> Self
pub fn set_audiences<T: Into<String>>(self, v: T) -> Self
Sets the value of audiences.
Trait Implementations§
Source§impl Clone for AuthRequirement
impl Clone for AuthRequirement
Source§fn clone(&self) -> AuthRequirement
fn clone(&self) -> AuthRequirement
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 moreSource§impl Debug for AuthRequirement
impl Debug for AuthRequirement
Source§impl Default for AuthRequirement
impl Default for AuthRequirement
Source§fn default() -> AuthRequirement
fn default() -> AuthRequirement
Returns the “default value” for a type. Read more
Source§impl Message for AuthRequirement
impl Message for AuthRequirement
Source§impl PartialEq for AuthRequirement
impl PartialEq for AuthRequirement
impl StructuralPartialEq for AuthRequirement
Auto Trait Implementations§
impl Freeze for AuthRequirement
impl RefUnwindSafe for AuthRequirement
impl Send for AuthRequirement
impl Sync for AuthRequirement
impl Unpin for AuthRequirement
impl UnwindSafe for AuthRequirement
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