Skip to main content

deny_all

Attribute Macro deny_all 

Source
#[deny_all]
Expand description

Marks an endpoint as completely inaccessible (always returns 403 Forbidden).

§Spring Security / Java EE Equivalent

@DenyAll

§Usage

use actix_security_codegen::deny_all;
use actix_security_core::http::security::AuthenticatedUser;

#[deny_all]
#[get("/disabled")]
async fn disabled_endpoint(user: AuthenticatedUser) -> impl Responder {
    HttpResponse::Ok().body("Never reached")
}

§Note

Useful for temporarily disabling endpoints or marking them as under construction.