@@ -2,8 +2,6 @@ use axum::extract::Json;
2
2
use axum:: extract:: Path ;
3
3
use axum:: extract:: Request ;
4
4
use axum:: response:: IntoResponse ;
5
- use axum:: Extension ;
6
- use editoast_authz:: BuiltinRole ;
7
5
use editoast_derive:: EditoastError ;
8
6
use thiserror:: Error ;
9
7
use tower:: ServiceExt ;
@@ -12,8 +10,6 @@ use tower_http::services::ServeFile;
12
10
use crate :: client:: get_dynamic_assets_path;
13
11
use crate :: error:: Result ;
14
12
use crate :: generated_data:: sprite_config:: SpriteConfig ;
15
- use crate :: views:: AuthenticationExt ;
16
- use crate :: views:: AuthorizationError ;
17
13
18
14
crate :: routes! {
19
15
"/sprites" => {
@@ -41,15 +37,7 @@ enum SpriteErrors {
41
37
( status = 200 , description = "List of supported signaling systems" , body = Vec <String >, example = json!( [ "BAL" , "TVM300" ] ) ) ,
42
38
) ,
43
39
) ]
44
- async fn signaling_systems ( Extension ( auth) : AuthenticationExt ) -> Result < Json < Vec < String > > > {
45
- let authorized = auth
46
- . check_roles ( [ BuiltinRole :: MapRead ] . into ( ) )
47
- . await
48
- . map_err ( AuthorizationError :: AuthError ) ?;
49
- if !authorized {
50
- return Err ( AuthorizationError :: Forbidden . into ( ) ) ;
51
- }
52
-
40
+ async fn signaling_systems ( ) -> Result < Json < Vec < String > > > {
53
41
let sprite_configs = SpriteConfig :: load ( ) ;
54
42
let signaling_systems = sprite_configs. keys ( ) . cloned ( ) . collect ( ) ;
55
43
Ok ( Json ( signaling_systems) )
@@ -69,18 +57,9 @@ async fn signaling_systems(Extension(auth): AuthenticationExt) -> Result<Json<Ve
69
57
) ,
70
58
) ]
71
59
async fn sprites (
72
- Extension ( auth) : AuthenticationExt ,
73
60
Path ( ( signaling_system, file_name) ) : Path < ( String , String ) > ,
74
61
request : Request ,
75
62
) -> Result < impl IntoResponse > {
76
- let authorized = auth
77
- . check_roles ( [ BuiltinRole :: MapRead ] . into ( ) )
78
- . await
79
- . map_err ( AuthorizationError :: AuthError ) ?;
80
- if !authorized {
81
- return Err ( AuthorizationError :: Forbidden . into ( ) ) ;
82
- }
83
-
84
63
let sprite_configs = SpriteConfig :: load ( ) ;
85
64
if signaling_system != "default" && !sprite_configs. contains_key ( & signaling_system) {
86
65
return Err ( SpriteErrors :: UnknownSignalingSystem { signaling_system } . into ( ) ) ;
0 commit comments