@@ -38,8 +38,8 @@ SET name = $1, enabled = $2, confidential = $3, secret = $4, secret_kid = $5, re
3838 post_logout_redirect_uris = $7, allowed_origins = $8, flows_enabled = $9, access_token_alg = $10,
3939 id_token_alg = $11, auth_code_lifetime = $12, access_token_lifetime = $13, scopes = $14,
4040 default_scopes = $15, challenge = $16, force_mfa= $17, client_uri = $18, contacts = $19,
41- backchannel_logout_uri = $20, restrict_group_prefix = $21
42- WHERE id = $22 "# ;
41+ backchannel_logout_uri = $20, restrict_group_prefix = $21, cust_email_mapping = $22
42+ WHERE id = $23 "# ;
4343
4444/**
4545# OIDC Client
@@ -77,6 +77,7 @@ pub struct Client {
7777 pub contacts : Option < String > ,
7878 pub backchannel_logout_uri : Option < String > ,
7979 pub restrict_group_prefix : Option < String > ,
80+ pub cust_email_mapping : Option < String > ,
8081}
8182
8283impl Debug for Client {
@@ -87,7 +88,8 @@ impl Debug for Client {
8788 redirect_uris: {}, post_logout_redirect_uris: {:?}, allowed_origins: {:?}, \
8889 flows_enabled: {}, access_token_alg: {}, id_token_alg: {}, auth_code_lifetime: {}, \
8990 access_token_lifetime: {}, scopes: {}, default_scopes: {}, challenge: {:?}, force_mfa: {}, \
90- client_uri: {:?}, contacts: {:?}, backchannel_logout_uri: {:?}, restrict_group_prefix: {:?} \
91+ client_uri: {:?}, contacts: {:?}, backchannel_logout_uri: {:?}, restrict_group_prefix: {:?}, \
92+ cust_email_mapping: {:?}
9193 }}" ,
9294 self . id,
9395 self . name,
@@ -109,6 +111,7 @@ impl Debug for Client {
109111 self . contacts,
110112 self . backchannel_logout_uri,
111113 self . restrict_group_prefix,
114+ self . cust_email_mapping
112115 )
113116 }
114117}
@@ -138,6 +141,7 @@ impl From<tokio_postgres::Row> for Client {
138141 contacts : row. get ( "contacts" ) ,
139142 backchannel_logout_uri : row. get ( "backchannel_logout_uri" ) ,
140143 restrict_group_prefix : row. get ( "restrict_group_prefix" ) ,
144+ cust_email_mapping : row. get ( "cust_email_mapping" ) ,
141145 }
142146 }
143147}
@@ -165,9 +169,9 @@ impl Client {
165169INSERT INTO clients (id, name, enabled, confidential, secret, secret_kid, redirect_uris,
166170post_logout_redirect_uris, allowed_origins, flows_enabled, access_token_alg, id_token_alg,
167171auth_code_lifetime, access_token_lifetime, scopes, default_scopes, challenge, force_mfa,
168- client_uri, contacts, backchannel_logout_uri, restrict_group_prefix)
172+ client_uri, contacts, backchannel_logout_uri, restrict_group_prefix, cust_email_mapping )
169173VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17,
170- $18, $19, $20, $21, $22)"# ;
174+ $18, $19, $20, $21, $22, $23 )"# ;
171175
172176 if is_hiqlite ( ) {
173177 DB :: hql ( )
@@ -195,7 +199,8 @@ $18, $19, $20, $21, $22)"#;
195199 & client. client_uri,
196200 & client. contacts,
197201 & client. backchannel_logout_uri,
198- & client. restrict_group_prefix
202+ & client. restrict_group_prefix,
203+ & client. cust_email_mapping
199204 ) ,
200205 )
201206 . await ?;
@@ -225,6 +230,7 @@ $18, $19, $20, $21, $22)"#;
225230 & client. contacts ,
226231 & client. backchannel_logout_uri ,
227232 & client. restrict_group_prefix ,
233+ & client. cust_email_mapping ,
228234 ] ,
229235 )
230236 . await ?;
@@ -250,9 +256,9 @@ $18, $19, $20, $21, $22)"#;
250256INSERT INTO clients (id, name, enabled, confidential, secret, secret_kid, redirect_uris,
251257post_logout_redirect_uris, allowed_origins, flows_enabled, access_token_alg, id_token_alg,
252258auth_code_lifetime, access_token_lifetime, scopes, default_scopes, challenge, force_mfa,
253- client_uri, contacts, backchannel_logout_uri, restrict_group_prefix)
259+ client_uri, contacts, backchannel_logout_uri, restrict_group_prefix, cust_email_mapping )
254260VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20,
255- $21, $22)"# ;
261+ $21, $22, $23 )"# ;
256262 let sql_2 = r#"
257263INSERT INTO
258264clients_dyn (id, created, registration_token, token_endpoint_auth_method)
@@ -285,7 +291,8 @@ VALUES ($1, $2, $3, $4)"#;
285291 & client. client_uri,
286292 & client. contacts,
287293 & client. backchannel_logout_uri,
288- & client. restrict_group_prefix
294+ & client. restrict_group_prefix,
295+ & client. cust_email_mapping
289296 ) ,
290297 ) ,
291298 (
@@ -329,6 +336,7 @@ VALUES ($1, $2, $3, $4)"#;
329336 & client. contacts ,
330337 & client. backchannel_logout_uri ,
331338 & client. restrict_group_prefix ,
339+ & client. cust_email_mapping ,
332340 ] ,
333341 )
334342 . await ?;
@@ -641,6 +649,7 @@ VALUES ($1, $2, $3, $4)"#;
641649 contacts,
642650 backchannel_logout_uri,
643651 & self . restrict_group_prefix,
652+ & self . cust_email_mapping,
644653 self . id. clone( )
645654 ) ,
646655 )
@@ -670,6 +679,7 @@ VALUES ($1, $2, $3, $4)"#;
670679 & contacts,
671680 & backchannel_logout_uri,
672681 & self . restrict_group_prefix ,
682+ & self . cust_email_mapping ,
673683 & self . id ,
674684 ] ,
675685 )
@@ -1472,6 +1482,7 @@ impl Client {
14721482 sync_groups : scim. sync_groups ,
14731483 group_sync_prefix : scim. group_sync_prefix ,
14741484 } ) ,
1485+ cust_email_mapping : self . cust_email_mapping ,
14751486 }
14761487 }
14771488}
@@ -1517,6 +1528,7 @@ impl From<EphemeralClientRequest> for Client {
15171528 contacts : value. contacts . map ( |c| c. join ( "," ) ) ,
15181529 backchannel_logout_uri : None ,
15191530 restrict_group_prefix : None ,
1531+ cust_email_mapping : None ,
15201532 }
15211533 }
15221534}
@@ -1556,6 +1568,7 @@ impl Default for Client {
15561568 contacts : None ,
15571569 backchannel_logout_uri : None ,
15581570 restrict_group_prefix : None ,
1571+ cust_email_mapping : None ,
15591572 }
15601573 }
15611574}
@@ -1765,6 +1778,7 @@ mod tests {
17651778 contacts : Some ( "[email protected] ,@alfred:matrix.org" . to_string ( ) ) , 17661779 backchannel_logout_uri : None ,
17671780 restrict_group_prefix : None ,
1781+ cust_email_mapping : None ,
17681782 } ;
17691783
17701784 assert_eq ! ( client. get_access_token_alg( ) . unwrap( ) , JwkKeyPairAlg :: EdDSA ) ;
0 commit comments