Skip to content

Commit d21bf44

Browse files
committed
Merger from develop into FB
2 parents 5ef12aa + 898e6dc commit d21bf44

File tree

22 files changed

+1199
-46
lines changed

22 files changed

+1199
-46
lines changed

.github/workflows/check-pull-request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Verify format
3232
run: dotnet format ./working-dir/KeeperData.Bridge.sln --verify-no-changes --verbosity diagnostic
3333
- name: Test (unit and component)
34-
run: dotnet test ./working-dir/KeeperData.Bridge.sln --filter "Category!=Integration" --logger "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true" --collect:"XPlat Code Coverage" --results-directory ./coverage
34+
run: dotnet test ./working-dir/KeeperData.Bridge.sln --filter Dependence!=localstack --logger "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true" --collect:"XPlat Code Coverage" --results-directory ./coverage
3535
- name: Install ReportGenerator
3636
run: dotnet tool install --global dotnet-reportgenerator-globaltool
3737
- name: Generate Coverage Summary

Dockerfile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@ RUN dotnet restore "KeeperData.Core/KeeperData.Core.csproj" -r linux-x64 -v n
2929

3030
COPY ["src/", "."]
3131

32-
# Run all tests except those with "Integration" in the path
33-
RUN find ./tests -name '*.csproj' | grep -v Integration | while read testproj; do \
34-
dotnet test "$testproj" --configuration ${BUILD_CONFIGURATION} --no-restore --verbosity normal; \
35-
done
36-
3732
FROM build AS publish
3833
WORKDIR "/src/KeeperData.Bridge"
3934
RUN dotnet publish "KeeperData.Bridge.csproj" -v n -c ${BUILD_CONFIGURATION} -o /app/publish -r linux-x64 --no-restore /p:UseAppHost=false

KeeperData.Bridge.sln

Lines changed: 51 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ EndProject
1010
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "solutionitems", "solutionitems", "{90214DF2-657C-49A2-BAB7-5FDBE17E956C}"
1111
ProjectSection(SolutionItems) = preProject
1212
.gitignore = .gitignore
13-
compose.yml = compose.yml
1413
Dockerfile = Dockerfile
1514
EndProjectSection
1615
EndProject
@@ -30,6 +29,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KeeperData.Bridge.Tests.Int
3029
EndProject
3130
Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker-compose.dcproj", "{81DDED9D-158B-E303-5F62-77A2896D2A5A}"
3231
EndProject
32+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KeeperData.Core.Tests.Unit", "tests\KeeperData.Core.Tests.Unit\KeeperData.Core.Tests.Unit.csproj", "{389DD08B-1B37-4BF2-9F2B-3F4805B25A46}"
33+
EndProject
34+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "util", "util", "{25784FFF-FBA8-4398-8497-7BE1FF8F92A5}"
35+
EndProject
36+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KeeperData.Crypto.Tool", "src\KeeperData.Crypto.Tool\KeeperData.Crypto.Tool.csproj", "{92F51802-9BF8-42A8-98C9-C25B27163DF0}"
37+
EndProject
3338
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KeeperData.Bridge.Worker", "src\KeeperData.Bridge.Worker\KeeperData.Bridge.Worker.csproj", "{C20E1970-BB6F-46BC-886E-7E856DAA763E}"
3439
EndProject
3540
Global
@@ -54,6 +59,7 @@ Global
5459
{7D935959-D3BE-4EDC-BAEC-541C72741633}.Release|x64.Build.0 = Release|Any CPU
5560
{7D935959-D3BE-4EDC-BAEC-541C72741633}.Release|x86.ActiveCfg = Release|Any CPU
5661
{7D935959-D3BE-4EDC-BAEC-541C72741633}.Release|x86.Build.0 = Release|Any CPU
62+
5763
{4E96024E-0BCB-4C41-8EB2-876499B07311}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
5864
{4E96024E-0BCB-4C41-8EB2-876499B07311}.Debug|Any CPU.Build.0 = Debug|Any CPU
5965
{4E96024E-0BCB-4C41-8EB2-876499B07311}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -66,6 +72,7 @@ Global
6672
{4E96024E-0BCB-4C41-8EB2-876499B07311}.Release|x64.Build.0 = Release|Any CPU
6773
{4E96024E-0BCB-4C41-8EB2-876499B07311}.Release|x86.ActiveCfg = Release|Any CPU
6874
{4E96024E-0BCB-4C41-8EB2-876499B07311}.Release|x86.Build.0 = Release|Any CPU
75+
6976
{D5BA4CDF-AABC-4FE6-B41A-D32381CDFB32}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
7077
{D5BA4CDF-AABC-4FE6-B41A-D32381CDFB32}.Debug|Any CPU.Build.0 = Debug|Any CPU
7178
{D5BA4CDF-AABC-4FE6-B41A-D32381CDFB32}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -78,6 +85,7 @@ Global
7885
{D5BA4CDF-AABC-4FE6-B41A-D32381CDFB32}.Release|x64.Build.0 = Release|Any CPU
7986
{D5BA4CDF-AABC-4FE6-B41A-D32381CDFB32}.Release|x86.ActiveCfg = Release|Any CPU
8087
{D5BA4CDF-AABC-4FE6-B41A-D32381CDFB32}.Release|x86.Build.0 = Release|Any CPU
88+
8189
{45E67021-5132-416B-92F0-AA2C1C7E65AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
8290
{45E67021-5132-416B-92F0-AA2C1C7E65AD}.Debug|Any CPU.Build.0 = Debug|Any CPU
8391
{45E67021-5132-416B-92F0-AA2C1C7E65AD}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -90,6 +98,7 @@ Global
9098
{45E67021-5132-416B-92F0-AA2C1C7E65AD}.Release|x64.Build.0 = Release|Any CPU
9199
{45E67021-5132-416B-92F0-AA2C1C7E65AD}.Release|x86.ActiveCfg = Release|Any CPU
92100
{45E67021-5132-416B-92F0-AA2C1C7E65AD}.Release|x86.Build.0 = Release|Any CPU
101+
93102
{28DA1EFD-BB2E-4AF5-B9BD-AD3B6A139DBE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
94103
{28DA1EFD-BB2E-4AF5-B9BD-AD3B6A139DBE}.Debug|Any CPU.Build.0 = Debug|Any CPU
95104
{28DA1EFD-BB2E-4AF5-B9BD-AD3B6A139DBE}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -102,6 +111,7 @@ Global
102111
{28DA1EFD-BB2E-4AF5-B9BD-AD3B6A139DBE}.Release|x64.Build.0 = Release|Any CPU
103112
{28DA1EFD-BB2E-4AF5-B9BD-AD3B6A139DBE}.Release|x86.ActiveCfg = Release|Any CPU
104113
{28DA1EFD-BB2E-4AF5-B9BD-AD3B6A139DBE}.Release|x86.Build.0 = Release|Any CPU
114+
105115
{324F5874-B7B9-4B87-9FAB-BDB970971919}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
106116
{324F5874-B7B9-4B87-9FAB-BDB970971919}.Debug|Any CPU.Build.0 = Debug|Any CPU
107117
{324F5874-B7B9-4B87-9FAB-BDB970971919}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -114,6 +124,7 @@ Global
114124
{324F5874-B7B9-4B87-9FAB-BDB970971919}.Release|x64.Build.0 = Release|Any CPU
115125
{324F5874-B7B9-4B87-9FAB-BDB970971919}.Release|x86.ActiveCfg = Release|Any CPU
116126
{324F5874-B7B9-4B87-9FAB-BDB970971919}.Release|x86.Build.0 = Release|Any CPU
127+
117128
{E2B6D37D-2D17-4B43-83DC-36F1C4961526}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
118129
{E2B6D37D-2D17-4B43-83DC-36F1C4961526}.Debug|Any CPU.Build.0 = Debug|Any CPU
119130
{E2B6D37D-2D17-4B43-83DC-36F1C4961526}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -126,6 +137,7 @@ Global
126137
{E2B6D37D-2D17-4B43-83DC-36F1C4961526}.Release|x64.Build.0 = Release|Any CPU
127138
{E2B6D37D-2D17-4B43-83DC-36F1C4961526}.Release|x86.ActiveCfg = Release|Any CPU
128139
{E2B6D37D-2D17-4B43-83DC-36F1C4961526}.Release|x86.Build.0 = Release|Any CPU
140+
129141
{16AA106D-B4F1-46C9-92F3-548AE89FDA3A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
130142
{16AA106D-B4F1-46C9-92F3-548AE89FDA3A}.Debug|Any CPU.Build.0 = Debug|Any CPU
131143
{16AA106D-B4F1-46C9-92F3-548AE89FDA3A}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -138,14 +150,20 @@ Global
138150
{16AA106D-B4F1-46C9-92F3-548AE89FDA3A}.Release|x64.Build.0 = Release|Any CPU
139151
{16AA106D-B4F1-46C9-92F3-548AE89FDA3A}.Release|x86.ActiveCfg = Release|Any CPU
140152
{16AA106D-B4F1-46C9-92F3-548AE89FDA3A}.Release|x86.Build.0 = Release|Any CPU
153+
141154
{81DDED9D-158B-E303-5F62-77A2896D2A5A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
142155
{81DDED9D-158B-E303-5F62-77A2896D2A5A}.Debug|Any CPU.Build.0 = Debug|Any CPU
143-
{81DDED9D-158B-E303-5F62-77A2896D2A5A}.Debug|x64.ActiveCfg = Debug|x64
144-
{81DDED9D-158B-E303-5F62-77A2896D2A5A}.Debug|x86.ActiveCfg = Debug|x86
156+
{81DDED9D-158B-E303-5F62-77A2896D2A5A}.Debug|x64.ActiveCfg = Debug|Any CPU
157+
{81DDED9D-158B-E303-5F62-77A2896D2A5A}.Debug|x64.Build.0 = Debug|Any CPU
158+
{81DDED9D-158B-E303-5F62-77A2896D2A5A}.Debug|x86.ActiveCfg = Debug|Any CPU
159+
{81DDED9D-158B-E303-5F62-77A2896D2A5A}.Debug|x86.Build.0 = Debug|Any CPU
145160
{81DDED9D-158B-E303-5F62-77A2896D2A5A}.Release|Any CPU.ActiveCfg = Release|Any CPU
146161
{81DDED9D-158B-E303-5F62-77A2896D2A5A}.Release|Any CPU.Build.0 = Release|Any CPU
147-
{81DDED9D-158B-E303-5F62-77A2896D2A5A}.Release|x64.ActiveCfg = Release|x64
148-
{81DDED9D-158B-E303-5F62-77A2896D2A5A}.Release|x86.ActiveCfg = Release|x86
162+
{81DDED9D-158B-E303-5F62-77A2896D2A5A}.Release|x64.ActiveCfg = Release|Any CPU
163+
{81DDED9D-158B-E303-5F62-77A2896D2A5A}.Release|x64.Build.0 = Release|Any CPU
164+
{81DDED9D-158B-E303-5F62-77A2896D2A5A}.Release|x86.ActiveCfg = Release|Any CPU
165+
{81DDED9D-158B-E303-5F62-77A2896D2A5A}.Release|x86.Build.0 = Release|Any CPU
166+
149167
{C20E1970-BB6F-46BC-886E-7E856DAA763E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
150168
{C20E1970-BB6F-46BC-886E-7E856DAA763E}.Debug|Any CPU.Build.0 = Debug|Any CPU
151169
{C20E1970-BB6F-46BC-886E-7E856DAA763E}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -158,15 +176,42 @@ Global
158176
{C20E1970-BB6F-46BC-886E-7E856DAA763E}.Release|x64.Build.0 = Release|Any CPU
159177
{C20E1970-BB6F-46BC-886E-7E856DAA763E}.Release|x86.ActiveCfg = Release|Any CPU
160178
{C20E1970-BB6F-46BC-886E-7E856DAA763E}.Release|x86.Build.0 = Release|Any CPU
179+
180+
{389DD08B-1B37-4BF2-9F2B-3F4805B25A46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
181+
{389DD08B-1B37-4BF2-9F2B-3F4805B25A46}.Debug|Any CPU.Build.0 = Debug|Any CPU
182+
{389DD08B-1B37-4BF2-9F2B-3F4805B25A46}.Debug|x64.ActiveCfg = Debug|Any CPU
183+
{389DD08B-1B37-4BF2-9F2B-3F4805B25A46}.Debug|x64.Build.0 = Debug|Any CPU
184+
{389DD08B-1B37-4BF2-9F2B-3F4805B25A46}.Debug|x86.ActiveCfg = Debug|Any CPU
185+
{389DD08B-1B37-4BF2-9F2B-3F4805B25A46}.Debug|x86.Build.0 = Debug|Any CPU
186+
{389DD08B-1B37-4BF2-9F2B-3F4805B25A46}.Release|Any CPU.ActiveCfg = Release|Any CPU
187+
{389DD08B-1B37-4BF2-9F2B-3F4805B25A46}.Release|Any CPU.Build.0 = Release|Any CPU
188+
{389DD08B-1B37-4BF2-9F2B-3F4805B25A46}.Release|x64.ActiveCfg = Release|Any CPU
189+
{389DD08B-1B37-4BF2-9F2B-3F4805B25A46}.Release|x64.Build.0 = Release|Any CPU
190+
{389DD08B-1B37-4BF2-9F2B-3F4805B25A46}.Release|x86.ActiveCfg = Release|Any CPU
191+
{389DD08B-1B37-4BF2-9F2B-3F4805B25A46}.Release|x86.Build.0 = Release|Any CPU
192+
193+
{92F51802-9BF8-42A8-98C9-C25B27163DF0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
194+
{92F51802-9BF8-42A8-98C9-C25B27163DF0}.Debug|Any CPU.Build.0 = Debug|Any CPU
195+
{92F51802-9BF8-42A8-98C9-C25B27163DF0}.Debug|x64.ActiveCfg = Debug|Any CPU
196+
{92F51802-9BF8-42A8-98C9-C25B27163DF0}.Debug|x64.Build.0 = Debug|Any CPU
197+
{92F51802-9BF8-42A8-98C9-C25B27163DF0}.Debug|x86.ActiveCfg = Debug|Any CPU
198+
{92F51802-9BF8-42A8-98C9-C25B27163DF0}.Debug|x86.Build.0 = Debug|Any CPU
199+
{92F51802-9BF8-42A8-98C9-C25B27163DF0}.Release|Any CPU.ActiveCfg = Release|Any CPU
200+
{92F51802-9BF8-42A8-98C9-C25B27163DF0}.Release|Any CPU.Build.0 = Release|Any CPU
201+
{92F51802-9BF8-42A8-98C9-C25B27163DF0}.Release|x64.ActiveCfg = Release|Any CPU
202+
{92F51802-9BF8-42A8-98C9-C25B27163DF0}.Release|x64.Build.0 = Release|Any CPU
203+
{92F51802-9BF8-42A8-98C9-C25B27163DF0}.Release|x86.ActiveCfg = Release|Any CPU
204+
{92F51802-9BF8-42A8-98C9-C25B27163DF0}.Release|x86.Build.0 = Release|Any CPU
161205
EndGlobalSection
162206
GlobalSection(SolutionProperties) = preSolution
163207
HideSolutionNode = FALSE
164208
EndGlobalSection
165209
GlobalSection(NestedProjects) = preSolution
166210
{28DA1EFD-BB2E-4AF5-B9BD-AD3B6A139DBE} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
167-
{324F5874-B7B9-4B87-9FAB-BDB970971919} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
168211
{E2B6D37D-2D17-4B43-83DC-36F1C4961526} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
169212
{16AA106D-B4F1-46C9-92F3-548AE89FDA3A} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
213+
{389DD08B-1B37-4BF2-9F2B-3F4805B25A46} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
214+
{92F51802-9BF8-42A8-98C9-C25B27163DF0} = {25784FFF-FBA8-4398-8497-7BE1FF8F92A5}
170215
EndGlobalSection
171216
GlobalSection(ExtensibilityGlobals) = postSolution
172217
SolutionGuid = {235917AE-9AF5-49A5-AB06-472A5E5DB30D}

docker-compose.override.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ services:
1212
- StorageConfiguration__ExternalStorage__BucketName=test-external-bucket
1313
- StorageConfiguration__InternalStorage__BucketName=test-internal-bucket
1414
- ServiceBusSenderConfiguration__DataBridgeEventsTopic__TopicArn=arn:aws:sns:eu-west-2:000000000000:ls-keeper-data-bridge-events
15+
- AesSalt=LD8BB2NNze7qKbVyLutAfGBxhkAApR
1516
ports:
1617
- "8080"
1718
volumes:

docker-compose.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
version: '3.4'
21
name: 'keeperdata_bridge'
32
services:
43
localstack:

src/KeeperData.Bridge/Setup/ServiceCollectionExtensions.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using KeeperData.Application.Setup;
2+
using KeeperData.Infrastructure.Crypto;
23
using KeeperData.Bridge.Worker.Setup;
34
using KeeperData.Infrastructure.Database.Setup;
45
using KeeperData.Infrastructure.Messaging.Setup;
@@ -22,6 +23,8 @@ public static void ConfigureApi(this IServiceCollection services, IConfiguration
2223

2324
services.AddStorageDependencies(configuration);
2425

26+
services.AddCrypto(configuration);
27+
2528
services.AddBackgroundJobDependencies(configuration);
2629
}
2730

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
namespace KeeperData.Core.Crypto;
2+
3+
public delegate void ProgressCallback(int progressPercentage, string status);
4+
5+
public interface IAesCryptoTransform
6+
{
7+
Task EncryptFileAsync(string inputFilePath, string outputFilePath, string password, byte[] salt,
8+
ProgressCallback? progressCallback = null, CancellationToken cancellationToken = default);
9+
10+
Task EncryptFileAsync(string inputFilePath, string outputFilePath, string password, string salt,
11+
ProgressCallback? progressCallback = null, CancellationToken cancellationToken = default);
12+
13+
Task DecryptFileAsync(string inputFilePath, string outputFilePath, string password, byte[] salt,
14+
ProgressCallback? progressCallback = null, CancellationToken cancellationToken = default);
15+
16+
Task DecryptFileAsync(string inputFilePath, string outputFilePath, string password, string salt,
17+
ProgressCallback? progressCallback = null, CancellationToken cancellationToken = default);
18+
19+
Task EncryptStreamAsync(Stream inputStream, Stream outputStream, string password, byte[] salt,
20+
long? totalBytes = null, ProgressCallback? progressCallback = null, CancellationToken cancellationToken = default);
21+
22+
Task EncryptStreamAsync(Stream inputStream, Stream outputStream, string password, string salt,
23+
long? totalBytes = null, ProgressCallback? progressCallback = null, CancellationToken cancellationToken = default);
24+
25+
Task DecryptStreamAsync(Stream inputStream, Stream outputStream, string password, byte[] salt,
26+
long? totalBytes = null, ProgressCallback? progressCallback = null, CancellationToken cancellationToken = default);
27+
28+
Task DecryptStreamAsync(Stream inputStream, Stream outputStream, string password, string salt,
29+
long? totalBytes = null, ProgressCallback? progressCallback = null, CancellationToken cancellationToken = default);
30+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
namespace KeeperData.Core.Messaging.Extensions;
2+
3+
public static class MessageAttributes
4+
{
5+
private const string MESSAGE_SUFFIX = "Message";
6+
7+
public static string ReplaceSuffix(this string? messageName)
8+
{
9+
return messageName?.EndsWith(MESSAGE_SUFFIX) == true
10+
? messageName[..^MESSAGE_SUFFIX.Length]
11+
: messageName ?? string.Empty;
12+
}
13+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net8.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
<AssemblyName>kryp</AssemblyName>
9+
</PropertyGroup>
10+
11+
<ItemGroup>
12+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.9" />
13+
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.9" />
14+
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="9.0.9" />
15+
<PackageReference Include="System.CommandLine" Version="2.0.0-rc.1.25451.107" />
16+
<ProjectReference Include="..\KeeperData.Core\KeeperData.Core.csproj" />
17+
<ProjectReference Include="..\KeeperData.Infrastructure\KeeperData.Infrastructure.csproj" />
18+
</ItemGroup>
19+
20+
</Project>

0 commit comments

Comments
 (0)