mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-07 18:07:47 +08:00
fix(ci): align lint-safe security paths
This commit is contained in:
@@ -643,22 +643,22 @@ fn deactivate_imported_credentials(
|
||||
.trim_matches(|ch| matches!(ch, '"' | '`'));
|
||||
|
||||
match table_name {
|
||||
"users" => {
|
||||
"users"
|
||||
if object
|
||||
.get("password_hash")
|
||||
.is_some_and(|value| !value.is_null())
|
||||
{
|
||||
set_supported_import_value(
|
||||
object,
|
||||
&target_has_column,
|
||||
"password_hash",
|
||||
Value::String(format!(
|
||||
"$aether-import-revoked${}",
|
||||
imported_credential_tombstone()
|
||||
)),
|
||||
);
|
||||
}
|
||||
.is_some_and(|value| !value.is_null()) =>
|
||||
{
|
||||
set_supported_import_value(
|
||||
object,
|
||||
&target_has_column,
|
||||
"password_hash",
|
||||
Value::String(format!(
|
||||
"$aether-import-revoked${}",
|
||||
imported_credential_tombstone()
|
||||
)),
|
||||
);
|
||||
}
|
||||
"users" => {}
|
||||
"api_keys" => {
|
||||
if object.contains_key("key_hash") {
|
||||
set_supported_import_value(
|
||||
|
||||
@@ -153,7 +153,7 @@ async fn enforce_mysql_identity_import_invariants(
|
||||
for user_id in &scope.user_ids {
|
||||
let auth_source =
|
||||
sqlx::query_scalar::<_, String>("SELECT auth_source FROM users WHERE id = ? LIMIT 1")
|
||||
.bind(&user_id)
|
||||
.bind(user_id)
|
||||
.fetch_optional(&mut **tx)
|
||||
.await
|
||||
.map_sql_err()?
|
||||
@@ -169,7 +169,7 @@ async fn enforce_mysql_identity_import_invariants(
|
||||
}
|
||||
if auth_source == "oauth" {
|
||||
sqlx::query("UPDATE users SET email_verified = 0 WHERE id = ?")
|
||||
.bind(&user_id)
|
||||
.bind(user_id)
|
||||
.execute(&mut **tx)
|
||||
.await
|
||||
.map_sql_err()?;
|
||||
|
||||
@@ -166,7 +166,7 @@ async fn enforce_postgres_identity_import_invariants(
|
||||
let auth_source = sqlx::query_scalar::<_, String>(
|
||||
"SELECT auth_source::text FROM public.users WHERE id = $1 LIMIT 1",
|
||||
)
|
||||
.bind(&user_id)
|
||||
.bind(user_id)
|
||||
.fetch_optional(&mut **tx)
|
||||
.await
|
||||
.map_sql_err()?
|
||||
@@ -182,7 +182,7 @@ async fn enforce_postgres_identity_import_invariants(
|
||||
}
|
||||
if auth_source == "oauth" {
|
||||
sqlx::query("UPDATE public.users SET email_verified = FALSE WHERE id = $1")
|
||||
.bind(&user_id)
|
||||
.bind(user_id)
|
||||
.execute(&mut **tx)
|
||||
.await
|
||||
.map_sql_err()?;
|
||||
|
||||
@@ -147,7 +147,7 @@ async fn enforce_sqlite_identity_import_invariants(
|
||||
for user_id in &scope.user_ids {
|
||||
let auth_source =
|
||||
sqlx::query_scalar::<_, String>("SELECT auth_source FROM users WHERE id = ? LIMIT 1")
|
||||
.bind(&user_id)
|
||||
.bind(user_id)
|
||||
.fetch_optional(&mut **tx)
|
||||
.await
|
||||
.map_sql_err()?
|
||||
@@ -163,7 +163,7 @@ async fn enforce_sqlite_identity_import_invariants(
|
||||
}
|
||||
if auth_source == "oauth" {
|
||||
sqlx::query("UPDATE users SET email_verified = 0 WHERE id = ?")
|
||||
.bind(&user_id)
|
||||
.bind(user_id)
|
||||
.execute(&mut **tx)
|
||||
.await
|
||||
.map_sql_err()?;
|
||||
|
||||
Reference in New Issue
Block a user