Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alowed to revoke rights given to system user #167

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Alowed to revoke rights given to system user
lovoll committed Dec 11, 2024
commit f9bd4d8b545fa5bad6aeda3e0c511787a0c9279c
Original file line number Diff line number Diff line change
@@ -168,13 +168,13 @@ public static void DefaultFrom(this IAssert<AttributeMatch> assert, IDictionary<
/// <param name="assert">list of assertions</param>
/// <param name="errors">dictionary for writing assertion errors</param>
/// <param name="values">list of attributes</param>
public static void Altinn2InternalIds(this IAssert<AttributeMatch> assert, IDictionary<string, string[]> errors, IEnumerable<AttributeMatch> values) =>
public static void RevokeInternalIds(this IAssert<AttributeMatch> assert, IDictionary<string, string[]> errors, IEnumerable<AttributeMatch> values) =>
assert.All(
assert.Single(
assert.HasAttributeTypes(AltinnXacmlConstants.MatchAttributeIdentifiers.PartyAttribute),
assert.HasAttributeTypes(AltinnXacmlConstants.MatchAttributeIdentifiers.UserAttribute)),
assert.AllAttributesHasValues,
assert.AttributesAreIntegers(BaseUrn.Altinn2InternalIds))(errors, values);
assert.HasAttributeTypes(AltinnXacmlConstants.MatchAttributeIdentifiers.UserAttribute),
assert.HasAttributeTypes(AltinnXacmlConstants.MatchAttributeIdentifiers.SystemUserUuid)),
assert.AllAttributesHasValues)(errors, values);

/// <summary>
/// A default list of assertions that contains the baseline for validating input for a resource.
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ public static class BaseUrn
/// <summary>
/// InternalIds from Altinn 2
/// </summary>
public static string[] Altinn2InternalIds => [AltinnXacmlConstants.MatchAttributeIdentifiers.UserAttribute, AltinnXacmlConstants.MatchAttributeIdentifiers.PartyAttribute];
public static string[] RevokeInternalIds => [AltinnXacmlConstants.MatchAttributeIdentifiers.UserAttribute, AltinnXacmlConstants.MatchAttributeIdentifiers.PartyAttribute, AltinnXacmlConstants.MatchAttributeIdentifiers.SystemUserUuid];

/// <summary>
/// Resources that belongs to Altinn
Original file line number Diff line number Diff line change
@@ -908,6 +908,8 @@ private async Task<List<Rule>> DeleteAllRulesInPolicy(RequestToDelete policyToDe
OfferedByPartyId = policyToDelete.PolicyMatch.OfferedByPartyId,
CoveredByPartyId = coveredByPartyId,
CoveredByUserId = coveredByUserId,
ToUuid = coveredByUuid,
ToUuidType = coveredByUuidType,
PerformedByUserId = policyToDelete.DeletedByUserId,
BlobStoragePolicyPath = policyPath,
BlobStorageVersionId = response.Value.VersionId
Original file line number Diff line number Diff line change
@@ -235,18 +235,37 @@ public async Task<ValidationProblemDetails> RevokeRightsDelegation(int authentic
}

var fromAttribute = await _resolver.Resolve(delegation.From, [AltinnXacmlConstants.MatchAttributeIdentifiers.PartyAttribute], cancellationToken);
var toAttribute = await _resolver.Resolve(delegation.To, BaseUrn.Altinn2InternalIds, cancellationToken);
var toAttribute = await _resolver.Resolve(delegation.To, BaseUrn.RevokeInternalIds, cancellationToken);

var to = toAttribute.Any(p => p.Id == AltinnXacmlConstants.MatchAttributeIdentifiers.UserAttribute)
? new AttributeMatch(AltinnXacmlConstants.MatchAttributeIdentifiers.UserAttribute, toAttribute.First(p => p.Id == AltinnXacmlConstants.MatchAttributeIdentifiers.UserAttribute).Value)
: new AttributeMatch(AltinnXacmlConstants.MatchAttributeIdentifiers.PartyAttribute, toAttribute.First(p => p.Id == AltinnXacmlConstants.MatchAttributeIdentifiers.PartyAttribute).Value);
var to = GetAttributeMatchFromAttributeMatchList(toAttribute);

var policiesToDelete = DelegationHelper.GetRequestToDeleteResource(authenticatedUserId, delegation.Rights[0].Resource, fromAttribute.GetRequiredInt(AltinnXacmlConstants.MatchAttributeIdentifiers.PartyAttribute), to);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Det må da vel en endring til også mot databasen? Eksisterende logikk forsøker vel å matche To mot CoveredBy kolonnene og ikke den nye ToUuid?


await _pap.TryDeleteDelegationPolicies(policiesToDelete, cancellationToken);
return assertion;
}

/// <summary>
/// Fetch the actual internal id from the attribute match list
/// </summary>
/// <param name="attributeMatches">the list to fetch from</param>
/// <returns>The identified internal id</returns>
private AttributeMatch GetAttributeMatchFromAttributeMatchList(IEnumerable<AttributeMatch> attributeMatches)
{
if (attributeMatches.Any(p => p.Id == AltinnXacmlConstants.MatchAttributeIdentifiers.UserAttribute))
{
return new AttributeMatch(AltinnXacmlConstants.MatchAttributeIdentifiers.UserAttribute, attributeMatches.First(p => p.Id == AltinnXacmlConstants.MatchAttributeIdentifiers.UserAttribute).Value);
}
else if (attributeMatches.Any(p => p.Id == AltinnXacmlConstants.MatchAttributeIdentifiers.SystemUserUuid))
{
return new AttributeMatch(AltinnXacmlConstants.MatchAttributeIdentifiers.SystemUserUuid, attributeMatches.First(p => p.Id == AltinnXacmlConstants.MatchAttributeIdentifiers.SystemUserUuid).Value);
}
else
{
return new AttributeMatch(AltinnXacmlConstants.MatchAttributeIdentifiers.PartyAttribute, attributeMatches.First(p => p.Id == AltinnXacmlConstants.MatchAttributeIdentifiers.PartyAttribute).Value);
}
}

/// <summary>
/// Ensures that given input for revoking a delegations contains a combination of attributes that
/// the service layer can process. If the method return null then input should be processable.
@@ -256,10 +275,10 @@ private ValidationProblemDetails AssertRevokeDelegationInput(DelegationLookup de
_asserter.Join(
_asserter.Evaluate(
delegation.From,
_asserter.Altinn2InternalIds),
_asserter.RevokeInternalIds),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Å støtte SystemUser uuid i From gir ikke egentlig mening men..

_asserter.Evaluate(
delegation.To,
_asserter.Altinn2InternalIds),
_asserter.RevokeInternalIds),
_asserter.Evaluate(
delegation.Rights?.FirstOrDefault()?.Resource ?? [],
_asserter.DefaultResource));

Unchanged files with check annotations Beta

{
public abstract string Name { get; }
public abstract new Task ExecuteAsync(ProgressTask task, CancellationToken cancellationToken);

Check warning on line 9 in src/apps/Altinn.Authorization.DeployApi/src/Altinn.Authorization.DeployApi/Tasks/StepTask.cs

GitHub Actions / CI (DeployApi)

The member 'StepTask.ExecuteAsync(ProgressTask, CancellationToken)' does not hide an accessible member. The new keyword is not required.
}
public abstract class StepTask<T>
namespace Altinn.Authorization.DeployApi.Pipelines;
public sealed class PipelineContext

Check warning on line 12 in src/apps/Altinn.Authorization.DeployApi/src/Altinn.Authorization.DeployApi/Pipelines/PipelineContext.cs

GitHub Actions / CI (DeployApi)

Missing XML comment for publicly visible type or member 'PipelineContext'
: IServiceProvider
, ISupportRequiredService
, IKeyedServiceProvider
catch (OperationCanceledException e) when (e.CancellationToken == ct)
{
}
catch (Exception e)

Check warning on line 97 in src/apps/Altinn.Authorization.DeployApi/src/Altinn.Authorization.DeployApi/Pipelines/PipelineContext.cs

GitHub Actions / CI (DeployApi)

The variable 'e' is declared but never used
{
}
}
_services = services;
}
object? IServiceProvider.GetService(Type serviceType)

Check warning on line 164 in src/apps/Altinn.Authorization.DeployApi/src/Altinn.Authorization.DeployApi/Pipelines/PipelineContext.cs

GitHub Actions / CI (DeployApi)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
=> _services.GetService(serviceType);
object ISupportRequiredService.GetRequiredService(Type serviceType)
=> _services.GetRequiredService(serviceType);
object? IKeyedServiceProvider.GetKeyedService(Type serviceType, object? serviceKey)

Check warning on line 170 in src/apps/Altinn.Authorization.DeployApi/src/Altinn.Authorization.DeployApi/Pipelines/PipelineContext.cs

GitHub Actions / CI (DeployApi)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 170 in src/apps/Altinn.Authorization.DeployApi/src/Altinn.Authorization.DeployApi/Pipelines/PipelineContext.cs

GitHub Actions / CI (DeployApi)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
=> _services.GetKeyedServices(serviceType, serviceKey);
object IKeyedServiceProvider.GetRequiredKeyedService(Type serviceType, object? serviceKey)

Check warning on line 173 in src/apps/Altinn.Authorization.DeployApi/src/Altinn.Authorization.DeployApi/Pipelines/PipelineContext.cs

GitHub Actions / CI (DeployApi)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
=> _services.GetRequiredKeyedService(serviceType, serviceKey);
public Task<T> RunTask<T>(StepTask<T> task, CancellationToken cancellationToken)
public Task RunTask(string description, Func<ProgressTask, CancellationToken, Task> task, CancellationToken cancellationToken)
{
return RunTask<object?>(

Check warning on line 188 in src/apps/Altinn.Authorization.DeployApi/src/Altinn.Authorization.DeployApi/Pipelines/PipelineContext.cs

GitHub Actions / CI (DeployApi)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
description,
async (ctx, ct) =>
{
if (context.WebSockets.IsWebSocketRequest)
{
using var webSocket = await context.WebSockets.AcceptWebSocketAsync("altinn.task-pipeline");
TPipeline? pipeline;

Check warning on line 30 in src/apps/Altinn.Authorization.DeployApi/src/Altinn.Authorization.DeployApi/Pipelines/TaskPipeline.cs

GitHub Actions / CI (DeployApi)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
{
using var sequence = new Sequence<byte>(ArrayPool<byte>.Shared);
}
});
private static TPipeline? DeserializePipeline<TPipeline>(ReadOnlySequence<byte> sequence)

Check warning on line 92 in src/apps/Altinn.Authorization.DeployApi/src/Altinn.Authorization.DeployApi/Pipelines/TaskPipeline.cs

GitHub Actions / CI (DeployApi)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
where TPipeline : TaskPipeline
{
var reader = new Utf8JsonReader(sequence);
namespace Altinn.Common.PEP.Authorization
{
public class AppAccessHandlerTest

Check warning on line 22 in src/pkgs/Altinn.Authorization.PEP/tests/Altinn.Authorization.PEP.Tests/AppAccessHandlerTest.cs

GitHub Actions / PR (PEP)

Missing XML comment for publicly visible type or member 'AppAccessHandlerTest'
{
private readonly Mock<IHttpContextAccessor> _httpContextAccessorMock;
private readonly Mock<IPDP> _pdpMock;
private readonly IOptions<PepSettings> _generalSettings;
private readonly AppAccessHandler _aah;
public AppAccessHandlerTest()

Check warning on line 29 in src/pkgs/Altinn.Authorization.PEP/tests/Altinn.Authorization.PEP.Tests/AppAccessHandlerTest.cs

GitHub Actions / PR (PEP)

Missing XML comment for publicly visible type or member 'AppAccessHandlerTest.AppAccessHandlerTest()'
{
_httpContextAccessorMock = new Mock<IHttpContextAccessor>();
_pdpMock = new Mock<IPDP>();
if (!string.IsNullOrEmpty(xForwardedForHeader))
{
httpContext.Request.Headers.Add("x-forwarded-for", xForwardedForHeader);

Check warning on line 306 in src/pkgs/Altinn.Authorization.PEP/tests/Altinn.Authorization.PEP.Tests/AppAccessHandlerTest.cs

GitHub Actions / PR (PEP)

Use IHeaderDictionary.Append or the indexer to append or set headers. IDictionary.Add will throw an ArgumentException when attempting to add a duplicate key. (https://aka.ms/aspnet/analyzers)
}
return httpContext;
namespace Altinn.Common.PEP.Authorization
{
public class ResourceAccessHandlerTest

Check warning on line 21 in src/pkgs/Altinn.Authorization.PEP/tests/Altinn.Authorization.PEP.Tests/ResourceAccessHandlerTest.cs

GitHub Actions / PR (PEP)

Missing XML comment for publicly visible type or member 'ResourceAccessHandlerTest'
{
private readonly Mock<IHttpContextAccessor> _httpContextAccessorMock;
private readonly Mock<IPDP> _pdpMock;
private readonly IOptions<PepSettings> _generalSettings;
private readonly ResourceAccessHandler _rah;
public ResourceAccessHandlerTest()

Check warning on line 28 in src/pkgs/Altinn.Authorization.PEP/tests/Altinn.Authorization.PEP.Tests/ResourceAccessHandlerTest.cs

GitHub Actions / PR (PEP)

Missing XML comment for publicly visible type or member 'ResourceAccessHandlerTest.ResourceAccessHandlerTest()'
{
_httpContextAccessorMock = new Mock<IHttpContextAccessor>();
_pdpMock = new Mock<IPDP>();
httpContext.Request.RouteValues.Add("party", party);
if (!string.IsNullOrEmpty(orgHeader))
{
httpContext.Request.Headers.Add("Altinn-Party-OrganizationNumber", orgHeader);

Check warning on line 211 in src/pkgs/Altinn.Authorization.PEP/tests/Altinn.Authorization.PEP.Tests/ResourceAccessHandlerTest.cs

GitHub Actions / PR (PEP)

Use IHeaderDictionary.Append or the indexer to append or set headers. IDictionary.Add will throw an ArgumentException when attempting to add a duplicate key. (https://aka.ms/aspnet/analyzers)
}
if (!string.IsNullOrEmpty(ssnHeader))
{
httpContext.Request.Headers.Add("Altinn-Party-SocialSecurityNumber", ssnHeader);

Check warning on line 216 in src/pkgs/Altinn.Authorization.PEP/tests/Altinn.Authorization.PEP.Tests/ResourceAccessHandlerTest.cs

GitHub Actions / PR (PEP)

Use IHeaderDictionary.Append or the indexer to append or set headers. IDictionary.Add will throw an ArgumentException when attempting to add a duplicate key. (https://aka.ms/aspnet/analyzers)
}
if (!string.IsNullOrEmpty(xForwardedForHeader))
namespace UnitTests
{
public class DecisionHelperTest

Check warning on line 15 in src/pkgs/Altinn.Authorization.PEP/tests/Altinn.Authorization.PEP.Tests/DecisionHelperTest.cs

GitHub Actions / PR (PEP)

Missing XML comment for publicly visible type or member 'DecisionHelperTest'
{
private const string Org = "Altinn";
private const string App = "App";
namespace UnitTests
{
public class ScopeAccessHandlerTest

Check warning on line 14 in src/pkgs/Altinn.Authorization.PEP/tests/Altinn.Authorization.PEP.Tests/ScopeAccessHandlerTest.cs

GitHub Actions / PR (PEP)

Missing XML comment for publicly visible type or member 'ScopeAccessHandlerTest'
{
private readonly ScopeAccessHandler _sah;
public ScopeAccessHandlerTest()

Check warning on line 18 in src/pkgs/Altinn.Authorization.PEP/tests/Altinn.Authorization.PEP.Tests/ScopeAccessHandlerTest.cs

GitHub Actions / PR (PEP)

Missing XML comment for publicly visible type or member 'ScopeAccessHandlerTest.ScopeAccessHandlerTest()'
{
_sah = new ScopeAccessHandler();
}
/// <summary>
/// Add serialization info.
/// </summary>
protected PlatformHttpException(SerializationInfo info, StreamingContext context) : base(info, context)

Check warning on line 45 in src/apps/Altinn.Authorization/src/Altinn.Authorization/Exceptions/PlatformHttpException.cs

GitHub Actions / CI (Authorization)

'Exception.Exception(SerializationInfo, StreamingContext)' is obsolete: 'This API supports obsolete formatter-based serialization. It should not be called or extended by application code.' (https://aka.ms/dotnet-warnings/SYSLIB0051)
{
}
}
_connectionString = string.Format(
postgresSettings.Value.ConnectionString,
postgresSettings.Value.AuthorizationDbPwd);
NpgsqlConnection.GlobalTypeMapper.MapEnum<DelegationChangeType>("delegation.delegationchangetype");

Check warning on line 43 in src/apps/Altinn.Authorization/src/Altinn.Authorization/Repositories/DelegationMetadataRepository.cs

GitHub Actions / CI (Authorization)

'NpgsqlConnection.GlobalTypeMapper' is obsolete: 'Global-level type mapping has been replaced with data source mapping, see the 7.0 release notes.'
}
/// <inheritdoc/>
/// <returns></returns>
public static string GetClientIpAddress(HttpContext context)
{
string[] clientIpList = context?.Request?.Headers?.GetCommaSeparatedValues("x-forwarded-for");

Check warning on line 193 in src/apps/Altinn.Authorization/src/Altinn.Authorization/Helpers/EventLogHelper.cs

GitHub Actions / CI (Authorization)

Converting null literal or possible null value to non-nullable type.
return clientIpList?.Length > 0 ? clientIpList[0] : null;

Check warning on line 194 in src/apps/Altinn.Authorization/src/Altinn.Authorization/Helpers/EventLogHelper.cs

GitHub Actions / CI (Authorization)

Possible null reference return.
}
}
}
client.Timeout = new TimeSpan(0, 0, 30);
Client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
}
}

Check warning on line 36 in src/apps/Altinn.Authorization/src/Altinn.Authorization/Clients/AccessManagementClient.cs

GitHub Actions / CI (Authorization)

return Task.FromResult(clientSecrets);
}
}
}

Check warning on line 36 in src/apps/Altinn.Authorization/src/Altinn.Authorization/Clients/OedAuthzMaskinportenClientDefinition.cs

GitHub Actions / CI (Authorization)

/// <inheritdoc/>
public bool? OverwriteAuthorizationHeader { get; set; }
}
}

Check warning on line 61 in src/apps/Altinn.Authorization/src/Altinn.Authorization/Configuration/OedAuthzMaskinportenClientSettings.cs

GitHub Actions / CI (Authorization)

return services;
}
}

Check warning on line 36 in src/apps/Altinn.Authorization/src/Altinn.Authorization/Extensions/PlatformAccessTokenDependencyInjectionExtensions.cs

GitHub Actions / CI (Authorization)

/// Gets or sets an optional action value to authorize
/// </summary>
public UrnJsonTypeValue<ActionUrn> Action { get; set; }
}

Check warning on line 34 in src/apps/Altinn.Authorization/src/Altinn.Authorization/Models/AccessListAuthorizationRequest.cs

GitHub Actions / CI (Authorization)

/// Gets or sets the result of the access list authorization
/// </summary>
public AccessListAuthorizationResult Result { get; set; }
}

Check warning on line 51 in src/apps/Altinn.Authorization/src/Altinn.Authorization/Models/AccessListAuthorizationResponse.cs

GitHub Actions / CI (Authorization)

_accessToken = _accessTokenGenerator.GenerateAccessToken(
_oidcProviderSettings["altinn"].Issuer,
"platform.authorization",
new X509Certificate2(Convert.FromBase64String(certBase64), (string)null, X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable));

Check warning on line 58 in src/apps/Altinn.AccessManagement/src/Altinn.AccessManagement.Integration/Services/PlatformAuthorizationTokenProvider.cs

GitHub Actions / CI (AccessManagement)

'X509Certificate2.X509Certificate2(byte[], string?, X509KeyStorageFlags)' is obsolete: 'Loading certificate data through the constructor or Import is obsolete. Use X509CertificateLoader instead to load certificates.' (https://aka.ms/dotnet-warnings/SYSLIB0057)
_cacheTokenUntil = DateTime.UtcNow.AddSeconds(_accessTokenSettings.TokenLifetimeInSeconds - 2); // Add some slack to avoid tokens expiring in transit
}
{
if (activity?.Recorded ?? false)
{
activity.RecordException(ex);

Check warning on line 25 in src/apps/Altinn.AccessManagement/src/Altinn.AccessManagement.Persistence/Extensions/ActivityExtensions.cs

GitHub Actions / CI (AccessManagement)

'ActivityExtensions.RecordException(Activity?, Exception?)' is obsolete: 'Call Activity.AddException instead this method will be removed in a future version.'
activity.SetStatus(ActivityStatusCode.Error, statusDescription);
}
}
{
var fs = new ManifestEmbeddedFileProvider(typeof(PersistenceDependencyInjectionExtensions).Assembly, "Migration");
builder.AddAltinnPostgresDataSource()

Check warning on line 136 in src/apps/Altinn.AccessManagement/src/Altinn.AccessManagement.Persistence/Extensions/PersistenceDependencyInjectionExtensions.cs

GitHub Actions / CI (AccessManagement)

'YuniqlDatabaseMigratorExtensions.AddYuniqlMigrations(INpgsqlDatabaseBuilder, Action<YuniqlDatabaseMigratorOptions>)' is obsolete: 'Use overload with serviceKey'
.MapEnum<DelegationChangeType>("delegation.delegationchangetype")
.MapEnum<UuidType>("delegation.uuidtype")
.MapEnum<InstanceDelegationMode>("delegation.instancedelegationmode")
{
certPath = $"{issuer}-org.pfx";
X509Certificate2 certIssuer = new X509Certificate2(certPath);

Check warning on line 47 in src/apps/Altinn.AccessManagement/test/Altinn.AccessManagement.Tests/Utils/JwtTokenMock.cs

GitHub Actions / CI (AccessManagement)

'X509Certificate2.X509Certificate2(string)' is obsolete: 'Loading certificate data through the constructor or Import is obsolete. Use X509CertificateLoader instead to load certificates.' (https://aka.ms/dotnet-warnings/SYSLIB0057)
return new X509SigningCredentials(certIssuer, SecurityAlgorithms.RsaSha256);
}
X509Certificate2 cert = new X509Certificate2(certPath, "qwer1234");

Check warning on line 51 in src/apps/Altinn.AccessManagement/test/Altinn.AccessManagement.Tests/Utils/JwtTokenMock.cs

GitHub Actions / CI (AccessManagement)

'X509Certificate2.X509Certificate2(string, string?)' is obsolete: 'Loading certificate data through the constructor or Import is obsolete. Use X509CertificateLoader instead to load certificates.' (https://aka.ms/dotnet-warnings/SYSLIB0057)
return new X509SigningCredentials(cert, SecurityAlgorithms.RsaSha256);
}
}
{
List<SecurityKey> signingKeys = new List<SecurityKey>();
X509Certificate2 cert = new X509Certificate2($"{issuer}-org.pem");

Check warning on line 30 in src/apps/Altinn.AccessManagement/test/Altinn.AccessManagement.Tests/Mocks/SigningKeyResolverMock.cs

GitHub Actions / CI (AccessManagement)

'X509Certificate2.X509Certificate2(string)' is obsolete: 'Loading certificate data through the constructor or Import is obsolete. Use X509CertificateLoader instead to load certificates.' (https://aka.ms/dotnet-warnings/SYSLIB0057)
SecurityKey key = new X509SecurityKey(cert);
signingKeys.Add(key);
{
List<SecurityKey> signingKeys = new List<SecurityKey>();
X509Certificate2 cert = new X509Certificate2("selfSignedTestCertificatePublic.cer");

Check warning on line 41 in src/apps/Altinn.AccessManagement/test/Altinn.AccessManagement.Tests/Mocks/ConfigurationManagerStub.cs

GitHub Actions / CI (AccessManagement)

'X509Certificate2.X509Certificate2(string)' is obsolete: 'Loading certificate data through the constructor or Import is obsolete. Use X509CertificateLoader instead to load certificates.' (https://aka.ms/dotnet-warnings/SYSLIB0057)
SecurityKey key = new X509SecurityKey(cert);
signingKeys.Add(key);
namespace Altinn.AccessManagement.Tests.Controllers;
public class AppsInstanceDelegationControllerTest : IClassFixture<CustomWebApplicationFactory<AppsInstanceDelegationController>>

Check warning on line 25 in src/apps/Altinn.AccessManagement/test/Altinn.AccessManagement.Tests/Controllers/ResourceOwnerAPI/AppsInstanceDelegationControllerTest.cs

GitHub Actions / CI (AccessManagement)

Missing XML comment for publicly visible type or member 'AppsInstanceDelegationControllerTest'
{
private readonly CustomWebApplicationFactory<AppsInstanceDelegationController> _factory;
private readonly JsonSerializerOptions options = new JsonSerializerOptions { PropertyNameCaseInsensitive = true };
[Theory]
[MemberData(nameof(TestDataAppsInstanceDelegation.RevokeAll), MemberType = typeof(TestDataAppsInstanceDelegation))]
public async Task AppsInstanceDelegationController_ValidToken_RevokeAll_OK(string platformToken, string resourceId, string instanceId, Paginated<AppsInstanceRevokeResponseDto> expected)

Check warning on line 114 in src/apps/Altinn.AccessManagement/test/Altinn.AccessManagement.Tests/Controllers/ResourceOwnerAPI/AppsInstanceDelegationControllerTest.cs

GitHub Actions / CI (AccessManagement)

Missing XML comment for publicly visible type or member 'AppsInstanceDelegationControllerTest.AppsInstanceDelegationController_ValidToken_RevokeAll_OK(string, string, string, Paginated<AppsInstanceRevokeResponseDto>)'
{
var client = GetTestClient(platformToken);
[Theory]
[MemberData(nameof(TestDataAppsInstanceDelegation.RevokeAllUnathorized), MemberType = typeof(TestDataAppsInstanceDelegation))]
public async Task AppsInstanceDelegationController_NoToken_RevokeAll_Unauthorized(string resourceId, string instanceId)

Check warning on line 130 in src/apps/Altinn.AccessManagement/test/Altinn.AccessManagement.Tests/Controllers/ResourceOwnerAPI/AppsInstanceDelegationControllerTest.cs

GitHub Actions / CI (AccessManagement)

Missing XML comment for publicly visible type or member 'AppsInstanceDelegationControllerTest.AppsInstanceDelegationController_ValidToken_RevokeAll_ToManyPolicyFilesToUpdate(string, string, string, AltinnProblemDetails)'
{
var client = GetTestClient(null);