-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
4 changed files
with
319 additions
and
0 deletions.
There are no files selected for viewing
101 changes: 101 additions & 0 deletions
101
...egrationTests/Data/Xacml/3.0/ResourceRegistry/AltinnResourceRegistryMulti0012Request.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
{ | ||
"Request": { | ||
"ReturnPolicyIdList": true, | ||
"AccessSubject": [ | ||
{ | ||
"Id": "s1", | ||
"Attribute": [ | ||
{ | ||
"AttributeId": "urn:altinn:person:identifier-no", | ||
"Value": "01039012345" | ||
} | ||
] | ||
} | ||
], | ||
"Action": [ | ||
{ | ||
"Id": "a1", | ||
"Attribute": [ | ||
{ | ||
"AttributeId": "urn:oasis:names:tc:xacml:1.0:action:action-id", | ||
"Value": "read", | ||
"DataType": "http://www.w3.org/2001/XMLSchema#string", | ||
"IncludeInResult": true | ||
} | ||
] | ||
} | ||
], | ||
"Resource": [ | ||
{ | ||
"Id": "r1", | ||
"Attribute": [ | ||
{ | ||
"AttributeId": "urn:altinn:resource", | ||
"Value": "ttd-externalpdp-resource1", | ||
"IncludeInResult": true | ||
}, | ||
{ | ||
"AttributeId": "urn:altinn:organization:identifier-no", | ||
"Value": "897069651", | ||
"IncludeInResult": true | ||
} | ||
] | ||
}, | ||
{ | ||
"Id": "r2", | ||
"Attribute": [ | ||
{ | ||
"AttributeId": "urn:altinn:resource", | ||
"Value": "ttd-externalpdp-resource1", | ||
"IncludeInResult": true | ||
}, | ||
{ | ||
"AttributeId": "urn:altinn:organization:identifier-no", | ||
"Value": "950474084", | ||
"IncludeInResult": true | ||
} | ||
] | ||
}, | ||
{ | ||
"Id": "r3", | ||
"Attribute": [ | ||
{ | ||
"AttributeId": "urn:altinn:resource", | ||
"Value": "ttd-externalpdp-resource3", | ||
"IncludeInResult": true | ||
}, | ||
{ | ||
"AttributeId": "urn:altinn:organization:identifier-no", | ||
"Value": "950474084", | ||
"IncludeInResult": true | ||
} | ||
] | ||
} | ||
], | ||
"MultiRequests": { | ||
"RequestReference": [ | ||
{ | ||
"ReferenceId": [ | ||
"s1", | ||
"a1", | ||
"r1" | ||
] | ||
}, | ||
{ | ||
"ReferenceId": [ | ||
"s1", | ||
"a1", | ||
"r2" | ||
] | ||
}, | ||
{ | ||
"ReferenceId": [ | ||
"s1", | ||
"a1", | ||
"r3" | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} |
140 changes: 140 additions & 0 deletions
140
...grationTests/Data/Xacml/3.0/ResourceRegistry/AltinnResourceRegistryMulti0012Response.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
{ | ||
"Response": [ | ||
{ | ||
"Decision": "Permit", | ||
"Status": { | ||
"StatusCode": { | ||
"Value": "urn:oasis:names:tc:xacml:1.0:status:ok" | ||
} | ||
}, | ||
"Obligations": [ | ||
{ | ||
"id": "urn:altinn:obligation:authenticationLevel1", | ||
"attributeAssignment": [ | ||
|
||
{ | ||
"attributeId": "urn:altinn:obligation-assignment:1", | ||
"value": "2", | ||
"category": "urn:altinn:minimum-authenticationlevel", | ||
"dataType": "http://www.w3.org/2001/XMLSchema#integer", | ||
"issuer": null | ||
} | ||
] | ||
} | ||
], | ||
"Category": [ | ||
{ | ||
"CategoryId": "urn:oasis:names:tc:xacml:3.0:attribute-category:action", | ||
"Attribute": [ | ||
{ | ||
"AttributeId": "urn:oasis:names:tc:xacml:1.0:action:action-id", | ||
"DataType": "http://www.w3.org/2001/XMLSchema#string", | ||
"Value": "read" | ||
} | ||
] | ||
}, | ||
{ | ||
"CategoryId": "urn:oasis:names:tc:xacml:3.0:attribute-category:resource", | ||
"Attribute": [ | ||
{ | ||
"AttributeId": "urn:altinn:resource", | ||
"DataType": "http://www.w3.org/2001/XMLSchema#string", | ||
"Value": "ttd-externalpdp-resource1" | ||
}, | ||
{ | ||
"AttributeId": "urn:altinn:organization:identifier-no", | ||
"DataType": "http://www.w3.org/2001/XMLSchema#string", | ||
"Value": "897069651" | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"Decision": "Permit", | ||
"Status": { | ||
"StatusCode": { | ||
"Value": "urn:oasis:names:tc:xacml:1.0:status:ok" | ||
} | ||
}, | ||
"Obligations": [ | ||
{ | ||
"id": "urn:altinn:obligation:authenticationLevel1", | ||
"attributeAssignment": [ | ||
{ | ||
"attributeId": "urn:altinn:obligation-assignment:1", | ||
"value": "2", | ||
"category": "urn:altinn:minimum-authenticationlevel", | ||
"dataType": "http://www.w3.org/2001/XMLSchema#integer", | ||
"issuer": null | ||
} | ||
] | ||
} | ||
], | ||
"Category": [ | ||
{ | ||
"CategoryId": "urn:oasis:names:tc:xacml:3.0:attribute-category:action", | ||
"Attribute": [ | ||
{ | ||
"AttributeId": "urn:oasis:names:tc:xacml:1.0:action:action-id", | ||
"DataType": "http://www.w3.org/2001/XMLSchema#string", | ||
"Value": "read" | ||
} | ||
] | ||
}, | ||
{ | ||
"CategoryId": "urn:oasis:names:tc:xacml:3.0:attribute-category:resource", | ||
"Attribute": [ | ||
{ | ||
"AttributeId": "urn:altinn:resource", | ||
"DataType": "http://www.w3.org/2001/XMLSchema#string", | ||
"Value": "ttd-externalpdp-resource1" | ||
}, | ||
{ | ||
"AttributeId": "urn:altinn:organization:identifier-no", | ||
"DataType": "http://www.w3.org/2001/XMLSchema#string", | ||
"Value": "950474084" | ||
} | ||
] | ||
} | ||
|
||
] | ||
}, | ||
{ | ||
"Decision": "NotApplicable", | ||
"Status": { | ||
"StatusCode": { | ||
"Value": "urn:oasis:names:tc:xacml:1.0:status:ok" | ||
} | ||
}, | ||
"Category": [ | ||
{ | ||
"CategoryId": "urn:oasis:names:tc:xacml:3.0:attribute-category:action", | ||
"Attribute": [ | ||
{ | ||
"AttributeId": "urn:oasis:names:tc:xacml:1.0:action:action-id", | ||
"DataType": "http://www.w3.org/2001/XMLSchema#string", | ||
"Value": "read" | ||
} | ||
] | ||
}, | ||
{ | ||
"CategoryId": "urn:oasis:names:tc:xacml:3.0:attribute-category:resource", | ||
"Attribute": [ | ||
{ | ||
"AttributeId": "urn:altinn:resource", | ||
"DataType": "http://www.w3.org/2001/XMLSchema#string", | ||
"Value": "ttd-externalpdp-resource3" | ||
}, | ||
{ | ||
"AttributeId": "urn:altinn:organization:identifier-no", | ||
"DataType": "http://www.w3.org/2001/XMLSchema#string", | ||
"Value": "950474084" | ||
} | ||
] | ||
} | ||
|
||
] | ||
} | ||
] | ||
} |
58 changes: 58 additions & 0 deletions
58
test/IntegrationTests/Data/Xacml/3.0/ResourceRegistry/ttd-externalpdp-resource3/policy.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<xacml:Policy xmlns:xsl="http://www.w3.org/2001/XMLSchema-instance" xmlns:xacml="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17" PolicyId="urn:altinn:example:policyid:1" Version="1.0" RuleCombiningAlgId="urn:oasis:names:tc:xacml:3.0:rule-combining-algorithm:deny-overrides"> | ||
<xacml:Target/> | ||
<xacml:Rule RuleId="urn:altinn:example:ruleid:1" Effect="Permit"> | ||
<xacml:Description>A rule giving user with role REGNA or DAGL and the ttd the right to pulish and subscribe to events registered to the altinn.test.events resource</xacml:Description> | ||
<xacml:Target> | ||
<xacml:AnyOf> | ||
<xacml:AllOf> | ||
<xacml:Match MatchId="urn:oasis:names:tc:xacml:3.0:function:string-equal-ignore-case"> | ||
<xacml:AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">LEDE</xacml:AttributeValue> | ||
<xacml:AttributeDesignator AttributeId="urn:altinn:rolecode" Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/> | ||
</xacml:Match> | ||
</xacml:AllOf> | ||
<xacml:AllOf> | ||
<xacml:Match MatchId="urn:oasis:names:tc:xacml:3.0:function:string-equal-ignore-case"> | ||
<xacml:AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">DAGL</xacml:AttributeValue> | ||
<xacml:AttributeDesignator AttributeId="urn:altinn:rolecode" Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/> | ||
</xacml:Match> | ||
</xacml:AllOf> | ||
<xacml:AllOf> | ||
<xacml:Match MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal"> | ||
<xacml:AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">ttd</xacml:AttributeValue> | ||
<xacml:AttributeDesignator AttributeId="urn:altinn:org" Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/> | ||
</xacml:Match> | ||
</xacml:AllOf> | ||
</xacml:AnyOf> | ||
<xacml:AnyOf> | ||
<xacml:AllOf> | ||
<xacml:Match MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal"> | ||
<xacml:AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">ttd-externalpdp-resource3</xacml:AttributeValue> | ||
<xacml:AttributeDesignator AttributeId="urn:altinn:resource" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/> | ||
</xacml:Match> | ||
</xacml:AllOf> | ||
</xacml:AnyOf> | ||
<xacml:AnyOf> | ||
<xacml:AllOf> | ||
<xacml:Match MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal"> | ||
<xacml:AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">read</xacml:AttributeValue> | ||
<xacml:AttributeDesignator AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:action" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/> | ||
</xacml:Match> | ||
</xacml:AllOf> | ||
<xacml:AllOf> | ||
<xacml:Match MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal"> | ||
<xacml:AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">write</xacml:AttributeValue> | ||
<xacml:AttributeDesignator AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:action" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/> | ||
</xacml:Match> | ||
</xacml:AllOf> | ||
</xacml:AnyOf> | ||
</xacml:Target> | ||
</xacml:Rule> | ||
<xacml:ObligationExpressions> | ||
<xacml:ObligationExpression FulfillOn="Permit" ObligationId="urn:altinn:obligation:1"> | ||
<xacml:AttributeAssignmentExpression AttributeId="urn:altinn:obligation-assignment:1" Category="urn:altinn:minimum-authenticationlevel"> | ||
<xacml:AttributeValue DataType="http://www.w3.org/2001/XMLSchema#integer">2</xacml:AttributeValue> | ||
</xacml:AttributeAssignmentExpression> | ||
</xacml:ObligationExpression> | ||
</xacml:ObligationExpressions> | ||
</xacml:Policy> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters