Struct telescope::web::services::auth::identity::AuthenticationCookie[][src]

pub struct AuthenticationCookie {
    pub root: RootIdentity,
    pub github: Option<GitHubIdentity>,
    pub discord: Option<DiscordIdentity>,
}
Expand description

The top level object stored in the identity cookie.

Fields

root: RootIdentity

The root authenticated identity. This identity must always exist.

github: Option<GitHubIdentity>

An optional GitHub access token.

discord: Option<DiscordIdentity>

An optional Discord access and refresh token.

Implementations

If necessary, refresh an identity cookie. This could include getting a new access token from an OAuth API for example.

Get the RCOS user ID of an authenticated user. This is the same as just getting the RCOS user ID of the root identity.

Get the authenticated user’s RCOS user ID via the root identity or throw an internal server error.

Get discord credentials if authenticated.

Get the github credentials if authenticated.

Get the RCS ID of the authenticated user. Error if there is not an account associated with this authentication cookie or if there is an issue communicating with the RCOS API. Return Ok(None) if there is an account but RPI CAS is not linked.

Try to replace the root identity with the secondary GitHub identity. Return true on success.

Try to replace the root identity with the discord token. Return true on success. See Self::replace_root_with_github.

Try to get the user’s RCS id from the RCOS database and replace the root identity with it. Return true on success.

Try to remove the root identity from this authentication cookie and replace it with one of the secondary ones. Return false if there is no secondary cookie to replace the root. This may try to access the RCOS API to look for an RCS ID to replace the root.

If the root can successfully be replaced, return true.

Try to remove a specific platform’s identity and authentication from this cookie. This is similar to Self::remove_root.

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

Deserialize this value from the given Serde deserializer. Read more

The associated error which can be returned.

Future that resolves to a Self

Configuration for this extractor

Convert request to a Self

Convert request to a Self Read more

Create and configure config instance.

Serialize this value into the given Serde serializer. Read more

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.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

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)

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.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more