mirror of
https://github.com/element-hq/matrix-authentication-service.git
synced 2026-06-07 17:32:57 +00:00
Upgrade Rust to 1.86.0 (#4355)
This commit is contained in:
@@ -210,7 +210,7 @@ jobs:
|
||||
uses: actions/checkout@v4.2.2
|
||||
|
||||
- name: Install Rust toolchain
|
||||
uses: dtolnay/rust-toolchain@1.85.0
|
||||
uses: dtolnay/rust-toolchain@1.86.0
|
||||
with:
|
||||
components: clippy
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
# The Debian version and version name must be in sync
|
||||
ARG DEBIAN_VERSION=12
|
||||
ARG DEBIAN_VERSION_NAME=bookworm
|
||||
ARG RUSTC_VERSION=1.85.0
|
||||
ARG RUSTC_VERSION=1.86.0
|
||||
ARG NODEJS_VERSION=20.15.0
|
||||
ARG OPA_VERSION=1.1.0
|
||||
ARG CARGO_AUDITABLE_VERSION=0.6.6
|
||||
|
||||
@@ -171,7 +171,7 @@ impl Credentials {
|
||||
(_, _) => {
|
||||
return Err(CredentialsVerificationError::AuthenticationMethodMismatch);
|
||||
}
|
||||
};
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -386,7 +386,7 @@ impl Options {
|
||||
0 => info!("No active compatibility sessions to end"),
|
||||
1 => info!("Ended 1 active OAuth 2.0 session"),
|
||||
_ => info!("Ended {affected} active OAuth 2.0 sessions"),
|
||||
};
|
||||
}
|
||||
|
||||
let filter = BrowserSessionFilter::new().for_user(&user).active_only();
|
||||
let affected = if dry_run {
|
||||
|
||||
@@ -130,7 +130,7 @@ impl Options {
|
||||
.await
|
||||
.context("could not run migrations")?;
|
||||
|
||||
if matches!(&self.subcommand, Subcommand::Migrate { .. }) {
|
||||
if matches!(&self.subcommand, Subcommand::Migrate) {
|
||||
// First perform a config sync
|
||||
// This is crucial to ensure we register upstream OAuth providers
|
||||
// in the MAS database
|
||||
|
||||
@@ -144,7 +144,7 @@ impl AsyncTransport for Transport {
|
||||
TransportInner::Sendmail(t) => {
|
||||
t.send_raw(envelope, email).await?;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -63,20 +63,20 @@ fn url_with_pagination(base: &str, pagination: Pagination) -> String {
|
||||
let mut query = query.to_owned();
|
||||
|
||||
if let Some(before) = pagination.before {
|
||||
query += &format!("&page[before]={before}");
|
||||
query = format!("{query}&page[before]={before}");
|
||||
}
|
||||
|
||||
if let Some(after) = pagination.after {
|
||||
query += &format!("&page[after]={after}");
|
||||
query = format!("{query}&page[after]={after}");
|
||||
}
|
||||
|
||||
let count = pagination.count;
|
||||
match pagination.direction {
|
||||
mas_storage::pagination::PaginationDirection::Forward => {
|
||||
query += &format!("&page[first]={count}");
|
||||
query = format!("{query}&page[first]={count}");
|
||||
}
|
||||
mas_storage::pagination::PaginationDirection::Backward => {
|
||||
query += &format!("&page[last]={count}");
|
||||
query = format!("{query}&page[last]={count}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ pub(crate) async fn get(
|
||||
|
||||
// The code isn't valid, set an error on the form
|
||||
form_state = form_state.with_error_on_field(DeviceLinkFormField::Code, FieldError::Invalid);
|
||||
};
|
||||
}
|
||||
|
||||
// Rendre the form
|
||||
let ctx = DeviceLinkContext::new()
|
||||
|
||||
@@ -426,7 +426,7 @@ async fn authorization_code_grant(
|
||||
(Some(pkce), Some(verifier)) => {
|
||||
pkce.verify(verifier)?;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
let Some(user_session_id) = session.user_session_id else {
|
||||
tracing::warn!("No user session associated with this OAuth2 session");
|
||||
|
||||
@@ -345,7 +345,7 @@ impl Algorithm {
|
||||
|
||||
Pbkdf2.verify_password(password.as_ref(), &hashed_password)?;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -189,7 +189,7 @@ pub(crate) async fn handler(
|
||||
}
|
||||
|
||||
return Err(RouteError::MissingFormParams);
|
||||
};
|
||||
}
|
||||
|
||||
// The `Form` extractor will use the body of the request for POST requests and
|
||||
// the query parameters for GET requests. We need to then look at the method do
|
||||
|
||||
@@ -85,7 +85,7 @@ pub(crate) async fn get(
|
||||
|
||||
let reply = query.go_next(&url_builder);
|
||||
return Ok((cookie_jar, reply).into_response());
|
||||
};
|
||||
}
|
||||
|
||||
let providers = repo.upstream_oauth_provider().all_enabled().await?;
|
||||
|
||||
@@ -98,10 +98,10 @@ pub(crate) async fn get(
|
||||
|
||||
if let Some(action) = query.post_auth_action {
|
||||
destination = destination.and_then(action);
|
||||
};
|
||||
}
|
||||
|
||||
return Ok((cookie_jar, url_builder.redirect(&destination)).into_response());
|
||||
};
|
||||
}
|
||||
|
||||
render(
|
||||
locale,
|
||||
|
||||
@@ -45,7 +45,7 @@ pub(crate) async fn get(
|
||||
|
||||
let reply = query.go_next(&url_builder);
|
||||
return Ok((cookie_jar, reply).into_response());
|
||||
};
|
||||
}
|
||||
|
||||
let providers = repo.upstream_oauth_provider().all_enabled().await?;
|
||||
|
||||
|
||||
@@ -469,7 +469,7 @@ fn format_value(value: &Value, placeholder: &Placeholder) -> Result<String, Form
|
||||
} else {
|
||||
let mut serializer = serde_json::Serializer::new(&mut json);
|
||||
value.serialize(&mut serializer)?;
|
||||
};
|
||||
}
|
||||
let json = String::from_utf8(json)?;
|
||||
Ok(format_placeholder!(json, placeholder))
|
||||
}
|
||||
|
||||
@@ -257,7 +257,7 @@ impl Tree {
|
||||
..
|
||||
} => self.inner = tree.inner,
|
||||
_ => panic!("Tried to replace the root node"),
|
||||
};
|
||||
}
|
||||
|
||||
replaced
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ impl QueryBuilderExt for sea_query::SelectStatement {
|
||||
self.order_by(id_field, sea_query::Order::Desc)
|
||||
.limit((pagination.count + 1) as u64);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
self
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ impl FullUserId {
|
||||
expected: expected_server_name.to_owned(),
|
||||
found: server_name.to_owned(),
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
Ok(localpart)
|
||||
}
|
||||
|
||||
@@ -209,7 +209,7 @@ impl RunnableJob for SyncDevicesJob {
|
||||
for (compat_session, _) in page.edges {
|
||||
if let Some(ref device) = compat_session.device {
|
||||
devices.insert(device.as_str().to_owned());
|
||||
};
|
||||
}
|
||||
cursor = cursor.after(compat_session.id);
|
||||
}
|
||||
|
||||
|
||||
@@ -1045,7 +1045,7 @@ impl JobTracker {
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
if blocking {
|
||||
self.last_join_result = self.running_jobs.join_next_with_id().await;
|
||||
|
||||
@@ -191,7 +191,7 @@ fn function_add_params_to_url(
|
||||
match mode {
|
||||
Fragment => uri.set_fragment(Some(¶ms)),
|
||||
Query => uri.set_query(Some(¶ms)),
|
||||
};
|
||||
}
|
||||
uri
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user