|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.idoox.wasp.WaspSecurity.SPI
This class defines the Service Provider Interface (SPI) for the
WaspSecurity
class.
All the abstract methods in this class must be implemented by each
WaspSecurity provider.
Field Summary | |
protected static java.lang.String[] |
STRAR_0
String array of length 0, it can be safely reused and returned by extenders. |
Constructor Summary | |
protected |
WaspSecurity.SPI()
Does nothing. |
Method Summary | |
protected abstract Credentials |
acquireClientCredentials(java.lang.String userName,
java.lang.String authData,
java.lang.String authenticationMechanism)
Creates client credentials for given name, password and authentication mechanism. |
protected abstract Credentials |
acquireServerCredentials(java.lang.String userName,
java.lang.String authData,
java.lang.String authenticationMechanism)
Creates server credentials for given name, password and authentication mechanism. |
protected abstract void |
checkPermission(java.security.Permission perm)
Determines whether the access request indicated by the specified permission should be allowed or denied, based on the security WSO2 SOA Enablement Server policy currently in effect. |
protected abstract java.lang.String[] |
getAcceptingProviders(ServiceEndpointContext serviceEndpointContext)
Returns names of the current service endpoint accepting security providers or current execution context accepting security providers, if the parameter is null . |
protected java.lang.String[] |
getAnRequirementsForEndpoint(java.lang.String serverURL,
java.lang.String serviceEndpointPath)
Returns authentication requirements for specified web service endpoint in the context of server URL. |
protected abstract java.lang.String[] |
getAnRequirementsForEndpoint(java.lang.String serverURL,
java.lang.String serviceEndpointPath,
boolean isGetTransportMethod)
Returns authentication requirements for specified web service endpoint in the context of server URL and transport method. |
protected abstract Credentials[] |
getCredentials(ServiceClient serviceClient)
Returns array of Credentials which were previously set on service client or execution context, if the parameter is null . |
protected abstract java.security.PermissionCollection |
getDefaultPrincipalPermissions()
Returns set of permissions for unauthenticated users, using another words, permissions for default principal. |
protected abstract java.lang.String |
getInitiatingProvider(ServiceClient serviceClient)
Returns initiating provider, which was previously set on service client or execution context, if the first parameter is null . |
protected abstract java.lang.String |
getInitiatingProvider(ServiceEndpointContext serviceEndpointContext)
Returns initiating provider, which was previously set on service endpoint context or execution context, if the first parameter is null . |
protected abstract java.util.Map |
getInstalledSecurityInfo()
Gets metadata information about installed security. |
protected java.security.Principal |
getInvokerFirstPrincipal()
This method can be invoked on the service side to determine service invoker identified as his first principal. |
protected java.util.Iterator |
getInvokerPrincipals()
This method can be on the service side to determine service invoker principals. |
protected abstract javax.security.auth.Subject |
getInvokerSubject()
Returns subject representing invoker. |
protected abstract Configurable |
getProviderProperties(ServiceClient serviceClient,
java.lang.String providerName)
Returns properties of security providers that are determined by the given instance of Configurable. |
protected abstract Configurable |
getProviderProperties(ServiceEndpointContext serviceEndpointContext,
java.lang.String providerName)
Returns properties of security providers that are determined by the given instance of Configurable. |
protected abstract java.lang.Class |
getProviderPropertiesIface(java.lang.String providerName)
Returns configuration class of the given provider. |
protected boolean |
isAppCredentialsSet()
Returns true if the application code already sets credentials, false otherwise. |
protected abstract boolean |
isAuthorizationRequired(ServiceEndpointContext serviceEndpointContext)
It determines whether automatic authorization for given service endpoint context is on. |
protected abstract java.util.Properties |
modifyLookupProperties(java.util.Properties lookupProperties)
This method is used to modify security properties for lookup, like HTTP proxy name and password. |
protected abstract void |
resetCredentials()
Resets client credentials in the current execution context. |
protected abstract void |
setAcceptingProviders(ServiceEndpointContext serviceEndpointContext,
java.lang.String[] providerNames)
Sets accepting security providers for the given web service context. |
protected abstract void |
setAuthorizationRequired(ServiceEndpointContext serviceEndpointContext,
boolean authorizationRequired)
Turns on or off automatic authorization for given service endpoint context. |
protected abstract void |
setCredentials(ServiceClient serviceClient,
Credentials[] creds)
Sets Credentials for given service client instance or the whole execution context, if the first parameter is null . |
protected abstract void |
setCredentials(ServiceEndpointContext serviceEndpointContext,
Credentials[] creds)
Set credentials for the given service endpoint context or default service execution context. |
protected abstract void |
setInitiatingProvider(ServiceClient serviceClient,
java.lang.String providerName)
Sets initiating provider for service client or to the execution context depending on the first parameter value. |
protected abstract void |
setInitiatingProvider(ServiceEndpointContext serviceEndpointContext,
java.lang.String providerName)
Sets initiating security provider for the given service endpoint context. |
protected abstract void |
setProviderProperties(ServiceClient serviceClient,
Configurable config,
java.lang.String providerName)
Sets properties of security providers that are determined by the given instance of Configurable. |
protected abstract void |
setProviderProperties(ServiceClient serviceClient,
java.util.Map properties)
Sets properties for security providers, these properties are provider specific and they are applied only for given service client. |
protected abstract void |
setProviderProperties(ServiceEndpointContext serviceEndpointContext,
Configurable config,
java.lang.String providerName)
Sets properties of security providers that are determined by the given instance of Configurable. |
protected abstract void |
setProviderProperties(ServiceEndpointContext serviceEndpointContext,
java.util.Map properties)
Sets properties for security providers, these properties are provider specific and they are applied only for service endpoint context. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final java.lang.String[] STRAR_0
Constructor Detail |
protected WaspSecurity.SPI()
Method Detail |
protected abstract java.util.Map getInstalledSecurityInfo()
"AUTHENTICATION_SUPPORTED"
"true"
means that authentication is supported."AUTHORIZATION_SUPPORTED"
"true"
means that authorization is supported.
WaspSecurity
classprotected abstract java.security.PermissionCollection getDefaultPrincipalPermissions() throws java.security.AccessControlException
java.security.AccessControlException
- security policy disallows to get default principal permissionsprotected abstract java.lang.String getInitiatingProvider(ServiceClient serviceClient)
null
.
It none was set, this method returns null
.
serviceClient
- service client, or null
to use execution context
null
if no provider is usedprotected abstract java.lang.String getInitiatingProvider(ServiceEndpointContext serviceEndpointContext)
null
.
It none was set, this method returns null
.
serviceEndpointContext
- service endpoint context, or null
to use execution context
null
if no provider is usedprotected abstract java.lang.String[] getAcceptingProviders(ServiceEndpointContext serviceEndpointContext)
null
.
serviceEndpointContext
- service context or null
to use execution context
protected abstract java.util.Properties modifyLookupProperties(java.util.Properties lookupProperties)
HTTP_BASIC_USER_NAME
HTTP_BASIC_PASSWORD
lookupProperties
- current lookup properties, can be null
null
protected abstract javax.security.auth.Subject getInvokerSubject()
null
, if the invoker is unknowngetInvokerFirstPrincipal()
,
getInvokerPrincipals()
protected abstract void setAuthorizationRequired(ServiceEndpointContext serviceEndpointContext, boolean authorizationRequired) throws java.security.NoSuchProviderException
serviceEndpointContext
- service endpoint contextauthorizationRequired
- true
, if authorization is required,
false
if it is not
java.security.NoSuchProviderException
- authorization settings cannot be setprotected abstract boolean isAuthorizationRequired(ServiceEndpointContext serviceEndpointContext) throws java.security.NoSuchProviderException
serviceEndpointContext
- service context
true
, if authorization is required, false
is it is not
java.security.NoSuchProviderException
- authorization settings cannot be determinedprotected abstract void setAcceptingProviders(ServiceEndpointContext serviceEndpointContext, java.lang.String[] providerNames) throws java.security.NoSuchProviderException
null
.
serviceEndpointContext
- service endpoint context, it can be null
to set them
to current service execution contextproviderNames
- names of security providers, empty array and null
value can be accepted to set no providers
java.security.NoSuchProviderException
- if there is some provider, which is not configured or
not accessibleprotected abstract void setInitiatingProvider(ServiceEndpointContext serviceEndpointContext, java.lang.String providerName) throws java.security.NoSuchProviderException
null
.
serviceEndpointContext
- web service context, it can be null
to set them
to current webservice endpoint contextproviderName
- provider name or null
to set no provider
java.security.NoSuchProviderException
- the provider, identified by providerName, is not configured or
not accessibleprotected abstract void setCredentials(ServiceEndpointContext serviceEndpointContext, Credentials[] creds)
serviceEndpointContext
- service endpoint context, or null
to use
current service execution contextcreds
- credentials to set to endpoint context, empty array or null
value can be used to reset credentials associated with service contextprotected abstract Credentials acquireClientCredentials(java.lang.String userName, java.lang.String authData, java.lang.String authenticationMechanism) throws java.security.NoSuchProviderException
setCredentials(Object,Credentials[])
method.
userName
- user name, can be null
authData
- authentication data, e.g. password of the user, can be null
authenticationMechanism
- authentication mechanism (e.g.
"SSL" or "HttpBasic")
true
if the credentials can be created for
given authentication mechanism, user name and password,
false
otherwise
java.security.NoSuchProviderException
- if there is no provider for
specified authentication mechanismprotected abstract Credentials acquireServerCredentials(java.lang.String userName, java.lang.String authData, java.lang.String authenticationMechanism) throws java.security.NoSuchProviderException
setCredentials(WSContext,Credentials[])
method.
userName
- user name or alias, can be null
authData
- authentication data, e.g. password of the user, can be null
authenticationMechanism
- authentication mechanism (e.g.
"SSL" or "HttpBasic")
java.security.NoSuchProviderException
- if there is no provider for
specified authentication mechanismprotected abstract Credentials[] getCredentials(ServiceClient serviceClient)
null
.
If none were set, this method returns null
.
serviceClient
- service client, or null
to to use execution context
null
.protected abstract void setCredentials(ServiceClient serviceClient, Credentials[] creds)
null
. This method only sets credentials.
serviceClient
- service client, or null
to set them to
execution contextcreds
- array of Credentials to be set for service client, can be null
setInitiatingProvider(ServiceClient,String)
protected abstract void setInitiatingProvider(ServiceClient serviceClient, java.lang.String providerName) throws java.security.NoSuchProviderException
serviceClient
- service client, can be null
to set
default client security providerproviderName
- provider name or null
to set no provider
java.security.NoSuchProviderException
- if there is no provider for
specified authentication mechanismprotected abstract void setProviderProperties(ServiceClient serviceClient, java.util.Map properties)
true
0
false
true
true
serviceClient
- service client, cannot be null
properties
- properties to setprotected abstract void setProviderProperties(ServiceEndpointContext serviceEndpointContext, java.util.Map properties)
true
0
false
true
true
serviceEndpointContext
- service endpoint context, cannot be null
properties
- properties to setprotected abstract void setProviderProperties(ServiceEndpointContext serviceEndpointContext, Configurable config, java.lang.String providerName) throws java.security.NoSuchProviderException
config
object is then narrowed to corresponding
configuration interface.
This method is usually used for configuration, integration,... In most cases, users
needn't to use this method.
serviceEndpointContext
- service endpoint context, cannot be null
config
- the configurable object that determines provider propertiesproviderName
- name of the security provider to set the properties
java.security.NoSuchProviderException
protected abstract Configurable getProviderProperties(ServiceEndpointContext serviceEndpointContext, java.lang.String providerName)
config
object is then narrowed to corresponding
configuration interface.
This method is usually used for configuration, integration,... In most cases, users
needn't to use this method.
serviceEndpointContext
- service endpoint context, cannot be null
providerName
- name of the security provider to get the properties
Configurable
instanceprotected abstract void setProviderProperties(ServiceClient serviceClient, Configurable config, java.lang.String providerName) throws java.security.NoSuchProviderException
config
object is then narrowed to corresponding
configuration interface.
This method is usually used for configuration, integration,... In most cases, users
needn't to use this method.
serviceClient
- service client, cannot be null
config
- the configurable object that determines provider propertiesproviderName
- name of the security provider to set the properties
java.security.NoSuchProviderException
protected abstract Configurable getProviderProperties(ServiceClient serviceClient, java.lang.String providerName)
config
object is then narrowed to corresponding
configuration interface.
This method is usually used for configuration, integration,... In most cases, users
needn't to use this method.
serviceClient
- service client, cannot be null
providerName
- name of the security provider to get the properties
Configurable
instanceprotected abstract void resetCredentials()
protected java.lang.String[] getAnRequirementsForEndpoint(java.lang.String serverURL, java.lang.String serviceEndpointPath) throws WebServiceLookupException
WebServiceLookupException
can be thrown.
The getAnRequirementsForEndpoint(String,String,false
)
method is invoked by
default.
serverURL
- server URL (e.g. "http://localhost:6060"), can be null
to use
local serverserviceEndpointPath
- service endpoint path (e.g.
"/admin/DeployService"), can be null
to query default authentication requirements
WebServiceLookupException
- unable to lookup the service providing endpoint security informationprotected abstract java.lang.String[] getAnRequirementsForEndpoint(java.lang.String serverURL, java.lang.String serviceEndpointPath, boolean isGetTransportMethod) throws WebServiceLookupException
WebServiceLookupException
can be thrown.
serverURL
- server URL (e.g. "http://localhost:6060"), can be null
to use
local serverserviceEndpointPath
- service endpoint path (e.g.
"/admin/DeployService"), can be null
to query default authentication requirementsisGetTransportMethod
- true
in the case that it must consider GET
transport, false
otherwise
WebServiceLookupException
- unable to lookup the service providing endpoint security informationprotected abstract void checkPermission(java.security.Permission perm) throws java.security.AccessControlException
AccessControlException
otherwise.
Default implementation allows every permission.
perm
- the requested permission (should not be null
)
java.security.AccessControlException
- if the specified permission
is not permitted, based on the current security policyprotected abstract java.lang.Class getProviderPropertiesIface(java.lang.String providerName) throws java.security.NoSuchProviderException
providerName
- provider name
java.security.NoSuchProviderException
protected boolean isAppCredentialsSet()
true
if the application code already sets credentials, false
otherwise.
This method is used by WSO2 SOA Enablement Server Core to determine, whether default credentials should be obtained. So this code
is neccessary according to priorities of credential obtaining. Credentials set by application MUST
be used first, if no credentials were set, WSO2 SOA Enablement Server is allowed to create and set default credentials using the
aquireCredentials
and
setCredentials((Object)null, Credentials[])
methods. The
aquireCredentials
is invoked using System properties
wasp.username
, wasp.password
and wasp.securityMechanism
.
Note, that WSO2 SOA Enablement Server invokes this method only in the case that wasp.username
System property is set. The implemenation provided inside this methods checks if
the getCredentials(null)
returns some credentials (array
of length greater than zero) to determine return value.
true
if application were set already client credentials, false
otherwiseprotected java.security.Principal getInvokerFirstPrincipal()
null
, if invoker identity
is unknowngetInvokerPrincipals()
,
getInvokerSubject()
protected java.util.Iterator getInvokerPrincipals()
null
if the invoker identity is unknowngetInvokerFirstPrincipal()
,
getInvokerSubject()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |