-
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.
Feature/843 revoke instance delegation2 (#857)
* Unsaved files * Push before stashrecovery * Stash recovery * Removed RevokeAllEndpoint * Removed unused method * Added test and fixed some duplicate code * Fixed some code smells Added Authorization removed for local test * Unsaved changes missed from merge
- Loading branch information
Showing
28 changed files
with
883 additions
and
77 deletions.
There are no files selected for viewing
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,18 @@ | ||
namespace Altinn.AccessManagement.Core.Enums | ||
{ | ||
/// <summary> | ||
/// Enum for different right revoke status responses | ||
/// </summary> | ||
public enum RevokeStatus | ||
{ | ||
/// <summary> | ||
/// Right was not revoked | ||
/// </summary> | ||
NotRevoked = 0, | ||
|
||
/// <summary> | ||
/// Right was revoked | ||
/// </summary> | ||
Revoked = 1 | ||
} | ||
} |
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
47 changes: 47 additions & 0 deletions
47
src/Altinn.AccessManagement.Core/Models/AppsInstanceRevokeResponse.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,47 @@ | ||
using System.ComponentModel.DataAnnotations; | ||
using Altinn.AccessManagement.Core.Enums; | ||
using Altinn.AccessManagement.Core.Models.Register; | ||
|
||
namespace Altinn.AccessManagement.Core.Models; | ||
|
||
/// <summary> | ||
/// Response model for performing revoke of access to a respource from Apps | ||
/// </summary> | ||
public class AppsInstanceRevokeResponse | ||
{ | ||
/// <summary> | ||
/// Gets or sets the urn identifying the party to delegate from | ||
/// </summary> | ||
[Required] | ||
public PartyUrn From { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the urn identifying the party to be delegated to | ||
/// </summary> | ||
[Required] | ||
public PartyUrn To { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the urn identifying the resource of the instance | ||
/// </summary> | ||
[Required] | ||
public string ResourceId { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the urn identifying the instance id | ||
/// </summary> | ||
[Required] | ||
public string InstanceId { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets a value indicating whether the instance delegation is for a parallel task | ||
/// </summary> | ||
[Required] | ||
public InstanceDelegationMode InstanceDelegationMode { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the rights to delegate | ||
/// </summary> | ||
[Required] | ||
public IEnumerable<InstanceRightRevokeResult> Rights { get; set; } | ||
} |
26 changes: 26 additions & 0 deletions
26
src/Altinn.AccessManagement.Core/Models/InstanceRightRevokeResult.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,26 @@ | ||
using Altinn.AccessManagement.Core.Enums; | ||
using Altinn.AccessManagement.Core.Models.Rights; | ||
using Altinn.Urn.Json; | ||
|
||
namespace Altinn.AccessManagement.Core.Models; | ||
|
||
/// <summary> | ||
/// This model describes a single right | ||
/// </summary> | ||
public class InstanceRightRevokeResult | ||
{ | ||
/// <summary> | ||
/// Gets or sets the list of resource matches which uniquely identifies the resource this right applies to. | ||
/// </summary> | ||
public List<UrnJsonTypeValue> Resource { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the set of Attribute Id and Attribute Value for a specific action, to identify the action this right applies to | ||
/// </summary> | ||
public UrnJsonTypeValue<ActionUrn> Action { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets a value indicating whether the right was successfully revoked or not | ||
/// </summary> | ||
public RevokeStatus Status { 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
Oops, something went wrong.