Package org.apache.wiki.auth
Class SecurityVerifier
java.lang.Object
org.apache.wiki.auth.SecurityVerifier
Helper class for verifying JSPWiki's security configuration. Invoked by
admin/SecurityConfig.jsp
.- Since:
- 2.4
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Message prefix for errors.static final String
Message topic for user database errors.static final String
Message topic for group database errors.static final String
Message topic for JAAS errors.static final String
Message topic for policy errors.static final String
Message topic for role-checking errors.static final String
Message prefix for information messages.static final String
Message topic for user database information messages.static final String
Message topic for group database information messages.static final String
Message topic for JAAS information messages.static final String
Message topic for policy information messages.static final String
Message topic for role-checking information messages.static final String
Message prefix for warnings.static final String
Message topic for user database warnings.static final String
Message topic for group database warnings.static final String
Message topic for JAAS warnings.static final String
Message topic for policy warnings. -
Constructor Summary
ConstructorsConstructorDescriptionSecurityVerifier
(Engine engine, Session session) Constructs a new SecurityVerifier for a supplied Engine and WikiSession. -
Method Summary
Modifier and TypeMethodDescriptionFormats and returns an HTML table containing the roles the web container is aware of, and whether each role maps to particular JSPs.boolean
Returnstrue
if the Java security policy is configured correctly, and it verifies as valid.Returns an array of unique Principals from the JSPWIki security policy file.Formats and returns an HTML table containing sample permissions and what roles are allowed to have them.If the active Authorizer is the WebContainerAuthorizer, returns the roles it knows about; otherwise, a zero-length array.
-
Field Details
-
ERROR
Message prefix for errors.- See Also:
-
WARNING
Message prefix for warnings.- See Also:
-
INFO
Message prefix for information messages.- See Also:
-
ERROR_POLICY
Message topic for policy errors.- See Also:
-
WARNING_POLICY
Message topic for policy warnings.- See Also:
-
INFO_POLICY
Message topic for policy information messages.- See Also:
-
ERROR_JAAS
Message topic for JAAS errors.- See Also:
-
WARNING_JAAS
Message topic for JAAS warnings.- See Also:
-
ERROR_ROLES
Message topic for role-checking errors.- See Also:
-
INFO_ROLES
Message topic for role-checking information messages.- See Also:
-
ERROR_DB
Message topic for user database errors.- See Also:
-
WARNING_DB
Message topic for user database warnings.- See Also:
-
INFO_DB
Message topic for user database information messages.- See Also:
-
ERROR_GROUPS
Message topic for group database errors.- See Also:
-
WARNING_GROUPS
Message topic for group database warnings.- See Also:
-
INFO_GROUPS
Message topic for group database information messages.- See Also:
-
INFO_JAAS
Message topic for JAAS information messages.- See Also:
-
-
Constructor Details
-
SecurityVerifier
Constructs a new SecurityVerifier for a supplied Engine and WikiSession.- Parameters:
engine
- the wiki enginesession
- the wiki session (typically, that of an administrator)
-
-
Method Details
-
policyPrincipals
Returns an array of unique Principals from the JSPWIki security policy file. This array will be zero-length if the policy file was not successfully located, or if the file did not specify any Principals in the policy.- Returns:
- the array of principals
-
policyRoleTable
Formats and returns an HTML table containing sample permissions and what roles are allowed to have them. This method will throw anIllegalStateException
if the authorizer is not of typeWebContainerAuthorizer
- Returns:
- the formatted HTML table containing the result of the tests
-
containerRoleTable
Formats and returns an HTML table containing the roles the web container is aware of, and whether each role maps to particular JSPs. This method throws anIllegalStateException
if the authorizer is not of typeWebContainerAuthorizer
- Returns:
- the formatted HTML table containing the result of the tests
- Throws:
WikiException
- if tests fail for unexpected reasons
-
isSecurityPolicyConfigured
Returnstrue
if the Java security policy is configured correctly, and it verifies as valid.- Returns:
- the result of the configuration check
-
webContainerRoles
If the active Authorizer is the WebContainerAuthorizer, returns the roles it knows about; otherwise, a zero-length array.- Returns:
- the roles parsed from
web.xml
, or a zero-length array - Throws:
WikiException
- if the web authorizer cannot obtain the list of roles
-