Package com.linecorp.armeria.server.auth
Interface AuthorizationStatus
@UnstableApi public interface AuthorizationStatus
Provides a status of the request authorization operation, optionally combined with
AuthSuccessHandler
and AuthFailureHandler
to facilitate custom status handling.-
Method Summary
Modifier and Type Method Description AuthFailureHandler
failureHandler()
Returns theAuthFailureHandler
to handle unauthorized requests.boolean
isAuthorized()
A status of the request authorization operation.static AuthorizationStatus
of(boolean isAuthorized)
CreatesAuthorizationStatus
based on the given boolean status, with neitherAuthFailureHandler
norAuthSuccessHandler
defined.static AuthorizationStatus
ofFailure(AuthFailureHandler failureHandler)
CreatesAuthorizationStatus
success status with optionalAuthFailureHandler
.static AuthorizationStatus
ofSuccess()
Default Authorization Success status with noAuthSuccessHandler
defined.static AuthorizationStatus
ofSuccess(AuthSuccessHandler successHandler)
CreatesAuthorizationStatus
success status with optionalAuthSuccessHandler
.AuthSuccessHandler
successHandler()
Returns theAuthSuccessHandler
to handle successfully authorized requests.
-
Method Details
-
of
CreatesAuthorizationStatus
based on the given boolean status, with neitherAuthFailureHandler
norAuthSuccessHandler
defined.- Parameters:
isAuthorized
- Whether the request was authorized or not.
-
ofSuccess
Default Authorization Success status with noAuthSuccessHandler
defined. -
ofSuccess
CreatesAuthorizationStatus
success status with optionalAuthSuccessHandler
. -
ofFailure
CreatesAuthorizationStatus
success status with optionalAuthFailureHandler
. -
isAuthorized
boolean isAuthorized()A status of the request authorization operation.- Returns:
true
if the request is authorized, orfalse
otherwise.
-
successHandler
Returns theAuthSuccessHandler
to handle successfully authorized requests. It may returnnull
, which indicates to useAuthService
's default handling.- Returns:
- An instance of
AuthSuccessHandler
to handle successfully authorized requests ornull
to rely on the default handling.
-
failureHandler
Returns theAuthFailureHandler
to handle unauthorized requests. It may returnnull
, which indicates to useAuthService
's default handling.- Returns:
- An instance of
AuthFailureHandler
to handle unauthorized requests ornull
to rely on the default handling.
-