-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathPdpDenyMock.cs
More file actions
29 lines (26 loc) · 1005 Bytes
/
PdpDenyMock.cs
File metadata and controls
29 lines (26 loc) · 1005 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System.Security.Claims;
using Altinn.Authorization.ABAC.Xacml.JsonProfile;
using Altinn.Common.PEP.Interfaces;
namespace Altinn.AccessManagement.Tests.Mocks
{
/// <summary>
/// Mock to delver Decision that is not Permit (deny)
/// </summary>
internal class PdpDenyMock : IPDP
{
/// <inheritdoc/>
public Task<XacmlJsonResponse> GetDecisionForRequest(XacmlJsonRequestRoot xacmlJsonRequest, CancellationToken cancellationToken = default)
{
var response = new XacmlJsonResponse
{
Response = new List<XacmlJsonResult>(new[] { new XacmlJsonResult { Decision = "Indeterminate" } })
};
return Task.FromResult(response);
}
/// <inheritdoc/>
public Task<bool> GetDecisionForUnvalidateRequest(XacmlJsonRequestRoot xacmlJsonRequest, ClaimsPrincipal user, CancellationToken cancellationToken = default)
{
return Task.FromResult(false);
}
}
}