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§
Source§impl Clone for AuthBlockLevel
impl Clone for AuthBlockLevel
Source§fn clone(&self) -> AuthBlockLevel
fn clone(&self) -> AuthBlockLevel
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 AuthBlockLevel
impl Debug for AuthBlockLevel
impl Copy for AuthBlockLevel
Auto Trait Implementations§
impl Freeze for AuthBlockLevel
impl RefUnwindSafe for AuthBlockLevel
impl Send for AuthBlockLevel
impl Sync for AuthBlockLevel
impl Unpin for AuthBlockLevel
impl UnwindSafe for AuthBlockLevel
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