-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Bruno test and fix max limit in revoke all (#157)
* Bruno test revoke all instance delegation single instance Fix and negative test for revoke 11 delegations * Fix test name * Revrote all test to have a descriptive name for each test step and use assert instead of axpect Revrote all test testing multiple iterations of delegations to use for loop Revrote al test to expect to to be in alist to not be vulnerable to difrent sorting from server and not using sorting on client as this would only fix it for one environment but could be difrent in other environment based on the uuid of that user. * Fixed expected path according to code change as it is instanceId that will make the number of policies handled not ResourceId * Fix expected after change in code
- Loading branch information
Showing
54 changed files
with
2,965 additions
and
45 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
...nagement/src/Altinn.AccessManagement.Core/Configuration/AppsInstanceDelegationSettings.cs
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,13 @@ | ||
namespace Altinn.AccessManagement.Core.Configuration | ||
{ | ||
/// <summary> | ||
/// AppsInstanceDelegationSettings | ||
/// </summary> | ||
public class AppsInstanceDelegationSettings | ||
{ | ||
/// <summary> | ||
/// Sets the maximum policy files to handle under revoke all calls | ||
/// </summary> | ||
public int MaxPolicyFilesToRevoke { get; set; } | ||
} | ||
} |
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
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
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
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
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
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
16 changes: 16 additions & 0 deletions
16
.../app_ttd_am-devtest-instancedelegation/00000000-0000-0000-0000-000000000011/response.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,16 @@ | ||
{ | ||
"type": "https://tools.ietf.org/html/rfc9110#section-15.5.1", | ||
"title": "Bad Request", | ||
"status": 400, | ||
"detail": "One or more validation errors occurred.", | ||
"code": "STD-00000", | ||
"validationErrors": [ | ||
{ | ||
"code": "AM.VLD-00005", | ||
"detail": "There is to many policy files to update. Must delete individual delegations.", | ||
"paths": [ | ||
"InstanceId" | ||
] | ||
} | ||
] | ||
} |
42 changes: 42 additions & 0 deletions
42
...ce/app_ttd_am-devtest-instancedelegation/000000000011/N/000000000010/delegationpolicy.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,42 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<xacml:Policy PolicyId="urn:altinn:policyid:1" Version="1.0" RuleCombiningAlgId="urn:oasis:names:tc:xacml:3.0:policy-combining-algorithm:deny-overrides" xmlns:xacml="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17"> | ||
<xacml:Description>Delegation policy containing all delegated rights/actions from urn:altinn:organization:uuid:0268b99a-5817-4bbf-9b62-d90b16d527ea to urn:altinn:person:uuid:ce4ba72b-d111-404f-95b5-313fb3847fa1, for the resource; app_ttd_am-devtest-instancedelegation</xacml:Description> | ||
<xacml:Target /> | ||
<xacml:Rule RuleId="96b20b71-06fb-4d59-9538-38bfa72774fb" Effect="Permit"> | ||
<xacml:Description>Delegation of a right/action from urn:altinn:organization:uuid:0268b99a-5817-4bbf-9b62-d90b16d527ea to urn:altinn:person:uuid:ce4ba72b-d111-404f-95b5-313fb3847fa1, for the resource: app_ttd_am-devtest-instancedelegation, by: urn:altinn:resource:app_ttd_am-devtest-instancedelegation</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">CE4BA72B-D111-404F-95B5-313FB3847FA1</xacml:AttributeValue> | ||
<xacml:AttributeDesignator AttributeId="urn:altinn:person:uuid" 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:3.0:function:string-equal-ignore-case"> | ||
<xacml:AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">app_ttd_am-devtest-instancedelegation</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:Match MatchId="urn:oasis:names:tc:xacml:3.0:function:string-equal-ignore-case"> | ||
<xacml:AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">task_1</xacml:AttributeValue> | ||
<xacml:AttributeDesignator AttributeId="urn:altinn:task" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false" /> | ||
</xacml:Match> | ||
<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">00000000-0000-0000-0000-000000000011</xacml:AttributeValue> | ||
<xacml:AttributeDesignator AttributeId="urn:altinn:resource:instance-id" 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:3.0:function:string-equal-ignore-case"> | ||
<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:AnyOf> | ||
</xacml:Target> | ||
</xacml:Rule> | ||
</xacml:Policy> |
79 changes: 79 additions & 0 deletions
79
...ce/app_ttd_am-devtest-instancedelegation/000000000011/N/000000000012/delegationpolicy.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,79 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<xacml:Policy PolicyId="urn:altinn:policyid:1" Version="1.0" RuleCombiningAlgId="urn:oasis:names:tc:xacml:3.0:policy-combining-algorithm:deny-overrides" xmlns:xacml="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17"> | ||
<xacml:Description>Delegation policy containing all delegated rights/actions from urn:altinn:organization:uuid:0268b99a-5817-4bbf-9b62-d90b16d527ea to urn:altinn:person:uuid:ce4ba72b-d111-404f-95b5-313fb3847fa1, for the resource; app_ttd_am-devtest-instancedelegation</xacml:Description> | ||
<xacml:Target /> | ||
<xacml:Rule RuleId="96b20b71-06fb-4d59-9538-38bfa72774fb" Effect="Permit"> | ||
<xacml:Description>Delegation of a right/action from urn:altinn:organization:uuid:0268b99a-5817-4bbf-9b62-d90b16d527ea to urn:altinn:person:uuid:ce4ba72b-d111-404f-95b5-313fb3847fa1, for the resource: app_ttd_am-devtest-instancedelegation, by: urn:altinn:resource:app_ttd_am-devtest-instancedelegation</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">0268B99A-5817-4BBF-9B62-D90B16D527EA</xacml:AttributeValue> | ||
<xacml:AttributeDesignator AttributeId="urn:altinn:person:uuid" 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:3.0:function:string-equal-ignore-case"> | ||
<xacml:AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">app_ttd_am-devtest-instancedelegation</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:Match MatchId="urn:oasis:names:tc:xacml:3.0:function:string-equal-ignore-case"> | ||
<xacml:AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">task_1</xacml:AttributeValue> | ||
<xacml:AttributeDesignator AttributeId="urn:altinn:task" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false" /> | ||
</xacml:Match> | ||
<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">00000000-0000-0000-0000-000000000011</xacml:AttributeValue> | ||
<xacml:AttributeDesignator AttributeId="urn:altinn:resource:instance-id" 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:3.0:function:string-equal-ignore-case"> | ||
<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:AnyOf> | ||
</xacml:Target> | ||
</xacml:Rule> | ||
<xacml:Rule RuleId="96b20b71-06fb-4d59-9538-38bfa72774fb" Effect="Permit"> | ||
<xacml:Description>Delegation of a right/action from urn:altinn:organization:uuid:0268b99a-5817-4bbf-9b62-d90b16d527ea to urn:altinn:person:uuid:ce4ba72b-d111-404f-95b5-313fb3847fa1, for the resource: app_ttd_am-devtest-instancedelegation, by: urn:altinn:resource:app_ttd_am-devtest-instancedelegation</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">0268B99A-5817-4BBF-9B62-D90B16D527EA</xacml:AttributeValue> | ||
<xacml:AttributeDesignator AttributeId="urn:altinn:person:uuid" 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:3.0:function:string-equal-ignore-case"> | ||
<xacml:AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">app_ttd_am-devtest-instancedelegation</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:Match MatchId="urn:oasis:names:tc:xacml:3.0:function:string-equal-ignore-case"> | ||
<xacml:AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">task_1</xacml:AttributeValue> | ||
<xacml:AttributeDesignator AttributeId="urn:altinn:task" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false" /> | ||
</xacml:Match> | ||
<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">00000000-0000-0000-0000-000000000011</xacml:AttributeValue> | ||
<xacml:AttributeDesignator AttributeId="urn:altinn:resource:instance-id" 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:3.0:function:string-equal-ignore-case"> | ||
<xacml:AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">sign</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:Policy> |
Oops, something went wrong.