Skip to content

Commit 59a561b

Browse files
committed
editoast: no auth for sprites
2 parents 47b853f + e9c4d28 commit 59a561b

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

editoast/src/views/sprites.rs

-13
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ use axum::extract::Json;
22
use axum::extract::Path;
33
use axum::extract::Request;
44
use axum::response::IntoResponse;
5-
use axum::Extension;
6-
use editoast_authz::BuiltinRole;
75
use editoast_derive::EditoastError;
86
use thiserror::Error;
97
use tower::ServiceExt;
@@ -12,8 +10,6 @@ use tower_http::services::ServeFile;
1210
use crate::client::get_dynamic_assets_path;
1311
use crate::error::Result;
1412
use crate::generated_data::sprite_config::SpriteConfig;
15-
use crate::views::AuthenticationExt;
16-
use crate::views::AuthorizationError;
1713

1814
crate::routes! {
1915
"/sprites" => {
@@ -61,18 +57,9 @@ async fn signaling_systems() -> Result<Json<Vec<String>>> {
6157
),
6258
)]
6359
async fn sprites(
64-
Extension(auth): AuthenticationExt,
6560
Path((signaling_system, file_name)): Path<(String, String)>,
6661
request: Request,
6762
) -> Result<impl IntoResponse> {
68-
let authorized = auth
69-
.check_roles([BuiltinRole::MapRead].into())
70-
.await
71-
.map_err(AuthorizationError::AuthError)?;
72-
if !authorized {
73-
return Err(AuthorizationError::Forbidden.into());
74-
}
75-
7663
let sprite_configs = SpriteConfig::load();
7764
if signaling_system != "default" && !sprite_configs.contains_key(&signaling_system) {
7865
return Err(SpriteErrors::UnknownSignalingSystem { signaling_system }.into());

0 commit comments

Comments
 (0)