Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions RemoteSigner.Tests/RemoteSigner.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<RootNamespace>RemoteSigner.Tests</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Amazon.Lambda.Core" Version="2.1.0" />
<PackageReference Include="Amazon.Lambda.TestUtilities" Version="2.0.0" />
<PackageReference Include="Amazon.Lambda.Core" Version="3.3.0" />
<PackageReference Include="Amazon.Lambda.TestUtilities" Version="4.2.0" />
<PackageReference Include="FluentAssertions" Version="6.11.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="xunit" Version="2.4.2" />
Expand Down
8 changes: 5 additions & 3 deletions RemoteSigner/Function.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using Amazon.Lambda.APIGatewayEvents;
using Amazon.Lambda.Core;
using Amazon.Lambda.Serialization.SystemTextJson;
using Amazon.Runtime;
using Amazon.Runtime.CredentialManagement;
using NBitcoin;

[assembly:
Expand All @@ -29,12 +29,12 @@
/// <summary>
/// Encrypted seed phrase
/// </summary>
public string EncryptedSeedphrase { get; set; }

Check warning on line 32 in RemoteSigner/Function.cs

View workflow job for this annotation

GitHub Actions / Run tests

Non-nullable property 'EncryptedSeedphrase' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

/// <summary>
/// AWS KMS Key Id used to decrypt the encrypted seedphrase
/// </summary>
public string AwsKmsKeyId { get; set; }

Check warning on line 37 in RemoteSigner/Function.cs

View workflow job for this annotation

GitHub Actions / Run tests

Non-nullable property 'AwsKmsKeyId' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.
}

public class Function
Expand All @@ -56,14 +56,16 @@
if (requestBody == null) throw new ArgumentNullException(nameof(requestBody), "Request body not found");

#if DEBUG
var kmsClient = new AmazonKeyManagementServiceClient(new StoredProfileAWSCredentials("default"),
RegionEndpoint.EUCentral1);
//AWS SDK v4 removed StoredProfileAWSCredentials; resolve the "default" profile explicitly
if (!new CredentialProfileStoreChain().TryGetAWSCredentials("default", out var debugCredentials))
throw new InvalidOperationException("AWS profile 'default' was not found");
var kmsClient = new AmazonKeyManagementServiceClient(debugCredentials, RegionEndpoint.EUCentral1);
#else
var kmsClient = new AmazonKeyManagementServiceClient();
#endif

Task<string> GetSeed(RootedKeyPath derivationPath) => DecryptSeed(kmsClient, derivationPath);

Check warning on line 67 in RemoteSigner/Function.cs

View workflow job for this annotation

GitHub Actions / Run tests

Nullability of reference types in value of type 'Task<string?>' doesn't match target type 'Task<string>'.
var result = await SignPSBT(requestBody.Psbt, requestBody.Network, requestBody.EnforcedSighash, GetSeed);

Check warning on line 68 in RemoteSigner/Function.cs

View workflow job for this annotation

GitHub Actions / Run tests

Nullability of reference types in return type of 'Task<string> GetSeed(RootedKeyPath derivationPath)' doesn't match the target delegate 'Func<RootedKeyPath?, Task<string?>>' (possibly because of nullability attributes).

response = new APIGatewayHttpApiV2ProxyResponse()
{
Expand Down Expand Up @@ -186,7 +188,7 @@

private static async Task<string?> DecryptSeed(AmazonKeyManagementServiceClient kmsClient, RootedKeyPath? derivationPath)
{
var inputPSBTMasterFingerPrint = derivationPath.MasterFingerprint;

Check warning on line 191 in RemoteSigner/Function.cs

View workflow job for this annotation

GitHub Actions / Run tests

Dereference of a possibly null reference.

var masterFingerPrint = $"MF_{inputPSBTMasterFingerPrint}";
var configJson = Environment.GetEnvironmentVariable(masterFingerPrint);
Expand Down
12 changes: 6 additions & 6 deletions RemoteSigner/RemoteSigner.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
<AssemblyName>RemoteSigner</AssemblyName>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Amazon.Lambda.APIGatewayEvents" Version="2.6.0" />
<PackageReference Include="Amazon.Lambda.Core" Version="2.1.0" />
<PackageReference Include="Amazon.Lambda.Serialization.SystemTextJson" Version="2.3.1" />
<PackageReference Include="AWSSDK.Core" Version="3.7.106.34" />
<PackageReference Include="AWSSDK.KeyManagementService" Version="3.7.102.4" />
<PackageReference Include="NBitcoin" Version="7.0.25" />
<PackageReference Include="Amazon.Lambda.APIGatewayEvents" Version="3.0.1" />
<PackageReference Include="Amazon.Lambda.Core" Version="3.3.0" />
<PackageReference Include="Amazon.Lambda.Serialization.SystemTextJson" Version="3.0.1" />
<PackageReference Include="AWSSDK.Core" Version="4.0.101.1" />
<PackageReference Include="AWSSDK.KeyManagementService" Version="4.0.100.9" />
<PackageReference Include="NBitcoin" Version="10.0.9" />
</ItemGroup>
</Project>
Loading