public interface SecurityDirectives
Modifier and Type | Method and Description |
---|---|
<T> AuthenticationDirective<T> |
authenticateBasic(java.lang.String realm,
scala.Function1<Credentials,scala.Option<T>> authenticator)
Wraps the inner route with Http Basic authentication support using a given
Authenticator[T] . |
<T> AuthenticationDirective<T> |
authenticateBasicAsync(java.lang.String realm,
scala.Function1<Credentials,scala.concurrent.Future<scala.Option<T>>> authenticator)
Wraps the inner route with Http Basic authentication support.
|
<T> AuthenticationDirective<T> |
authenticateBasicPF(java.lang.String realm,
scala.PartialFunction<Credentials,T> authenticator)
A directive that wraps the inner route with Http Basic authentication support.
|
<T> AuthenticationDirective<T> |
authenticateBasicPFAsync(java.lang.String realm,
scala.PartialFunction<Credentials,scala.concurrent.Future<T>> authenticator)
A directive that wraps the inner route with Http Basic authentication support.
|
<T> AuthenticationDirective<T> |
authenticateOAuth2(java.lang.String realm,
scala.Function1<Credentials,scala.Option<T>> authenticator)
A directive that wraps the inner route with OAuth2 Bearer Token authentication support.
|
<T> AuthenticationDirective<T> |
authenticateOAuth2Async(java.lang.String realm,
scala.Function1<Credentials,scala.concurrent.Future<scala.Option<T>>> authenticator)
A directive that wraps the inner route with OAuth2 Bearer Token authentication support.
|
<T> AuthenticationDirective<T> |
authenticateOAuth2PF(java.lang.String realm,
scala.PartialFunction<Credentials,T> authenticator)
A directive that wraps the inner route with OAuth2 Bearer Token authentication support.
|
<T> AuthenticationDirective<T> |
authenticateOAuth2PFAsync(java.lang.String realm,
scala.PartialFunction<Credentials,scala.concurrent.Future<T>> authenticator)
A directive that wraps the inner route with OAuth2 Bearer Token authentication support.
|
<C extends HttpCredentials,T> |
authenticateOrRejectWithChallenge(scala.Function1<scala.Option<C>,scala.concurrent.Future<scala.util.Either<HttpChallenge,T>>> authenticator,
scala.reflect.ClassTag<C> evidence$1)
Lifts an authenticator function into a directive.
|
<T> AuthenticationDirective<T> |
authenticateOrRejectWithChallenge(scala.Function1<scala.Option<HttpCredentials>,scala.concurrent.Future<scala.util.Either<HttpChallenge,T>>> authenticator)
Lifts an authenticator function into a directive.
|
Directive<scala.runtime.BoxedUnit> |
authorize(scala.Function0<java.lang.Object> check)
Applies the given authorization check to the request.
|
Directive<scala.runtime.BoxedUnit> |
authorize(scala.Function1<RequestContext,java.lang.Object> check)
Applies the given authorization check to the request.
|
Directive<scala.runtime.BoxedUnit> |
authorizeAsync(scala.Function0<scala.concurrent.Future<java.lang.Object>> check)
Asynchronous version of
authorize . |
Directive<scala.runtime.BoxedUnit> |
authorizeAsync(scala.Function1<RequestContext,scala.concurrent.Future<java.lang.Object>> check)
Asynchronous version of
authorize . |
Directive<scala.Tuple1<scala.Option<HttpCredentials>>> |
extractCredentials()
Extracts the potentially present
HttpCredentials provided with the request's Authorization header. |
Directive<scala.Tuple1<scala.Option<HttpCredentials>>> extractCredentials()
HttpCredentials
provided with the request's Authorization
header.
<T> AuthenticationDirective<T> authenticateBasic(java.lang.String realm, scala.Function1<Credentials,scala.Option<T>> authenticator)
Authenticator[T]
.
The given authenticator determines whether the credentials in the request are valid
and, if so, which user object to supply to the inner route.
realm
- (undocumented)authenticator
- (undocumented)<T> AuthenticationDirective<T> authenticateBasicAsync(java.lang.String realm, scala.Function1<Credentials,scala.concurrent.Future<scala.Option<T>>> authenticator)
realm
- (undocumented)authenticator
- (undocumented)<T> AuthenticationDirective<T> authenticateBasicPF(java.lang.String realm, scala.PartialFunction<Credentials,T> authenticator)
realm
- (undocumented)authenticator
- (undocumented)<T> AuthenticationDirective<T> authenticateBasicPFAsync(java.lang.String realm, scala.PartialFunction<Credentials,scala.concurrent.Future<T>> authenticator)
realm
- (undocumented)authenticator
- (undocumented)<T> AuthenticationDirective<T> authenticateOAuth2(java.lang.String realm, scala.Function1<Credentials,scala.Option<T>> authenticator)
realm
- (undocumented)authenticator
- (undocumented)<T> AuthenticationDirective<T> authenticateOAuth2Async(java.lang.String realm, scala.Function1<Credentials,scala.concurrent.Future<scala.Option<T>>> authenticator)
realm
- (undocumented)authenticator
- (undocumented)<T> AuthenticationDirective<T> authenticateOAuth2PF(java.lang.String realm, scala.PartialFunction<Credentials,T> authenticator)
realm
- (undocumented)authenticator
- (undocumented)<T> AuthenticationDirective<T> authenticateOAuth2PFAsync(java.lang.String realm, scala.PartialFunction<Credentials,scala.concurrent.Future<T>> authenticator)
realm
- (undocumented)authenticator
- (undocumented)<T> AuthenticationDirective<T> authenticateOrRejectWithChallenge(scala.Function1<scala.Option<HttpCredentials>,scala.concurrent.Future<scala.util.Either<HttpChallenge,T>>> authenticator)
Authorization
header of the request. If the function returns Right(user)
the user object is provided
to the inner route. If the function returns Left(challenge)
the request is rejected with an
AuthenticationFailedRejection
that contains this challenge to be added to the response.
authenticator
- (undocumented)<C extends HttpCredentials,T> AuthenticationDirective<T> authenticateOrRejectWithChallenge(scala.Function1<scala.Option<C>,scala.concurrent.Future<scala.util.Either<HttpChallenge,T>>> authenticator, scala.reflect.ClassTag<C> evidence$1)
authenticateOrRejectWithChallenge
but only applies the authenticator function with a certain type of credentials.
authenticator
- (undocumented)evidence$1
- (undocumented)Directive<scala.runtime.BoxedUnit> authorize(scala.Function0<java.lang.Object> check)
AuthorizationFailedRejection
.
check
- (undocumented)Directive<scala.runtime.BoxedUnit> authorize(scala.Function1<RequestContext,java.lang.Object> check)
AuthorizationFailedRejection
.
check
- (undocumented)Directive<scala.runtime.BoxedUnit> authorizeAsync(scala.Function0<scala.concurrent.Future<java.lang.Object>> check)
authorize
.
If the Future
fails or is completed with false
authorization fails and the route is rejected with an AuthorizationFailedRejection
.
check
- (undocumented)Directive<scala.runtime.BoxedUnit> authorizeAsync(scala.Function1<RequestContext,scala.concurrent.Future<java.lang.Object>> check)
authorize
.
If the Future
fails or is completed with false
authorization fails and the route is rejected with an AuthorizationFailedRejection
.
check
- (undocumented)