Class RouteAuthority
java.lang.Object
tech.lastbox.lastshield.security.core.RouteAuthority
Represents the authorization configuration for a specific route within the application.
A RouteAuthority defines the access control for a specific path, including the roles required to access it
and the HTTP methods (GET, POST, etc.) allowed on that path. This class is used to specify the security constraints
for each route in the application's security configuration.
-
Constructor Summary
ConstructorsConstructorDescriptionRouteAuthority(String path) Constructs aRouteAuthoritywith the specified path and no roles.RouteAuthority(String path, String role) Constructs aRouteAuthoritywith the specified path and a single role.RouteAuthority(String path, String role, HttpMethod... httpMethods) Constructs aRouteAuthoritywith the specified path, role, and HTTP methods.RouteAuthority(String path, List<String> roles) Constructs aRouteAuthoritywith the specified path and list of roles.RouteAuthority(String path, HttpMethod... httpMethods) Constructs aRouteAuthoritywith the specified path and HTTP methods. -
Method Summary
-
Constructor Details
-
RouteAuthority
Constructs aRouteAuthoritywith the specified path and no roles. The route can be accessed with any role or no role, depending on additional configuration.- Parameters:
path- the path of the route to which this authority applies.
-
RouteAuthority
Constructs aRouteAuthoritywith the specified path and a single role.- Parameters:
path- the path of the route to which this authority applies.role- the role that is required to access this route.
-
RouteAuthority
Constructs aRouteAuthoritywith the specified path, role, and HTTP methods.- Parameters:
path- the path of the route to which this authority applies.role- the role that is required to access this route.httpMethods- the HTTP methods (e.g., GET, POST) allowed on this route.
-
RouteAuthority
Constructs aRouteAuthoritywith the specified path and list of roles.- Parameters:
path- the path of the route to which this authority applies.roles- the list of roles that are allowed to access this route.
-
RouteAuthority
Constructs aRouteAuthoritywith the specified path and HTTP methods.- Parameters:
path- the path of the route to which this authority applies.httpMethods- the HTTP methods (e.g., GET, POST) allowed on this route.
-
-
Method Details
-
getPath
Gets the path associated with thisRouteAuthority.- Returns:
- the path for this route.
-
getRoles
Gets the roles associated with thisRouteAuthority.- Returns:
- the roles that are allowed to access this route.
-
getHttpMethods
Gets the HTTP methods allowed on this route.- Returns:
- a list of allowed HTTP methods (GET, POST, etc.).
-
toString
Returns a string representation of theRouteAuthority. This includes the path, roles, and HTTP methods associated with the route.
-