File tree Expand file tree Collapse file tree 4 files changed +29
-49
lines changed
handlers/src/upstream_oauth2 Expand file tree Collapse file tree 4 files changed +29
-49
lines changed Original file line number Diff line number Diff line change 66
77use std:: collections:: BTreeMap ;
88
9+ use camino:: Utf8PathBuf ;
910use mas_iana:: jose:: JsonWebSignatureAlg ;
1011use schemars:: JsonSchema ;
1112use serde:: { Deserialize , Serialize , de:: Error } ;
1213use serde_with:: skip_serializing_none;
13- use camino:: Utf8PathBuf ;
1414use ulid:: Ulid ;
1515use 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+ }
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 66
77use std:: string:: FromUtf8Error ;
88
9+ use camino:: Utf8PathBuf ;
910use mas_data_model:: { UpstreamOAuthProvider , UpstreamOAuthProviderTokenAuthMethod } ;
1011use mas_iana:: jose:: JsonWebSignatureAlg ;
1112use mas_keystore:: { DecryptError , Encrypter , Keystore } ;
1213use mas_oidc_client:: types:: client_credentials:: ClientCredentials ;
1314use pkcs8:: DecodePrivateKey ;
1415use schemars:: JsonSchema ;
15- use camino:: Utf8PathBuf ;
1616use serde:: Deserialize ;
1717use thiserror:: Error ;
1818use 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 } ) ?;
Original file line number Diff line number Diff line change 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" ,
25962574 }
25972575 }
25982576 }
2599- }
2577+ }
You can’t perform that action at this time.
0 commit comments