From e75739c6133091645a13c3158a8bab6608483a10 Mon Sep 17 00:00:00 2001 From: Tim Haasdyk Date: Tue, 24 Oct 2023 10:56:14 +0200 Subject: [PATCH] fixup! Add S/R tests using JWT over basic auth --- .../SyncReverseProxy/SendReceiveServiceTests.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/backend/Testing/SyncReverseProxy/SendReceiveServiceTests.cs b/backend/Testing/SyncReverseProxy/SendReceiveServiceTests.cs index 739c4b030..3b6a5ad92 100644 --- a/backend/Testing/SyncReverseProxy/SendReceiveServiceTests.cs +++ b/backend/Testing/SyncReverseProxy/SendReceiveServiceTests.cs @@ -79,9 +79,7 @@ public async Task VerifyHgWorking() [Fact] public void CloneBigProject() { - RunCloneSendReceive(HgProtocol.Hgweb, - new SendReceiveAuth("admin", TestingEnvironmentVariables.DefaultPassword), - "elawa-dev-flex"); + RunCloneSendReceive(HgProtocol.Hgweb, AdminAuth, "elawa-dev-flex"); } [Theory] @@ -97,11 +95,13 @@ public void CanCloneSendReceive(HgProtocol hgProtocol, string user) } [Theory] - [InlineData(HgProtocol.Hgweb)] - [InlineData(HgProtocol.Resumable)] - public async Task CanCloneSendReceiveWithJwtOverBasicAuth(HgProtocol hgProtocol) + [InlineData(HgProtocol.Hgweb, "admin")] + [InlineData(HgProtocol.Hgweb, "manager")] + [InlineData(HgProtocol.Resumable, "admin")] + [InlineData(HgProtocol.Resumable, "manager")] + public async Task CanCloneSendReceiveWithJwtOverBasicAuth(HgProtocol hgProtocol, string user) { - var jwt = await JwtHelper.GetJwtForUser(AdminAuth); + var jwt = await JwtHelper.GetJwtForUser(new SendReceiveAuth(user, TestingEnvironmentVariables.DefaultPassword)); RunCloneSendReceive(hgProtocol, new SendReceiveAuth(AuthKernel.JwtOverBasicAuthUsername, jwt), TestingEnvironmentVariables.ProjectCode);