public abstract class BaseUserStore extends com.epimorphics.appbase.core.ComponentBase implements UserStore
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_ALGORITHM |
static int |
DEFAULT_ITERATIONS |
protected File |
initfile |
protected org.apache.shiro.crypto.SecureRandomNumberGenerator |
rand |
protected AppRealm |
realm |
AUTH_USER_ID| Constructor and Description |
|---|
BaseUserStore() |
| Modifier and Type | Method and Description |
|---|---|
void |
addPermision(String id,
String permission)
Record a new permission for this user.
|
protected void |
checkSubjectControls(String path) |
org.apache.shiro.authc.SaltedAuthenticationInfo |
checkUser(String id)
Test if a user is registered.
|
protected abstract void |
commit()
Commit the transaction if the store supports transactions
|
String |
createCredentials(String id,
int minstolive)
Create a new random password, set it and return it.
|
abstract void |
doAddPermision(String id,
String permission) |
abstract boolean |
doRegister(UserInfo user) |
abstract void |
doRemoveCredentials(String id) |
abstract void |
doRemovePermission(String id,
String permission) |
abstract void |
doRemovePermissionsOn(String id,
String path) |
abstract void |
doSetCredentials(String id,
org.apache.shiro.util.ByteSource credentials,
int minstolive) |
abstract void |
doUnregister(String id) |
protected abstract com.epimorphics.appbase.security.BaseUserStore.UserRecord |
getRecord(String id)
Return the record for the identified user.
|
UserInfo |
getUser(String id)
Return the user info for the given user ID, or null if not found
|
protected abstract boolean |
initstore()
Test if store is available, if not create a new empty
store and return true.
|
boolean |
register(UserInfo user)
Register a new user.
|
void |
removeCredentials(String id)
Remove the credentials for the user
|
void |
removePermission(String id,
String permission)
Remove the specific matching permission for this user
|
void |
removePermissionsOn(String id,
String path)
Remove permissions from this user for the given path.
|
void |
setCredentials(String id,
org.apache.shiro.util.ByteSource credentials,
int minstolive)
Store new credentials for the user
|
void |
setInitfile(String file) |
void |
setRealm(AppRealm realm)
Link this store to a specific authorization realm
|
protected abstract void |
startTransaction()
Start a transaction if the store supports transactions
|
void |
unregister(String id)
Unregister a user, removing them and any permissions from the store
|
asFile, expandFileLocation, getApp, getName, require, setName, startup, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitauthorizedOn, getPermissions, listUserspublic static final String DEFAULT_ALGORITHM
public static final int DEFAULT_ITERATIONS
protected org.apache.shiro.crypto.SecureRandomNumberGenerator rand
protected File initfile
protected AppRealm realm
public void setInitfile(String file)
public void setRealm(AppRealm realm)
UserStoreprotected abstract boolean initstore()
protected abstract void startTransaction()
protected abstract void commit()
protected abstract com.epimorphics.appbase.security.BaseUserStore.UserRecord getRecord(String id)
public UserInfo getUser(String id)
UserStorepublic org.apache.shiro.authc.SaltedAuthenticationInfo checkUser(String id)
UserStorepublic String createCredentials(String id, int minstolive)
UserStoreYes, the return ought to be a char[] to allow for reseting but the use case will be creating string serializations of the key in any case to send it out so the added security of using char[] is zero.
createCredentials in interface UserStoreprotected void checkSubjectControls(String path)
public boolean register(UserInfo user)
UserStorepublic abstract boolean doRegister(UserInfo user)
public void unregister(String id)
UserStoreunregister in interface UserStorepublic abstract void doUnregister(String id)
public void setCredentials(String id, org.apache.shiro.util.ByteSource credentials, int minstolive)
UserStoresetCredentials in interface UserStoreid - the openid identifier string authenticated by the usercredentials - the password to storeminstolive - the time-to-livefor the credentials in minutespublic abstract void doSetCredentials(String id, org.apache.shiro.util.ByteSource credentials, int minstolive)
public void removeCredentials(String id)
UserStoreremoveCredentials in interface UserStorepublic abstract void doRemoveCredentials(String id)
public void addPermision(String id, String permission)
UserStoreaddPermision in interface UserStorepublic void removePermissionsOn(String id, String path)
UserStoreremovePermissionsOn in interface UserStorepublic void removePermission(String id, String permission)
UserStoreremovePermission in interface UserStoreCopyright © 2015. All rights reserved.