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

V8 #285

Closed
wants to merge 51 commits into from
Closed

V8 #285

wants to merge 51 commits into from

Conversation

tjololo
Copy link
Member

@tjololo tjololo commented Aug 8, 2023

Description

Related Issue(s)

  • #{issue number}

Verification

  • Your code builds clean without any errors or warnings
  • Manual testing done (required)
  • Relevant automated test added (if you find this hard, leave it and we'll help out)
  • All tests run green

Documentation

  • User documentation is updated with a separate linked PR in altinn-studio-docs. (if applicable)

tjololo and others added 12 commits May 15, 2023 15:10
#207 (#237)

* New process engine seems to work.
Needs more tests and verification

* refactored to make class more testable

* added tests for ProcessEngine

* Refactor and delete old and unused code

* added tests for ProcessEventDispatcher

* Add tests and fix ProcessNavigator

* add available actions to currentTask and perform authcheck

* action passed along from PUT process/next to gateway filters

* fix bug in AppProcessState ctor

* add fields for read/write and check users permissions

* Fix test stub implementation of IProcessExclusiveGateway

* Fixing some reported code smells

* Some code smell fixes.
Added logic to dispatch abandon event if action is reject

* remove unfinished test file

* add tests for method in ProcessClient

* add test for classes extending storage classes

* add test for null values in extensions

* revert code changes due to test

* add frontend feature and parse request body on process/next if present

* add frontend feature and parse request body on process/next if present

* fix codeql warning

* add v8 as target of github workflows in addition to main

* Fix return type of all methods in ProcessController returning ProcessState

* Authorize action moved to AuthorizationClient
TaskType is substituted with corresponding action earlier
Resolvs #207

* Fixed some issues after review and added some more tests

* fix codeQL warning and improve test

* Fix some code smells

* Update src/Altinn.App.Api/Controllers/InstancesController.cs

Co-authored-by: Ronny Birkeli <[email protected]>

* fix build error

---------

Co-authored-by: Ronny Birkeli <[email protected]>
* Working gateway filter leveraging expressions to make decisions

* remove logger

* Add tests for expressions function gatewayAction

* move test out of shared tests as it is only supported backend (no process in frontend)

* Add tests and small refactoring

* Fix code smells

* Fixes after review
* Add a hook in the process engine where custom code kan be injected when a given action is performed

* Refactor to UserAction
Add tests for UserActionFactory

* Add SignClient

* Chore/refactor interfaces and clients (#253)

* Huge refactoring

* Moved all interfaces from Altinn.App.Interfaces to namespaces under Altinn.App.Internal
* Interfaces for clients has postfix Client
* Marked all old interfaces as obsolete with message of what interface to use instead

* Actually add back the old interfaces

* Fixes after review

* Add tests for SignClient

* Remove dependency to Altinn.Platform.Storage.Interface nuget from API-project as it is included in Core-project which API-project depends on

* Implement signign action handler

* Fixes after review

* Fix codeQL notice and add test
* Lock and unlock method in storage client

* Mark HttpContent as nullable

* reformat code

* prepare for deletion of pdfs with outdated data

* Fix build error

* Last changes after merging in v8

* Remove changes in old obsolete interface

* Add generatedFrom logic for pdf generation

* Change to supply GeneratedFromTask instead. Remove old GeneratedFrom elements befor new end task is executed

* Fix codeQl error, warning and notice

* fix nullability warning

* Fix codesmell

* Fix some small things after self-review

* Apply suggestions from code review
* Add logic to write custom authorization logic for actions in a process task

* Add trailing linebreaks

* trailing linebreaks

* fix check. If taskId from input is null UserActionAuthorizer.TaskId also needs to be null.

* Enable nullability in AuthorizationServiceTests.cs

* remove nullability in AuthorizationServiceTests.cs as is not needed

* Add tests for GetPartyList and ValidateSelectedParty

* Refactor taskextension to group signature configuration

* Fix typoœœ

* check for missing config

* Add missing xml comment

* add test for missing config for SigningUserAction

* verify no more calls to sign client

* fix some codesmells
…gnatures (#266)

* Implement UniqueSignatureAuthorizer to support checking for unique signatures across signing taks

* trailing linebreaks

* add tests and fix nullability

* Add some more tests
* Expose prometheus endpoint and som default metrics

* Fix issues from CodeQL

* Fix codesmells from sonar
* Remove trailing slash from source filter in event subscription. (#242)

Co-authored-by: Ronny Birkeli <[email protected]>

* Fix unauthorized submit resulting in 500 (#243)

* catch PlatformException and return 403

* remove code smell

* add test for 403 case

* add test that other PlatformHttpExceptions are rethrown

* return ok inside try block

* chore(deps): update nuget non-major dependencies (#251)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Support for extended file analysis (#229)

Co-authored-by: Ronny Birkeli <[email protected]>

* chore(deps): update dependency coverlet.collector to v6 (#252)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Documentation of parameteres used when generating codelists (#259)

Co-authored-by: Ronny Birkeli <[email protected]>

* chore(deps): update nuget non-major dependencies (#254)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency jwtcookieauthentication to v3 (#258)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update nuget non-major dependencies (#270)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ronny Birkeli <[email protected]>

* Feat/add instance selection options to appmetadata (#271)

* Add instance selection option to appmetadata

* update test to use new OnEntry class

* Fix obsolete method in IAppResources

* newlines cleanup

---------

Co-authored-by: Vemund Gaukstad <[email protected]>

* Add defaultRowsPerPage option to InstanceSelection (#272)

* add defaultRowsPerPage option to InstanceSelection

* remove pagination class

* chore(deps): update nuget non-major dependencies (#274)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Mark onEntry as nullable and add check for null (#279)

* Introduce new option for default selected pages per row (#280)

* Introduce new option for default selected pages per row

* fix codesmells

* chore(deps): update nuget non-major dependencies (#281)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Fixed missing await statement (#282)

* Fixed missing await statement

* Changed from array to string

---------

Co-authored-by: Ronny Birkeli <[email protected]>

* Fix bug in 7.13.0 where anonymous statlessapps does not allow anonymous users even if configured (#283)

* Sync backend expression functions with frontend (#277)

* Implement missing functions in backend

* add some testcases for functions that should be evaluated before implemented in the backend code

* Simplify some functions

* last sync changes from main

* update some testfiles

* fix some codesmells

---------

Co-authored-by: Ronny Birkeli <[email protected]>
Co-authored-by: Ronny Birkeli <[email protected]>
Co-authored-by: Magnus Revheim Martinsen <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Comment on lines +75 to +78
catch (Exception exception)
{
_logger.LogWarning(exception, "Exception when sending event with the Events component");
}

Check notice

Code scanning / CodeQL

Generic catch clause Note

Generic catch clause.
Comment on lines +107 to +131
foreach (InstanceEvent instanceEvent in events)
{
if (Enum.TryParse<InstanceEventType>(instanceEvent.EventType, true, out InstanceEventType eventType))
{
string? elementId = instanceEvent.ProcessInfo?.CurrentTask?.ElementId;
ITask task = GetProcessTask(instanceEvent.ProcessInfo?.CurrentTask?.AltinnTaskType);
switch (eventType)
{
case InstanceEventType.process_StartEvent:
break;
case InstanceEventType.process_StartTask:
await task.HandleTaskStart(elementId, instance, prefill);
break;
case InstanceEventType.process_EndTask:
await task.HandleTaskComplete(elementId, instance);
break;
case InstanceEventType.process_AbandonTask:
await task.HandleTaskAbandon(elementId, instance);
break;
case InstanceEventType.process_EndEvent:
await _appEvents.OnEndAppEvent(instanceEvent.ProcessInfo?.EndEvent, instance);
break;
}
}
}

Check notice

Code scanning / CodeQL

Missed opportunity to use Where Note

This foreach loop
implicitly filters its target sequence
- consider filtering the sequence explicitly using '.Where(...)'.
Comment on lines +123 to +130
catch (Exception e)
{
using var jsonDocument = JsonDocument.Parse(data);

testCase.Name = jsonDocument.RootElement.GetProperty("name").GetString();
testCase.ExpectsFailure = jsonDocument.RootElement.TryGetProperty("expectsFailure", out var expectsFailure) ? expectsFailure.GetString() : null;
testCase.ParsingException = e;
}

Check notice

Code scanning / CodeQL

Generic catch clause Note test

Generic catch clause.
Comment on lines +70 to +76
if(outgoingFlows.Any(a => a.ConditionExpression != null))
{
gatewayFilter = _gatewayFactory.GetProcessExclusiveGateway("AltinnExpressionsExclusiveGateway");
} else
{
gatewayFilter = _gatewayFactory.GetProcessExclusiveGateway(directFlowTarget.Id);
}

Check notice

Code scanning / CodeQL

Missed ternary opportunity Note

Both branches of this 'if' statement write to the same variable - consider using '?' to express intent better.
src/Altinn.App.Api/Controllers/ProcessController.cs Dismissed Show dismissed Hide dismissed
var actualJson = JsonConvert.SerializeObject(actual);

var jsonCompare = expectedJson == actualJson;
if (jsonCompare == false)

Check notice

Code scanning / CodeQL

Unnecessarily complex Boolean expression Note test

The expression 'A == false' can be simplified to '!A'.
Comment on lines +62 to +65
return (authorizer.TaskId == null && authorizer.Action == null)
|| (authorizer.TaskId == null && authorizer.Action == action)
|| (authorizer.TaskId == taskId && authorizer.Action == null)
|| (authorizer.TaskId == taskId && authorizer.Action == action);

Check notice

Code scanning / CodeQL

Complex condition Note

Complex condition: too many logical operations in this expression.
# Conflicts:
#	src/Altinn.App.Core/Internal/App/FrontendFeatures.cs
#	src/Altinn.App.Core/Internal/Expressions/ExpressionEvaluator.cs
#	test/Altinn.App.Api.Tests/Controllers/FileScanControllerTests.cs
#	test/Altinn.App.Api.Tests/Controllers/ValidateControllerTests.cs
#	test/Altinn.App.Api.Tests/EFormidling/EformidlingStatusCheckEventHandlerTests.cs
#	test/Altinn.App.Api.Tests/Mocks/AppMetadataMock.cs
#	test/Altinn.App.Api.Tests/Mocks/DataClientMock.cs
#	test/Altinn.App.Api.Tests/Mocks/InstanceClientMockSi.cs
#	test/Altinn.App.Api.Tests/Program.cs
#	test/Altinn.App.Core.Tests/Internal/App/FrontendFeaturesTest.cs
tjololo and others added 7 commits August 17, 2023 09:46
* Make Metrics configurable through appsettings.json and move endpoint to separate port

* add missing trailing linebreaks
* Add tool for upgrading from v7 to v8

* rename cli tool and include release pipeline
# Conflicts:
#	src/Altinn.App.Core/Internal/Expressions/ExpressionEvaluator.cs
#	src/Altinn.App.Core/Internal/Expressions/LayoutEvaluatorState.cs
* frontend support for expression validation

* parse expression validation config

* parse config file

* evaluate expressions for validation

* add argv function

* migrate from newtonsoft and fix parsing

* improve error handling and fix numeric parse

* started making shared tests

* improved test runner

* fix list of resolved keys

* add tests and refactor jsondatamodel

* update settings

* add app-settings-rewriter to altinn-app-cli

* fix upgrade appsettings

* refactor JsonDataModel RemoveField and check deleteRow arg

* add source and throw exception
tjololo and others added 3 commits October 10, 2023 14:26
* Deserializing applicationmetadata with unknown root elements puts elements in jsonextensiondata dictionary

* Fix codeql and sonar warnings

* removed newtonsoft jsonextensiondata and added round trip test

* Add WebApplicationFactoryTest that (#324)

This is to ensure that the returned json actually includes the extra fields

---------

Co-authored-by: Ivar Nesje <[email protected]>
* MinVer update

adamralph/minver#839
MinVerDefaultPreReleasePhase -> MinVerDefaultPreReleaseIdentifiers

* Don't warn for [Obsolete] api usage or missing XML doc in test projects

* Enable nullable in options controller

The `[FromQuery]` `?language=` parameter was optional without nullable
reference types, but now became required causing a `BadRequest` in tests.
It was not decorated as nullable, so a quick fix is to supply a default value
of "nb".

Other potential resolutions would be
* Update the interface so that language is declared nullable for IAppOptionsProvider
* Change the public app API, so that language becomes a required get parameter.

* Fix all the easy nullability warnings in Controllers

Note that enabeling nullable on controllers makes non nullable
parameters required and causes additional BadRequest responses

* Change behaviour of SecretsLocalClient to throw exception like the client backed by KeyVault

* Fix nullability warnings in MulipartRequestReader

* Update sonarColud comment

* Declare DataController with [ApiController] to automatically trigger bad request

Also add test
@@ -330,19 +330,19 @@

if (appLogic == null)
{
_logger.LogError($"Could not determine if {dataType} requires app logic for application {org}/{app}");
_logger.LogError("Could not determine if {dataType} requires app logic for application {org}/{app}", dataType, org, app);

Check failure

Code scanning / CodeQL

Log entries created from user input High

This log entry depends on a
user-provided value
.
@@ -330,19 +330,19 @@

if (appLogic == null)
{
_logger.LogError($"Could not determine if {dataType} requires app logic for application {org}/{app}");
_logger.LogError("Could not determine if {dataType} requires app logic for application {org}/{app}", dataType, org, app);

Check failure

Code scanning / CodeQL

Log entries created from user input High

This log entry depends on a
user-provided value
.
Copy link

sonarcloud bot commented Nov 24, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug C 1 Bug
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 221 Code Smells

66.8% 66.8% Coverage
2.3% 2.3% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

ivarne and others added 3 commits November 25, 2023 23:45
Source link is no longer required: https://github.com/dotnet/sourcelink/releases/tag/8.0.0
    > Source Link is now included in .NET SDK 8 and enabled by default. Projects that migrate to .NET SDK 8 do not need to reference Source Link packages explicitly via PackageReference anymore.
* Make multi decision request for actions

* Prepare code for useraction in task

* add controller endpoint

* trigger userdefined task actions

* Add authorization check

* Add some tests

* controller tests for actions

* added more tests for actionscontroller

* Change how errors are returned

* Add tests for MultiDecisionHelper and add xml comments

* Add tests for AuthorizationClient

* Fix some codesmells and add some more tests

* Fix style error

* Action Controller return 404 if no implementations found
Fix comments from review

* Apply suggestions from code review

Co-authored-by: Ivar Nesje <[email protected]>

* Apply suggestion from code review

Remove IUserActionService and rename UserActionFactory to UserActionService
Add JsonPropertyName to classes returned through the ActionsController

* Remove ValidationGroup from IUserAction

* Apply suggestions from code review

Co-authored-by: Ivar Nesje <[email protected]>

* Remove the need for NullUserAction

---------

Co-authored-by: Ivar Nesje <[email protected]>
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

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

CodeQL found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.

ivarne and others added 5 commits November 30, 2023 08:43
Also add a Dockerfile for running tests on linux
System.Text.Json includes some bolilerplate and in my opinion wrong defaults.

I added JsonSerializerPremissive witch provides dropp inn replacements
with more sensible defaults.
* feat: add ProcessTasks to AppProcessState

* wip: add test for process controller

* feat: add ProcessTasks to AppProcessState

* wip: add test for process controller

* Adding first test for processcontroller

* Fix bad case for roles folder in testsetup

* User ArgumentNullException.ThrowIfNull instead of custom method

* Fix codesmells

---------

Co-authored-by: Vemund Gaukstad <[email protected]>
Upgrade TargetFramework to net8 and dockerfile
Make code rewrite more reliable by moving it before the csproj rewrite
#376)

* Rename Action.Type from userAction to serverAction. FrontendAction renamed to ClientAction

* Add test to better cover response from actionscontroller

* Fix codesmells and notices
src/Altinn.App.Api/Controllers/ActionsController.cs Dismissed Show dismissed Hide dismissed
src/Altinn.App.Api/Controllers/ActionsController.cs Dismissed Show dismissed Hide dismissed
{
XacmlJsonCategory actionCategory;
actionCategory = DecisionHelper.CreateActionCategory(actionType, true);
actionCategory.Id = ActionId + counter.ToString();

Check notice

Code scanning / CodeQL

Redundant ToString() call Note

Redundant call to 'ToString' on a String object.
Comment on lines +62 to +68
foreach (var attribute in attributes)
{
if (attribute.AttributeId == XacmlResourceActionId)
{
actions[attribute.Value] = true;
}
}

Check notice

Code scanning / CodeQL

Missed opportunity to use Where Note

This foreach loop
implicitly filters its target sequence
- consider filtering the sequence explicitly using '.Where(...)'.
* Let ModelDeserializer return a Result type instead of nullable

* Remove NullDataProcessor and let user registrer multiple processors

* Update IDataProcessor interface and support multipart data write

* Update v7tov8 script for new IDataProcessor interface

Also ignore CS1998 in apps (warning when not awaiting anything in async hooks)

* Code review updates

* Update src/Altinn.App.Core/Helpers/Serialization/ModelDeserializer.cs

Co-authored-by: Vemund Gaukstad <[email protected]>

* First draft of tests for controllers

* Finish writing tests

* Set partyId in token to null

* Fix bad case for roles folder in testsetup

* Add partyId correctly in test tokens

Also add a Dockerfile for running tests on linux

* Use proper parsing library to decode multipart/form-data requests

* Continue returning changed only changed values from data put.

* Fix so that it compiles (still failing tests)

* Fix tests by disabeling redirects in applciationfactory client

For some reason backend returns 303 See Other when datamodel updates are availible.
This is a redirect code and crashed the tests as no Location header was set.

* Add more tests

* More tests

* Update src/Altinn.App.Api/Controllers/DataController.cs

Co-authored-by: Vemund Gaukstad <[email protected]>

* Fix code smells

* Fix tests

* Tests OK now?

* More tests for model deserializer

---------

Co-authored-by: Vemund Gaukstad <[email protected]>
Comment on lines +39 to +43
catch (Exception e)
{
logger.LogError(e, "Unable to determine changed fields");
return null;
}

Check notice

Code scanning / CodeQL

Generic catch clause Note

Generic catch clause.
mikaelrss and others added 5 commits December 14, 2023 12:46
This wil become a requirement from may 2025, so adding this early ensures that does not become an requirement for updating apps.

microsoft/ApplicationInsights-dotnet#2560
* Remove usage of DateTime.Now in favor of DateTime.UtcNow

Use DateTime.UtcNow
Added some tests
Remove Console.WriteLines

* Add some simple tests for DefaultEFormidlingService

* Fix code smells

* Implement suggestions from review
* Revert Multipart form data #329 on PUT endpoint

* Add JsonPatch and create a new PATCH endpoint for updating form data

* Fix a few SonarCloud warnings

* Start work on new validation

Improve GetJsonPath(Expression) and fix some sonarcloud issues

Improve test coverage

Full validation rewrite complete and existing tests work

Probably still some issues and test coverage was spoty so more tests needs to be written.

Make IInstanceValidator obsolete

Add DataType as input to validators

Fix a few issues to prepare for tests of expressions

Add more tests

* Fix sonar cloud issues

* Rename to get more consistent naming

* Clanup DataType/TaskId to allow *

Also comment out KeyedService fetching

* Fix more sonarcloud issues

* Registrer new validators in DI container

* Remove dead code

* Adjust interface and add a few tests

* Add object? previousData to IDataProcessor

* Cleanup and more tests

* OptionsSource doesn't really need a label to work. In recent fronted versions, this label can also be an expression, so parsing fails when this is expected to be a string.

* Removing the requirement for a 'pageRef' property on Summary components. Frontend doesn't use this anymore, and disallows rendering Summary components with it.

* Allowing attachments to be deleted (attachments don't have AppLogic)

* ValidationIssue.Severity is an int in json

Improve handeling of errors in PATCH endpoint
code style fixes

* Initialize lists for concistency in frontend after patch

also add tests

* Fix issues with list initialization and prettify tests

* Add test to verify that PATCH initializes arrays (as xml serialization does)

* Read json configuration file for api tests

* Set empty strings to null in patch endpoint

xml serializing does always preserve empty string when using attributes and [XmlText].

* Apply suggestions from code review

Co-authored-by: Vemund Gaukstad <[email protected]>

* Remove caching logic for CanTaskBeEnded

* Improve description on validationsource

* Rename ShouldRun to HasRelevantChanges

fix style issues

* Fix dataProcessorRewriter

* Add genericDataProcessor

* Fix a few codestyle issues

* Making some validator sources match those used on the frontend

* Fix tests after validator source name change

* Adding support for explicit repeating group components (new in frontend v4)

---------

Co-authored-by: Ole Martin Handeland <[email protected]>
Co-authored-by: Vemund Gaukstad <[email protected]>
}
catch (Exception e)
{
_logger.LogError(e, "Error while running validator {validatorName} on task {taskId} in instance {instanceId}", tv.GetType().Name, taskId, instance.Id);

Check failure

Code scanning / CodeQL

Log entries created from user input High

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
.
}
catch (Exception e)
{
_logger.LogError(e, "Error while running validator {validatorName} on task {taskId} in instance {instanceId}", tv.GetType().Name, taskId, instance.Id);

Check failure

Code scanning / CodeQL

Log entries created from user input High

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
.
{
try
{
_logger.LogDebug("Start running validator {validatorName} on task {taskId} in instance {instanceId}", tv.GetType().Name, taskId, instance.Id);

Check failure

Code scanning / CodeQL

Log entries created from user input High

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
.
{
try
{
_logger.LogDebug("Start running validator {validatorName} on task {taskId} in instance {instanceId}", tv.GetType().Name, taskId, instance.Id);

Check failure

Code scanning / CodeQL

Log entries created from user input High

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
.
}
catch (Exception e)
{
_logger.LogError(e, "Error while running validator {validatorName} on {dataType} for data element {dataElementId} in instance {instanceId}", v.GetType().Name, dataElement.DataType, dataElement.Id, instance.Id);

Check failure

Code scanning / CodeQL

Log entries created from user input High

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
.
}
catch (Exception e)
{
_logger.LogError(e, "Error while running validator {validatorName} on {dataType} for data element {dataElementId} in instance {instanceId}", v.GetType().Name, dataElement.DataType, dataElement.Id, instance.Id);

Check failure

Code scanning / CodeQL

Log entries created from user input High

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
.
}
catch (Exception e)
{
_logger.LogError(e, "Error while running validator {validatorName} on {dataType} for data element {dataElementId} in instance {instanceId}", v.GetType().Name, dataElement.DataType, dataElement.Id, instance.Id);

Check failure

Code scanning / CodeQL

Log entries created from user input High

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
.
{
try
{
_logger.LogDebug("Start running validator {validatorName} on {dataType} for data element {dataElementId} in instance {instanceId}", v.GetType().Name, dataElement.DataType, dataElement.Id, instance.Id);

Check failure

Code scanning / CodeQL

Log entries created from user input High

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
.
{
try
{
_logger.LogDebug("Start running validator {validatorName} on {dataType} for data element {dataElementId} in instance {instanceId}", v.GetType().Name, dataElement.DataType, dataElement.Id, instance.Id);

Check failure

Code scanning / CodeQL

Log entries created from user input High

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
.
Comment on lines +64 to +67
catch (Exception e)
{
return Task.FromException<List<ValidationIssue>>(e);
}

Check notice

Code scanning / CodeQL

Generic catch clause Note

Generic catch clause.
Magnusrm and others added 3 commits January 24, 2024 08:22
* chore(deps): update nuget non-major dependencies (#310)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Add [Authorize] attribute on AuthorizationController.GetCurrentParty (#339)

This means that the code won't crash with missing cookie when the cookie
exipires

* chore(deps): update nuget non-major dependencies (#330)

* chore(deps): update nuget non-major dependencies

* Fix broken test

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Vemund Gaukstad <[email protected]>

* chore(deps): update dependency moq to v4.20.70 (#371)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update actions/setup-java action to v4 (#372)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update nuget non-major dependencies (#385)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update github/codeql-action action to v3 (#388)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update actions/setup-dotnet action to v4 (#386)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update actions/upload-artifact action to v4 (#387)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Support using connectionString for ApplicationInsights (#379) (#391)

This wil become a requirement from may 2025, so adding this early ensures that does not become an requirement for updating apps.

microsoft/ApplicationInsights-dotnet#2560

* chore(deps): update nuget non-major dependencies (#390)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* v7: Fix issue with non-ascii characters in code list parameters not being correctly encoded in parameter header. (#402)

Likely fix Altinn/codelists-lib-dotnet#23

* Include changes from main in v8 branch

mostly verion updates

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Vemund Gaukstad <[email protected]>
@tjololo
Copy link
Member Author

tjololo commented Jan 26, 2024

Sorry tried resolving these changes in the webUI and it resultetd in a updated PR from another branch (resolve-conflicts)
Lets close this and create a new PR from v8 to main, and then I can delete the resolve-conflicts branch.
We might need to open up for commits directly to v8 so we can resolve the conflicts with main

Copy link

sonarcloud bot commented Jan 26, 2024

Quality Gate Failed Quality Gate failed

Failed conditions

C Reliability Rating on New Code (required ≥ A)
64.86% Condition Coverage on New Code (required ≥ 65%)

See analysis details on SonarCloud

idea Catch issues before they fail your Quality Gate with our IDE extension SonarLint SonarLint

@tjololo tjololo closed this Jan 26, 2024
@ivarne ivarne deleted the resolve-conflicts branch October 10, 2024 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants