pub struct OAuthFlow {
pub authorization_url: Option<String>,
pub token_url: Option<String>,
pub device_authorization_url: Option<String>,
pub refresh_url: Option<String>,
pub scopes: Map<String>,
pub extensions: Extensions,
}Expand description
The configuration of one OAuth 2.0 flow.
Which URL fields are required depends on the flow this is attached to. That
pairing is not checked here, and the model is deliberately the permissive
half: a flow read back from someone else’s description has to round-trip
whatever it said. #[derive(SecurityScheme)] enforces the pairing where the
flow is written, which is the layer that knows which flow it is naming.
Fields§
The authorization URL. Required for the implicit and authorization code flows.
token_url: Option<String>The token URL. Required for the password, client credentials and authorization code flows.
The device authorization URL. Required for the device authorization flow.
Introduced in OpenAPI 3.2.
refresh_url: Option<String>The URL used to obtain refresh tokens.
scopes: Map<String>The scopes available, mapped to a short description of each.
Required, though it may be empty.
extensions: ExtensionsSpecification extensions.
Implementations§
Source§impl OAuthFlow
impl OAuthFlow
Sourcepub fn new(scopes: impl IntoIterator<Item = (String, String)>) -> Self
pub fn new(scopes: impl IntoIterator<Item = (String, String)>) -> Self
Creates a flow with the given scopes and no URLs.
Sets the authorization URL.
Sourcepub fn with_token_url(self, url: impl Into<String>) -> Self
pub fn with_token_url(self, url: impl Into<String>) -> Self
Sets the token URL.
Sourcepub fn with_refresh_url(self, url: impl Into<String>) -> Self
pub fn with_refresh_url(self, url: impl Into<String>) -> Self
Sets the refresh URL.
Sets the device authorization URL.
Required for the device authorization flow, and legal on any of them.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for OAuthFlow
impl<'de> Deserialize<'de> for OAuthFlow
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>,
impl Eq for OAuthFlow
impl StructuralPartialEq for OAuthFlow
Auto Trait Implementations§
impl Freeze for OAuthFlow
impl RefUnwindSafe for OAuthFlow
impl Send for OAuthFlow
impl Sync for OAuthFlow
impl Unpin for OAuthFlow
impl UnsafeUnpin for OAuthFlow
impl UnwindSafe for OAuthFlow
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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
key and return true if they are equal.