|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecteu.emi.dsr.security.SecurityManager
public final class SecurityManager
access to security components
| Nested Class Summary | |
|---|---|
static class |
SecurityManager.NullAuthoriser
|
| Field Summary | |
|---|---|
static String |
DISABLE_SECURITY_AND_ACCESS_CONTROL
for unit testing, set this property to "true" to disable security |
static Pattern |
pattern
|
protected static String |
proxyRE
|
| Method Summary | |
|---|---|
static void |
addCallback(AttributeHandlingCallback aac)
add a callback class for dealing with additional security attributes |
static void |
addSOAPActionsRequiringSignatures(String... actions)
add SOAP actions to the special list requiring signed messages |
static void |
checkAuthentication(SecurityTokens tokens,
String action,
ResourceDescriptor d)
check whether authentication is OK and conforms to this server's policies |
static void |
checkAuthorisation(Client c,
String action,
ResourceDescriptor d)
Check access by evaluating the XACML policies. |
static void |
clearLocalCall()
for the current thread, clear the "local call" flag |
static Client |
createAndAuthoriseClient(SecurityTokens tokens)
Create an authorised Client object. |
static void |
createAttributeSource()
Creates AttributeSource used for establishing clients' attributes. |
static SubjectAttributesHolder |
establishAttributes(SecurityTokens tokens)
Returns an attribute map for a set of security tokens from the configured Attribute Source |
static IAttributeSource |
getAtributeSource()
get the attribute source |
static String |
getAuthoriserConnectionStatus()
get a human-readable description of the current status of the configured authorisers. |
static RegistryPDP |
getPDP()
get the XACML policy decision point |
static X509Certificate |
getPeerCertificate(String url,
ISecurityProperties security)
|
static X509Certificate |
getPeerCertificate(String url,
ISecurityProperties security,
int timeout)
helper to get the certificate on the other side of a SSL connection to "url" |
static X509Certificate |
getServerCert()
get the certificate of the server |
static String |
getServerDistinguishedName()
get the X500 name of the server in human-friendly form, i.e. |
static X500Principal |
getServerIdentity()
get the server's identity, or null if
no server keystore has been configured
makeAnonymousClient |
protected static Role |
getServerRole()
server role |
static String[] |
getTrustedCertificateDNs()
|
static boolean |
isAccessControlEnabled()
|
static boolean |
isAccessible(Client client,
String serviceName,
String wsResourceID,
String owner)
Can the given client access the given (server-local!) endpoint? This will not give the correct result if the action plays a role |
static boolean |
isAdmin(Client c)
checks whether the given client has the "admin" role |
static boolean |
isLocalCall()
check whether the current request is local (i.e. |
static boolean |
isProxyDN(String dn)
|
static boolean |
isServer(CertPath path)
checks whether the given CertPath is the server identity |
static boolean |
isServer(Client c)
checks whether the given client has the server identity |
static boolean |
isServer(X509Certificate cert)
checks whether the given certificate is the server identity |
protected static Client |
makeAnonymousClient(String dn)
a special client useful for anonymous requests |
static boolean |
needSignature(String soapAction)
|
static void |
registerAuthNCheckingStrategies(AuthNCheckingStrategy... strategies)
register checking strategies |
static void |
setAccessControlEnabled(boolean isAccessControlEnabled)
|
static void |
setLocalCall()
for the current thread, set the "local call" flag. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String DISABLE_SECURITY_AND_ACCESS_CONTROL
protected static final String proxyRE
public static final Pattern pattern
| Method Detail |
|---|
public static void addCallback(AttributeHandlingCallback aac)
aac - - an AttributeHandlingCallbackpublic static X509Certificate getServerCert()
public static X500Principal getServerIdentity()
null if
no server keystore has been configured
makeAnonymousClient
X500Principal or nullgetServerCert()public static String getServerDistinguishedName()
getServerIdentity()public static String[] getTrustedCertificateDNs()
public static RegistryPDP getPDP()
XacmlPDP
public static SubjectAttributesHolder establishAttributes(SecurityTokens tokens)
throws Exception
tokens -
Exception
public static void createAttributeSource()
throws Exception
Exceptionpublic static Client createAndAuthoriseClient(SecurityTokens tokens)
tokens - - Security tokens
protected static Role getServerRole()
protected static Client makeAnonymousClient(String dn)
public static void checkAuthentication(SecurityTokens tokens,
String action,
ResourceDescriptor d)
tokens - - SecurityTokens from the requestaction - - the method being invokedd - - the resource being accessedpublic static void registerAuthNCheckingStrategies(AuthNCheckingStrategy... strategies)
strategies - - AuthNCheckingStrategy objects
public static void checkAuthorisation(Client c,
String action,
ResourceDescriptor d)
throws AuthorisationException
AuthorisationException is thrown.
c - action - d -
AuthorisationException
public static boolean isAccessible(Client client,
String serviceName,
String wsResourceID,
String owner)
throws Exception
client - - the clientserviceName - - can be nullwsResourceID - - can be null
Exceptionpublic static void setLocalCall()
SecurityManager.setLocalCall();
try{
//... perform call
}
finally{
SecurityManager.clearLocalCall();
}
public static void clearLocalCall()
public static boolean isLocalCall()
public static boolean isServer(Client c)
public static boolean isServer(X509Certificate cert)
public static boolean isServer(CertPath path)
public static boolean isAdmin(Client c)
public static X509Certificate getPeerCertificate(String url,
ISecurityProperties security)
public static X509Certificate getPeerCertificate(String url,
ISecurityProperties security,
int timeout)
url - - the URL to connect tosecurity - - the IUASSecurityProperties to usetimeout - - the time to wait for a connection before giving uppublic static boolean isAccessControlEnabled()
public static void setAccessControlEnabled(boolean isAccessControlEnabled)
public static String getAuthoriserConnectionStatus()
throws Exception
Exception
public static IAttributeSource getAtributeSource()
throws Exception
Exceptionpublic static boolean isProxyDN(String dn)
public static void addSOAPActionsRequiringSignatures(String... actions)
actions - public static boolean needSignature(String soapAction)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||