Enum diana::AuthBlockLevel[][src]

pub enum AuthBlockLevel {
    AllowAll,
    BlockUnauthenticated,
    AllowMissing,
}
Expand description

An enum for the level of blocking imposed on a particular endpoint. Your choice on this should be carefully evaluated based on your threat model. Please choose wisely!

Variants

AllowAll

Allows anything through.

  • Valid token -> allow
  • Invalid token -> allow
  • Missing token -> allow
BlockUnauthenticated

Blocks eveything except requests with valid tokens. Note that, with this setting, introspection will be impossible in the GraphiQL playground. You may want to use AllowMissing in development and then this in production (see the book).

  • Valid token -> allow
  • Invalid token -> block
  • Missing token -> block
AllowMissing

Allows requests with valid tokens or no token at all. Only blocks requests that specify an invalid token. This is mostly useful for development to enable introspection in the GraphiQL playground (see the book).

  • Valid token -> allow
  • Invalid token -> block
  • Missing token -> allow

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

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.

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.