refactor: apply rust formatter suggestion
This commit is contained in:
@@ -480,6 +480,11 @@ impl DriveManagementService {
|
|||||||
/// supplied is overwritten. Returns the post-merge typed view.
|
/// supplied is overwritten. Returns the post-merge typed view.
|
||||||
/// Audit emits `drive.policy_changed` with the post-merge bag for
|
/// Audit emits `drive.policy_changed` with the post-merge bag for
|
||||||
/// steady-state observability.
|
/// steady-state observability.
|
||||||
|
///
|
||||||
|
/// Ed's call, 2026-07-17: intentional deviation from the AGENTS.md
|
||||||
|
/// "AuthZ in service layer" rule for this specific endpoint —
|
||||||
|
/// the handler-layer admin check stays, this method stays trusting.
|
||||||
|
/// See memory `feedback_drive_policies_admin_at_handler`.
|
||||||
pub async fn update_policies(
|
pub async fn update_policies(
|
||||||
&self,
|
&self,
|
||||||
caller_id: Uuid,
|
caller_id: Uuid,
|
||||||
|
|||||||
+2
-1
@@ -1074,7 +1074,8 @@ impl AppServiceFactory {
|
|||||||
user_repository,
|
user_repository,
|
||||||
)
|
)
|
||||||
.with_drive_repo(
|
.with_drive_repo(
|
||||||
drive_repo as Arc<dyn crate::domain::repositories::drive_repository::DriveRepository>,
|
drive_repo
|
||||||
|
as Arc<dyn crate::domain::repositories::drive_repository::DriveRepository>,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
// Keep cached storage usage fresh off the request path: GET /api/auth/me
|
// Keep cached storage usage fresh off the request path: GET /api/auth/me
|
||||||
|
|||||||
@@ -151,7 +151,6 @@ pub fn admin_routes() -> Router<Arc<AppState>> {
|
|||||||
pub async fn get_oidc_settings(
|
pub async fn get_oidc_settings(
|
||||||
State(state): State<Arc<AppState>>,
|
State(state): State<Arc<AppState>>,
|
||||||
) -> Result<impl IntoResponse, AppError> {
|
) -> Result<impl IntoResponse, AppError> {
|
||||||
|
|
||||||
let svc = state
|
let svc = state
|
||||||
.admin_settings_service
|
.admin_settings_service
|
||||||
.as_ref()
|
.as_ref()
|
||||||
@@ -206,7 +205,6 @@ async fn test_oidc_connection(
|
|||||||
State(state): State<Arc<AppState>>,
|
State(state): State<Arc<AppState>>,
|
||||||
Json(dto): Json<TestOidcConnectionDto>,
|
Json(dto): Json<TestOidcConnectionDto>,
|
||||||
) -> Result<impl IntoResponse, AppError> {
|
) -> Result<impl IntoResponse, AppError> {
|
||||||
|
|
||||||
let svc = state
|
let svc = state
|
||||||
.admin_settings_service
|
.admin_settings_service
|
||||||
.as_ref()
|
.as_ref()
|
||||||
@@ -239,7 +237,6 @@ async fn test_oidc_connection(
|
|||||||
pub async fn get_storage_settings(
|
pub async fn get_storage_settings(
|
||||||
State(state): State<Arc<AppState>>,
|
State(state): State<Arc<AppState>>,
|
||||||
) -> Result<impl IntoResponse, AppError> {
|
) -> Result<impl IntoResponse, AppError> {
|
||||||
|
|
||||||
let svc = state
|
let svc = state
|
||||||
.storage_settings_service
|
.storage_settings_service
|
||||||
.as_ref()
|
.as_ref()
|
||||||
@@ -294,7 +291,6 @@ async fn test_storage_connection(
|
|||||||
State(state): State<Arc<AppState>>,
|
State(state): State<Arc<AppState>>,
|
||||||
Json(dto): Json<TestStorageConnectionDto>,
|
Json(dto): Json<TestStorageConnectionDto>,
|
||||||
) -> Result<impl IntoResponse, AppError> {
|
) -> Result<impl IntoResponse, AppError> {
|
||||||
|
|
||||||
let svc = state
|
let svc = state
|
||||||
.storage_settings_service
|
.storage_settings_service
|
||||||
.as_ref()
|
.as_ref()
|
||||||
@@ -350,7 +346,6 @@ pub async fn start_migration(
|
|||||||
) -> Result<impl IntoResponse, AppError> {
|
) -> Result<impl IntoResponse, AppError> {
|
||||||
use crate::infrastructure::services::migration_blob_backend::MigrationStatus;
|
use crate::infrastructure::services::migration_blob_backend::MigrationStatus;
|
||||||
|
|
||||||
|
|
||||||
// Check not already running.
|
// Check not already running.
|
||||||
{
|
{
|
||||||
let s = state.migration_state.read().await;
|
let s = state.migration_state.read().await;
|
||||||
@@ -521,7 +516,6 @@ pub async fn verify_migration(
|
|||||||
State(state): State<Arc<AppState>>,
|
State(state): State<Arc<AppState>>,
|
||||||
Json(dto): Json<VerifyMigrationDto>,
|
Json(dto): Json<VerifyMigrationDto>,
|
||||||
) -> Result<impl IntoResponse, AppError> {
|
) -> Result<impl IntoResponse, AppError> {
|
||||||
|
|
||||||
let pool = state
|
let pool = state
|
||||||
.db_pool
|
.db_pool
|
||||||
.clone()
|
.clone()
|
||||||
@@ -652,7 +646,6 @@ fn build_backend_from_config(
|
|||||||
pub async fn get_dashboard_stats(
|
pub async fn get_dashboard_stats(
|
||||||
State(state): State<Arc<AppState>>,
|
State(state): State<Arc<AppState>>,
|
||||||
) -> Result<impl IntoResponse, AppError> {
|
) -> Result<impl IntoResponse, AppError> {
|
||||||
|
|
||||||
let auth = state
|
let auth = state
|
||||||
.auth_service
|
.auth_service
|
||||||
.as_ref()
|
.as_ref()
|
||||||
@@ -742,7 +735,6 @@ pub async fn list_users(
|
|||||||
State(state): State<Arc<AppState>>,
|
State(state): State<Arc<AppState>>,
|
||||||
Query(query): Query<ListUsersQueryDto>,
|
Query(query): Query<ListUsersQueryDto>,
|
||||||
) -> Result<impl IntoResponse, AppError> {
|
) -> Result<impl IntoResponse, AppError> {
|
||||||
|
|
||||||
let auth = state
|
let auth = state
|
||||||
.auth_service
|
.auth_service
|
||||||
.as_ref()
|
.as_ref()
|
||||||
@@ -789,7 +781,6 @@ pub async fn get_user(
|
|||||||
State(state): State<Arc<AppState>>,
|
State(state): State<Arc<AppState>>,
|
||||||
Path(id): Path<String>,
|
Path(id): Path<String>,
|
||||||
) -> Result<impl IntoResponse, AppError> {
|
) -> Result<impl IntoResponse, AppError> {
|
||||||
|
|
||||||
let id = Uuid::parse_str(&id).map_err(|_| AppError::bad_request("Invalid UUID"))?;
|
let id = Uuid::parse_str(&id).map_err(|_| AppError::bad_request("Invalid UUID"))?;
|
||||||
|
|
||||||
let auth = state
|
let auth = state
|
||||||
@@ -981,7 +972,6 @@ pub async fn update_user_quota(
|
|||||||
Path(id): Path<String>,
|
Path(id): Path<String>,
|
||||||
Json(dto): Json<UpdateUserQuotaDto>,
|
Json(dto): Json<UpdateUserQuotaDto>,
|
||||||
) -> Result<impl IntoResponse, AppError> {
|
) -> Result<impl IntoResponse, AppError> {
|
||||||
|
|
||||||
let id = Uuid::parse_str(&id).map_err(|_| AppError::bad_request("Invalid UUID"))?;
|
let id = Uuid::parse_str(&id).map_err(|_| AppError::bad_request("Invalid UUID"))?;
|
||||||
|
|
||||||
let auth = state
|
let auth = state
|
||||||
@@ -1024,7 +1014,6 @@ pub async fn create_user(
|
|||||||
State(state): State<Arc<AppState>>,
|
State(state): State<Arc<AppState>>,
|
||||||
Json(dto): Json<AdminCreateUserDto>,
|
Json(dto): Json<AdminCreateUserDto>,
|
||||||
) -> Result<impl IntoResponse, AppError> {
|
) -> Result<impl IntoResponse, AppError> {
|
||||||
|
|
||||||
let auth = state
|
let auth = state
|
||||||
.auth_service
|
.auth_service
|
||||||
.as_ref()
|
.as_ref()
|
||||||
@@ -1064,7 +1053,6 @@ pub async fn reset_user_password(
|
|||||||
Path(id): Path<String>,
|
Path(id): Path<String>,
|
||||||
Json(dto): Json<AdminResetPasswordDto>,
|
Json(dto): Json<AdminResetPasswordDto>,
|
||||||
) -> Result<impl IntoResponse, AppError> {
|
) -> Result<impl IntoResponse, AppError> {
|
||||||
|
|
||||||
let id = Uuid::parse_str(&id).map_err(|_| AppError::bad_request("Invalid UUID"))?;
|
let id = Uuid::parse_str(&id).map_err(|_| AppError::bad_request("Invalid UUID"))?;
|
||||||
|
|
||||||
let auth = state
|
let auth = state
|
||||||
@@ -1147,7 +1135,6 @@ pub async fn set_registration_setting(
|
|||||||
async fn reextract_audio_metadata(
|
async fn reextract_audio_metadata(
|
||||||
State(state): State<Arc<AppState>>,
|
State(state): State<Arc<AppState>>,
|
||||||
) -> Result<impl IntoResponse, AppError> {
|
) -> Result<impl IntoResponse, AppError> {
|
||||||
|
|
||||||
let audio_service = state
|
let audio_service = state
|
||||||
.applications
|
.applications
|
||||||
.audio_metadata_service
|
.audio_metadata_service
|
||||||
@@ -1175,7 +1162,6 @@ async fn reextract_audio_metadata(
|
|||||||
async fn reextract_image_metadata(
|
async fn reextract_image_metadata(
|
||||||
State(state): State<Arc<AppState>>,
|
State(state): State<Arc<AppState>>,
|
||||||
) -> Result<impl IntoResponse, AppError> {
|
) -> Result<impl IntoResponse, AppError> {
|
||||||
|
|
||||||
let result = state
|
let result = state
|
||||||
.applications
|
.applications
|
||||||
.media_metadata_service
|
.media_metadata_service
|
||||||
@@ -1218,10 +1204,7 @@ async fn reextract_image_metadata(
|
|||||||
security(("bearerAuth" = [])),
|
security(("bearerAuth" = [])),
|
||||||
tag = "admin"
|
tag = "admin"
|
||||||
)]
|
)]
|
||||||
async fn get_smtp_info(
|
async fn get_smtp_info(State(state): State<Arc<AppState>>) -> Result<impl IntoResponse, AppError> {
|
||||||
State(state): State<Arc<AppState>>,
|
|
||||||
) -> Result<impl IntoResponse, AppError> {
|
|
||||||
|
|
||||||
let smtp = &state.core.config.smtp;
|
let smtp = &state.core.config.smtp;
|
||||||
let info = SmtpInfoDto {
|
let info = SmtpInfoDto {
|
||||||
enabled: smtp.is_enabled() && state.email_sender.is_some(),
|
enabled: smtp.is_enabled() && state.email_sender.is_some(),
|
||||||
@@ -1252,7 +1235,6 @@ async fn get_captured_email(
|
|||||||
State(state): State<Arc<AppState>>,
|
State(state): State<Arc<AppState>>,
|
||||||
Query(params): Query<CapturedEmailQuery>,
|
Query(params): Query<CapturedEmailQuery>,
|
||||||
) -> Result<impl IntoResponse, AppError> {
|
) -> Result<impl IntoResponse, AppError> {
|
||||||
|
|
||||||
if !std::env::var("OXICLOUD_SMTP_MOCK")
|
if !std::env::var("OXICLOUD_SMTP_MOCK")
|
||||||
.map(|v| v == "true" || v == "1")
|
.map(|v| v == "true" || v == "1")
|
||||||
.unwrap_or(false)
|
.unwrap_or(false)
|
||||||
|
|||||||
Reference in New Issue
Block a user