public interface SecureStorage extends Storage
generateToken(String)
.
This should happen over an authenticated and secured connection, thus authenticating the client
in the storage. The returned AuthToken will carry a client-token (that has been generated by the
client) and an auth-token (generated by the storage). If authentication fails at this stage
(e.g. because the client does not have the necessary privileges/roles), a StorageException is
thrown.
#verifyToken(AuthToken)
to
verify the validity of the tokens. Again, this needs to happen through an authenticated and
secured connection, thus authenticating the receiver. The storage verifies that it generated
the same token for an authenticated client before, and replies with true if it succeeds, and
false otherwise.Modifier and Type | Method and Description |
---|---|
AuthToken |
generateToken(String actionName)
Generates a token in the storage that can be used to authenticate cmd
channel requests.
|
boolean |
verifyToken(AuthToken token,
String actionName)
Verifies the specified token and action in the storage.
|
getConnection, loadFile, prepareStatement, purge, registerCategory, saveFile, shutdown
AuthToken generateToken(String actionName) throws StorageException
actionName
- A unique name of the type of action to be performed.StorageException
- if authentication fails at this pointboolean verifyToken(AuthToken token, String actionName)
actionName
- A unique name of the type of action to be performed. This
action name is used during verification. This means if
verification succeeds, the given action name can be trusted
and may be used for authorization checks.token
- The token to be verified.true
if authentication succeeded, false
otherwiseCopyright © 2018. All rights reserved.