Enum oxide_auth::primitives::grant::Value[][src]

pub enum Value {
    Public(Option<String>),
    Private(Option<String>),
}
Expand description

Wraps the data for an extension as a string with access restrictions.

This is a generic way for extensions to store their data in a universal, encoded form. It is also able to indicate the intended readers for such an extension so that backends can ensure that private extension data is properly encrypted even when present in a self-encoded access token.

Some extensions have semantics where the presence alone is the stored data, so storing data is optional and storing no data is distinct from not attaching any extension instance at all.

Variants

Public(Option<String>)

An extension that the token owner is allowed to read and interpret.

Tuple Fields of Public

0: Option<String>
Private(Option<String>)

Identifies an extenion whose content and/or existance MUST be kept secret.

Tuple Fields of Private

0: Option<String>

Implementations

Creates an extension whose presence and content can be unveiled by the token holder.

Anyone in possession of the token corresponding to such a grant is potentially able to read the content of a public extension.

Creates an extension with secret content only visible for the server.

Token issuers should take special care to protect the content and the identifier of such an extension from being interpreted or correlated by the token holder.

Inspect the public value.

Returns an Err if this is not a public extension, None if the extension has no value but consists only of the key, and Some(_) otherwise.

Convert into the public value.

Returns an Err if this is not a public extension, None if the extension has no value but consists only of the key, and Some(_) otherwise.

Inspect the private value.

Returns an Err if this is not a private extension, None if the extension has no value but consists only of the key, and Some(_) otherwise.

Inspect the private value.

Returns an Err if this is not a private extension, None if the extension has no value but consists only of the key, and Some(_) otherwise.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.