|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuk.ac.soton.itinnovation.grid.types.MatchRule
public class MatchRule
A rule used in determining whether a user has a process role.
When determining whether a SOAP operation should be permitted, the
PBAC PDP must first find the
set of process roles which the caller has in the context of the resource.
This is done by evaluating each of the resource's MatchRules.
There are various different types of MatchRule, although all are handled by this single class, rather than with subclasses:
World matches match anyone at all.
Wildcarded issuer matches match anyone whose identity is vouched for by a particular CA. This could be used to ensure that people can't open new accounts under bogus names, for example.
Specific subject matches only match someone with that exact distinguished name (DN), signed by a given CA. Note that only the distinguished name is taken from the user's certificate, not their public key. If the user generates a new key they can still get the role, provided it has the same DN and is signed by the same issuer. This allows the use of short-lived X.509 user certificates.
Group matches match anyone who is a member of the specified group. Each
group is itself a resource, and has its own set of match rules to determine
who is a member. See GroupUtils
for more details about groups.
SAML attribute matches match anyone who presents a SAML assertion signed by a given authority, stating that they have the specified attribute.
Note: MatchRule is being phased out and replaced by the MatchPattern
and PolicyRule classes.
| Constructor Summary | |
|---|---|
MatchRule()
Create an empty match rule. |
|
MatchRule(MatchPattern pattern,
String processRole,
boolean deny)
Create a rule from a pattern. |
|
MatchRule(MatchRule rule)
Create a rule based on an existing one. |
|
MatchRule(PolicyRule rule)
|
|
MatchRule(String memberOfGroup,
String processRole,
boolean deny)
Group membership rule. |
|
MatchRule(String attributeName,
String attributeValue,
X509Certificate authority,
String processRole,
boolean deny)
Full constructor that allows setting all values for a SAML attribute. |
|
MatchRule(String subjectDN,
X509Certificate authority,
String processRole,
boolean deny)
Full constructor that allows setting all values for an X.509 match. |
|
MatchRule(SubjectDescription subject,
SubjectDescription authority,
String processRole)
Convenience constructor that extracts the subject DN from 'subject', and the issuer certificate from 'authority'. |
|
| Method Summary | |
|---|---|
void |
checkRole(String role)
Check that the role is correct. |
void |
checkValid()
Ensure that all required fields are set, and no fields conflict. |
int |
compareTo(Object otherObj)
Used to ensure a stable sort order for display. |
static MatchRule |
createAnyoneRule(String processRole)
Create a rule that will give anyone at all this role. |
MatchPattern |
extractMatchPattern()
Return the pattern component of this rule. |
String |
getAttributeName()
Get SAML attribute name. |
String |
getAttributeValue()
Get SAML attribute value. |
boolean |
getDeny()
|
String |
getIssuerCertificate()
Get a serialised form of the issuer's certificate, or null if there isn't one. |
String |
getMemberOfGroup()
|
String |
getProcessRole()
|
String |
getSubjectDN()
|
static TypeDesc |
getTypeDesc()
Return type metadata object for Axis serialisation. |
X509Certificate |
parseIssuerCertificate()
Decode the issuerCertificate into an X509Certificate. |
void |
setAttributeName(String value)
Set required SAML attribute name (for SAML match rules). |
void |
setAttributeValue(String value)
Set required SAML attribute value (for SAML match rules). |
void |
setDeny(boolean deny)
|
void |
setIssuerCertificate(String issuerCertificate)
|
void |
setMemberOfGroup(String memberOfGroup)
For group rules: set the group of which the subject must be a member. |
void |
setProcessRole(String processRole)
|
void |
setSubjectDN(String subjectDN)
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MatchRule()
public MatchRule(PolicyRule rule)
public MatchRule(MatchRule rule)
throws InvalidMatchRuleException
SavedMatchRule class.
InvalidMatchRuleException
public MatchRule(SubjectDescription subject,
SubjectDescription authority,
String processRole)
subject - subject containing the DN to extractauthority - authority containing the X.509 certificate to extractprocessRole - the role which should be granted to the subject
public MatchRule(String subjectDN,
X509Certificate authority,
String processRole,
boolean deny)
subjectDN - the client certificate's subject DN must match this string.authority - the client certificate must be signed by this certificate's public key.processRole - the role to grant (or deny) if the rule matches.deny - if true, matching this rule denies access.
public MatchRule(String attributeName,
String attributeValue,
X509Certificate authority,
String processRole,
boolean deny)
attributeName - the name of the SAML attributeattributeValue - the value of the SAML attributeauthority - the assertion must be signed by this certificate's public key; use null to
match only trusted attributes (verified outside of PBAC)processRole - the role to grant (or deny) if the rule matches.deny - if true, matching this rule denies access.
public MatchRule(String memberOfGroup,
String processRole,
boolean deny)
memberOfGroup - the group resource in which users must have
PDP.GROUP_MEMBER_ROLE.processRole - the role to grant (or deny) if the rule matches.deny - if true, matching this rule denies access.
public MatchRule(MatchPattern pattern,
String processRole,
boolean deny)
pattern - the pattern which must match for this rule to be usedprocessRole - the role which this pattern affectsdeny - if true, matching this rule denies access
Note that this constructor takes a reference to the pattern rather than making a copy.| Method Detail |
|---|
public static MatchRule createAnyoneRule(String processRole)
processRole - the role that anyone will get
public MatchPattern extractMatchPattern()
public String getIssuerCertificate()
parseIssuerCertificate()public void setIssuerCertificate(String issuerCertificate)
public void setSubjectDN(String subjectDN)
public String getSubjectDN()
public void setAttributeName(String value)
public void setAttributeValue(String value)
public String getAttributeName()
public String getAttributeValue()
public void setMemberOfGroup(String memberOfGroup)
public String getMemberOfGroup()
public void setDeny(boolean deny)
public boolean getDeny()
public void setProcessRole(String processRole)
public String getProcessRole()
public String toString()
toString in class Object
public void checkValid()
throws InvalidMatchRuleException
InvalidMatchRuleException
public void checkRole(String role)
throws GridFailureException
role - the required role
GridFailureException - if the rule's role is not set or is different to 'role'public static TypeDesc getTypeDesc()
public X509Certificate parseIssuerCertificate()
RuntimeException - if no certificate is set, or if the certificate cannot be decodedpublic int compareTo(Object otherObj)
compareTo in interface Comparable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||