public class ApiKeyRealm
extends org.apache.shiro.realm.AuthorizingRealm
| Constructor and Description |
|---|
ApiKeyRealm(java.lang.String name,
org.apache.shiro.cache.CacheManager cacheManager,
AuthIdentityReader<ApiKey> authIdentityReader,
PermissionReader permissionReader,
java.lang.String anonymousId) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
clearCachedAuthenticationInfo(org.apache.shiro.subject.PrincipalCollection principals)
Override default behavior to only clear cached authentication info if enabled.
|
protected void |
clearCachedAuthorizationInfo(org.apache.shiro.subject.PrincipalCollection principals)
Override default behavior to only clear cached authorization info if enabled.
|
protected org.apache.shiro.authc.AuthenticationInfo |
doGetAuthenticationInfo(org.apache.shiro.authc.AuthenticationToken token)
Gets the AuthenticationInfo that matches a token.
|
protected org.apache.shiro.authz.AuthorizationInfo |
doGetAuthorizationInfo(org.apache.shiro.subject.PrincipalCollection principals)
Gets the AuthorizationInfo that matches a token.
|
protected org.apache.shiro.cache.Cache<java.lang.String,org.apache.shiro.authz.AuthorizationInfo> |
getAvailableIdAuthorizationCache() |
protected org.apache.shiro.cache.Cache<java.lang.String,RolePermissionSet> |
getAvailableRolesCache() |
org.apache.shiro.cache.Cache<java.lang.String,org.apache.shiro.authz.AuthorizationInfo> |
getIdAuthorizationCache() |
java.lang.String |
getIdAuthorizationCacheName() |
protected java.util.Collection<org.apache.shiro.authz.Permission> |
getRolePermissions(java.lang.String role)
Gets the permissions for a role.
|
java.lang.String |
getRolesCacheName() |
boolean |
hasPermissionById(java.lang.String id,
org.apache.shiro.authz.Permission permission)
Test for whether an API key has a specific permission using its ID.
|
boolean |
hasPermissionById(java.lang.String id,
java.lang.String permission)
Test for whether an API key has a specific permission using its ID.
|
boolean |
hasPermissionsById(java.lang.String id,
java.util.Collection<org.apache.shiro.authz.Permission> permissions)
Test for whether an API key has specific permissions using its ID.
|
boolean |
hasPermissionsById(java.lang.String id,
org.apache.shiro.authz.Permission... permissions)
Test for whether an API key has specific permissions using its ID.
|
boolean |
hasPermissionsById(java.lang.String id,
java.lang.String... permissions)
Test for whether an API key has specific permissions using its ID.
|
protected void |
onInit() |
void |
setIdAuthorizationCacheName(java.lang.String name) |
void |
setName(java.lang.String name) |
boolean |
supports(org.apache.shiro.authc.AuthenticationToken token)
Override the parent method to also accept anonymous tokens
|
afterCacheManagerSet, checkPermission, checkPermission, checkPermission, checkPermissions, checkPermissions, checkPermissions, checkRole, checkRole, checkRoles, checkRoles, checkRoles, doClearCache, getAuthorizationCache, getAuthorizationCacheKey, getAuthorizationCacheName, getAuthorizationInfo, getPermissionResolver, getPermissions, getRolePermissionResolver, hasAllRoles, hasRole, hasRole, hasRoles, hasRoles, isAuthorizationCachingEnabled, isPermitted, isPermitted, isPermitted, isPermitted, isPermitted, isPermitted, isPermittedAll, isPermittedAll, isPermittedAll, setAuthorizationCache, setAuthorizationCacheName, setAuthorizationCachingEnabled, setPermissionResolver, setRolePermissionResolverassertCredentialsMatch, getAuthenticationCache, getAuthenticationCacheKey, getAuthenticationCacheKey, getAuthenticationCacheName, getAuthenticationInfo, getAuthenticationTokenClass, getCredentialsMatcher, init, isAuthenticationCachingEnabled, isAuthenticationCachingEnabled, setAuthenticationCache, setAuthenticationCacheName, setAuthenticationCachingEnabled, setAuthenticationTokenClass, setCredentialsMatcherclearCache, getAvailablePrincipal, getCacheManager, getName, isCachingEnabled, onLogout, setCacheManager, setCachingEnabledpublic ApiKeyRealm(java.lang.String name,
org.apache.shiro.cache.CacheManager cacheManager,
AuthIdentityReader<ApiKey> authIdentityReader,
PermissionReader permissionReader,
@Nullable
java.lang.String anonymousId)
protected void onInit()
onInit in class org.apache.shiro.realm.AuthorizingRealmpublic boolean supports(org.apache.shiro.authc.AuthenticationToken token)
supports in interface org.apache.shiro.realm.Realmsupports in class org.apache.shiro.realm.AuthenticatingRealmprotected org.apache.shiro.authc.AuthenticationInfo doGetAuthenticationInfo(org.apache.shiro.authc.AuthenticationToken token)
throws org.apache.shiro.authc.AuthenticationException
doGetAuthenticationInfo in class org.apache.shiro.realm.AuthenticatingRealmorg.apache.shiro.authc.AuthenticationExceptionprotected org.apache.shiro.authz.AuthorizationInfo doGetAuthorizationInfo(org.apache.shiro.subject.PrincipalCollection principals)
doGetAuthorizationInfo in class org.apache.shiro.realm.AuthorizingRealmpublic void setName(java.lang.String name)
setName in interface org.apache.shiro.util.NameablesetName in class org.apache.shiro.realm.AuthorizingRealmpublic java.lang.String getRolesCacheName()
public void setIdAuthorizationCacheName(java.lang.String name)
public java.lang.String getIdAuthorizationCacheName()
protected org.apache.shiro.cache.Cache<java.lang.String,RolePermissionSet> getAvailableRolesCache()
public org.apache.shiro.cache.Cache<java.lang.String,org.apache.shiro.authz.AuthorizationInfo> getIdAuthorizationCache()
protected org.apache.shiro.cache.Cache<java.lang.String,org.apache.shiro.authz.AuthorizationInfo> getAvailableIdAuthorizationCache()
protected java.util.Collection<org.apache.shiro.authz.Permission> getRolePermissions(java.lang.String role)
protected void clearCachedAuthenticationInfo(org.apache.shiro.subject.PrincipalCollection principals)
clearCachedAuthenticationInfo in class org.apache.shiro.realm.AuthenticatingRealmprotected void clearCachedAuthorizationInfo(org.apache.shiro.subject.PrincipalCollection principals)
clearCachedAuthorizationInfo in class org.apache.shiro.realm.AuthorizingRealmpublic boolean hasPermissionById(java.lang.String id,
java.lang.String permission)
public boolean hasPermissionById(java.lang.String id,
org.apache.shiro.authz.Permission permission)
public boolean hasPermissionsById(java.lang.String id,
java.lang.String... permissions)
public boolean hasPermissionsById(java.lang.String id,
org.apache.shiro.authz.Permission... permissions)
public boolean hasPermissionsById(java.lang.String id,
java.util.Collection<org.apache.shiro.authz.Permission> permissions)
Copyright © 2019. All Rights Reserved.