diff --git a/test/Altinn.App.Integration.Tests/Signing/Simple.cs b/test/Altinn.App.Integration.Tests/Signing/Simple.cs new file mode 100644 index 000000000..e3b588347 --- /dev/null +++ b/test/Altinn.App.Integration.Tests/Signing/Simple.cs @@ -0,0 +1,77 @@ +using Altinn.App.Api.Models; +using Altinn.Platform.Storage.Interface.Models; +using Xunit.Abstractions; + +namespace Altinn.App.Integration.Tests.Singning; + +[Trait("Category", "Integration")] +public class SimpleTests(ITestOutputHelper _output, AppFixtureClassFixture _classFixture) + : IClassFixture +{ + public enum Auth + { + OldUser, + OldServiceOwner, + User, + ServiceOwner, + SystemUser, + SelfIdentifiedUser, + } + + [Theory] + [CombinatorialData] + public async Task Full([CombinatorialValues(Auth.User, Auth.SystemUser)] Auth auth) + { + await using var fixtureScope = await _classFixture.Get(_output, TestApps.Basic, "signing-simple"); + var fixture = fixtureScope.Fixture; + var verifier = fixture.ScopedVerifier; + verifier.UseTestCase(new { auth }); + + var token = auth switch + { + Auth.User => await fixture.Auth.GetUserToken(1337, authenticationLevel: 3, scope: "altinn:portal/enduser"), + Auth.SystemUser => await fixture.Auth.GetSystemUserToken( + systemId: "913312465_sbs", + systemUserId: "d111dbab-d619-4f15-bf29-58fe570a9ae6", + scope: "altinn:instances.read altinn:instances.write" + ), + _ => throw new NotSupportedException($"Auth {auth} is not supported"), + }; + + var instanceOwner = auth switch + { + Auth.User => new InstanceOwner { PartyId = "501337" }, + Auth.SystemUser => new InstanceOwner { OrganisationNumber = "950474084" }, + _ => throw new NotSupportedException($"Auth {auth} is not supported"), + }; + + using var instantiationResponse = await fixture.Instances.PostSimplified( + token, + new InstansiationInstance + { + InstanceOwner = instanceOwner, + Prefill = new() { ["property1"] = "1" }, + } + ); + + using var instantiationData = await instantiationResponse.Read(); + var instance = instantiationData.Data.Model; + Assert.NotNull(instance); + var scrubbers = new Scrubbers(StringScrubber: Scrubbers.InstanceStringScrubber(instance)); + await verifier.Verify(instantiationData, snapshotName: "Instance", scrubbers: scrubbers); + + using var processNextResponse = await fixture.Instances.ProcessNext( + token, + instantiationData, + new ProcessNext { Action = "sign" } + ); + using var processNextData = await processNextResponse.Read(); + + await verifier.Verify(processNextData, snapshotName: "ProcessNext", scrubbers: scrubbers); + + using var download = await fixture.Instances.Download(token, instantiationData); + await download.Verify(verifier); + + await verifier.Verify(fixture.GetSnapshotAppLogs(), snapshotName: "Logs"); + } +} diff --git a/test/Altinn.App.Integration.Tests/Signing/_snapshots/SimpleTests.Full_auth=SystemUser_0_Instance.verified.txt b/test/Altinn.App.Integration.Tests/Signing/_snapshots/SimpleTests.Full_auth=SystemUser_0_Instance.verified.txt new file mode 100644 index 000000000..34f612e0d --- /dev/null +++ b/test/Altinn.App.Integration.Tests/Signing/_snapshots/SimpleTests.Full_auth=SystemUser_0_Instance.verified.txt @@ -0,0 +1,127 @@ +{ + HttpResponse: { + Version: 1.1, + Content: { + Headers: { + Content-Type: [ + application/json; charset=utf-8 + ] + } + }, + StatusCode: Created, + ReasonPhrase: Created, + Headers: { + Date: , + Server: [ + Kestrel + ], + Cache-Control: [ + no-store, no-cache + ], + Location: [ + https://app:5005/ttd/basic/instances/500700/ + ], + Transfer-Encoding: [ + chunked + ], + Request-Context: [ + appId= + ], + X-Frame-Options: [ + deny + ], + X-Content-Type-Options: [ + nosniff + ], + X-XSS-Protection: [ + 0 + ], + Referrer-Policy: [ + no-referrer + ] + }, + TrailingHeaders: {}, + RequestMessage: { + Version: 1.1, + Content: { + Headers: { + Content-Type: [ + application/json + ], + Content-Length: [ + 192 + ] + } + }, + Method: { + Method: POST + }, + RequestUri: http://local.altinn.cloud:/ttd/basic/instances/create, + Headers: { + Authorization: [ + Bearer + ], + User-Agent: [ + Altinn.App.Integration.Tests + ] + } + }, + IsSuccessStatusCode: true + }, + Response: { + Id: 500700/, + InstanceOwner: { + PartyId: 500700, + OrganisationNumber: 950474084 + }, + AppId: ttd/basic, + Org: ttd, + SelfLinks: { + Apps: https://app:5005/ttd/basic/instances/500700/, + Platform: https://platform.local.altinn.cloud/storage/api/v1/instances/500700/ + }, + VisibleAfter: DateTime_1, + Process: { + Started: DateTime_2, + StartEvent: StartEvent_1, + CurrentTask: { + Flow: 2, + Started: DateTime_3, + ElementId: Task_1, + Name: Fyll ut og signer, + AltinnTaskType: signing, + FlowType: CompleteCurrentMoveToNext + } + }, + Status: { + IsArchived: false, + IsSoftDeleted: false, + IsHardDeleted: false, + ReadStatus: Read + }, + Data: [ + { + Id: , + InstanceGuid: , + DataType: model, + ContentType: application/xml, + BlobStoragePath: ttd/basic//data/, + SelfLinks: { + Apps: https://app:5005/ttd/basic/instances/500700//data/, + Platform: https://platform./storage/api/v1/instances/500700//data/ + }, + Size: 176, + Locked: false, + IsRead: true, + Created: DateTime_4, + CreatedBy: 950474084, + LastChanged: DateTime_4, + LastChangedBy: 950474084 + } + ], + Created: DateTime_1, + CreatedBy: 950474084, + LastChanged: DateTime_1, + LastChangedBy: 950474084 + } +} \ No newline at end of file diff --git a/test/Altinn.App.Integration.Tests/Signing/_snapshots/SimpleTests.Full_auth=SystemUser_1_ProcessNext.verified.txt b/test/Altinn.App.Integration.Tests/Signing/_snapshots/SimpleTests.Full_auth=SystemUser_1_ProcessNext.verified.txt new file mode 100644 index 000000000..5401b7d1e --- /dev/null +++ b/test/Altinn.App.Integration.Tests/Signing/_snapshots/SimpleTests.Full_auth=SystemUser_1_ProcessNext.verified.txt @@ -0,0 +1,69 @@ +{ + HttpResponse: { + Version: 1.1, + Content: { + Headers: { + Content-Type: [ + application/problem+json; charset=utf-8 + ] + } + }, + StatusCode: InternalServerError, + ReasonPhrase: Internal Server Error, + Headers: { + Date: , + Server: [ + Kestrel + ], + Cache-Control: [ + no-store, no-cache + ], + Transfer-Encoding: [ + chunked + ], + Request-Context: [ + appId= + ], + X-Frame-Options: [ + deny + ], + X-Content-Type-Options: [ + nosniff + ], + X-XSS-Protection: [ + 0 + ], + Referrer-Policy: [ + no-referrer + ] + }, + TrailingHeaders: {}, + RequestMessage: { + Version: 1.1, + Content: { + Headers: { + Content-Type: [ + application/json + ], + Content-Length: [ + 41 + ] + } + }, + Method: { + Method: PUT + }, + RequestUri: http://local.altinn.cloud:/ttd/basic/instances/500700//process/next, + Headers: { + Authorization: [ + Bearer + ], + User-Agent: [ + Altinn.App.Integration.Tests + ] + } + }, + IsSuccessStatusCode: false + }, + Response: {} +} \ No newline at end of file diff --git a/test/Altinn.App.Integration.Tests/Signing/_snapshots/SimpleTests.Full_auth=SystemUser_2_Download-Instance.verified.txt b/test/Altinn.App.Integration.Tests/Signing/_snapshots/SimpleTests.Full_auth=SystemUser_2_Download-Instance.verified.txt new file mode 100644 index 000000000..b5cad4f24 --- /dev/null +++ b/test/Altinn.App.Integration.Tests/Signing/_snapshots/SimpleTests.Full_auth=SystemUser_2_Download-Instance.verified.txt @@ -0,0 +1,140 @@ +{ + HttpResponse: { + Version: 1.1, + Content: { + Headers: { + Content-Type: [ + application/json; charset=utf-8 + ] + } + }, + StatusCode: OK, + ReasonPhrase: OK, + Headers: { + Date: , + Server: [ + Kestrel + ], + Cache-Control: [ + no-store, no-cache + ], + Transfer-Encoding: [ + chunked + ], + Request-Context: [ + appId= + ], + X-Frame-Options: [ + deny + ], + X-Content-Type-Options: [ + nosniff + ], + X-XSS-Protection: [ + 0 + ], + Referrer-Policy: [ + no-referrer + ] + }, + TrailingHeaders: {}, + RequestMessage: { + Version: 1.1, + Method: { + Method: GET + }, + RequestUri: http://local.altinn.cloud:/ttd/basic/instances/500700/, + Headers: { + Authorization: [ + Bearer + ], + User-Agent: [ + Altinn.App.Integration.Tests + ] + } + }, + IsSuccessStatusCode: true + }, + Response: { + Id: 500700/, + InstanceOwner: { + PartyId: 500700, + OrganisationNumber: 950474084 + }, + AppId: ttd/basic, + Org: ttd, + SelfLinks: { + Apps: https://app:5005/ttd/basic/instances/500700/, + Platform: https://platform.local.altinn.cloud/storage/api/v1/instances/500700/ + }, + VisibleAfter: DateTime_1, + Process: { + Started: DateTime_2, + StartEvent: StartEvent_1, + CurrentTask: { + Flow: 2, + Started: DateTime_3, + ElementId: Task_1, + Name: Fyll ut og signer, + AltinnTaskType: signing, + FlowType: CompleteCurrentMoveToNext + } + }, + Status: { + IsArchived: false, + IsSoftDeleted: false, + IsHardDeleted: false, + ReadStatus: Read + }, + Data: [ + { + Id: , + InstanceGuid: , + DataType: model, + ContentType: application/xml, + BlobStoragePath: ttd/basic//data/, + SelfLinks: { + Apps: https://app:5005/ttd/basic/instances/500700//data/, + Platform: https://platform.local.altinn.cloud/storage/api/v1/instances/500700//data/ + }, + Size: {Scrubbed}, + Locked: false, + IsRead: true, + Created: DateTime_4, + CreatedBy: 950474084, + LastChanged: DateTime_4, + LastChangedBy: 950474084 + }, + { + Id: , + InstanceGuid: , + DataType: signatureInformation, + Filename: signatureInformation.json, + ContentType: application/json, + BlobStoragePath: ttd/basic//data/, + SelfLinks: { + Apps: https://app:5005/ttd/basic/instances/500700//data/, + Platform: https://platform.local.altinn.cloud/storage/api/v1/instances/500700//data/ + }, + Size: {Scrubbed}, + Locked: false, + IsRead: true, + References: [ + { + Value: Task_1, + Relation: GeneratedFrom, + ValueType: Task + } + ], + Created: DateTime_5, + CreatedBy: 950474084, + LastChanged: DateTime_5, + LastChangedBy: 950474084 + } + ], + Created: DateTime_1, + CreatedBy: 950474084, + LastChanged: DateTime_5, + LastChangedBy: 950474084 + } +} \ No newline at end of file diff --git a/test/Altinn.App.Integration.Tests/Signing/_snapshots/SimpleTests.Full_auth=SystemUser_3_Download-Data[0].verified.txt b/test/Altinn.App.Integration.Tests/Signing/_snapshots/SimpleTests.Full_auth=SystemUser_3_Download-Data[0].verified.txt new file mode 100644 index 000000000..13e201a51 --- /dev/null +++ b/test/Altinn.App.Integration.Tests/Signing/_snapshots/SimpleTests.Full_auth=SystemUser_3_Download-Data[0].verified.txt @@ -0,0 +1,66 @@ +{ + HttpResponse: { + Version: 1.1, + Content: { + Headers: { + Content-Type: [ + application/json; charset=utf-8 + ] + } + }, + StatusCode: OK, + ReasonPhrase: OK, + Headers: { + Date: , + Server: [ + Kestrel + ], + Cache-Control: [ + no-store, no-cache + ], + Transfer-Encoding: [ + chunked + ], + Request-Context: [ + appId= + ], + X-Frame-Options: [ + deny + ], + X-Content-Type-Options: [ + nosniff + ], + X-XSS-Protection: [ + 0 + ], + Referrer-Policy: [ + no-referrer + ] + }, + TrailingHeaders: {}, + RequestMessage: { + Version: 1.1, + Method: { + Method: GET + }, + RequestUri: http://local.altinn.cloud:/ttd/basic/instances/500700//data/, + Headers: { + Authorization: [ + Bearer + ], + Accept: [ + application/json + ], + User-Agent: [ + Altinn.App.Integration.Tests + ] + } + }, + IsSuccessStatusCode: true + }, + Response: { + property1: 1, + property2: null, + property3: null + } +} \ No newline at end of file diff --git a/test/Altinn.App.Integration.Tests/Signing/_snapshots/SimpleTests.Full_auth=SystemUser_4_Download-Data[1].verified.txt b/test/Altinn.App.Integration.Tests/Signing/_snapshots/SimpleTests.Full_auth=SystemUser_4_Download-Data[1].verified.txt new file mode 100644 index 000000000..cdef0a6eb --- /dev/null +++ b/test/Altinn.App.Integration.Tests/Signing/_snapshots/SimpleTests.Full_auth=SystemUser_4_Download-Data[1].verified.txt @@ -0,0 +1,82 @@ +{ + HttpResponse: { + Version: 1.1, + Content: { + Headers: { + Content-Length: [ + 534 + ], + Content-Type: [ + application/json + ], + Content-Disposition: [ + attachment; filename=signatureInformation.json; filename*=UTF-8''signatureInformation.json + ] + } + }, + StatusCode: OK, + ReasonPhrase: OK, + Headers: { + Date: , + Server: [ + Kestrel + ], + Cache-Control: [ + no-store, no-cache + ], + Request-Context: [ + appId= + ], + X-Frame-Options: [ + deny + ], + X-Content-Type-Options: [ + nosniff + ], + X-XSS-Protection: [ + 0 + ], + Referrer-Policy: [ + no-referrer + ] + }, + TrailingHeaders: {}, + RequestMessage: { + Version: 1.1, + Method: { + Method: GET + }, + RequestUri: http://local.altinn.cloud:/ttd/basic/instances/500700//data/, + Headers: { + Authorization: [ + Bearer + ], + Accept: [ + application/json + ], + User-Agent: [ + Altinn.App.Integration.Tests + ] + } + }, + IsSuccessStatusCode: true + }, + Response: { + id: , + instanceGuid: , + signedTime: DateTimeOffset_1, + signeeInfo: { + userId: null, + systemUserId: Guid_1, + personNumber: null, + organisationNumber: null + }, + dataElementSignatures: [ + { + dataElementId: , + sha256Hash: 9621bdd8df0f3c757f9a91f449e9cf32e2d6c77aca437c3a117c6b78b05343b7, + signed: true + } + ] + } +} \ No newline at end of file diff --git a/test/Altinn.App.Integration.Tests/Signing/_snapshots/SimpleTests.Full_auth=SystemUser_5_Logs.verified.txt b/test/Altinn.App.Integration.Tests/Signing/_snapshots/SimpleTests.Full_auth=SystemUser_5_Logs.verified.txt new file mode 100644 index 000000000..214594d91 --- /dev/null +++ b/test/Altinn.App.Integration.Tests/Signing/_snapshots/SimpleTests.Full_auth=SystemUser_5_Logs.verified.txt @@ -0,0 +1,52 @@ +[basic/signing-simple] [INIT INFO] Fixture configuration updated +[basic/signing-simple] [INIT INFO] Scenario 'signing-simple' specified but no services directory found at /App/scenario-overrides/services +[basic/signing-simple] [INFO] ### Request: Instances.PostSimplified - User: SystemUser/950474084/d111dbab-d619-4f15-bf29-58fe570a9ae6, AuthLevel: 3, AuthMethod: maskinporten +[basic/signing-simple] [INFO] IInstantiationValidator.Validate +[basic/signing-simple] [INFO] IProcessTaskStart.Start +[basic/signing-simple] [INFO] IInstantiationProcessor.DataCreation +[basic/signing-simple] [INFO] ### Response: Instances.PostSimplified - CreatedResult, StatusCode: 201 +[basic/signing-simple] [INFO] ### Request: Process.NextElement - User: SystemUser/950474084/d111dbab-d619-4f15-bf29-58fe570a9ae6, AuthLevel: 3, AuthMethod: maskinporten +[basic/signing-simple] [INFO] IValidator.Validate +[basic/signing-simple] [INFO] ITaskValidator.ValidateTask +[basic/signing-simple] [INFO] IDataElementValidator.ValidateDataElement +[basic/signing-simple] [INFO] IFormDataValidator.ValidateFormData +fail: Altinn.App.Core.Features.Signing.Services.SigningService[0] + Failed to create signee contexts for 1 unmatched documents for task Task_1. + System.ArgumentException: Could not find party for person or organization. A valid SSN or OrgNr must be provided. + at Altinn.App.Core.Features.Signing.Models.Signee.From(String ssn, String orgNr, Nullable`1 systemId, Func`2 lookupParty) in /_/src/Altinn.App.Core/Features/Signing/Models/SigneeContext.cs:line 140 + at Altinn.App.Core.Features.Signing.Services.SignDocumentManager.CreateSigneeContextFromSignDocument(String taskId, SignDocument signDocument) in /_/src/Altinn.App.Core/Features/Signing/Services/SignDocumentManager.cs:line 292 + at Altinn.App.Core.Features.Signing.Services.SignDocumentManager.CreateSigneeContextsForUnmatchedDocuments(String taskId, List`1 unmatchedSignDocuments) in /_/src/Altinn.App.Core/Features/Signing/Services/SignDocumentManager.cs:line 263 +fail: Altinn.App.Core.Internal.Validation.ValidationService[0] + Error while running validator Altinn.App.Core.Features.Validation.Default.SigningTaskValidator-* for task Task_1 on instance 500700/629e01b6-7965-40df-bd51-d8162c004cce + System.ArgumentException: Could not find party for person or organization. A valid SSN or OrgNr must be provided. + at Altinn.App.Core.Features.Signing.Models.Signee.From(String ssn, String orgNr, Nullable`1 systemId, Func`2 lookupParty) in /_/src/Altinn.App.Core/Features/Signing/Models/SigneeContext.cs:line 140 + at Altinn.App.Core.Features.Signing.Services.SignDocumentManager.CreateSigneeContextFromSignDocument(String taskId, SignDocument signDocument) in /_/src/Altinn.App.Core/Features/Signing/Services/SignDocumentManager.cs:line 292 + at Altinn.App.Core.Features.Signing.Services.SignDocumentManager.CreateSigneeContextsForUnmatchedDocuments(String taskId, List`1 unmatchedSignDocuments) in /_/src/Altinn.App.Core/Features/Signing/Services/SignDocumentManager.cs:line 263 + at Altinn.App.Core.Features.Signing.Services.SignDocumentManager.SynchronizeSigneeContextsWithSignDocuments(String taskId, List`1 signeeContexts, List`1 signDocuments, CancellationToken ct) in /_/src/Altinn.App.Core/Features/Signing/Services/SignDocumentManager.cs:line 136 + at Altinn.App.Core.Features.Signing.Services.SigningService.GetSigneeContexts(IInstanceDataAccessor instanceDataAccessor, AltinnSignatureConfiguration signatureConfiguration, CancellationToken ct) in /_/src/Altinn.App.Core/Features/Signing/Services/SigningService.cs:line 182 + at Altinn.App.Core.Features.Validation.Default.SigningTaskValidator.Validate(IInstanceDataAccessor dataAccessor, String taskId, String language) in /_/src/Altinn.App.Core/Features/Validation/Default/SigningTaskValidator.cs:line 92 + at Altinn.App.Core.Internal.Validation.ValidationService.<>c__DisplayClass5_0.<b__3>d.MoveNext() in /_/src/Altinn.App.Core/Internal/Validation/ValidationService.cs:line 67 +fail: Altinn.App.Api.Controllers.ProcessController[0] + Process next failed. + System.ArgumentException: Could not find party for person or organization. A valid SSN or OrgNr must be provided. + at Altinn.App.Core.Features.Signing.Models.Signee.From(String ssn, String orgNr, Nullable`1 systemId, Func`2 lookupParty) in /_/src/Altinn.App.Core/Features/Signing/Models/SigneeContext.cs:line 140 + at Altinn.App.Core.Features.Signing.Services.SignDocumentManager.CreateSigneeContextFromSignDocument(String taskId, SignDocument signDocument) in /_/src/Altinn.App.Core/Features/Signing/Services/SignDocumentManager.cs:line 292 + at Altinn.App.Core.Features.Signing.Services.SignDocumentManager.CreateSigneeContextsForUnmatchedDocuments(String taskId, List`1 unmatchedSignDocuments) in /_/src/Altinn.App.Core/Features/Signing/Services/SignDocumentManager.cs:line 263 + at Altinn.App.Core.Features.Signing.Services.SignDocumentManager.SynchronizeSigneeContextsWithSignDocuments(String taskId, List`1 signeeContexts, List`1 signDocuments, CancellationToken ct) in /_/src/Altinn.App.Core/Features/Signing/Services/SignDocumentManager.cs:line 136 + at Altinn.App.Core.Features.Signing.Services.SigningService.GetSigneeContexts(IInstanceDataAccessor instanceDataAccessor, AltinnSignatureConfiguration signatureConfiguration, CancellationToken ct) in /_/src/Altinn.App.Core/Features/Signing/Services/SigningService.cs:line 182 + at Altinn.App.Core.Features.Validation.Default.SigningTaskValidator.Validate(IInstanceDataAccessor dataAccessor, String taskId, String language) in /_/src/Altinn.App.Core/Features/Validation/Default/SigningTaskValidator.cs:line 92 + at Altinn.App.Core.Internal.Validation.ValidationService.<>c__DisplayClass5_0.<b__3>d.MoveNext() in /_/src/Altinn.App.Core/Internal/Validation/ValidationService.cs:line 67 + --- End of stack trace from previous location --- + at Altinn.App.Core.Internal.Validation.ValidationService.ValidateInstanceAtTask(IInstanceDataAccessor dataAccessor, String taskId, List`1 ignoredValidators, Nullable`1 onlyIncrementalValidators, String language) in /_/src/Altinn.App.Core/Internal/Validation/ValidationService.cs:line 92 + at Altinn.App.Api.Controllers.ProcessController.GetValidationProblemDetails(Instance instance, String currentTaskId, String language) in /_/src/Altinn.App.Api/Controllers/ProcessController.cs:line 249 + at Altinn.App.Api.Controllers.ProcessController.NextElement(String org, String app, Int32 instanceOwnerPartyId, Guid instanceGuid, CancellationToken ct, String elementId, String language, ProcessNext processNext) in /_/src/Altinn.App.Api/Controllers/ProcessController.cs:line 396 +[basic/signing-simple] [INFO] ### Response: Process.NextElement - ObjectResult, StatusCode: 500 +[basic/signing-simple] [INFO] ### Request: Instances.Get - User: SystemUser/950474084/d111dbab-d619-4f15-bf29-58fe570a9ae6, AuthLevel: 3, AuthMethod: maskinporten +[basic/signing-simple] [INFO] ### Response: Instances.Get - OkObjectResult, StatusCode: 200 +[basic/signing-simple] [INFO] ### Request: ApplicationMetadata.GetAction - User: None/none, AuthLevel: 0, AuthMethod: none +[basic/signing-simple] [INFO] ### Response: ApplicationMetadata.GetAction - OkObjectResult, StatusCode: 200 +[basic/signing-simple] [INFO] ### Request: Data.Get - User: SystemUser/950474084/d111dbab-d619-4f15-bf29-58fe570a9ae6, AuthLevel: 3, AuthMethod: maskinporten +[basic/signing-simple] [INFO] IDataProcessor.ProcessDataRead +[basic/signing-simple] [INFO] ### Response: Data.Get - OkObjectResult, StatusCode: 200 +[basic/signing-simple] [INFO] ### Request: Data.Get - User: SystemUser/950474084/d111dbab-d619-4f15-bf29-58fe570a9ae6, AuthLevel: 3, AuthMethod: maskinporten +[basic/signing-simple] [INFO] ### Response: Data.Get - FileStreamResult, StatusCode: \ No newline at end of file diff --git a/test/Altinn.App.Integration.Tests/Signing/_snapshots/SimpleTests.Full_auth=User_0_Instance.verified.txt b/test/Altinn.App.Integration.Tests/Signing/_snapshots/SimpleTests.Full_auth=User_0_Instance.verified.txt new file mode 100644 index 000000000..de697779b --- /dev/null +++ b/test/Altinn.App.Integration.Tests/Signing/_snapshots/SimpleTests.Full_auth=User_0_Instance.verified.txt @@ -0,0 +1,127 @@ +{ + HttpResponse: { + Version: 1.1, + Content: { + Headers: { + Content-Type: [ + application/json; charset=utf-8 + ] + } + }, + StatusCode: Created, + ReasonPhrase: Created, + Headers: { + Date: , + Server: [ + Kestrel + ], + Cache-Control: [ + no-store, no-cache + ], + Location: [ + https://app:5005/ttd/basic/instances/501337/ + ], + Transfer-Encoding: [ + chunked + ], + Request-Context: [ + appId= + ], + X-Frame-Options: [ + deny + ], + X-Content-Type-Options: [ + nosniff + ], + X-XSS-Protection: [ + 0 + ], + Referrer-Policy: [ + no-referrer + ] + }, + TrailingHeaders: {}, + RequestMessage: { + Version: 1.1, + Content: { + Headers: { + Content-Type: [ + application/json + ], + Content-Length: [ + 189 + ] + } + }, + Method: { + Method: POST + }, + RequestUri: http://local.altinn.cloud:/ttd/basic/instances/create, + Headers: { + Authorization: [ + Bearer + ], + User-Agent: [ + Altinn.App.Integration.Tests + ] + } + }, + IsSuccessStatusCode: true + }, + Response: { + Id: 501337/, + InstanceOwner: { + PartyId: 501337, + PersonNumber: 01039012345 + }, + AppId: ttd/basic, + Org: ttd, + SelfLinks: { + Apps: https://app:5005/ttd/basic/instances/501337/, + Platform: https://platform.local.altinn.cloud/storage/api/v1/instances/501337/ + }, + VisibleAfter: DateTime_1, + Process: { + Started: DateTime_2, + StartEvent: StartEvent_1, + CurrentTask: { + Flow: 2, + Started: DateTime_3, + ElementId: Task_1, + Name: Fyll ut og signer, + AltinnTaskType: signing, + FlowType: CompleteCurrentMoveToNext + } + }, + Status: { + IsArchived: false, + IsSoftDeleted: false, + IsHardDeleted: false, + ReadStatus: Read + }, + Data: [ + { + Id: , + InstanceGuid: , + DataType: model, + ContentType: application/xml, + BlobStoragePath: ttd/basic//data/, + SelfLinks: { + Apps: https://app:5005/ttd/basic/instances/501337//data/, + Platform: https://platform./storage/api/v1/instances/501337//data/ + }, + Size: 176, + Locked: false, + IsRead: true, + Created: DateTime_4, + CreatedBy: 1337, + LastChanged: DateTime_4, + LastChangedBy: 1337 + } + ], + Created: DateTime_1, + CreatedBy: 1337, + LastChanged: DateTime_1, + LastChangedBy: 1337 + } +} \ No newline at end of file diff --git a/test/Altinn.App.Integration.Tests/Signing/_snapshots/SimpleTests.Full_auth=User_1_ProcessNext.verified.txt b/test/Altinn.App.Integration.Tests/Signing/_snapshots/SimpleTests.Full_auth=User_1_ProcessNext.verified.txt new file mode 100644 index 000000000..f4363ec74 --- /dev/null +++ b/test/Altinn.App.Integration.Tests/Signing/_snapshots/SimpleTests.Full_auth=User_1_ProcessNext.verified.txt @@ -0,0 +1,74 @@ +{ + HttpResponse: { + Version: 1.1, + Content: { + Headers: { + Content-Type: [ + application/json; charset=utf-8 + ] + } + }, + StatusCode: OK, + ReasonPhrase: OK, + Headers: { + Date: , + Server: [ + Kestrel + ], + Cache-Control: [ + no-store, no-cache + ], + Transfer-Encoding: [ + chunked + ], + Request-Context: [ + appId= + ], + X-Frame-Options: [ + deny + ], + X-Content-Type-Options: [ + nosniff + ], + X-XSS-Protection: [ + 0 + ], + Referrer-Policy: [ + no-referrer + ] + }, + TrailingHeaders: {}, + RequestMessage: { + Version: 1.1, + Content: { + Headers: { + Content-Type: [ + application/json + ], + Content-Length: [ + 41 + ] + } + }, + Method: { + Method: PUT + }, + RequestUri: http://local.altinn.cloud:/ttd/basic/instances/501337//process/next, + Headers: { + Authorization: [ + Bearer + ], + User-Agent: [ + Altinn.App.Integration.Tests + ] + } + }, + IsSuccessStatusCode: true + }, + Response: { + Started: DateTime_1, + StartEvent: StartEvent_1, + Ended: DateTime_2, + EndEvent: EndEvent_1 + } +} \ No newline at end of file diff --git a/test/Altinn.App.Integration.Tests/Signing/_snapshots/SimpleTests.Full_auth=User_2_Download-Instance.verified.txt b/test/Altinn.App.Integration.Tests/Signing/_snapshots/SimpleTests.Full_auth=User_2_Download-Instance.verified.txt new file mode 100644 index 000000000..962220380 --- /dev/null +++ b/test/Altinn.App.Integration.Tests/Signing/_snapshots/SimpleTests.Full_auth=User_2_Download-Instance.verified.txt @@ -0,0 +1,161 @@ +{ + HttpResponse: { + Version: 1.1, + Content: { + Headers: { + Content-Type: [ + application/json; charset=utf-8 + ] + } + }, + StatusCode: OK, + ReasonPhrase: OK, + Headers: { + Date: , + Server: [ + Kestrel + ], + Cache-Control: [ + no-store, no-cache + ], + Transfer-Encoding: [ + chunked + ], + Request-Context: [ + appId= + ], + X-Frame-Options: [ + deny + ], + X-Content-Type-Options: [ + nosniff + ], + X-XSS-Protection: [ + 0 + ], + Referrer-Policy: [ + no-referrer + ] + }, + TrailingHeaders: {}, + RequestMessage: { + Version: 1.1, + Method: { + Method: GET + }, + RequestUri: http://local.altinn.cloud:/ttd/basic/instances/501337/, + Headers: { + Authorization: [ + Bearer + ], + User-Agent: [ + Altinn.App.Integration.Tests + ] + } + }, + IsSuccessStatusCode: true + }, + Response: { + Id: 501337/, + InstanceOwner: { + PartyId: 501337, + PersonNumber: 01039012345 + }, + AppId: ttd/basic, + Org: ttd, + SelfLinks: { + Apps: https://app:5005/ttd/basic/instances/501337/, + Platform: https://platform.local.altinn.cloud/storage/api/v1/instances/501337/ + }, + VisibleAfter: DateTime_1, + Process: { + Started: DateTime_2, + StartEvent: StartEvent_1, + Ended: DateTime_3, + EndEvent: EndEvent_1 + }, + Status: { + IsArchived: true, + Archived: DateTime_3, + IsSoftDeleted: false, + IsHardDeleted: false, + ReadStatus: Read + }, + Data: [ + { + Id: , + InstanceGuid: , + DataType: model, + ContentType: application/xml, + BlobStoragePath: ttd/basic//data/, + SelfLinks: { + Apps: https://app:5005/ttd/basic/instances/501337//data/, + Platform: https://platform.local.altinn.cloud/storage/api/v1/instances/501337//data/ + }, + Size: {Scrubbed}, + Locked: true, + IsRead: true, + Created: DateTime_4, + CreatedBy: 1337, + LastChanged: DateTime_4, + LastChangedBy: 1337 + }, + { + Id: , + InstanceGuid: , + DataType: signatureInformation, + Filename: signatureInformation.json, + ContentType: application/json, + BlobStoragePath: ttd/basic//data/, + SelfLinks: { + Apps: https://app:5005/ttd/basic/instances/501337//data/, + Platform: https://platform.local.altinn.cloud/storage/api/v1/instances/501337//data/ + }, + Size: {Scrubbed}, + Locked: false, + IsRead: true, + References: [ + { + Value: Task_1, + Relation: GeneratedFrom, + ValueType: Task + } + ], + Created: DateTime_5, + CreatedBy: 1337, + LastChanged: DateTime_5, + LastChangedBy: 1337 + }, + { + Id: , + InstanceGuid: , + DataType: ref-data-as-pdf, + Filename: basic.pdf, + ContentType: application/pdf, + BlobStoragePath: ttd/basic//data/, + SelfLinks: { + Apps: https://app:5005/ttd/basic/instances/501337//data/, + Platform: https://platform.local.altinn.cloud/storage/api/v1/instances/501337//data/ + }, + Size: {Scrubbed}, + Locked: false, + IsRead: true, + References: [ + { + Value: Task_1, + Relation: GeneratedFrom, + ValueType: Task + } + ], + Created: DateTime_6, + CreatedBy: 1337, + LastChanged: DateTime_6, + LastChangedBy: 1337 + } + ], + Created: DateTime_1, + CreatedBy: 1337, + LastChanged: DateTime_7, + LastChangedBy: 1337 + } +} \ No newline at end of file diff --git a/test/Altinn.App.Integration.Tests/Signing/_snapshots/SimpleTests.Full_auth=User_3_Download-Data[0].verified.txt b/test/Altinn.App.Integration.Tests/Signing/_snapshots/SimpleTests.Full_auth=User_3_Download-Data[0].verified.txt new file mode 100644 index 000000000..daec95db7 --- /dev/null +++ b/test/Altinn.App.Integration.Tests/Signing/_snapshots/SimpleTests.Full_auth=User_3_Download-Data[0].verified.txt @@ -0,0 +1,66 @@ +{ + HttpResponse: { + Version: 1.1, + Content: { + Headers: { + Content-Type: [ + application/json; charset=utf-8 + ] + } + }, + StatusCode: OK, + ReasonPhrase: OK, + Headers: { + Date: , + Server: [ + Kestrel + ], + Cache-Control: [ + no-store, no-cache + ], + Transfer-Encoding: [ + chunked + ], + Request-Context: [ + appId= + ], + X-Frame-Options: [ + deny + ], + X-Content-Type-Options: [ + nosniff + ], + X-XSS-Protection: [ + 0 + ], + Referrer-Policy: [ + no-referrer + ] + }, + TrailingHeaders: {}, + RequestMessage: { + Version: 1.1, + Method: { + Method: GET + }, + RequestUri: http://local.altinn.cloud:/ttd/basic/instances/501337//data/, + Headers: { + Authorization: [ + Bearer + ], + Accept: [ + application/json + ], + User-Agent: [ + Altinn.App.Integration.Tests + ] + } + }, + IsSuccessStatusCode: true + }, + Response: { + property1: 1, + property2: null, + property3: null + } +} \ No newline at end of file diff --git a/test/Altinn.App.Integration.Tests/Signing/_snapshots/SimpleTests.Full_auth=User_4_Download-Data[1].verified.txt b/test/Altinn.App.Integration.Tests/Signing/_snapshots/SimpleTests.Full_auth=User_4_Download-Data[1].verified.txt new file mode 100644 index 000000000..8e094b633 --- /dev/null +++ b/test/Altinn.App.Integration.Tests/Signing/_snapshots/SimpleTests.Full_auth=User_4_Download-Data[1].verified.txt @@ -0,0 +1,82 @@ +{ + HttpResponse: { + Version: 1.1, + Content: { + Headers: { + Content-Length: [ + 510 + ], + Content-Type: [ + application/json + ], + Content-Disposition: [ + attachment; filename=signatureInformation.json; filename*=UTF-8''signatureInformation.json + ] + } + }, + StatusCode: OK, + ReasonPhrase: OK, + Headers: { + Date: , + Server: [ + Kestrel + ], + Cache-Control: [ + no-store, no-cache + ], + Request-Context: [ + appId= + ], + X-Frame-Options: [ + deny + ], + X-Content-Type-Options: [ + nosniff + ], + X-XSS-Protection: [ + 0 + ], + Referrer-Policy: [ + no-referrer + ] + }, + TrailingHeaders: {}, + RequestMessage: { + Version: 1.1, + Method: { + Method: GET + }, + RequestUri: http://local.altinn.cloud:/ttd/basic/instances/501337//data/, + Headers: { + Authorization: [ + Bearer + ], + Accept: [ + application/json + ], + User-Agent: [ + Altinn.App.Integration.Tests + ] + } + }, + IsSuccessStatusCode: true + }, + Response: { + id: , + instanceGuid: , + signedTime: DateTimeOffset_1, + signeeInfo: { + userId: 1337, + systemUserId: null, + personNumber: 01039012345, + organisationNumber: null + }, + dataElementSignatures: [ + { + dataElementId: , + sha256Hash: 9621bdd8df0f3c757f9a91f449e9cf32e2d6c77aca437c3a117c6b78b05343b7, + signed: true + } + ] + } +} \ No newline at end of file diff --git a/test/Altinn.App.Integration.Tests/Signing/_snapshots/SimpleTests.Full_auth=User_5_Download-PDF.verified.txt b/test/Altinn.App.Integration.Tests/Signing/_snapshots/SimpleTests.Full_auth=User_5_Download-PDF.verified.txt new file mode 100644 index 000000000..971604494 --- /dev/null +++ b/test/Altinn.App.Integration.Tests/Signing/_snapshots/SimpleTests.Full_auth=User_5_Download-PDF.verified.txt @@ -0,0 +1,61 @@ +{ + HttpResponse: { + Version: 1.1, + Content: { + Headers: { + Content-Type: [ + application/pdf + ], + Content-Disposition: [ + attachment; filename=basic.pdf; filename*=UTF-8''basic.pdf + ] + } + }, + StatusCode: OK, + ReasonPhrase: OK, + Headers: { + Date: , + Server: [ + Kestrel + ], + Cache-Control: [ + no-store, no-cache + ], + Request-Context: [ + appId= + ], + X-Frame-Options: [ + deny + ], + X-Content-Type-Options: [ + nosniff + ], + X-XSS-Protection: [ + 0 + ], + Referrer-Policy: [ + no-referrer + ] + }, + TrailingHeaders: {}, + RequestMessage: { + Version: 1.1, + Method: { + Method: GET + }, + RequestUri: http://local.altinn.cloud:/ttd/basic/instances/501337//data/, + Headers: { + Authorization: [ + Bearer + ], + Accept: [ + application/octet-stream + ], + User-Agent: [ + Altinn.App.Integration.Tests + ] + } + }, + IsSuccessStatusCode: true + } +} \ No newline at end of file diff --git a/test/Altinn.App.Integration.Tests/Signing/_snapshots/SimpleTests.Full_auth=User_6_Logs.verified.txt b/test/Altinn.App.Integration.Tests/Signing/_snapshots/SimpleTests.Full_auth=User_6_Logs.verified.txt new file mode 100644 index 000000000..eb75bc91f --- /dev/null +++ b/test/Altinn.App.Integration.Tests/Signing/_snapshots/SimpleTests.Full_auth=User_6_Logs.verified.txt @@ -0,0 +1,27 @@ +[basic/signing-simple] [INIT INFO] Fixture configuration updated +[basic/signing-simple] [INFO] ### Request: Instances.PostSimplified - User: User/1337/501337, AuthLevel: 3, AuthMethod: BankID +[basic/signing-simple] [INFO] IInstantiationValidator.Validate +[basic/signing-simple] [INFO] IProcessTaskStart.Start +[basic/signing-simple] [INFO] IInstantiationProcessor.DataCreation +[basic/signing-simple] [INFO] ### Response: Instances.PostSimplified - CreatedResult, StatusCode: 201 +[basic/signing-simple] [INFO] ### Request: Process.NextElement - User: User/1337/501337, AuthLevel: 3, AuthMethod: BankID +[basic/signing-simple] [INFO] IValidator.Validate +[basic/signing-simple] [INFO] ITaskValidator.ValidateTask +[basic/signing-simple] [INFO] IDataElementValidator.ValidateDataElement +[basic/signing-simple] [INFO] IFormDataValidator.ValidateFormData +[basic/signing-simple] [INFO] IProcessTaskEnd.End +[basic/signing-simple] [INFO] IDataProcessor.ProcessDataRead +[basic/signing-simple] [INFO] IExternalApiClient.GetExternalApiDataAsync +[basic/signing-simple] [INFO] IProcessEnd.End +[basic/signing-simple] [INFO] ### Response: Process.NextElement - OkObjectResult, StatusCode: 200 +[basic/signing-simple] [INFO] ### Request: Instances.Get - User: User/1337/501337, AuthLevel: 3, AuthMethod: BankID +[basic/signing-simple] [INFO] ### Response: Instances.Get - OkObjectResult, StatusCode: 200 +[basic/signing-simple] [INFO] ### Request: ApplicationMetadata.GetAction - User: None/none, AuthLevel: 0, AuthMethod: none +[basic/signing-simple] [INFO] ### Response: ApplicationMetadata.GetAction - OkObjectResult, StatusCode: 200 +[basic/signing-simple] [INFO] ### Request: Data.Get - User: User/1337/501337, AuthLevel: 3, AuthMethod: BankID +[basic/signing-simple] [INFO] IDataProcessor.ProcessDataRead +[basic/signing-simple] [INFO] ### Response: Data.Get - OkObjectResult, StatusCode: 200 +[basic/signing-simple] [INFO] ### Request: Data.Get - User: User/1337/501337, AuthLevel: 3, AuthMethod: BankID +[basic/signing-simple] [INFO] ### Response: Data.Get - FileStreamResult, StatusCode: +[basic/signing-simple] [INFO] ### Request: Data.Get - User: User/1337/501337, AuthLevel: 3, AuthMethod: BankID +[basic/signing-simple] [INFO] ### Response: Data.Get - FileStreamResult, StatusCode: \ No newline at end of file diff --git a/test/Altinn.App.Integration.Tests/_fixture/Operations/AppFixture.Instances.cs b/test/Altinn.App.Integration.Tests/_fixture/Operations/AppFixture.Instances.cs index c7f38bbd2..48bee58f8 100644 --- a/test/Altinn.App.Integration.Tests/_fixture/Operations/AppFixture.Instances.cs +++ b/test/Altinn.App.Integration.Tests/_fixture/Operations/AppFixture.Instances.cs @@ -89,7 +89,8 @@ public async Task Download(string token, ReadApiResponse ac == "application/json"); + if (dataType.AppLogic?.ClassRef is not null || hasJsonContentType) request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); else request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/octet-stream")); @@ -108,11 +109,21 @@ public async Task Download(string token, ReadApiResponse(); - var binaryData = new InstanceDataDownload.Binary(i, dataGuid, dataType.Id, readResponse); - data.Add(binaryData); + if (hasJsonContentType) + { + var dataResponse = new ApiResponse(_fixture, response); + var readResponse = await dataResponse.Read(); // Argon is being used by VerifyTests for JSON + var formData = new InstanceDataDownload.Json(i, dataGuid, dataType.Id, readResponse); + data.Add(formData); + } + else + { + // This is binary data (attachment) + var dataResponse = new ApiResponse(_fixture, response); + var readResponse = await dataResponse.Read(); + var binaryData = new InstanceDataDownload.Binary(i, dataGuid, dataType.Id, readResponse); + data.Add(binaryData); + } } } catch (Exception) @@ -345,6 +356,15 @@ await verifier.Verify( sourceFile: sourceFile ); break; + case InstanceDataDownload.Json json: + await verifier.Verify( + json.Data, + snapshotName: $"Download-Data[{data.Index}]", + scrubbers: scrubbers, + parameters: parameters, + sourceFile: sourceFile + ); + break; case InstanceDataDownload.Binary binary: var finalScrubbers = scrubbers; if (data.DataType == "ref-data-as-pdf") @@ -391,6 +411,12 @@ internal sealed record Form(int Index, Guid Id, string DataType, ReadApiResponse public override void Dispose() => Data.Dispose(); } + internal sealed record Json(int Index, Guid Id, string DataType, ReadApiResponse Data) + : InstanceDataDownload(Index, Id, DataType) + { + public override void Dispose() => Data.Dispose(); + } + internal sealed record Binary(int Index, Guid Id, string DataType, ReadApiResponse Data) : InstanceDataDownload(Index, Id, DataType) { diff --git a/test/Altinn.App.Integration.Tests/_testapps/basic/_scenarios/signing-simple/config/applicationmetadata.json b/test/Altinn.App.Integration.Tests/_testapps/basic/_scenarios/signing-simple/config/applicationmetadata.json new file mode 100644 index 000000000..d0a57719e --- /dev/null +++ b/test/Altinn.App.Integration.Tests/_testapps/basic/_scenarios/signing-simple/config/applicationmetadata.json @@ -0,0 +1,85 @@ +{ + "id": "ttd/basic", + "org": "ttd", + "title": { + "nb": "basic" + }, + "dataTypes": [ + { + "id": "ref-data-as-pdf", + "allowedContentTypes": [ + "application/pdf" + ], + "maxCount": 0, + "minCount": 0, + "enablePdfCreation": true, + "enableFileScan": false, + "validationErrorOnPendingFileScan": false, + "enabledFileAnalysers": [], + "enabledFileValidators": [] + }, + { + "id": "attachment", + "allowedContentTypes": [ + "application/pdf", + "image/jpeg", + "image/png", + "text/plain" + ], + "maxCount": 10, + "minCount": 0, + "taskId": "Task_1", + "enablePdfCreation": false, + "enableFileScan": false, + "validationErrorOnPendingFileScan": false, + "enabledFileAnalysers": [], + "enabledFileValidators": [] + }, + { + "id": "model", + "allowedContentTypes": [ + "application/xml" + ], + "appLogic": { + "autoCreate": true, + "classRef": "Altinn.App.Models.model.model", + "allowAnonymousOnStateless": false, + "autoDeleteOnProcessEnd": false + }, + "taskId": "Task_1", + "maxCount": 1, + "minCount": 1, + "enablePdfCreation": true, + "enableFileScan": false, + "validationErrorOnPendingFileScan": false, + "enabledFileAnalysers": [], + "enabledFileValidators": [] + }, + { + "id": "signatureInformation", + "allowedContentTypes": [ + "application/json" + ], + "maxCount": 1, + "minCount": 0, + "enablePdfCreation": false, + "enableFileScan": false, + "validationErrorOnPendingFileScan": false, + "enabledFileAnalysers": [], + "enabledFileValidators": [], + "allowedContributers": ["app:owned"] + } + ], + "partyTypesAllowed": { + "bankruptcyEstate": false, + "organisation": false, + "person": false, + "subUnit": false + }, + "autoDeleteOnProcessEnd": false, + "disallowUserInstantiation": false, + "created": "2024-05-15T12:17:03.656228Z", + "createdBy": "altinn", + "lastChanged": "2024-05-15T12:17:03.65623Z", + "lastChangedBy": "altinn" +} diff --git a/test/Altinn.App.Integration.Tests/_testapps/basic/_scenarios/signing-simple/config/authorization/policy.xml b/test/Altinn.App.Integration.Tests/_testapps/basic/_scenarios/signing-simple/config/authorization/policy.xml new file mode 100644 index 000000000..71a86273e --- /dev/null +++ b/test/Altinn.App.Integration.Tests/_testapps/basic/_scenarios/signing-simple/config/authorization/policy.xml @@ -0,0 +1,318 @@ + + + + + A rule giving user with role REGNA or DAGL and the app owner [ORG] the right to instantiate a instance of a given app of [ORG]/[APP] + + + + + REGNA + + + + + + DAGL + + + + + + [ORG] + + + + + + 991825827 + + + + + + f58fe166-bc22-4899-beb7-c3e8e3332f43 + + + + + + + + [ORG] + + + + [APP] + + + + + + + + instantiate + + + + + + read + + + + + + + + Rule that defines that user with role REGNA or DAGL can read and write for [ORG]/[APP] when it is in Task_1 + + + + + REGNA + + + + + + DAGL + + + + + + 991825827 + + + + + + f58fe166-bc22-4899-beb7-c3e8e3332f43 + + + + + + + + [ORG] + + + + [APP] + + + + Task_1 + + + + + + [ORG] + + + + [APP] + + + + EndEvent_1 + + + + + + + + read + + + + + + write + + + + + + sign + + + + + + + + Rule that defines that user with role REGNA or DAGL can delete instances of [ORG]/[APP] + + + + + REGNA + + + + + + DAGL + + + + + + + + [ORG] + + + + [APP] + + + + + + + + delete + + + + + + + + Rule that defines that org can write to instances of [ORG]/[APP] for any states + + + + + [ORG] + + + + + + + + [ORG] + + + + [APP] + + + + + + + + write + + + + + + + + Rule that defines that org can complete an instance of [ORG]/[APP] which state is at the end event. + + + + + [ORG] + + + + + + + + [ORG] + + + + [APP] + + + + EndEvent_1 + + + + + + + + complete + + + + + + + + A rule giving user with role REGNA or DAGL and the app owner [ORG] the right to read the appresource events of a given app of [ORG]/[APP] + + + + + REGNA + + + + + + DAGL + + + + + + [ORG] + + + + + + + + [ORG] + + + + [APP] + + + + events + + + + + + + + read + + + + + + + + + + 2 + + + + + 3 + + + + diff --git a/test/Altinn.App.Integration.Tests/_testapps/basic/_scenarios/signing-simple/config/process/process.bpmn b/test/Altinn.App.Integration.Tests/_testapps/basic/_scenarios/signing-simple/config/process/process.bpmn new file mode 100644 index 000000000..f10343f16 --- /dev/null +++ b/test/Altinn.App.Integration.Tests/_testapps/basic/_scenarios/signing-simple/config/process/process.bpmn @@ -0,0 +1,55 @@ + + + + + Flow_0esyro2 + + + + + signing + + sign + reject + + + + model + + signatureInformation + true + + + + Flow_0esyro2 + Flow_1438z6c + + + Flow_1438z6c + + + + + + + + + + + + + + + + + + + + + + + + + + +