public interface OpenAPISecurityEnvironment
| Modifier and Type | Method and Description |
|---|---|
<T> T |
dispatch(java.lang.String authenticatedUser,
java.lang.String base,
java.lang.String operation,
java.util.concurrent.Callable<T> request)
Dispatch the request and associate the authenticated user.
|
java.util.Optional<byte[]> |
getCredential(java.lang.String user,
java.lang.String key)
Get a credential for a user.
|
java.util.Optional<java.lang.String> |
getProperty(java.lang.String user,
java.lang.String key)
Get a property for a given user
|
java.util.Optional<java.lang.String> |
getUser(java.lang.String userId)
Get the user currently associated with the thread.
|
java.util.Optional<java.lang.String> |
getUser(java.lang.String key,
java.lang.String value)
Return a user id for a user that has the given value for the given key
|
default boolean |
handleException(java.lang.Exception exception,
java.lang.String operation,
HttpServletRequest request,
HttpServletResponse response)
Handle any exceptions throw by the user code.
|
default boolean |
hasPermission(java.lang.String action,
java.lang.String... arguments)
Answer if the user associated with this thread has the following
permission
|
void |
setCredential(java.lang.String user,
java.lang.String key,
byte[] value)
Set a credential for a user.
|
void |
setProperty(java.lang.String user,
java.lang.String key,
java.lang.String value)
Set a property for a user.
|
java.util.Optional<java.lang.String> getProperty(java.lang.String user,
java.lang.String key)
user - the user idkey - the property keyvoid setProperty(java.lang.String user,
java.lang.String key,
java.lang.String value)
user - the user, not nullkey - the keyvalue - the valuevoid setCredential(java.lang.String user,
java.lang.String key,
byte[] value)
user - the user, not nullkey - the keyvalue - the valuejava.util.Optional<byte[]> getCredential(java.lang.String user,
java.lang.String key)
user - key - java.util.Optional<java.lang.String> getUser(java.lang.String key,
java.lang.String value)
user - the user idkey - the property keyvalue - the expected value<T> T dispatch(java.lang.String authenticatedUser,
java.lang.String base,
java.lang.String operation,
java.util.concurrent.Callable<T> request)
throws java.lang.Exception
authenticatedUser - the user or null if not authenticatedrequest - java.lang.Exceptionjava.util.Optional<java.lang.String> getUser(java.lang.String userId)
userId - default boolean hasPermission(java.lang.String action,
java.lang.String... arguments)
action - the action to performarguments - the arguments of the actiondefault boolean handleException(java.lang.Exception exception,
java.lang.String operation,
HttpServletRequest request,
HttpServletResponse response)
exception - Any exception by user codeoperation - The operation idrequest - The servlet requestresponse - The servlet response. The output can of course already be
(partially) committed.aQute SARL