mirror of
https://github.com/bitwarden/server
synced 2026-01-02 16:43:25 +00:00
fix(auth-validator): [PM-22975] Client Version Validator - Fixed more tests. Checking in with CI to see how it's looking.
This commit is contained in:
@@ -9,6 +9,8 @@ using Bit.Core.Entities;
|
||||
using Bit.Core.Enums;
|
||||
using Bit.Core.Services;
|
||||
using Bit.Identity;
|
||||
using Bit.Identity.IdentityServer;
|
||||
using Bit.Identity.IdentityServer.RequestValidators;
|
||||
using Bit.Test.Common.Helpers;
|
||||
using LinqToDB;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
@@ -46,6 +48,13 @@ public class IdentityApplicationFactory : WebApplicationFactoryBase<Startup>
|
||||
});
|
||||
});
|
||||
|
||||
// Bypass client version gating to isolate tests from client version behavior
|
||||
SubstituteService<IClientVersionValidator>(svc =>
|
||||
{
|
||||
svc.ValidateAsync(Arg.Any<User>(), Arg.Any<CustomValidatorRequestContext>())
|
||||
.Returns(Task.FromResult(true));
|
||||
});
|
||||
|
||||
base.ConfigureWebHost(builder);
|
||||
}
|
||||
|
||||
|
||||
@@ -131,6 +131,10 @@ public abstract class WebApplicationFactoryBase<T> : WebApplicationFactory<T>
|
||||
{ "globalSettings:databaseProvider", "postgres" },
|
||||
{ "globalSettings:postgreSql:connectionString", "Host=localhost;Username=test;Password=test;Database=test" },
|
||||
|
||||
// Ensure base service URIs are defined for tests (used for client redirect URIs)
|
||||
{ "globalSettings:baseServiceUri:vault", "https://localhost:8080" },
|
||||
{ "globalSettings:baseServiceUri:internalVault", "https://localhost:8080" },
|
||||
|
||||
// Clear the redis connection string for distributed caching, forcing an in-memory implementation
|
||||
{ "globalSettings:redis:connectionString", "" },
|
||||
|
||||
|
||||
Reference in New Issue
Block a user