|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ecyrd.jspwiki.auth.SecurityVerifier
public class SecurityVerifier
Helper class for verifying JSPWiki's security configuration. Invoked by
admin/SecurityConfig.jsp
.
Field Summary | |
---|---|
static String |
ERROR
|
static String |
ERROR_DB
|
static String |
ERROR_JAAS
|
static String |
ERROR_POLICY
|
static String |
ERROR_ROLES
|
static String |
INFO
|
static String |
INFO_DB
|
static String |
INFO_JAAS
|
static String |
INFO_POLICY
|
static String |
INFO_ROLES
|
static String |
WARNING
|
static String |
WARNING_DB
|
static String |
WARNING_JAAS
|
static String |
WARNING_POLICY
|
Constructor Summary | |
---|---|
SecurityVerifier(WikiEngine engine,
WikiSession session)
|
Method Summary | |
---|---|
String |
containerRoleTable()
Formats and returns an HTML table containing the roles the web container is aware of, and whether each role maps to particular JSPs. |
protected File |
getFileFromProperty(String property)
|
protected boolean |
isJaasConfigurationAvailable(String config)
Returns true if JSPWiki can locate a named JAAS login
configuration. |
boolean |
isJaasConfigured()
Returns true if JAAS is configured correctly. |
boolean |
isJaasConfiguredAtStartup()
Returns true if the JAAS login configuration was already
set when JSPWiki started up. |
boolean |
isSecurityPolicyConfigured()
Returns true if the Java security policy is configured
correctly, and it verifies as valid. |
boolean |
isSecurityPolicyConfiguredAtStartup()
Returns true if the Java security policy file was already
set when JSPWiki started up. |
File |
jaasConfiguration()
Returns the location of the JAAS configuration file if and only if the java.security.auth.login.config is set and the
file it points to exists in the file system; returns null
in all other cases. |
Principal[] |
policyPrincipals()
Returns an array of unique Principals from the JSPWIki security policy file. |
String |
policyRoleTable()
Formats and returns an HTML table containing sample permissions and what roles are allowed to have them. |
File |
securityPolicy()
Returns the location of the Java security policy file if and only if the java.security.policy is set and the file it
points to exists in the file system; returns null in all
other cases. |
protected void |
verifyJaas()
Verfies the JAAS configuration. |
protected void |
verifyPolicy()
Verfies the Java security policy configuration. |
protected void |
verifyPolicyAndContainerRoles()
Verifies that the roles given in the security policy are reflected by the container web.xml file. |
protected boolean |
verifyStaticPermission(Principal principal,
Permission permission)
Verifies that a particular Principal possesses a Permission, as defined in the security policy file. |
protected void |
verifyUserDatabase()
Verifies that the user datbase was initialized properly, and that user add and delete operations work as they should. |
Principal[] |
webContainerRoles()
If the active Authorizer is the WebContainerAuthorizer, returns the roles it knows about; otherwise, a zero-length array. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String ERROR
public static final String WARNING
public static final String INFO
public static final String ERROR_POLICY
public static final String WARNING_POLICY
public static final String INFO_POLICY
public static final String ERROR_JAAS
public static final String WARNING_JAAS
public static final String ERROR_ROLES
public static final String INFO_ROLES
public static final String ERROR_DB
public static final String WARNING_DB
public static final String INFO_DB
public static final String INFO_JAAS
Constructor Detail |
---|
public SecurityVerifier(WikiEngine engine, WikiSession session)
Method Detail |
---|
public final Principal[] policyPrincipals()
public String policyRoleTable()
IllegalStateException
- if the authorizer is not of type
WebContainerAuthorizer
public String containerRoleTable()
IllegalStateException
- if the authorizer is not of type
WebContainerAuthorizer
public final boolean isJaasConfigured()
true
if JAAS is configured correctly.
public final boolean isJaasConfiguredAtStartup()
true
if the JAAS login configuration was already
set when JSPWiki started up. We determine this value by consulting a
protected member field of AuthenticationManager
, which was set
at in initialization by PolicyLoader
.
true
if PolicyLoader
successfully set the
policy, or false
for any other reason.protected boolean isJaasConfigurationAvailable(String config)
true
if JSPWiki can locate a named JAAS login
configuration.
config
- the name of the application (e.g.,
JSPWiki-container
).
true
if found; false
otherwisepublic final boolean isSecurityPolicyConfigured()
true
if the Java security policy is configured
correctly, and it verifies as valid.
public final boolean isSecurityPolicyConfiguredAtStartup()
true
if the Java security policy file was already
set when JSPWiki started up. We determine this value by consulting a
protected member field of AuthenticationManager
, which was set
at in initialization by PolicyLoader
.
true
if PolicyLoader
successfully set the
policy, or false
for any other reason.public final Principal[] webContainerRoles()
web.xml
, or a zero-length arrayprotected void verifyPolicyAndContainerRoles()
web.xml
file.
protected void verifyJaas()
java.security.auth.login.config
resolves to an existing file, and we can find the JAAS login
configurations for JSPWiki-container
and
JSPWiki-custom
.
protected File getFileFromProperty(String property)
protected void verifyPolicy()
java.security.policy
resolves to an existing file, and the policy file that this file
represents a valid policy.
protected boolean verifyStaticPermission(Principal principal, Permission permission)
principal
- the principalpermission
- the permission
protected void verifyUserDatabase()
public final File jaasConfiguration()
java.security.auth.login.config
is set and the
file it points to exists in the file system; returns null
in all other cases.
public final File securityPolicy()
java.security.policy
is set and the file it
points to exists in the file system; returns null
in all
other cases.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |