Skip to content

Commit 754c0d8

Browse files
committed
Format project and run misc/update.sh
1 parent a9693c8 commit 754c0d8

File tree

4 files changed

+29
-49
lines changed

4 files changed

+29
-49
lines changed

crates/config/src/sections/upstream_oauth2.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66

77
use std::collections::BTreeMap;
88

9+
use camino::Utf8PathBuf;
910
use mas_iana::jose::JsonWebSignatureAlg;
1011
use schemars::JsonSchema;
1112
use serde::{Deserialize, Serialize, de::Error};
1213
use serde_with::skip_serializing_none;
13-
use camino::Utf8PathBuf;
1414
use ulid::Ulid;
1515
use url::Url;
1616

@@ -390,7 +390,7 @@ pub struct SignInWithApple {
390390
pub private_key_file: Option<Utf8PathBuf>,
391391

392392
/// The private key used to sign the `id_token`
393-
#[serde(skip_serializing_if = "Option::is_none")]
393+
#[serde(skip_serializing_if = "Option::is_none")]
394394
pub private_key: Option<String>,
395395

396396
/// The Team ID of the Apple Developer Portal
@@ -565,4 +565,4 @@ pub struct Provider {
565565
/// Specify `oidc` here.
566566
#[serde(skip_serializing_if = "Option::is_none")]
567567
pub synapse_idp_id: Option<String>,
568-
}
568+
}

crates/handlers/src/upstream_oauth2/callback.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,8 @@ pub(crate) async fn handler(
294294
lazy_metadata.token_endpoint().await?,
295295
&keystore,
296296
&encrypter,
297-
).await?;
297+
)
298+
.await?;
298299

299300
let redirect_uri = url_builder.upstream_oauth_callback(provider.id);
300301

crates/handlers/src/upstream_oauth2/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66

77
use std::string::FromUtf8Error;
88

9+
use camino::Utf8PathBuf;
910
use mas_data_model::{UpstreamOAuthProvider, UpstreamOAuthProviderTokenAuthMethod};
1011
use mas_iana::jose::JsonWebSignatureAlg;
1112
use mas_keystore::{DecryptError, Encrypter, Keystore};
1213
use mas_oidc_client::types::client_credentials::ClientCredentials;
1314
use pkcs8::DecodePrivateKey;
1415
use schemars::JsonSchema;
15-
use camino::Utf8PathBuf;
1616
use serde::Deserialize;
1717
use thiserror::Error;
1818
use url::Url;
@@ -142,7 +142,8 @@ async fn client_credentials_for_provider(
142142
},
143143

144144
UpstreamOAuthProviderTokenAuthMethod::SignInWithApple => {
145-
let client_secret = client_secret.ok_or(ProviderCredentialsError::MissingClientSecret)?;
145+
let client_secret =
146+
client_secret.ok_or(ProviderCredentialsError::MissingClientSecret)?;
146147

147148
let params: SignInWithApple = serde_json::from_str(&client_secret)
148149
.map_err(|inner| ProviderCredentialsError::InvalidClientSecretJson { inner })?;

docs/config.schema.json

Lines changed: 21 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2156,50 +2156,28 @@
21562156
},
21572157
"SignInWithApple": {
21582158
"type": "object",
2159-
"oneOf": [
2160-
{
2161-
"required": [
2162-
"key_id",
2163-
"private_key_file",
2164-
"team_id"
2165-
],
2166-
"properties": {
2167-
"private_key_file": {
2168-
"description": "The private key file used to sign the `id_token`",
2169-
"type": "string"
2170-
},
2171-
"team_id": {
2172-
"description": "The Team ID of the Apple Developer Portal",
2173-
"type": "string"
2174-
},
2175-
"key_id": {
2176-
"description": "The key ID of the Apple Developer Portal",
2177-
"type": "string"
2178-
}
2179-
}
2159+
"required": [
2160+
"key_id",
2161+
"team_id"
2162+
],
2163+
"properties": {
2164+
"private_key_file": {
2165+
"description": "The private key file used to sign the `id_token`",
2166+
"type": "string"
21802167
},
2181-
{
2182-
"required": [
2183-
"key_id",
2184-
"private_key",
2185-
"team_id"
2186-
],
2187-
"properties": {
2188-
"private_key": {
2189-
"description": "The private key used to sign the `id_token`",
2190-
"type": "string"
2191-
},
2192-
"team_id": {
2193-
"description": "The Team ID of the Apple Developer Portal",
2194-
"type": "string"
2195-
},
2196-
"key_id": {
2197-
"description": "The key ID of the Apple Developer Portal",
2198-
"type": "string"
2199-
}
2200-
}
2168+
"private_key": {
2169+
"description": "The private key used to sign the `id_token`",
2170+
"type": "string"
2171+
},
2172+
"team_id": {
2173+
"description": "The Team ID of the Apple Developer Portal",
2174+
"type": "string"
2175+
},
2176+
"key_id": {
2177+
"description": "The key ID of the Apple Developer Portal",
2178+
"type": "string"
22012179
}
2202-
]
2180+
}
22032181
},
22042182
"DiscoveryMode": {
22052183
"description": "How to discover the provider's configuration",
@@ -2596,4 +2574,4 @@
25962574
}
25972575
}
25982576
}
2599-
}
2577+
}

0 commit comments

Comments
 (0)