pub struct SecurityScheme {
pub type: i32,
pub description: String,
pub name: String,
pub in: i32,
pub flow: i32,
pub authorization_url: String,
pub token_url: String,
pub scopes: Option<Scopes>,
pub extensions: HashMap<String, Value>,
}Expand description
SecurityScheme is a representation of OpenAPI v2 specification’s
Security Scheme object.
See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securitySchemeObject
Allows the definition of a security scheme that can be used by the operations. Supported schemes are basic authentication, an API key (either as a header or as a query parameter) and OAuth2’s common flows (implicit, password, application and access code).
Fields§
§type: i32The type of the security scheme. Valid values are “basic”, “apiKey” or “oauth2”.
description: StringA short description for security scheme.
name: StringThe name of the header or query parameter to be used. Valid for apiKey.
in: i32The location of the API key. Valid values are “query” or “header”. Valid for apiKey.
flow: i32The flow used by the OAuth2 security scheme. Valid values are “implicit”, “password”, “application” or “accessCode”. Valid for oauth2.
The authorization URL to be used for this flow. This SHOULD be in the form of a URL. Valid for oauth2/implicit and oauth2/accessCode.
token_url: StringThe token URL to be used for this flow. This SHOULD be in the form of a URL. Valid for oauth2/password, oauth2/application and oauth2/accessCode.
scopes: Option<Scopes>The available scopes for the OAuth2 security scheme. Valid for oauth2.
extensions: HashMap<String, Value>Custom properties that start with “x-” such as “x-foo” used to describe extra functionality that is not covered by the standard OpenAPI Specification. See: https://swagger.io/docs/specification/2-0/swagger-extensions/
Implementations§
Source§impl SecurityScheme
impl SecurityScheme
Sourcepub fn type(&self) -> Type
pub fn type(&self) -> Type
Returns the enum value of type, or the default if the field is set to an invalid enum value.
Sourcepub fn in(&self) -> In
pub fn in(&self) -> In
Returns the enum value of in, or the default if the field is set to an invalid enum value.
Trait Implementations§
Source§impl Clone for SecurityScheme
impl Clone for SecurityScheme
Source§fn clone(&self) -> SecurityScheme
fn clone(&self) -> SecurityScheme
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SecurityScheme
impl Debug for SecurityScheme
Source§impl Default for SecurityScheme
impl Default for SecurityScheme
Source§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>,
Source§impl Message for SecurityScheme
impl Message for SecurityScheme
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.Source§impl PartialEq for SecurityScheme
impl PartialEq for SecurityScheme
Source§impl Serialize for SecurityScheme
impl Serialize 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request