Skip to content

Commit 5630d2d

Browse files
committed
hotfix: bad lambda runtime path reference
1 parent 73f68e3 commit 5630d2d

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

VirtualFinland.UsersAPI.AdminFunction/AdminApp/Actions/TermsOfServiceUpdateAction.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,13 @@ private static string ReadActionInput(string? data)
7878

7979
// Read the built-in terms of service default
8080
var currentDirectory = Path.GetDirectoryName(Assembly.GetEntryAssembly()?.Location) ?? throw new InvalidOperationException();
81+
82+
// Fix: lambda runtime is not in the same folder as the function code
83+
if (currentDirectory == "/var/runtime")
84+
{
85+
currentDirectory = "/var/task";
86+
}
87+
8188
string archiveFolder = Path.Combine(currentDirectory, "terms-of-services.json");
8289

8390
return File.ReadAllText(archiveFolder);

VirtualFinland.UsersAPI.UnitTests/Tests/Security/AuthenticationTests.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
using Microsoft.IdentityModel.Tokens;
1414
using VirtualFinland.UserAPI.Data.Repositories;
1515
using VirtualFinland.UserAPI.Security.Models;
16-
using VirtualFinland.UserAPI.Data.Repositories;
1716
using VirtualFinland.UserAPI.Security.Configurations;
1817

1918
namespace VirtualFinland.UsersAPI.UnitTests.Tests.Security;
@@ -94,7 +93,7 @@ public async Task Should_SuccessInAuthVerification()
9493
"test-audience",
9594
new List<Claim>
9695
{
97-
new Claim("sub", dbEntity.externalIdentity.IdentityId ?? throw new Exception("IdentityId is null")),
96+
new("sub", dbEntity.externalIdentity.IdentityId ?? throw new Exception("IdentityId is null")),
9897
},
9998
DateTime.Now,
10099
DateTime.Now.AddDays(1),

0 commit comments

Comments
 (0)