public class AuthProvider extends Object
If you wish to use the auth service with other providers, implement this interface for your provider.
NOTE: This class has been automatically generated from theoriginal
non RX-ified interface using Vert.x codegen.Constructor and Description |
---|
AuthProvider(AuthProvider delegate) |
Modifier and Type | Method and Description |
---|---|
Object |
getDelegate() |
void |
hasPermission(JsonObject principal,
String permission,
Handler<AsyncResult<Boolean>> resultHandler)
Handle whether a principal has a permission
|
rx.Observable<Boolean> |
hasPermissionObservable(JsonObject principal,
String permission)
Handle whether a principal has a permission
|
void |
hasRole(JsonObject principal,
String role,
Handler<AsyncResult<Boolean>> resultHandler)
Handle whether a principal has a role
|
rx.Observable<Boolean> |
hasRoleObservable(JsonObject principal,
String role)
Handle whether a principal has a role
|
void |
login(JsonObject principal,
JsonObject credentials,
Handler<AsyncResult<Void>> resultHandler)
Handle the actual login
|
rx.Observable<Void> |
loginObservable(JsonObject principal,
JsonObject credentials)
Handle the actual login
|
static AuthProvider |
newInstance(AuthProvider arg) |
public AuthProvider(AuthProvider delegate)
public Object getDelegate()
public void login(JsonObject principal, JsonObject credentials, Handler<AsyncResult<Void>> resultHandler)
principal
- represents the unique id (e.g. username) of the user being logged incredentials
- the credentials - this can contain anything your provider expects, e.g. passwordresultHandler
- - this must return a failed result if login fails and it must return a succeeded result if the login succeedspublic rx.Observable<Void> loginObservable(JsonObject principal, JsonObject credentials)
principal
- represents the unique id (e.g. username) of the user being logged incredentials
- the credentials - this can contain anything your provider expects, e.g. passwordpublic void hasRole(JsonObject principal, String role, Handler<AsyncResult<Boolean>> resultHandler)
principal
- represents the unique id (e.g. username) of the user being logged inrole
- the roleresultHandler
- this must return a failure if the check could not be performed - e.g. the principal is not known. Otherwise it must return a succeeded result which contains a boolean `true` if the principal has the role, or `false` if they do not have the role.public rx.Observable<Boolean> hasRoleObservable(JsonObject principal, String role)
principal
- represents the unique id (e.g. username) of the user being logged inrole
- the rolepublic void hasPermission(JsonObject principal, String permission, Handler<AsyncResult<Boolean>> resultHandler)
principal
- represents the unique id (e.g. username) of the user being logged inpermission
- the permissionresultHandler
- this must return a failure if the check could not be performed - e.g. the principal is not known. Otherwise it must return a succeeded result which contains a boolean `true` if the principal has the permission, or `false` if they do not have the permission.public rx.Observable<Boolean> hasPermissionObservable(JsonObject principal, String permission)
principal
- represents the unique id (e.g. username) of the user being logged inpermission
- the permissionpublic static AuthProvider newInstance(AuthProvider arg)
Copyright © 2015. All Rights Reserved.