@@ -44,7 +44,7 @@ impl Options {
44
44
r"The homeserver host in the config (`matrix.homeserver`) is not a valid domain.
45
45
See {DOCS_BASE}/setup/homeserver.html" ,
46
46
) ?;
47
- let admin_token = config. matrix . secret ( ) . await ?;
47
+ let secret = config. matrix . secret ( ) . await ?;
48
48
let hs_api = config. matrix . endpoint ;
49
49
50
50
if !issuer. starts_with ( "https://" ) {
@@ -280,49 +280,50 @@ Error details: {e}
280
280
) ,
281
281
}
282
282
283
- // Try to reach an authenticated admin API endpoint
283
+ // Try to reach an authenticated MAS API endpoint
284
284
let mas_api = hs_api. join ( "/_synapse/mas/is_localpart_available" ) ?;
285
285
let result = http_client
286
286
. get ( mas_api. as_str ( ) )
287
- . bearer_auth ( & admin_token )
287
+ . bearer_auth ( & secret )
288
288
. send_traced ( )
289
289
. await ;
290
290
match result {
291
291
Ok ( response) => {
292
292
let status = response. status ( ) ;
293
- // We intentionally omit the required 'localpart' parameter in this request.
294
- // If authentication is successful, Synapse returns a 400 Bad Request because of
295
- // the missing parameter. If authentication fails, Synapse
296
- // will return a 403 Forbidden. If the MAS integration isn't
297
- // enabled, Synapse will return a 404 Not found.
293
+ // We intentionally omit the required 'localpart' parameter
294
+ // in this request. If authentication is successful, Synapse
295
+ // returns a 400 Bad Request because of the missing
296
+ // parameter. If authentication fails, Synapse will return a
297
+ // 403 Forbidden. If the MAS integration isn't enabled,
298
+ // Synapse will return a 404 Not found.
298
299
if status == StatusCode :: BAD_REQUEST {
299
300
info ! (
300
- r#"✅ The Synapse admin API is reachable with authentication at "{mas_api}"."#
301
+ r#"✅ The Synapse MAS API is reachable with authentication at "{mas_api}"."#
301
302
) ;
302
303
} else {
303
304
error ! (
304
- r#"❌ A Synapse admin API endpoint at "{mas_api}" replied with {status}.
305
+ r#"❌ A Synapse MAS API endpoint at "{mas_api}" replied with {status}.
305
306
Make sure the homeserver is running, and that the MAS config has the correct `matrix.secret`.
306
- It should match the `admin_token ` set in the Synapse config.
307
+ It should match the `secret ` set in the Synapse config.
307
308
308
309
matrix_authentication_service:
309
310
enabled: true
310
311
endpoint: {issuer:?}
311
312
# This must exactly match the secret in the MAS config:
312
- secret: {admin_token :?}
313
+ secret: {secret :?}
313
314
314
315
And in the MAS config:
315
316
316
317
matrix:
317
318
homeserver: "{matrix_domain}"
318
319
endpoint: "{hs_api}"
319
- secret: {admin_token :?}
320
+ secret: {secret :?}
320
321
"#
321
322
) ;
322
323
}
323
324
}
324
325
Err ( e) => error ! (
325
- r#"❌ Can't reach the Synapse admin API at "{mas_api}".
326
+ r#"❌ Can't reach the Synapse MAS API at "{mas_api}".
326
327
Make sure the homeserver is running, and that the MAS config has the correct `matrix.secret`.
327
328
328
329
Error details: {e}
0 commit comments