Enum utoipa::openapi::security::SecurityScheme
source · pub enum SecurityScheme {
OAuth2(OAuth2),
ApiKey(ApiKey),
Http(Http),
OpenIdConnect(OpenIdConnect),
MutualTls {
description: Option<String>,
},
}
Expand description
OpenAPI security scheme for path operations.
§Examples
Create implicit oauth2 flow security schema for path operations.
SecurityScheme::OAuth2(
OAuth2::with_description([Flow::Implicit(
Implicit::new(
"https://localhost/auth/dialog",
Scopes::from_iter([
("edit:items", "edit my items"),
("read:items", "read my items")
]),
),
)], "my oauth2 flow")
);
Create JWT header authentication.
SecurityScheme::Http(
HttpBuilder::new().scheme(HttpAuthScheme::Bearer).bearer_format("JWT").build()
);
Variants§
OAuth2(OAuth2)
Oauth flow authentication.
ApiKey(ApiKey)
Api key authentication sent in header
, cookie
or query
.
Http(Http)
Http authentication such as bearer
or basic
.
OpenIdConnect(OpenIdConnect)
Open id connect url to discover OAuth2 configuration values.
MutualTls
Authentication is done via client side certificate.
OpenApi 3.1 type
Trait Implementations§
source§impl Clone for SecurityScheme
impl Clone for SecurityScheme
source§fn clone(&self) -> SecurityScheme
fn clone(&self) -> SecurityScheme
Returns a copy 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<'de> Deserialize<'de> for SecurityScheme
impl<'de> Deserialize<'de> for SecurityScheme
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for SecurityScheme
impl PartialEq for SecurityScheme
source§impl Serialize for SecurityScheme
impl Serialize for SecurityScheme
impl Eq for SecurityScheme
impl StructuralPartialEq for SecurityScheme
Auto Trait Implementations§
impl Freeze for SecurityScheme
impl RefUnwindSafe for SecurityScheme
impl Send for SecurityScheme
impl Sync for SecurityScheme
impl Unpin for SecurityScheme
impl UnwindSafe for SecurityScheme
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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
Compare self to
key
and return true
if they are equal.