Package io.quarkus.oidc.runtime
Class DefaultTokenIntrospectionUserInfoCache
- java.lang.Object
-
- io.quarkus.oidc.runtime.DefaultTokenIntrospectionUserInfoCache
-
- All Implemented Interfaces:
TokenIntrospectionCache
,UserInfoCache
public class DefaultTokenIntrospectionUserInfoCache extends Object implements TokenIntrospectionCache, UserInfoCache
Default TokenIntrospection and UserInfo Cache implementation. A single cache entry can keep TokenIntrospection and/or UserInfo.In most cases it is the opaque bearer access tokens which are introspected but the code flow access tokens can also be introspected if they have the roles claims.
In either case, if a remote request to fetch UserInfo is required then it will be the same access token which has been introspected which will be used to request UserInfo.
-
-
Constructor Summary
Constructors Constructor Description DefaultTokenIntrospectionUserInfoCache(OidcConfig oidcConfig, io.vertx.core.Vertx vertx)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.smallrye.mutiny.Uni<Void>
addIntrospection(String token, TokenIntrospection introspection, OidcTenantConfig oidcTenantConfig, OidcRequestContext<Void> requestContext)
Add a newTokenIntrospection
result to the cache.io.smallrye.mutiny.Uni<Void>
addUserInfo(String token, UserInfo userInfo, OidcTenantConfig oidcTenantConfig, OidcRequestContext<Void> requestContext)
Add a newUserInfo
to the cache.void
clearCache()
int
getCacheSize()
io.smallrye.mutiny.Uni<TokenIntrospection>
getIntrospection(String token, OidcTenantConfig oidcConfig, OidcRequestContext<TokenIntrospection> requestContext)
Get the cachedTokenIntrospection
result.io.smallrye.mutiny.Uni<UserInfo>
getUserInfo(String token, OidcTenantConfig oidcConfig, OidcRequestContext<UserInfo> requestContext)
Get the cachedUserInfo
.
-
-
-
Constructor Detail
-
DefaultTokenIntrospectionUserInfoCache
public DefaultTokenIntrospectionUserInfoCache(OidcConfig oidcConfig, io.vertx.core.Vertx vertx)
-
-
Method Detail
-
addIntrospection
public io.smallrye.mutiny.Uni<Void> addIntrospection(String token, TokenIntrospection introspection, OidcTenantConfig oidcTenantConfig, OidcRequestContext<Void> requestContext)
Description copied from interface:TokenIntrospectionCache
Add a newTokenIntrospection
result to the cache.- Specified by:
addIntrospection
in interfaceTokenIntrospectionCache
- Parameters:
token
- the token which has been introspectedintrospection
- the token introspection resultoidcTenantConfig
- the tenant configurationrequestContext
- the request context which can be used to run the blocking tasks
-
getIntrospection
public io.smallrye.mutiny.Uni<TokenIntrospection> getIntrospection(String token, OidcTenantConfig oidcConfig, OidcRequestContext<TokenIntrospection> requestContext)
Description copied from interface:TokenIntrospectionCache
Get the cachedTokenIntrospection
result.- Specified by:
getIntrospection
in interfaceTokenIntrospectionCache
- Parameters:
token
- the token which has to be introspectedoidcConfig
- the tenant configurationrequestContext
- the request context which can be used to run the blocking tasks
-
addUserInfo
public io.smallrye.mutiny.Uni<Void> addUserInfo(String token, UserInfo userInfo, OidcTenantConfig oidcTenantConfig, OidcRequestContext<Void> requestContext)
Description copied from interface:UserInfoCache
Add a newUserInfo
to the cache.- Specified by:
addUserInfo
in interfaceUserInfoCache
- Parameters:
token
- the token which was used to getUserInfo
userInfo
-UserInfo
oidcTenantConfig
- the tenant configurationrequestContext
- the request context which can be used to run the blocking tasks
-
getUserInfo
public io.smallrye.mutiny.Uni<UserInfo> getUserInfo(String token, OidcTenantConfig oidcConfig, OidcRequestContext<UserInfo> requestContext)
Description copied from interface:UserInfoCache
Get the cachedUserInfo
.- Specified by:
getUserInfo
in interfaceUserInfoCache
- Parameters:
token
- the token which will be used to get newUserInfo
if noUserInfo
is cached. Effectively this token is a cache key which has to be stored when#addUserInfo(String, UserInfo, OidcTenantConfig, AddUserInfoRequestContext)
is called.oidcConfig
- the tenant configurationrequestContext
- the request context which can be used to run the blocking tasks
-
getCacheSize
public int getCacheSize()
-
clearCache
public void clearCache()
-
-