-
Notifications
You must be signed in to change notification settings - Fork 3
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/merge in system text json branch; fixes #262 #354
base: development
Are you sure you want to change the base?
Feat/merge in system text json branch; fixes #262 #354
Conversation
…-in-system-text-json-branch
emailAddress.ModifiedOn = jObject["modifiedOn"].ToObject<DateTime>(); | ||
if(modifiedOnProperty.ValueKind == JsonValueKind.Null) | ||
{ | ||
Logger.Trace("The non-nullabale modifiedOn property of the emailAddress {id} is null", emailAddress.Iid); |
Check warning
Code scanning / CodeQL
Exposure of private information Medium
access to local variable emailAddress
Private data returned by
access to local variable emailAddress
Private data returned by
access to local variable emailAddress
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI about 1 month ago
To fix the problem, we should avoid logging the Iid
directly. Instead, we can log a generic message that does not include any sensitive information. This way, we can still keep track of the event without exposing private data.
- Replace the logging statements that include
emailAddress.Iid
with a more generic message. - Ensure that no sensitive information is logged.
-
Copy modified line R89 -
Copy modified line R101 -
Copy modified line R113 -
Copy modified line R125
@@ -88,3 +88,3 @@ | ||
{ | ||
Logger.Trace("The non-nullabale modifiedOn property of the emailAddress {id} is null", emailAddress.Iid); | ||
Logger.Trace("The non-nullabale modifiedOn property of an emailAddress is null"); | ||
} | ||
@@ -100,3 +100,3 @@ | ||
{ | ||
Logger.Trace("The non-nullabale thingPreference property of the emailAddress {id} is null", emailAddress.Iid); | ||
Logger.Trace("The non-nullabale thingPreference property of an emailAddress is null"); | ||
} | ||
@@ -112,3 +112,3 @@ | ||
{ | ||
Logger.Trace("The non-nullabale value property of the emailAddress {id} is null", emailAddress.Iid); | ||
Logger.Trace("The non-nullabale value property of an emailAddress is null"); | ||
} | ||
@@ -124,3 +124,3 @@ | ||
{ | ||
Logger.Trace("The non-nullabale vcardType property of the emailAddress {id} is null", emailAddress.Iid); | ||
Logger.Trace("The non-nullabale vcardType property of an emailAddress is null"); | ||
} |
emailAddress.ThingPreference = jObject["thingPreference"].ToObject<string>(); | ||
if(thingPreferenceProperty.ValueKind == JsonValueKind.Null) | ||
{ | ||
Logger.Trace("The non-nullabale thingPreference property of the emailAddress {id} is null", emailAddress.Iid); |
Check warning
Code scanning / CodeQL
Exposure of private information Medium
access to local variable emailAddress
Private data returned by
access to local variable emailAddress
Private data returned by
access to local variable emailAddress
Private data returned by
access to local variable emailAddress
Private data returned by
access to local variable emailAddress
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI about 1 month ago
To fix the problem, we should avoid logging sensitive information directly. Instead, we can log a generic message without including the sensitive emailAddress.Iid
. This way, we still get the benefit of logging without exposing private data.
- Modify the logging statements to remove the inclusion of
emailAddress.Iid
. - Ensure that the log messages are still informative enough for debugging purposes without exposing sensitive information.
-
Copy modified line R89 -
Copy modified line R101 -
Copy modified line R113 -
Copy modified line R125
@@ -88,3 +88,3 @@ | ||
{ | ||
Logger.Trace("The non-nullabale modifiedOn property of the emailAddress {id} is null", emailAddress.Iid); | ||
Logger.Trace("The non-nullabale modifiedOn property of an emailAddress is null"); | ||
} | ||
@@ -100,3 +100,3 @@ | ||
{ | ||
Logger.Trace("The non-nullabale thingPreference property of the emailAddress {id} is null", emailAddress.Iid); | ||
Logger.Trace("The non-nullabale thingPreference property of an emailAddress is null"); | ||
} | ||
@@ -112,3 +112,3 @@ | ||
{ | ||
Logger.Trace("The non-nullabale value property of the emailAddress {id} is null", emailAddress.Iid); | ||
Logger.Trace("The non-nullabale value property of an emailAddress is null"); | ||
} | ||
@@ -124,3 +124,3 @@ | ||
{ | ||
Logger.Trace("The non-nullabale vcardType property of the emailAddress {id} is null", emailAddress.Iid); | ||
Logger.Trace("The non-nullabale vcardType property of an emailAddress is null"); | ||
} |
emailAddress.Value = jObject["value"].ToObject<string>(); | ||
if(valueProperty.ValueKind == JsonValueKind.Null) | ||
{ | ||
Logger.Trace("The non-nullabale value property of the emailAddress {id} is null", emailAddress.Iid); |
Check warning
Code scanning / CodeQL
Exposure of private information Medium
access to local variable emailAddress
Private data returned by
access to local variable emailAddress
Private data returned by
access to local variable emailAddress
Private data returned by
access to local variable emailAddress
Private data returned by
access to local variable emailAddress
Private data returned by
access to local variable emailAddress
Private data returned by
access to local variable emailAddress
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI about 1 month ago
To fix the problem, we should avoid logging sensitive information such as emailAddress.Iid
. Instead, we can log a generic message that does not include any sensitive data. This change will ensure that private information is not exposed through log files.
- Modify the
Logger.Trace
calls to remove the inclusion ofemailAddress.Iid
. - Update the log messages to be more generic and not include any sensitive information.
-
Copy modified line R89 -
Copy modified line R101 -
Copy modified line R113 -
Copy modified line R125
@@ -88,3 +88,3 @@ | ||
{ | ||
Logger.Trace("The non-nullabale modifiedOn property of the emailAddress {id} is null", emailAddress.Iid); | ||
Logger.Trace("The non-nullabale modifiedOn property of an emailAddress is null"); | ||
} | ||
@@ -100,3 +100,3 @@ | ||
{ | ||
Logger.Trace("The non-nullabale thingPreference property of the emailAddress {id} is null", emailAddress.Iid); | ||
Logger.Trace("The non-nullabale thingPreference property of an emailAddress is null"); | ||
} | ||
@@ -112,3 +112,3 @@ | ||
{ | ||
Logger.Trace("The non-nullabale value property of the emailAddress {id} is null", emailAddress.Iid); | ||
Logger.Trace("The non-nullabale value property of an emailAddress is null"); | ||
} | ||
@@ -124,3 +124,3 @@ | ||
{ | ||
Logger.Trace("The non-nullabale vcardType property of the emailAddress {id} is null", emailAddress.Iid); | ||
Logger.Trace("The non-nullabale vcardType property of an emailAddress is null"); | ||
} |
emailAddress.VcardType = jObject["vcardType"].ToObject<VcardEmailAddressKind>(); | ||
if(vcardTypeProperty.ValueKind == JsonValueKind.Null) | ||
{ | ||
Logger.Trace("The non-nullabale vcardType property of the emailAddress {id} is null", emailAddress.Iid); |
Check warning
Code scanning / CodeQL
Exposure of private information Medium
access to local variable emailAddress
Private data returned by
access to local variable emailAddress
Private data returned by
access to local variable emailAddress
Private data returned by
access to local variable emailAddress
Private data returned by
access to local variable emailAddress
Private data returned by
access to local variable emailAddress
Private data returned by
access to local variable emailAddress
Private data returned by
access to local variable emailAddress
Private data returned by
access to local variable emailAddress
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI about 1 month ago
To fix the problem, we should avoid logging the Iid
directly. Instead, we can log a sanitized or masked version of the Iid
to ensure that sensitive information is not exposed. This can be achieved by hashing the Iid
before logging it. We will use a cryptographic hash function to generate a fixed-length hash of the Iid
, which will be logged instead of the raw Iid
.
-
Copy modified lines R33-R34 -
Copy modified lines R50-R58 -
Copy modified line R100 -
Copy modified line R112 -
Copy modified line R124 -
Copy modified line R136
@@ -32,2 +32,4 @@ | ||
using System.Text.Json; | ||
using System.Security.Cryptography; | ||
using System.Text; | ||
|
||
@@ -47,2 +49,11 @@ | ||
|
||
private static string HashIid(Guid iid) | ||
{ | ||
using (var sha256 = SHA256.Create()) | ||
{ | ||
var hashBytes = sha256.ComputeHash(Encoding.UTF8.GetBytes(iid.ToString())); | ||
return Convert.ToBase64String(hashBytes); | ||
} | ||
} | ||
|
||
/// <summary> | ||
@@ -88,3 +99,3 @@ | ||
{ | ||
Logger.Trace("The non-nullabale modifiedOn property of the emailAddress {id} is null", emailAddress.Iid); | ||
Logger.Trace("The non-nullabale modifiedOn property of the emailAddress {id} is null", HashIid(emailAddress.Iid)); | ||
} | ||
@@ -100,3 +111,3 @@ | ||
{ | ||
Logger.Trace("The non-nullabale thingPreference property of the emailAddress {id} is null", emailAddress.Iid); | ||
Logger.Trace("The non-nullabale thingPreference property of the emailAddress {id} is null", HashIid(emailAddress.Iid)); | ||
} | ||
@@ -112,3 +123,3 @@ | ||
{ | ||
Logger.Trace("The non-nullabale value property of the emailAddress {id} is null", emailAddress.Iid); | ||
Logger.Trace("The non-nullabale value property of the emailAddress {id} is null", HashIid(emailAddress.Iid)); | ||
} | ||
@@ -124,3 +135,3 @@ | ||
{ | ||
Logger.Trace("The non-nullabale vcardType property of the emailAddress {id} is null", emailAddress.Iid); | ||
Logger.Trace("The non-nullabale vcardType property of the emailAddress {id} is null", HashIid(emailAddress.Iid)); | ||
} |
telephoneNumber.ModifiedOn = jObject["modifiedOn"].ToObject<DateTime>(); | ||
if(modifiedOnProperty.ValueKind == JsonValueKind.Null) | ||
{ | ||
Logger.Trace("The non-nullabale modifiedOn property of the telephoneNumber {id} is null", telephoneNumber.Iid); |
Check warning
Code scanning / CodeQL
Exposure of private information Medium
access to local variable telephoneNumber
Private data returned by
access to local variable telephoneNumber
Private data returned by
access to local variable telephoneNumber
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI about 1 month ago
To fix the problem, we need to ensure that sensitive information is not logged. We can achieve this by either removing the logging statement or by masking the sensitive information before logging it. In this case, we will remove the logging statement to prevent any potential exposure of private information.
-
Copy modified line R89 -
Copy modified line R101 -
Copy modified line R113
@@ -88,3 +88,3 @@ | ||
{ | ||
Logger.Trace("The non-nullabale modifiedOn property of the telephoneNumber {id} is null", telephoneNumber.Iid); | ||
// The non-nullabale modifiedOn property of the telephoneNumber is null | ||
} | ||
@@ -100,3 +100,3 @@ | ||
{ | ||
Logger.Trace("The non-nullabale thingPreference property of the telephoneNumber {id} is null", telephoneNumber.Iid); | ||
// The non-nullabale thingPreference property of the telephoneNumber is null | ||
} | ||
@@ -112,3 +112,3 @@ | ||
{ | ||
Logger.Trace("The non-nullabale value property of the telephoneNumber {id} is null", telephoneNumber.Iid); | ||
// The non-nullabale value property of the telephoneNumber is null | ||
} |
telephoneNumber.ThingPreference = jObject["thingPreference"].ToObject<string>(); | ||
if(thingPreferenceProperty.ValueKind == JsonValueKind.Null) | ||
{ | ||
Logger.Trace("The non-nullabale thingPreference property of the telephoneNumber {id} is null", telephoneNumber.Iid); |
Check warning
Code scanning / CodeQL
Exposure of private information Medium
access to local variable telephoneNumber
Private data returned by
access to local variable telephoneNumber
Private data returned by
access to local variable telephoneNumber
Private data returned by
access to local variable telephoneNumber
Private data returned by
access to local variable telephoneNumber
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI about 1 month ago
To fix the problem, we should avoid logging the telephoneNumber.Iid
directly. Instead, we can log a generic message that does not include potentially sensitive information. This way, we maintain the logging functionality without risking the exposure of private data.
- Replace the logging statements that include
telephoneNumber.Iid
with more generic messages. - Ensure that the new logging messages do not contain any sensitive information.
-
Copy modified line R89 -
Copy modified line R101 -
Copy modified line R113
@@ -88,3 +88,3 @@ | ||
{ | ||
Logger.Trace("The non-nullabale modifiedOn property of the telephoneNumber {id} is null", telephoneNumber.Iid); | ||
Logger.Trace("The non-nullabale modifiedOn property of a telephoneNumber is null"); | ||
} | ||
@@ -100,3 +100,3 @@ | ||
{ | ||
Logger.Trace("The non-nullabale thingPreference property of the telephoneNumber {id} is null", telephoneNumber.Iid); | ||
Logger.Trace("The non-nullabale thingPreference property of a telephoneNumber is null"); | ||
} | ||
@@ -112,3 +112,3 @@ | ||
{ | ||
Logger.Trace("The non-nullabale value property of the telephoneNumber {id} is null", telephoneNumber.Iid); | ||
Logger.Trace("The non-nullabale value property of a telephoneNumber is null"); | ||
} |
telephoneNumber.Value = jObject["value"].ToObject<string>(); | ||
if(valueProperty.ValueKind == JsonValueKind.Null) | ||
{ | ||
Logger.Trace("The non-nullabale value property of the telephoneNumber {id} is null", telephoneNumber.Iid); |
Check warning
Code scanning / CodeQL
Exposure of private information Medium
access to local variable telephoneNumber
Private data returned by
access to local variable telephoneNumber
Private data returned by
access to local variable telephoneNumber
Private data returned by
access to local variable telephoneNumber
Private data returned by
access to local variable telephoneNumber
Private data returned by
access to local variable telephoneNumber
Private data returned by
access to local variable telephoneNumber
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI about 1 month ago
To fix the problem, we need to ensure that sensitive information is not logged. One way to achieve this is by redacting or omitting the sensitive information from the log messages. In this case, we can avoid logging the telephoneNumber.Iid
directly.
- Identify the lines where sensitive information is logged.
- Modify the log messages to exclude sensitive information or replace it with a non-sensitive placeholder.
- Ensure that the changes do not affect the existing functionality of the code.
-
Copy modified line R89 -
Copy modified line R101 -
Copy modified line R113
@@ -88,3 +88,3 @@ | ||
{ | ||
Logger.Trace("The non-nullabale modifiedOn property of the telephoneNumber {id} is null", telephoneNumber.Iid); | ||
Logger.Trace("The non-nullabale modifiedOn property of the telephoneNumber is null"); | ||
} | ||
@@ -100,3 +100,3 @@ | ||
{ | ||
Logger.Trace("The non-nullabale thingPreference property of the telephoneNumber {id} is null", telephoneNumber.Iid); | ||
Logger.Trace("The non-nullabale thingPreference property of the telephoneNumber is null"); | ||
} | ||
@@ -112,3 +112,3 @@ | ||
{ | ||
Logger.Trace("The non-nullabale value property of the telephoneNumber {id} is null", telephoneNumber.Iid); | ||
Logger.Trace("The non-nullabale value property of the telephoneNumber is null"); | ||
} |
Quality Gate passedIssues Measures |
This reverts commit 1936e00.
…izer and remove CDP4DalJsonSerializer project
CDP4JsonSerializer/AutoGenDtoSerializer/PersonPermissionSerializer.cs
Outdated
Show resolved
Hide resolved
- Use same unit JsoinSerializer tests for Net and NetCore - Add extra datamodel version checks to JsonSerializers
…and fix unit tests accordingly
Prerequisites
Description
[WIP] Feat/merge in system text json branch