@@ -24,7 +24,7 @@ use sqlx::{postgres::PgAdvisoryLock, Connection, PgConnection};
24
24
use tracing:: { error, info, info_span, warn} ;
25
25
26
26
fn map_import_action (
27
- config : & mas_config:: UpstreamOAuth2ImportAction ,
27
+ config : mas_config:: UpstreamOAuth2ImportAction ,
28
28
) -> mas_data_model:: UpstreamOAuthProviderImportAction {
29
29
match config {
30
30
mas_config:: UpstreamOAuth2ImportAction :: Ignore => {
@@ -50,15 +50,15 @@ fn map_claims_imports(
50
50
template : config. subject . template . clone ( ) ,
51
51
} ,
52
52
localpart : mas_data_model:: UpstreamOAuthProviderImportPreference {
53
- action : map_import_action ( & config. localpart . action ) ,
53
+ action : map_import_action ( config. localpart . action ) ,
54
54
template : config. localpart . template . clone ( ) ,
55
55
} ,
56
56
displayname : mas_data_model:: UpstreamOAuthProviderImportPreference {
57
- action : map_import_action ( & config. displayname . action ) ,
57
+ action : map_import_action ( config. displayname . action ) ,
58
58
template : config. displayname . template . clone ( ) ,
59
59
} ,
60
60
email : mas_data_model:: UpstreamOAuthProviderImportPreference {
61
- action : map_import_action ( & config. email . action ) ,
61
+ action : map_import_action ( config. email . action ) ,
62
62
template : config. email . template . clone ( ) ,
63
63
} ,
64
64
verify_email : match config. email . set_email_verification {
@@ -145,11 +145,10 @@ pub async fn config_sync(
145
145
}
146
146
147
147
let encrypted_client_secret = provider
148
- . client_secret ( )
148
+ . client_secret
149
+ . as_deref ( )
149
150
. map ( |client_secret| encrypter. encrypt_to_string ( client_secret. as_bytes ( ) ) )
150
151
. transpose ( ) ?;
151
- let token_endpoint_auth_method = provider. client_auth_method ( ) ;
152
- let token_endpoint_signing_alg = provider. client_auth_signing_alg ( ) ;
153
152
154
153
let discovery_mode = match provider. discovery_mode {
155
154
mas_config:: UpstreamOAuth2DiscoveryMode :: Oidc => {
@@ -198,8 +197,10 @@ pub async fn config_sync(
198
197
human_name : provider. human_name ,
199
198
brand_name : provider. brand_name ,
200
199
scope : provider. scope . parse ( ) ?,
201
- token_endpoint_auth_method,
202
- token_endpoint_signing_alg,
200
+ token_endpoint_auth_method : provider. token_endpoint_auth_method . into ( ) ,
201
+ token_endpoint_signing_alg : provider
202
+ . token_endpoint_auth_signing_alg
203
+ . clone ( ) ,
203
204
client_id : provider. client_id ,
204
205
encrypted_client_secret,
205
206
claims_imports : map_claims_imports ( & provider. claims_imports ) ,
0 commit comments