Enum mas_oidc_client::types::scope::ScopeToken
source · pub enum ScopeToken {
Openid,
Profile,
Email,
Address,
Phone,
OfflineAccess,
MatrixApi(MatrixApiScopeToken),
MatrixDevice(PrivString),
Custom(PrivString),
}
Expand description
Tokens to define the scope of an access token or to request specific claims.
Variants§
Openid
openid
Required for OpenID Connect requests.
Profile
profile
Requests access to the end-user’s profile.
email
Requests access to the end-user’s email address.
Address
address
Requests access to the end-user’s address.
Phone
phone
Requests access to the end-user’s phone number.
OfflineAccess
offline_access
Requests that an OAuth 2.0 refresh token be issued that can be used to
obtain an access token that grants access to the end-user’s UserInfo
Endpoint even when the end-user is not present (not logged in).
MatrixApi(MatrixApiScopeToken)
urn:matrix:org.matrix.msc2967.client:api:{token}
Requests access to the Matrix Client-Server API.
MatrixDevice(PrivString)
urn:matrix:org.matrix.msc2967.client:device:{device_id}
Requests access to the Matrix device with the given device_id
.
To access the device ID, use ScopeToken::matrix_device_id
.
Custom(PrivString)
Another scope token.
To access it’s value use this type’s Display
implementation.
Implementations§
source§impl ScopeToken
impl ScopeToken
sourcepub fn try_with_matrix_device(device_id: String) -> Result<Self, InvalidScope>
pub fn try_with_matrix_device(device_id: String) -> Result<Self, InvalidScope>
Creates a Matrix device scope token with the given device ID.
§Errors
Returns an error if the device ID string is not compatible with the scope syntax.
sourcepub fn matrix_device_id(&self) -> Option<&str>
pub fn matrix_device_id(&self) -> Option<&str>
Get the device ID of this scope token, if it is a
ScopeToken::MatrixDevice
.
Trait Implementations§
source§impl Clone for ScopeToken
impl Clone for ScopeToken
source§fn clone(&self) -> ScopeToken
fn clone(&self) -> ScopeToken
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ScopeToken
impl Debug for ScopeToken
source§impl Display for ScopeToken
impl Display for ScopeToken
source§impl From<ScopeToken> for ScopeToken
impl From<ScopeToken> for ScopeToken
source§fn from(t: StrScopeToken) -> Self
fn from(t: StrScopeToken) -> Self
source§impl From<ScopeToken> for ScopeToken
impl From<ScopeToken> for ScopeToken
source§fn from(t: ScopeToken) -> Self
fn from(t: ScopeToken) -> Self
source§impl FromIterator<ScopeToken> for Scope
impl FromIterator<ScopeToken> for Scope
source§fn from_iter<T: IntoIterator<Item = ScopeToken>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = ScopeToken>>(iter: T) -> Self
source§impl FromStr for ScopeToken
impl FromStr for ScopeToken
source§impl Hash for ScopeToken
impl Hash for ScopeToken
source§impl Ord for ScopeToken
impl Ord for ScopeToken
source§fn cmp(&self, other: &ScopeToken) -> Ordering
fn cmp(&self, other: &ScopeToken) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for ScopeToken
impl PartialEq for ScopeToken
source§fn eq(&self, other: &ScopeToken) -> bool
fn eq(&self, other: &ScopeToken) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for ScopeToken
impl PartialOrd for ScopeToken
source§fn partial_cmp(&self, other: &ScopeToken) -> Option<Ordering>
fn partial_cmp(&self, other: &ScopeToken) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl Eq for ScopeToken
impl StructuralPartialEq for ScopeToken
Auto Trait Implementations§
impl Freeze for ScopeToken
impl RefUnwindSafe for ScopeToken
impl Send for ScopeToken
impl Sync for ScopeToken
impl Unpin for ScopeToken
impl UnwindSafe for ScopeToken
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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 moresource§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.