Skip to content

Commit 675cfb9

Browse files
thetayloredmanEllis Git
authored andcommitted
feat: add support for MSC4439 PGP key URIs in wk-support
This commit introduces support for MSC4439, Encryption Key URIs in `.well-known/matrix/support`. ([MSC](matrix-org/matrix-spec-proposals#4439), [Rendered](https://github.com/thetayloredman/matrix-spec-proposals/blob/msc4439/proposals/4439-support-contact-encryption.md)) via an additional config option.
1 parent 0931279 commit 675cfb9

6 files changed

Lines changed: 37 additions & 16 deletions

File tree

Cargo.lock

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ version = "0.1.2"
344344
[workspace.dependencies.ruma]
345345
git = "https://forgejo.ellis.link/continuwuation/ruwuma"
346346
#branch = "conduwuit-changes"
347-
rev = "a97b91adcc012ef04991d823b8b5a79c6686ae48"
347+
rev = "1415caf8a32af4d943580c5ea4e12be1974593c2"
348348
features = [
349349
"compat",
350350
"rand",
@@ -383,7 +383,8 @@ features = [
383383
"unstable-pdu",
384384
"unstable-msc4155",
385385
"unstable-msc4143", # livekit well_known response
386-
"unstable-msc4284"
386+
"unstable-msc4284",
387+
"unstable-msc4439", # pgp_key in .well_known/matrix/support
387388
]
388389

389390
[workspace.dependencies.rust-rocksdb]

changelog.d/1609.feature.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Add new config option for [MSC4439](https://github.com/matrix-org/matrix-spec-proposals/pull/4439)
2+
PGP key URIs. Contributed by LogN.

conduwuit-example.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1869,6 +1869,14 @@
18691869
#
18701870
#support_mxid =
18711871

1872+
# PGP key URI for server support contacts, to be served as part of the
1873+
# MSC1929 server support endpoint. This uses the unstable prefix from
1874+
# [MSC4439].
1875+
#
1876+
# [MSC4439]: https://github.com/matrix-org/matrix-spec-proposals/pull/4439
1877+
#
1878+
#support_pgp_key =
1879+
18721880
# **DEPRECATED**: Use `[global.matrix_rtc].foci` instead.
18731881
#
18741882
# A list of MatrixRTC foci URLs which will be served as part of the

src/api/client/well_known.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ pub(crate) async fn well_known_support(
7171

7272
let email_address = services.config.well_known.support_email.clone();
7373
let matrix_id = services.config.well_known.support_mxid.clone();
74+
let pgp_key = services.config.well_known.support_pgp_key.clone();
7475

7576
// TODO: support defining multiple contacts in the config
7677
let mut contacts: Vec<Contact> = vec![];
@@ -88,6 +89,7 @@ pub(crate) async fn well_known_support(
8889
role: role_value.clone(),
8990
email_address: email_address.clone(),
9091
matrix_id: matrix_id.clone(),
92+
pgp_key: pgp_key.clone(),
9193
});
9294
}
9395

@@ -104,6 +106,7 @@ pub(crate) async fn well_known_support(
104106
role: role_value.clone(),
105107
email_address: None,
106108
matrix_id: Some(user_id.to_owned()),
109+
pgp_key: None,
107110
});
108111
}
109112
}

src/core/config/mod.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2191,6 +2191,13 @@ pub struct WellKnownConfig {
21912191
/// listed.
21922192
pub support_mxid: Option<OwnedUserId>,
21932193

2194+
/// PGP key URI for server support contacts, to be served as part of the
2195+
/// MSC1929 server support endpoint. This uses the unstable prefix from
2196+
/// [MSC4439].
2197+
///
2198+
/// [MSC4439]: https://github.com/matrix-org/matrix-spec-proposals/pull/4439
2199+
pub support_pgp_key: Option<String>,
2200+
21942201
/// **DEPRECATED**: Use `[global.matrix_rtc].foci` instead.
21952202
///
21962203
/// A list of MatrixRTC foci URLs which will be served as part of the

0 commit comments

Comments
 (0)