-
Notifications
You must be signed in to change notification settings - Fork 14
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
Feat/Payment process task and some process engine refactoring #448
Conversation
…ent related code.
…per early edition.
…ct logic. Update unit tests.
…roller. Should never have been there.
/// <inheritdoc/> | ||
public async Task Initialize(string taskId, Instance instance, Dictionary<string, string> prefill) | ||
{ | ||
_logger.LogDebug("OnStartProcessTask for {InstanceId}", instance.Id); |
Check failure
Code scanning / CodeQL
Log entries created from user input High
user-provided value
This log entry depends on a
user-provided value
This log entry depends on a
user-provided value
This log entry depends on a
user-provided value
This log entry depends on a
user-provided value
This log entry depends on a
user-provided value
This log entry depends on a
user-provided value
This log entry depends on a
user-provided value
This log entry depends on a user-provided value.
This log entry depends on a user-provided value.
This log entry depends on a user-provided value.
This log entry depends on a user-provided value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thoughts? These debugs already existed. I guess debug logs only run on local dev?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have lots of these issues. The problem is that if you log to standard out with a newline separating log entries, this pattern is problematic, because the user might provide two a new forged log entry between two newlines. That trick won't fool application insights, so I think we can safely ignore these.
The other issue is that C# might have a similar issue as log4j (log4shell), but after java was caught, lots of people checked dotnet for similar issues, and none was reported.
test/Altinn.App.Core.Tests/Internal/Process/ProcessTasks/PaymentProcessTaskTests.cs
Fixed
Show fixed
Hide fixed
...Altinn.App.Core.Tests/Internal/Process/EventHandlers/ProcessTask/EndTaskEventHandlerTests.cs
Fixed
Show fixed
Hide fixed
...Altinn.App.Core.Tests/Internal/Process/EventHandlers/ProcessTask/EndTaskEventHandlerTests.cs
Fixed
Show fixed
Hide fixed
{ | ||
private Mock<IProcessTaskDataLocker> _processTaskDataLocker; | ||
private Mock<IProcessTaskFinalizer> _processTaskFinisher; | ||
private Mock<IServiceTask> _pdfServiceTask; |
Check notice
Code scanning / CodeQL
Missed 'readonly' opportunity Note test
private Mock<IProcessTaskDataLocker> _processTaskDataLocker; | ||
private Mock<IProcessTaskFinalizer> _processTaskFinisher; | ||
private Mock<IServiceTask> _pdfServiceTask; | ||
private Mock<IServiceTask> _eformidlingServiceTask; |
Check notice
Code scanning / CodeQL
Missed 'readonly' opportunity Note test
foreach (var processTaskType in _processTasks) | ||
{ | ||
if (processTaskType.Type == altinnTaskType) | ||
{ | ||
return processTaskType; | ||
} | ||
} |
Check notice
Code scanning / CodeQL
Missed opportunity to use Where Note
src/Altinn.App.Core/Features/Payment/Providers/Nets/NetsPaymentProcessor.cs
Fixed
Show fixed
Hide fixed
test/Altinn.App.Core.Tests/Features/Payment/PaymentServiceTests.cs
Dismissed
Show dismissed
Hide dismissed
# Conflicts: # test/Altinn.App.Api.Tests/Mocks/DataClientMock.cs
…CurrentTask is null. StartEvent, EndEvent etc.
} | ||
|
||
/// <inheritdoc /> | ||
public async Task<PaymentStatus?> GetPaymentStatus(Instance instance, string paymentReference, decimal expectedTotalIncVat) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any input on what kinds of verifications we should do to check if the payment is in good health? Right now I'm just doing a simple sum comparison. Charged amount == our local calculation of total inc VAT.
src/Altinn.App.Core/Internal/Process/EventHandlers/EndEventEventHandler.cs
Show resolved
Hide resolved
src/Altinn.App.Core/Internal/Process/EventHandlers/ProcessTask/AbandonTaskEventHandler.cs
Show resolved
Hide resolved
src/Altinn.App.Core/Internal/Process/EventHandlers/ProcessTask/EndTaskEventHandler.cs
Show resolved
Hide resolved
src/Altinn.App.Core/Internal/Process/EventHandlers/ProcessTask/StartTaskEventHandler.cs
Show resolved
Hide resolved
src/Altinn.App.Core/Internal/Process/ProcessTasks/Common/ProcessTaskDataLocker.cs
Show resolved
Hide resolved
src/Altinn.App.Core/Internal/Process/ProcessTasks/Common/ProcessTaskFinalizer.cs
Show resolved
Hide resolved
src/Altinn.App.Core/Internal/Process/ProcessTasks/Common/ProcessTaskInitializer.cs
Show resolved
Hide resolved
src/Altinn.App.Core/Internal/Process/ServiceTasks/EformidlingServiceTask.cs
Show resolved
Hide resolved
@@ -20,7 +19,7 @@ | |||
|
|||
namespace Altinn.App.PlatformServices.Tests.Implementation; | |||
|
|||
public class DefaultTaskEventsTests: IDisposable | |||
public class DefaultTaskEventsTests : IDisposable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: Remove file. Consider if more tests should be kept.
…ementAndModel_WhenDataElementExists
…payment status check. Remove setting for integration type.
…ction extension, so it's fully opt in.
|
/// <summary> | ||
/// Removes data elements generated from a task, if the data elements are tagged with the task ID. | ||
/// </summary> | ||
/// <param name="instance"></param> | ||
/// <param name="taskId"></param> | ||
/// <returns></returns> | ||
Task RemoveDataElementsGeneratedFromTask(Instance instance, string taskId); | ||
|
||
/// <summary> | ||
/// Remove hidden data from the instance. | ||
/// </summary> | ||
/// <param name="instance"></param> | ||
/// <param name="instanceGuid"></param> | ||
/// <param name="connectedDataTypes"></param> | ||
/// <returns></returns> | ||
Task RemoveHiddenData(Instance instance, Guid instanceGuid, List<DataType>? connectedDataTypes); | ||
|
||
/// <summary> | ||
/// Remove shadow fields from the instance. | ||
/// </summary> | ||
/// <param name="instance"></param> | ||
/// <param name="instanceGuid"></param> | ||
/// <param name="connectedDataTypes"></param> | ||
/// <returns></returns> | ||
Task RemoveShadowFields(Instance instance, Guid instanceGuid, List<DataType> connectedDataTypes); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hvorfor ligger disse metodene i interfacet? De kalles da bare fra Finalize?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Det tror jeg var en glipp. Takk!
/// <summary> | ||
/// Updates presentation texts on the instance for a given data type and data. | ||
/// </summary> | ||
/// <param name="instance"></param> | ||
/// <param name="dataType"></param> | ||
/// <param name="data"></param> | ||
/// <returns></returns> | ||
Task UpdatePresentationTextsOnInstance(Instance instance, string dataType, dynamic data); | ||
|
||
/// <summary> | ||
/// Updates data values on the instance for a given data type and data. | ||
/// </summary> | ||
/// <param name="instance"></param> | ||
/// <param name="dataType"></param> | ||
/// <param name="data"></param> | ||
/// <returns></returns> | ||
Task UpdateDataValuesOnInstance(Instance instance, string dataType, object data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Samme her. De har vel ikke noe i interfacet å gjøre?
IAppModel appModel, | ||
IAppResources appResources, | ||
LayoutEvaluatorStateInitializer layoutEvaluatorStateInitializer, | ||
IOptions<AppSettings>? appSettings = null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hvorfor er AppSettings nullable?
Creating new PR. |
Description
Adding payment process task. Refactored the process engine code somewhat.
Related Issue(s)
Verification
Documentation