Skip to content

Commit 9b6aa2a

Browse files
committed
Fix the wording about admin token vs. secret in the doctor command
1 parent 68b74db commit 9b6aa2a

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

crates/cli/src/commands/doctor.rs

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ impl Options {
4444
r"The homeserver host in the config (`matrix.homeserver`) is not a valid domain.
4545
See {DOCS_BASE}/setup/homeserver.html",
4646
)?;
47-
let admin_token = config.matrix.secret().await?;
47+
let secret = config.matrix.secret().await?;
4848
let hs_api = config.matrix.endpoint;
4949

5050
if !issuer.starts_with("https://") {
@@ -280,49 +280,50 @@ Error details: {e}
280280
),
281281
}
282282

283-
// Try to reach an authenticated admin API endpoint
283+
// Try to reach an authenticated MAS API endpoint
284284
let mas_api = hs_api.join("/_synapse/mas/is_localpart_available")?;
285285
let result = http_client
286286
.get(mas_api.as_str())
287-
.bearer_auth(&admin_token)
287+
.bearer_auth(&secret)
288288
.send_traced()
289289
.await;
290290
match result {
291291
Ok(response) => {
292292
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.
298299
if status == StatusCode::BAD_REQUEST {
299300
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}"."#
301302
);
302303
} else {
303304
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}.
305306
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.
307308
308309
matrix_authentication_service:
309310
enabled: true
310311
endpoint: {issuer:?}
311312
# This must exactly match the secret in the MAS config:
312-
secret: {admin_token:?}
313+
secret: {secret:?}
313314
314315
And in the MAS config:
315316
316317
matrix:
317318
homeserver: "{matrix_domain}"
318319
endpoint: "{hs_api}"
319-
secret: {admin_token:?}
320+
secret: {secret:?}
320321
"#
321322
);
322323
}
323324
}
324325
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}".
326327
Make sure the homeserver is running, and that the MAS config has the correct `matrix.secret`.
327328
328329
Error details: {e}

0 commit comments

Comments
 (0)