Package io.vertx.mutiny.ext.auth.oauth2
Class OAuth2RBAC
- java.lang.Object
-
- io.vertx.mutiny.ext.auth.oauth2.OAuth2RBAC
-
public class OAuth2RBAC extends Object
Functional interface that allows users to implement custom RBAC verifiers for OAuth2/OpenId Connect. Users are to implement theisAuthorized
method to verify authorities. For provides that do not export the permissions/roles in the token, this interface allows you to communicate with 3rd party services such as graph APIs to collect the required data. The contract is that once an authority is checked for a given user, it's value is cached during the execution of the request. If a user is stored to a persistent storage, or the token is introspected, the cache is cleared and a new call will be handled to the implementation. NOTE: This class has been automatically generated from theoriginal
non Mutiny-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<OAuth2RBAC>
__TYPE_ARG
-
Constructor Summary
Constructors Constructor Description OAuth2RBAC(io.vertx.ext.auth.oauth2.OAuth2RBAC delegate)
OAuth2RBAC(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
equals(Object o)
io.vertx.ext.auth.oauth2.OAuth2RBAC
getDelegate()
int
hashCode()
io.smallrye.mutiny.Uni<Boolean>
isAuthorized(AccessToken user, String authority)
Deprecated.Boolean
isAuthorizedAndAwait(AccessToken user, String authority)
Deprecated.void
isAuthorizedAndForget(AccessToken user, String authority)
Deprecated.static OAuth2RBAC
newInstance(io.vertx.ext.auth.oauth2.OAuth2RBAC arg)
String
toString()
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<OAuth2RBAC> __TYPE_ARG
-
-
Constructor Detail
-
OAuth2RBAC
public OAuth2RBAC(io.vertx.ext.auth.oauth2.OAuth2RBAC delegate)
-
OAuth2RBAC
public OAuth2RBAC(Object delegate)
-
-
Method Detail
-
getDelegate
public io.vertx.ext.auth.oauth2.OAuth2RBAC getDelegate()
-
isAuthorized
@Deprecated public io.smallrye.mutiny.Uni<Boolean> isAuthorized(AccessToken user, String authority)
Deprecated.This method should verify if the user has the given authority and return either a boolean value or an error. Note that false and errors are not the same. A user might not have a given authority but that doesn't mean that there was an error during the call.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
user
- the given user to assert onauthority
- the authority to lookup- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
isAuthorizedAndAwait
@Deprecated public Boolean isAuthorizedAndAwait(AccessToken user, String authority)
Deprecated.Blocking variant ofisAuthorized(io.vertx.mutiny.ext.auth.oauth2.AccessToken,String)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
user
- the given user to assert onauthority
- the authority to lookup- Returns:
- the Boolean instance produced by the operation.
-
isAuthorizedAndForget
@Deprecated public void isAuthorizedAndForget(AccessToken user, String authority)
Deprecated.Variant ofisAuthorized(io.vertx.mutiny.ext.auth.oauth2.AccessToken,String)
that ignores the result of the operation.This method subscribes on the result of
isAuthorized(io.vertx.mutiny.ext.auth.oauth2.AccessToken,String)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromisAuthorized(io.vertx.mutiny.ext.auth.oauth2.AccessToken,String)
but you don't need to compose it with other operations.- Parameters:
user
- the given user to assert onauthority
- the authority to lookup
-
newInstance
public static OAuth2RBAC newInstance(io.vertx.ext.auth.oauth2.OAuth2RBAC arg)
-
-