Class User
- All Implemented Interfaces:
MutinyDelegate
Please consult the documentation for a detailed explanation.
NOTE: This class has been automatically generated from theoriginal
non Mutiny-ified interface using Vert.x codegen.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionio.vertx.core.json.JsonObject
Deprecated.This method will be removed.boolean
containsKey
(String key) static User
create
(io.vertx.core.json.JsonObject principal) static User
create
(io.vertx.core.json.JsonObject principal, io.vertx.core.json.JsonObject attributes) boolean
boolean
expired()
boolean
expired
(int leeway) static User
static User
<T> T
io.vertx.ext.auth.User
<T> T
getOrDefault
(String key, T defaultValue) boolean
int
hashCode()
io.smallrye.mutiny.Uni<Boolean>
isAuthorized
(Authorization authority) Deprecated.io.smallrye.mutiny.Uni<Boolean>
isAuthorized
(String authority) Deprecated.Use typed alternative#isAuthorized(Authorization, Handler)
isAuthorizedAndAwait
(Authorization authority) Deprecated.isAuthorizedAndAwait
(String authority) Deprecated.Use typed alternative#isAuthorized(Authorization, Handler)
isAuthorizedAndForget
(Authorization authority) Deprecated.isAuthorizedAndForget
(String authority) Deprecated.Use typed alternative#isAuthorized(Authorization, Handler)
static User
newInstance
(io.vertx.ext.auth.User arg) io.vertx.core.json.JsonObject
void
setAuthProvider
(AuthProvider authProvider) Deprecated.subject()
toString()
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
User
public User(io.vertx.ext.auth.User delegate) -
User
-
-
Method Details
-
getDelegate
public io.vertx.ext.auth.User getDelegate()- Specified by:
getDelegate
in interfaceMutinyDelegate
- Returns:
- the delegate used by this Mutiny object of generated type
-
toString
-
equals
-
hashCode
public int hashCode() -
fromName
- Parameters:
username
- the value for this user- Returns:
- user instance
-
fromToken
- Parameters:
token
- the value for this user- Returns:
- user instance
-
create
- Parameters:
principal
- the free form json principal- Returns:
- user instance
-
create
public static User create(io.vertx.core.json.JsonObject principal, io.vertx.core.json.JsonObject attributes) - Parameters:
principal
- the free form json principalattributes
- the free form json attributes that further describe the principal- Returns:
- user instance
-
subject
- Returns:
- the subject for this user or
null
.
-
attributes
public io.vertx.core.json.JsonObject attributes()- Returns:
- a json object with any relevant attribute.
-
expired
public boolean expired()- Returns:
true
if expired
-
expired
public boolean expired(int leeway) - Parameters:
leeway
- a greater than zero leeway value.- Returns:
true
if expired
-
get
- Parameters:
key
- the key to look up- Returns:
- the value or null if missing
-
getOrDefault
- Parameters:
key
- the key to look updefaultValue
- default value to return if missing- Returns:
- the value or null if missing
-
containsKey
- Parameters:
key
- the key to look up- Returns:
- the value or null if missing
-
authorizations
- Returns:
- authorizations holder for the user.
-
isAuthorized
@CheckReturnValue @Deprecated public io.smallrye.mutiny.Uni<Boolean> isAuthorized(Authorization authority) Deprecated.Is the user authorised toUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
authority
- the authority - what this really means is determined by the specific implementation. It might represent a permission to access a resource e.g. `printers:printer34` or it might represent authority to a role in a roles based model, e.g. `role:admin`.- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
isAuthorizedAndAwait
Deprecated.Blocking variant ofisAuthorized(io.vertx.mutiny.ext.auth.authorization.Authorization)
.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:
authority
- the authority - what this really means is determined by the specific implementation. It might represent a permission to access a resource e.g. `printers:printer34` or it might represent authority to a role in a roles based model, e.g. `role:admin`.- Returns:
- the Boolean instance produced by the operation.
-
isAuthorizedAndForget
Deprecated.Variant ofisAuthorized(io.vertx.mutiny.ext.auth.authorization.Authorization)
that ignores the result of the operation.This method subscribes on the result of
isAuthorized(io.vertx.mutiny.ext.auth.authorization.Authorization)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromisAuthorized(io.vertx.mutiny.ext.auth.authorization.Authorization)
but you don't need to compose it with other operations.- Parameters:
authority
- the authority - what this really means is determined by the specific implementation. It might represent a permission to access a resource e.g. `printers:printer34` or it might represent authority to a role in a roles based model, e.g. `role:admin`.- Returns:
- the instance of User to chain method calls.
-
isAuthorized
Deprecated.Use typed alternative#isAuthorized(Authorization, Handler)
Is the user authorised toUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
authority
- the authority - what this really means is determined by the specific implementation. It might represent a permission to access a resource e.g. `printers:printer34` or it might represent authority to a role in a roles based model, e.g. `role:admin`.- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
isAuthorizedAndAwait
Deprecated.Use typed alternative#isAuthorized(Authorization, Handler)
Blocking variant ofisAuthorized(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:
authority
- the authority - what this really means is determined by the specific implementation. It might represent a permission to access a resource e.g. `printers:printer34` or it might represent authority to a role in a roles based model, e.g. `role:admin`.- Returns:
- the Boolean instance produced by the operation.
-
isAuthorizedAndForget
Deprecated.Use typed alternative#isAuthorized(Authorization, Handler)
Variant ofisAuthorized(String)
that ignores the result of the operation.This method subscribes on the result of
isAuthorized(String)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromisAuthorized(String)
but you don't need to compose it with other operations.- Parameters:
authority
- the authority - what this really means is determined by the specific implementation. It might represent a permission to access a resource e.g. `printers:printer34` or it might represent authority to a role in a roles based model, e.g. `role:admin`.- Returns:
- the instance of User to chain method calls.
-
clearCache
Deprecated.This method will be removed. UseAuthorizations#clear()
- Returns:
- the User to enable fluent use
-
principal
public io.vertx.core.json.JsonObject principal()- Returns:
- JSON representation of the Principal
-
setAuthProvider
Deprecated.- Parameters:
authProvider
- the AuthProvider - this must be the same type of AuthProvider that originally created the User
-
merge
- Parameters:
other
- the other user to merge- Returns:
- fluent self
-
hasAmr
- Parameters:
value
-- Returns:
true
if claim is present in the principal.
-
newInstance
-