Skip to content

Commit db3846e

Browse files
authored
Automatic merge back to main (#4703)
2 parents 228ddee + 3bc32dc commit db3846e

File tree

3 files changed

+66
-66
lines changed

3 files changed

+66
-66
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ members = ["crates/*"]
99
resolver = "2"
1010

1111
# Updated in the CI with a `sed` command
12-
package.version = "0.17.0"
12+
package.version = "0.17.1"
1313
package.license = "AGPL-3.0-only OR LicenseRef-Element-Commercial"
1414
package.authors = ["Element Backend Team"]
1515
package.edition = "2024"
@@ -33,35 +33,35 @@ broken_intra_doc_links = "deny"
3333
[workspace.dependencies]
3434

3535
# Workspace crates
36-
mas-axum-utils = { path = "./crates/axum-utils/", version = "=0.17.0" }
37-
mas-cli = { path = "./crates/cli/", version = "=0.17.0" }
38-
mas-config = { path = "./crates/config/", version = "=0.17.0" }
39-
mas-context = { path = "./crates/context/", version = "=0.17.0" }
40-
mas-data-model = { path = "./crates/data-model/", version = "=0.17.0" }
41-
mas-email = { path = "./crates/email/", version = "=0.17.0" }
42-
mas-graphql = { path = "./crates/graphql/", version = "=0.17.0" }
43-
mas-handlers = { path = "./crates/handlers/", version = "=0.17.0" }
44-
mas-http = { path = "./crates/http/", version = "=0.17.0" }
45-
mas-i18n = { path = "./crates/i18n/", version = "=0.17.0" }
46-
mas-i18n-scan = { path = "./crates/i18n-scan/", version = "=0.17.0" }
47-
mas-iana = { path = "./crates/iana/", version = "=0.17.0" }
48-
mas-iana-codegen = { path = "./crates/iana-codegen/", version = "=0.17.0" }
49-
mas-jose = { path = "./crates/jose/", version = "=0.17.0" }
50-
mas-keystore = { path = "./crates/keystore/", version = "=0.17.0" }
51-
mas-listener = { path = "./crates/listener/", version = "=0.17.0" }
52-
mas-matrix = { path = "./crates/matrix/", version = "=0.17.0" }
53-
mas-matrix-synapse = { path = "./crates/matrix-synapse/", version = "=0.17.0" }
54-
mas-oidc-client = { path = "./crates/oidc-client/", version = "=0.17.0" }
55-
mas-policy = { path = "./crates/policy/", version = "=0.17.0" }
56-
mas-router = { path = "./crates/router/", version = "=0.17.0" }
57-
mas-spa = { path = "./crates/spa/", version = "=0.17.0" }
58-
mas-storage = { path = "./crates/storage/", version = "=0.17.0" }
59-
mas-storage-pg = { path = "./crates/storage-pg/", version = "=0.17.0" }
60-
mas-tasks = { path = "./crates/tasks/", version = "=0.17.0" }
61-
mas-templates = { path = "./crates/templates/", version = "=0.17.0" }
62-
mas-tower = { path = "./crates/tower/", version = "=0.17.0" }
63-
oauth2-types = { path = "./crates/oauth2-types/", version = "=0.17.0" }
64-
syn2mas = { path = "./crates/syn2mas", version = "=0.17.0" }
36+
mas-axum-utils = { path = "./crates/axum-utils/", version = "=0.17.1" }
37+
mas-cli = { path = "./crates/cli/", version = "=0.17.1" }
38+
mas-config = { path = "./crates/config/", version = "=0.17.1" }
39+
mas-context = { path = "./crates/context/", version = "=0.17.1" }
40+
mas-data-model = { path = "./crates/data-model/", version = "=0.17.1" }
41+
mas-email = { path = "./crates/email/", version = "=0.17.1" }
42+
mas-graphql = { path = "./crates/graphql/", version = "=0.17.1" }
43+
mas-handlers = { path = "./crates/handlers/", version = "=0.17.1" }
44+
mas-http = { path = "./crates/http/", version = "=0.17.1" }
45+
mas-i18n = { path = "./crates/i18n/", version = "=0.17.1" }
46+
mas-i18n-scan = { path = "./crates/i18n-scan/", version = "=0.17.1" }
47+
mas-iana = { path = "./crates/iana/", version = "=0.17.1" }
48+
mas-iana-codegen = { path = "./crates/iana-codegen/", version = "=0.17.1" }
49+
mas-jose = { path = "./crates/jose/", version = "=0.17.1" }
50+
mas-keystore = { path = "./crates/keystore/", version = "=0.17.1" }
51+
mas-listener = { path = "./crates/listener/", version = "=0.17.1" }
52+
mas-matrix = { path = "./crates/matrix/", version = "=0.17.1" }
53+
mas-matrix-synapse = { path = "./crates/matrix-synapse/", version = "=0.17.1" }
54+
mas-oidc-client = { path = "./crates/oidc-client/", version = "=0.17.1" }
55+
mas-policy = { path = "./crates/policy/", version = "=0.17.1" }
56+
mas-router = { path = "./crates/router/", version = "=0.17.1" }
57+
mas-spa = { path = "./crates/spa/", version = "=0.17.1" }
58+
mas-storage = { path = "./crates/storage/", version = "=0.17.1" }
59+
mas-storage-pg = { path = "./crates/storage-pg/", version = "=0.17.1" }
60+
mas-tasks = { path = "./crates/tasks/", version = "=0.17.1" }
61+
mas-templates = { path = "./crates/templates/", version = "=0.17.1" }
62+
mas-tower = { path = "./crates/tower/", version = "=0.17.1" }
63+
oauth2-types = { path = "./crates/oauth2-types/", version = "=0.17.1" }
64+
syn2mas = { path = "./crates/syn2mas", version = "=0.17.1" }
6565

6666
# OpenAPI schema generation and validation
6767
[workspace.dependencies.aide]

crates/config/src/sections/secrets.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -149,21 +149,21 @@ impl KeyConfig {
149149
/// Returns the password in case any is provided.
150150
///
151151
/// If `password_file` was given, the password is read from that file.
152-
async fn password(&self) -> anyhow::Result<Option<Cow<String>>> {
152+
async fn password(&self) -> anyhow::Result<Option<Cow<[u8]>>> {
153153
Ok(match &self.password {
154-
Some(Password::File(path)) => Some(Cow::Owned(tokio::fs::read_to_string(path).await?)),
155-
Some(Password::Value(password)) => Some(Cow::Borrowed(password)),
154+
Some(Password::File(path)) => Some(Cow::Owned(tokio::fs::read(path).await?)),
155+
Some(Password::Value(password)) => Some(Cow::Borrowed(password.as_bytes())),
156156
None => None,
157157
})
158158
}
159159

160160
/// Returns the key.
161161
///
162162
/// If `key_file` was given, the key is read from that file.
163-
async fn key(&self) -> anyhow::Result<Cow<String>> {
163+
async fn key(&self) -> anyhow::Result<Cow<[u8]>> {
164164
Ok(match &self.key {
165-
Key::File(path) => Cow::Owned(tokio::fs::read_to_string(path).await?),
166-
Key::Value(key) => Cow::Borrowed(key),
165+
Key::File(path) => Cow::Owned(tokio::fs::read(path).await?),
166+
Key::Value(key) => Cow::Borrowed(key.as_bytes()),
167167
})
168168
}
169169

@@ -174,8 +174,8 @@ impl KeyConfig {
174174
let (key, password) = try_join(self.key(), self.password()).await?;
175175

176176
let private_key = match password {
177-
Some(password) => PrivateKey::load_encrypted(key.as_bytes(), password.as_bytes())?,
178-
None => PrivateKey::load(key.as_bytes())?,
177+
Some(password) => PrivateKey::load_encrypted(&key, password)?,
178+
None => PrivateKey::load(&key)?,
179179
};
180180

181181
Ok(JsonWebKey::new(private_key)

0 commit comments

Comments
 (0)