pub struct UpstreamOAuth2Provider {Show 24 fields
pub enabled: bool,
pub id: Ulid,
pub issuer: Option<String>,
pub human_name: Option<String>,
pub brand_name: Option<String>,
pub client_id: String,
pub client_secret: Option<String>,
pub token_endpoint_auth_method: TokenAuthMethod,
pub sign_in_with_apple: Option<SignInWithApple>,
pub token_endpoint_auth_signing_alg: Option<JsonWebSignatureAlg>,
pub id_token_signed_response_alg: JsonWebSignatureAlg,
pub scope: String,
pub discovery_mode: DiscoveryMode,
pub pkce_method: PkceMethod,
pub fetch_userinfo: bool,
pub userinfo_signed_response_alg: Option<JsonWebSignatureAlg>,
pub authorization_endpoint: Option<Url>,
pub userinfo_endpoint: Option<Url>,
pub token_endpoint: Option<Url>,
pub jwks_uri: Option<Url>,
pub response_mode: Option<ResponseMode>,
pub claims_imports: ClaimsImports,
pub additional_authorization_parameters: BTreeMap<String, String>,
pub synapse_idp_id: Option<String>,
}
Expand description
Configuration for one upstream OAuth 2 provider.
Fields§
§enabled: bool
Whether this provider is enabled.
Defaults to true
id: Ulid
An internal unique identifier for this provider
issuer: Option<String>
The OIDC issuer URL
This is required if OIDC discovery is enabled (which is the default)
human_name: Option<String>
A human-readable name for the provider, that will be shown to users
brand_name: Option<String>
A brand identifier used to customise the UI, e.g. apple
, google
,
github
, etc.
Values supported by the default template are:
apple
google
facebook
github
gitlab
twitter
client_id: String
The client ID to use when authenticating with the provider
client_secret: Option<String>
The client secret to use when authenticating with the provider
Used by the client_secret_basic
, client_secret_post
, and
client_secret_jwt
methods
token_endpoint_auth_method: TokenAuthMethod
The method to authenticate the client with the provider
sign_in_with_apple: Option<SignInWithApple>
Additional parameters for the sign_in_with_apple
method
token_endpoint_auth_signing_alg: Option<JsonWebSignatureAlg>
The JWS algorithm to use when authenticating the client with the provider
Used by the client_secret_jwt
and private_key_jwt
methods
id_token_signed_response_alg: JsonWebSignatureAlg
Expected signature for the JWT payload returned by the token authentication endpoint.
Defaults to RS256
.
scope: String
The scopes to request from the provider
discovery_mode: DiscoveryMode
How to discover the provider’s configuration
Defaults to oidc
, which uses OIDC discovery with strict metadata
verification
pkce_method: PkceMethod
Whether to use proof key for code exchange (PKCE) when requesting and exchanging the token.
Defaults to auto
, which uses PKCE if the provider supports it.
fetch_userinfo: bool
Whether to fetch the user profile from the userinfo endpoint,
or to rely on the data returned in the id_token
from the
token_endpoint
.
Defaults to false
.
userinfo_signed_response_alg: Option<JsonWebSignatureAlg>
Expected signature for the JWT payload returned by the userinfo endpoint.
If not specified, the response is expected to be an unsigned JSON payload.
The URL to use for the provider’s authorization endpoint
Defaults to the authorization_endpoint
provided through discovery
userinfo_endpoint: Option<Url>
The URL to use for the provider’s userinfo endpoint
Defaults to the userinfo_endpoint
provided through discovery
token_endpoint: Option<Url>
The URL to use for the provider’s token endpoint
Defaults to the token_endpoint
provided through discovery
jwks_uri: Option<Url>
The URL to use for getting the provider’s public keys
Defaults to the jwks_uri
provided through discovery
response_mode: Option<ResponseMode>
The response mode we ask the provider to use for the callback
claims_imports: ClaimsImports
How claims should be imported from the id_token
provided by the
provider
Additional parameters to include in the authorization request
Orders of the keys are not preserved.
synapse_idp_id: Option<String>
The ID of the provider that was used by Synapse. In order to perform a Synapse-to-MAS migration, this must be specified.
§For providers that used OAuth 2.0 or OpenID Connect in Synapse
§For oidc_providers
:
This should be specified as oidc-
followed by the ID that was
configured as idp_id
in one of the oidc_providers
in the Synapse
configuration.
For example, if Synapse’s configuration contained idp_id: wombat
for
this provider, then specify oidc-wombat
here.
§For oidc_config
(legacy):
Specify oidc
here.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Provider
impl<'de> Deserialize<'de> for Provider
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 JsonSchema for Provider
impl JsonSchema for Provider
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref
keyword. Read moreAuto Trait Implementations§
impl Freeze for Provider
impl RefUnwindSafe for Provider
impl Send for Provider
impl Sync for Provider
impl Unpin for Provider
impl UnwindSafe for Provider
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the foreground set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red()
and
green()
, which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg()
:
use yansi::{Paint, Color};
painted.fg(Color::White);
Set foreground color to white using white()
.
use yansi::Paint;
painted.white();
Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Returns self
with the
fg()
set to
Color::BrightBlack
.
§Example
println!("{}", value.bright_black());
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Returns self
with the
fg()
set to
Color::BrightGreen
.
§Example
println!("{}", value.bright_green());
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Returns self
with the
fg()
set to
Color::BrightYellow
.
§Example
println!("{}", value.bright_yellow());
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Returns self
with the
fg()
set to
Color::BrightMagenta
.
§Example
println!("{}", value.bright_magenta());
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Returns self
with the
fg()
set to
Color::BrightWhite
.
§Example
println!("{}", value.bright_white());
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the background set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red()
and
on_green()
, which have the same functionality but
are pithier.
§Example
Set background color to red using fg()
:
use yansi::{Paint, Color};
painted.bg(Color::Red);
Set background color to red using on_red()
.
use yansi::Paint;
painted.on_red();
Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightBlack
.
§Example
println!("{}", value.on_bright_black());
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightGreen
.
§Example
println!("{}", value.on_bright_green());
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightYellow
.
§Example
println!("{}", value.on_bright_yellow());
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightBlue
.
§Example
println!("{}", value.on_bright_blue());
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightMagenta
.
§Example
println!("{}", value.on_bright_magenta());
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightCyan
.
§Example
println!("{}", value.on_bright_cyan());
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightWhite
.
§Example
println!("{}", value.on_bright_white());
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute
value
.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold()
and
underline()
, which have the same functionality
but are pithier.
§Example
Make text bold using attr()
:
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);
Make text bold using using bold()
.
use yansi::Paint;
painted.bold();
Source§fn underline(&self) -> Painted<&T>
fn underline(&self) -> Painted<&T>
Returns self
with the
attr()
set to
Attribute::Underline
.
§Example
println!("{}", value.underline());
Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Returns self
with the
attr()
set to
Attribute::RapidBlink
.
§Example
println!("{}", value.rapid_blink());
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi
Quirk
value
.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask()
and
wrap()
, which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk()
:
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);
Enable wrapping using wrap()
.
use yansi::Paint;
painted.wrap();
Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition
value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted
only when both stdout
and stderr
are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);