✨ (web): Exige el acceso de cada ruta al montarla

`configure_router()` recibe Routes, que no monta ninguna ruta sin su
Access: `route()`, `public_route()` y `admin_route()`, que toma el
permiso de la página del panel de la que cuelga.

Una ruta del panel montada de otra forma impide arrancar.

`configure_middleware()` recibe Layers y `configure_static_files()`
recibe StaticFiles, siempre públicos.
This commit is contained in:
Manuel Cillero 2026-11-07 13:52:04 +01:00
parent 71ea609088
commit ab2677be44
28 changed files with 664 additions and 158 deletions

View file

@ -11,8 +11,8 @@ impl Extension for FormControls {
vec![&pagetop_aliner::Aliner, &pagetop_bootsier::Bootsier]
}
fn configure_router(&self, router: Router) -> Router {
router.route("/", web::get(form_controls).post(form_controls))
fn configure_router(&self, routes: Routes) -> Routes {
routes.public_route("/", web::get(form_controls).post(form_controls))
}
}

View file

@ -4,8 +4,8 @@ struct HelloName;
#[async_trait]
impl Extension for HelloName {
fn configure_router(&self, router: Router) -> Router {
router.route("/hello/{name}", web::get(hello_name))
fn configure_router(&self, routes: Routes) -> Routes {
routes.public_route("/hello/{name}", web::get(hello_name))
}
}

View file

@ -4,8 +4,8 @@ struct HelloWorld;
#[async_trait]
impl Extension for HelloWorld {
fn configure_router(&self, router: Router) -> Router {
router.route("/", web::get(hello_world))
fn configure_router(&self, routes: Routes) -> Routes {
routes.public_route("/", web::get(hello_world))
}
}

View file

@ -6,8 +6,8 @@ struct IntroColors;
#[async_trait]
impl Extension for IntroColors {
fn configure_router(&self, router: Router) -> Router {
router.route("/", web::get(intro_colors))
fn configure_router(&self, routes: Routes) -> Routes {
routes.public_route("/", web::get(intro_colors))
}
}

View file

@ -6,8 +6,8 @@ struct IntroDatetime;
#[async_trait]
impl Extension for IntroDatetime {
fn configure_router(&self, router: Router) -> Router {
router.route("/", web::get(intro_datetime))
fn configure_router(&self, routes: Routes) -> Routes {
routes.public_route("/", web::get(intro_datetime))
}
}

View file

@ -10,8 +10,8 @@ impl Extension for IntroFlex {
vec![&pagetop_bootsier::Bootsier]
}
fn configure_router(&self, router: Router) -> Router {
router.route("/", web::get(intro_flex))
fn configure_router(&self, routes: Routes) -> Routes {
routes.public_route("/", web::get(intro_flex))
}
}

View file

@ -10,8 +10,8 @@ impl Extension for IntroGrid {
vec![&pagetop_bootsier::Bootsier]
}
fn configure_router(&self, router: Router) -> Router {
router.route("/", web::get(intro_grid))
fn configure_router(&self, routes: Routes) -> Routes {
routes.public_route("/", web::get(intro_grid))
}
}

View file

@ -10,8 +10,8 @@ impl Extension for IntroResponsive {
vec![&pagetop_bootsier::Bootsier]
}
fn configure_router(&self, router: Router) -> Router {
router.route("/", web::get(intro_responsive))
fn configure_router(&self, routes: Routes) -> Routes {
routes.public_route("/", web::get(intro_responsive))
}
}

View file

@ -10,8 +10,8 @@ impl Extension for IntroSpacing {
vec![&pagetop_bootsier::Bootsier]
}
fn configure_router(&self, router: Router) -> Router {
router.route("/", web::get(intro_spacing))
fn configure_router(&self, routes: Routes) -> Routes {
routes.public_route("/", web::get(intro_spacing))
}
}

View file

@ -11,8 +11,8 @@ impl Extension for NavbarMenus {
vec![&pagetop_bootsier::Bootsier]
}
fn configure_router(&self, router: Router) -> Router {
router.route("/", web::get(navbar_menus))
fn configure_router(&self, routes: Routes) -> Routes {
routes.public_route("/", web::get(navbar_menus))
}
}