-
Notifications
You must be signed in to change notification settings - Fork 11
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
Use 'instanceandevents' endpoint when updating process state, so that process and events are updated in a single transaction #937
Conversation
} | ||
else | ||
{ | ||
_logger.LogError($"Unable to update instance process with instance id {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
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 3 months ago
To fix the problem, we need to sanitize the instance.Id
before logging it. Since the log entries are plain text, we should remove any new line characters from the instance.Id
to prevent log forging. This can be done using the String.Replace
method to replace new line characters with an empty string.
-
Copy modified line R193 -
Copy modified line R219
@@ -192,3 +192,3 @@ | ||
{ | ||
_logger.LogError($"Unable to update instance process with instance id {instance.Id}"); | ||
_logger.LogError($"Unable to update instance process with instance id {instance.Id.Replace(Environment.NewLine, "").Replace("\n", "").Replace("\r", "")}"); | ||
throw await PlatformHttpException.CreateAsync(response); | ||
@@ -218,3 +218,3 @@ | ||
_logger.LogError( | ||
$"Unable to create instance {response.StatusCode} - {await response.Content.ReadAsStringAsync()}" | ||
$"Unable to create instance {response.StatusCode} - {await response.Content.ReadAsStringAsync().Replace(Environment.NewLine, "").Replace("\n", "").Replace("\r", "")}" | ||
); |
d2dc7c6
to
b42909b
Compare
/publish |
1 similar comment
/publish |
d922cd0
to
b42909b
Compare
/publish |
2 similar comments
/publish |
/publish |
Published 8.5.0-rc11.use-instanceandevents-endpoint.b42909b521d1fdb1548f4f3a74ec1103751f34d9 |
/publish |
|
/publish |
/publish |
daccd8b
to
5bc79a4
Compare
/publish |
4f37aa8
to
de9fe3f
Compare
|
Description
Uses the new endpoint which commits new process state and instance events in one transaction.
The related tests were a little funny. Test names said they were testing more than they actually were, it seems like most of the variation comes from the
AltinnTaskType
thingy.Related Issue(s)
InstanceEvents
) within a single transaction altinn-storage#544Verification
Documentation