Top Description Fields Constructors Methods
org.eclipse.jetty.security

public Class HashLoginService

extends AbstractLoginService
Class Inheritance
Imports
java.util.List, org.eclipse.jetty.util.resource.Resource, org.slf4j.Logger, .LoggerFactory

An implementation of a LoginService that stores users and roles in-memory in HashMaps. The source of the users and roles information is a properties file formatted like so:
 username: password [,rolename ...]
Passwords may be clear text, obfuscated or checksummed. The class com.eclipse.Util.Password should be used to generate obfuscated passwords or password checksums.

If DIGEST Authentication is used, the password must be in a recoverable format, either plain text or OBF:.

Field Summary

Modifier and TypeField and Description
private Resource
private int
private UserStore
private boolean
private static final Logger
Inherited from org.eclipse.jetty.security.AbstractLoginService:
_fullValidate_identityService_name

Constructor Summary

AccessConstructor and Description
public
public
public

Method Summary

Modifier and TypeMethod and Description
protected void
doStart()

Overrides org.eclipse.jetty.util.component.ContainerLifeCycle.doStart.

Starts the managed lifecycle beans in the order they were added.
protected void
doStop()

Overrides org.eclipse.jetty.util.component.ContainerLifeCycle.doStop.

Stops the managed lifecycle beans in the reverse order they were added.
public Resource
public int

Returns:

the scan interval in seconds for reloading the property file.
getReloadInterval
()

Get the scan interval in seconds for reloading the property file..

pack-priv UserStore

Returns:

the UserStore
getUserStore
()

To facilitate testing.

public boolean

Returns:

true if hot reload was enabled before startup
isHotReload
()

Deprecated use getReloadInterval()
Is hot reload enabled on this user store
pack-priv boolean

Returns:

true if a UserStore has been created from a config, false if a UserStore was provided.
isUserStoreAutoCreate
()

protected List<RolePrincipal>
protected UserPrincipal
public void
setConfig(Resource
uri or url or path to realm properties file
config
)

Load users from properties file.

public void
setHotReload(boolean
true to enable 1s refresh interval, false to disable
enable
)

Deprecated use setReloadInterval(int)
Enable Hot Reload of the Property File
public void
setReloadInterval(int
Set the scan interval in seconds for reloading the property file.
reloadIntervalSeconds
)

public void
setUserStore(UserStore
the UserStore implementation to use
userStore
)

Configure the UserStore implementation to use.

Inherited from org.eclipse.jetty.security.AbstractLoginService:
getIdentityServicegetNameisFullValidateloginlogoutsetFullValidatesetIdentityServicesetNametoStringvalidate

Field Detail

_configback to summary
private Resource _config
_reloadIntervalback to summary
private int _reloadInterval
_userStoreback to summary
private UserStore _userStore
_userStoreAutoCreateback to summary
private boolean _userStoreAutoCreate
LOGback to summary
private static final Logger LOG

Hides org.eclipse.jetty.util.component.ContainerLifeCycle.LOG.

Constructor Detail

HashLoginServiceback to summary
public HashLoginService()
HashLoginServiceback to summary
public HashLoginService(String name)
HashLoginServiceback to summary
public HashLoginService(String name, Resource config)

Method Detail

doStartback to summary
protected void doStart() throws Exception

Overrides org.eclipse.jetty.util.component.ContainerLifeCycle.doStart.

Doc from org.eclipse.jetty.util.component.ContainerLifeCycle.doStart.

Starts the managed lifecycle beans in the order they were added.

Annotations
@Override
Exceptions
Exception:

Doc from org.eclipse.jetty.util.component.AbstractLifeCycle.doStart.

If there was a problem starting. Will cause a transition to FAILED state

doStopback to summary
protected void doStop() throws Exception

Overrides org.eclipse.jetty.util.component.ContainerLifeCycle.doStop.

Doc from org.eclipse.jetty.util.component.ContainerLifeCycle.doStop.

Stops the managed lifecycle beans in the reverse order they were added.

Annotations
@Override
Exceptions
Exception:

Doc from org.eclipse.jetty.util.component.AbstractLifeCycle.doStop.

If there was a problem stopping. Will cause a transition to FAILED state

getConfigback to summary
public Resource getConfig()
getReloadIntervalback to summary
public int getReloadInterval()

Get the scan interval in seconds for reloading the property file..

Returns:int

the scan interval in seconds for reloading the property file.

getUserStoreback to summary
pack-priv UserStore getUserStore()

To facilitate testing.

Returns:UserStore

the UserStore

isHotReloadback to summary
public boolean isHotReload()

Deprecated

use getReloadInterval()

Is hot reload enabled on this user store

Returns:boolean

true if hot reload was enabled before startup

Annotations
@Deprecated
isUserStoreAutoCreateback to summary
pack-priv boolean isUserStoreAutoCreate()
Returns:boolean

true if a UserStore has been created from a config, false if a UserStore was provided.

loadRoleInfoback to summary
protected List<RolePrincipal> loadRoleInfo(UserPrincipal user)

Implements abstract org.eclipse.jetty.security.AbstractLoginService.loadRoleInfo.

Annotations
@Override
loadUserInfoback to summary
protected UserPrincipal loadUserInfo(String userName)

Implements abstract org.eclipse.jetty.security.AbstractLoginService.loadUserInfo.

Annotations
@Override
setConfigback to summary
public void setConfig(Resource config)

Load users from properties file.

The property file maps usernames to password specs followed by an optional comma separated list of role names.

Parameters
config:Resource

uri or url or path to realm properties file

setHotReloadback to summary
public void setHotReload(boolean enable)

Deprecated

use setReloadInterval(int)

Enable Hot Reload of the Property File

Parameters
enable:boolean

true to enable 1s refresh interval, false to disable

Annotations
@Deprecated
setReloadIntervalback to summary
public void setReloadInterval(int reloadIntervalSeconds)
Parameters
reloadIntervalSeconds:int

Set the scan interval in seconds for reloading the property file.

setUserStoreback to summary
public void setUserStore(UserStore userStore)

Configure the UserStore implementation to use. If none, for backward compat if none the PropertyUserStore will be used

Parameters
userStore:UserStore

the UserStore implementation to use