-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds SeenBy per user in activities --------- Co-authored-by: Magnus Sandgren <[email protected]>
- Loading branch information
1 parent
4b98348
commit c68db9e
Showing
32 changed files
with
1,552 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/Digdir.Domain.Dialogporten.Application/Common/MappingUtils.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System.Security.Cryptography; | ||
using System.Text; | ||
|
||
namespace Digdir.Domain.Dialogporten.Application.Common; | ||
|
||
internal static class MappingUtils | ||
{ | ||
internal static byte[] GetHashSalt(int size = 16) => RandomNumberGenerator.GetBytes(size); | ||
|
||
internal static string? HashPid(string? personIdentifier, byte[] salt) | ||
{ | ||
if (string.IsNullOrWhiteSpace(personIdentifier)) | ||
{ | ||
return null; | ||
} | ||
|
||
var identifierBytes = Encoding.UTF8.GetBytes(personIdentifier); | ||
Span<byte> buffer = stackalloc byte[identifierBytes.Length + salt.Length]; | ||
identifierBytes.CopyTo(buffer); | ||
salt.CopyTo(buffer[identifierBytes.Length..]); | ||
|
||
var hashBytes = SHA256.HashData(buffer); | ||
|
||
return BitConverter.ToString(hashBytes, 0, 5).Replace("-", "").ToLowerInvariant(); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/Digdir.Domain.Dialogporten.Application/Externals/INameRegistry.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace Digdir.Domain.Dialogporten.Application.Externals; | ||
|
||
public interface INameRegistry | ||
{ | ||
Task<string?> GetName(string personalIdentificationNumber, CancellationToken cancellationToken); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.