Interface JwtAuthorityRepository
-
- All Known Implementing Classes:
InMemoryJwtAuthorityRepositoryManagedObjectSource
,InMemoryJwtAuthorityRepositoryManagedObjectSource
public interface JwtAuthorityRepository
JWT repository.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
JwtAuthorityRepository.ClusterCriticalSection
Critical section logic for the cluster.static interface
JwtAuthorityRepository.RetrieveKeysContext
Context for retrieving keys.static interface
JwtAuthorityRepository.SaveKeysContext
Context for saving keys.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
doClusterCriticalSection(JwtAuthorityRepository.ClusterCriticalSection clusterCriticalSection)
Allows overriding to take distributed locks within the cluster to avoid duplicate keys being generated.java.util.List<JwtAccessKey>
retrieveJwtAccessKeys(JwtAuthorityRepository.RetrieveKeysContext context)
Retrieves the list ofJwtAccessKey
instances.java.util.List<JwtRefreshKey>
retrieveJwtRefreshKeys(JwtAuthorityRepository.RetrieveKeysContext context)
Retrieves the list ofJwtRefreshKey
instances.void
saveJwtAccessKeys(JwtAuthorityRepository.SaveKeysContext context, JwtAccessKey... accessKeys)
Saves newJwtAccessKey
instances.void
saveJwtRefreshKeys(JwtAuthorityRepository.SaveKeysContext context, JwtRefreshKey... refreshKeys)
Saves newJwtRefreshKey
instances.
-
-
-
Method Detail
-
retrieveJwtAccessKeys
java.util.List<JwtAccessKey> retrieveJwtAccessKeys(JwtAuthorityRepository.RetrieveKeysContext context) throws java.lang.Exception
Retrieves the list ofJwtAccessKey
instances.- Parameters:
context
-JwtAuthorityRepository.RetrieveKeysContext
.- Returns:
JwtAccessKey
instances.- Throws:
java.lang.Exception
- Possible failure in retrieving theJwtAccessKey
instances.
-
saveJwtAccessKeys
void saveJwtAccessKeys(JwtAuthorityRepository.SaveKeysContext context, JwtAccessKey... accessKeys) throws java.lang.Exception
Saves newJwtAccessKey
instances.- Parameters:
context
-JwtAuthorityRepository.SaveKeysContext
.accessKeys
- NewJwtAccessKey
instances.- Throws:
java.lang.Exception
- If fails to save theJwtAccessKey
instance.
-
retrieveJwtRefreshKeys
java.util.List<JwtRefreshKey> retrieveJwtRefreshKeys(JwtAuthorityRepository.RetrieveKeysContext context) throws java.lang.Exception
Retrieves the list ofJwtRefreshKey
instances.- Parameters:
context
-JwtAuthorityRepository.RetrieveKeysContext
.- Returns:
JwtRefreshKey
instances.- Throws:
java.lang.Exception
- Possible failure in retrieving theJwtRefreshKey
instances.
-
saveJwtRefreshKeys
void saveJwtRefreshKeys(JwtAuthorityRepository.SaveKeysContext context, JwtRefreshKey... refreshKeys)
Saves newJwtRefreshKey
instances.- Parameters:
context
-JwtAuthorityRepository.SaveKeysContext
.refreshKeys
- NewJwtRefreshKey
instances.- Throws:
java.lang.Exception
- If fails to save theJwtRefreshKey
instance.
-
doClusterCriticalSection
default void doClusterCriticalSection(JwtAuthorityRepository.ClusterCriticalSection clusterCriticalSection) throws java.lang.Exception
Allows overriding to take distributed locks within the cluster to avoid duplicate keys being generated. This is optional to implement.
Default is to allow duplicate keys to be created. This is handled by logic of JWT allowing multiple active keys.
- Parameters:
clusterCriticalSection
-JwtAuthorityRepository.ClusterCriticalSection
.- Throws:
java.lang.Exception
- If fails to undertakeJwtAuthorityRepository.ClusterCriticalSection
.
-
-