myc_http_tools/models/
external_providers_config.rs

1use myc_config::secret_resolver::SecretResolver;
2use serde::{Deserialize, Serialize};
3
4#[derive(Debug, Clone, Deserialize, Serialize)]
5#[serde(rename_all = "camelCase")]
6pub struct ExternalProviderConfig {
7    /// The issuer of the token
8    ///
9    /// This is the issuer of the token that will be used to validate the token.
10    ///
11    /// Example:
12    ///  - Google: https://accounts.google.com
13    ///  - Microsoft: https://login.microsoftonline.com/{tenant_id}/v2.0
14    ///  - Auth0: https://your-tenant.auth0.com/
15    ///
16    pub issuer: SecretResolver<String>,
17    /// The jwks uri of the token
18    ///
19    /// This is the jwks uri of the token that will be used to validate the
20    /// token.
21    ///
22    /// Example:
23    ///  - Google: https://www.googleapis.com/oauth2/v1/certs
24    ///  - Microsoft: https://login.microsoftonline.com/{tenant_id}/discovery/v2.0/keys
25    ///  - Auth0: https://{your-auth0-domain}/.well-known/jwks.json
26    ///
27    pub jwks_uri: SecretResolver<String>,
28    /// The audience of the token
29    ///
30    /// This is the audience of the token that will be used to validate the
31    /// token.
32    ///
33    /// Example:
34    ///  - Google: YOUR_CLIENT_ID
35    ///  - Microsoft: YOUR_CLIENT_ID
36    ///  - Auth0: YOUR_CLIENT_ID
37    ///
38    pub audience: SecretResolver<String>,
39
40    /// The user info url of the token
41    ///
42    /// This is the user info url of the token that will be used to validate the
43    /// token.
44    ///
45    /// Example:
46    ///  - Google: https://www.googleapis.com/oauth2/v3/userinfo
47    ///  - Microsoft: https://graph.microsoft.com/oidc/userinfo
48    ///  - Auth0: https://{your-auth0-domain}.auth0.com/userinfo
49    ///
50    pub user_info_url: Option<SecretResolver<String>>,
51}