@@ -14,6 +14,7 @@ use std::process::ExitCode;
14
14
use anyhow:: Context ;
15
15
use clap:: Parser ;
16
16
use figment:: Figment ;
17
+ use hyper:: StatusCode ;
17
18
use mas_config:: { ConfigurationSection , RootConfig } ;
18
19
use mas_http:: RequestBuilderExt ;
19
20
use tracing:: { error, info, info_span, warn} ;
@@ -99,17 +100,14 @@ Make sure that the MAS config contains:
99
100
100
101
http:
101
102
public_base: {issuer:?}
102
- # Or, if the issuer is different from the public base:
103
- issuer: {issuer:?}
104
103
105
104
And in the Synapse config:
106
105
107
- experimental_features:
108
- msc3861:
109
- enabled: true
110
- # This must exactly match:
111
- issuer: {issuer:?}
112
- # ...
106
+ matrix_authentication_service:
107
+ enabled: true
108
+ # This must point to where MAS is reachable by Synapse
109
+ endpoint: {issuer:?}
110
+ # ...
113
111
114
112
See {DOCS_BASE}/setup/homeserver.html
115
113
"#
@@ -128,11 +126,10 @@ Check the well-known document at "{well_known_uri}"
128
126
Check the well-known document at "{well_known_uri}"
129
127
Make sure Synapse has delegated auth enabled:
130
128
131
- experimental_features:
132
- msc3861:
133
- enabled: true
134
- issuer: {issuer:?}
135
- # ...
129
+ matrix_authentication_service:
130
+ enabled: true
131
+ endpoint: {issuer:?}
132
+ # ...
136
133
137
134
If it is not Synapse handling the well-known document, update it to include the following:
138
135
@@ -278,62 +275,37 @@ Check that the homeserver is running."#
278
275
Err ( e) => error ! (
279
276
r#"❌ Can't reach the homeserver at "{whoami}".
280
277
281
- Error details: {e}
282
- "#
283
- ) ,
284
- }
285
-
286
- // Try to reach the admin API on an unauthorized endpoint
287
- let server_version = hs_api. join ( "/_synapse/admin/v1/server_version" ) ?;
288
- let result = http_client. get ( server_version. as_str ( ) ) . send_traced ( ) . await ;
289
- match result {
290
- Ok ( response) => {
291
- let status = response. status ( ) ;
292
- if status. is_success ( ) {
293
- info ! ( r#"✅ The Synapse admin API is reachable at "{server_version}"."# ) ;
294
- } else {
295
- error ! (
296
- r#"❌ A Synapse admin API endpoint at "{server_version}" replied with {status}.
297
- Make sure MAS can reach the admin API, and that the homeserver is running.
298
- "#
299
- ) ;
300
- }
301
- }
302
- Err ( e) => error ! (
303
- r#"❌ Can't reach the Synapse admin API at "{server_version}".
304
- Make sure MAS can reach the admin API, and that the homeserver is running.
305
-
306
278
Error details: {e}
307
279
"#
308
280
) ,
309
281
}
310
282
311
283
// Try to reach an authenticated admin API endpoint
312
- let background_updates = hs_api. join ( "/_synapse/admin/v1/background_updates/status " ) ?;
284
+ let mas_api = hs_api. join ( "/_synapse/mas/is_localpart_available " ) ?;
313
285
let result = http_client
314
- . get ( background_updates . as_str ( ) )
286
+ . get ( mas_api . as_str ( ) )
315
287
. bearer_auth ( & admin_token)
316
288
. send_traced ( )
317
289
. await ;
318
290
match result {
319
291
Ok ( response) => {
320
292
let status = response. status ( ) ;
321
- if status. is_success ( ) {
293
+ // We're missing the localpart parameter, so expect a 400
294
+ if status == StatusCode :: BAD_REQUEST {
322
295
info ! (
323
- r#"✅ The Synapse admin API is reachable with authentication at "{background_updates }"."#
296
+ r#"✅ The Synapse admin API is reachable with authentication at "{mas_api }"."#
324
297
) ;
325
298
} else {
326
299
error ! (
327
- r#"❌ A Synapse admin API endpoint at "{background_updates }" replied with {status}.
300
+ r#"❌ A Synapse admin API endpoint at "{mas_api }" replied with {status}.
328
301
Make sure the homeserver is running, and that the MAS config has the correct `matrix.secret`.
329
302
It should match the `admin_token` set in the Synapse config.
330
303
331
- experimental_features:
332
- msc3861:
333
- enabled: true
334
- issuer: {issuer}
335
- # This must exactly match the secret in the MAS config:
336
- admin_token: {admin_token:?}
304
+ matrix_authentication_service:
305
+ enabled: true
306
+ endpoint: {issuer:?}
307
+ # This must exactly match the secret in the MAS config:
308
+ secret: {admin_token:?}
337
309
338
310
And in the MAS config:
339
311
@@ -346,7 +318,7 @@ And in the MAS config:
346
318
}
347
319
}
348
320
Err ( e) => error ! (
349
- r#"❌ Can't reach the Synapse admin API at "{background_updates }".
321
+ r#"❌ Can't reach the Synapse admin API at "{mas_api }".
350
322
Make sure the homeserver is running, and that the MAS config has the correct `matrix.secret`.
351
323
352
324
Error details: {e}
0 commit comments