Skip to content

Commit 684df56

Browse files
x86pupjevolk
authored andcommitted
add pgp_key support contact field for /.well-known/matrix/support (MSC4439)
matrix-org/matrix-spec-proposals#4439 Signed-off-by: June Strawberry <june@girlboss.ceo>
1 parent e365349 commit 684df56

5 files changed

Lines changed: 42 additions & 24 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@ features = [
392392
"unstable-msc4310",
393393
"unstable-msc4311",
394394
"unstable-msc4383",
395+
"unstable-msc4439",
395396
"unstable-msc4466",
396397
"unstable-extensible-events",
397398
]

docs/development/compliance/msc.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@
1818

1919
## Counts
2020

21-
-`yes`: 216
21+
-`yes`: 217
2222
- 🟨 `partial`: 59
23-
-`no`: 457
23+
-`no`: 456
2424
-`n/a`: 292
2525

2626
### Status by inventory bucket
2727

2828
| Inv | yes | partial | no | n/a | total |
2929
|---|---|---|---|---|---|
3030
| merged | 150 | 30 | 12 | 64 | 256 |
31-
| open | 58 | 28 | 406 | 176 | 668 |
31+
| open | 59 | 28 | 405 | 176 | 668 |
3232
| closed | 8 | 1 | 39 | 52 | 100 |
3333

3434
## Merged
@@ -314,7 +314,7 @@ in the [Out of scope](#out-of-scope) section.
314314
| MSC4446 | ❌ ● | 0/0 | Allow moving the fully read marker to older events | No allow_backward field; no monotonicity check on m.fully_read |
315315
| MSC4445 | ❌ ◐ | 0/0 | Clarify `/sync` timeline order | No msc4445 unstable_features flags advertised |
316316
| MSC4440 | ❌ ● | 0/0 | Profile Biography via Global Profiles | Generic MSC4133 passthrough only; no m.biography validation |
317-
| MSC4439 | | 0/0 | Encryption key URIs in `/.well-known/matrix/support` | No pgp_key field on /.well-known/matrix/support contacts |
317+
| MSC4439 | | 80/90 | Encryption key URIs in `/.well-known/matrix/support` | src/api/client/well_known.rs:58; pgp_key plumbed via ruma unstable-msc4439 |
318318
| MSC4438 | ✅ ● | 100/100 | Message bookmarks via account data | Pure account-data convention; existing endpoints store arbitrary types |
319319
| MSC4437 | ❌ ● | 0/0 | Endpoint to replace entire profile | No PUT /_matrix/client/v3/profile/{userId} replace-all endpoint |
320320
| MSC4436 | ✅ ● | 100/100 | Make server ACLs case insensitive | Ruma is_allowed uses WildMatch::new_case_insensitive |

src/api/client/well_known.rs

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -38,38 +38,24 @@ pub(crate) async fn well_known_support(
3838
_body: Ruma<discover_support::Request>,
3939
) -> Result<discover_support::Response> {
4040
let support_page = services
41-
.server
4241
.config
4342
.well_known
4443
.support_page
4544
.as_ref()
4645
.map(ToString::to_string);
4746

48-
let role = services
49-
.server
50-
.config
51-
.well_known
52-
.support_role
53-
.clone();
47+
let role = services.config.well_known.support_role.clone();
5448

5549
// support page or role must be either defined for this to be valid
5650
if support_page.is_none() && role.is_none() {
5751
return Err!(Request(NotFound("Not found.")));
5852
}
5953

60-
let email_address = services
61-
.server
62-
.config
63-
.well_known
64-
.support_email
65-
.clone();
54+
let email_address = services.config.well_known.support_email.clone();
6655

67-
let matrix_id = services
68-
.server
69-
.config
70-
.well_known
71-
.support_mxid
72-
.clone();
56+
let matrix_id = services.config.well_known.support_mxid.clone();
57+
58+
let pgp_key = services.config.well_known.support_pgp_key.clone();
7359

7460
// if a role is specified, an email address or matrix id is required
7561
if role.is_some() && (email_address.is_none() && matrix_id.is_none()) {
@@ -80,7 +66,7 @@ pub(crate) async fn well_known_support(
8066
let mut contacts: Vec<Contact> = vec![];
8167

8268
if let Some(role) = role {
83-
let contact = Contact { role, email_address, matrix_id };
69+
let contact = Contact { role, email_address, matrix_id, pgp_key };
8470

8571
contacts.push(contact);
8672
}

src/core/config/mod.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2811,6 +2811,21 @@ pub struct WellKnownConfig {
28112811
/// reloadable: yes
28122812
pub support_mxid: Option<OwnedUserId>,
28132813

2814+
/// The PGP key (i.e. OpenPGP) that one may use for encrypted communications
2815+
/// for the above support role. No specific format is mandated for this
2816+
/// field or by the spec proposal. This field can contain a URL to a PGP
2817+
/// key, the 64-bit long ID, the OPENPGPKEY DNS record, or just the full
2818+
/// fingerprint.
2819+
///
2820+
/// Full/raw key content must not be here.
2821+
///
2822+
/// As this is a spec proposal (MSC4439), the identifier/prefix for this
2823+
/// field is currently "dev.zirco.msc4439.pgp_key"
2824+
///
2825+
/// reloadable: yes
2826+
/// example: "openpgp4fpr:8B77919975EAFA5E2456EE03665FE73077489DB0"
2827+
pub support_pgp_key: Option<String>,
2828+
28142829
/// LiveKit JWT endpoint.
28152830
/// Required for Element Call / MatrixRTC (MSC4143).
28162831
///

tuwunel-example.toml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2462,6 +2462,22 @@
24622462
#
24632463
#support_mxid =
24642464

2465+
# The PGP key (i.e. OpenPGP) that one may use for encrypted communications
2466+
# for the above support role. No specific format is mandated for this
2467+
# field or by the spec proposal. This field can contain a URL to a PGP
2468+
# key, the 64-bit long ID, the OPENPGPKEY DNS record, or just the full
2469+
# fingerprint.
2470+
#
2471+
# Full/raw key content must not be here.
2472+
#
2473+
# As this is a spec proposal (MSC4439), the identifier/prefix for this
2474+
# field is currently "dev.zirco.msc4439.pgp_key"
2475+
#
2476+
# reloadable: yes
2477+
# example: "openpgp4fpr:8B77919975EAFA5E2456EE03665FE73077489DB0"
2478+
#
2479+
#support_pgp_key =
2480+
24652481
# LiveKit JWT endpoint.
24662482
# Required for Element Call / MatrixRTC (MSC4143).
24672483
#

0 commit comments

Comments
 (0)