1
0
mirror of https://github.com/bitwarden/server synced 2025-12-17 08:43:27 +00:00

[PM-15015] Add Country Name to auth request from request headers (#5471)

* feat(pm-15015) : 
  * Add `CountryName` column to AuthRequest Table in Database, and refreshing AuthRequestView
  * Modify database stored procedures and Entity Framework migrations for AuthRequest Repositories
  * Add property to `ICurrentContext` and response models.
This commit is contained in:
Ike
2025-03-10 12:16:43 -04:00
committed by GitHub
parent 031e188e82
commit 913da4a629
20 changed files with 9372 additions and 49 deletions

View File

@@ -30,6 +30,7 @@ public class CurrentContext : ICurrentContext
public virtual string DeviceIdentifier { get; set; }
public virtual DeviceType? DeviceType { get; set; }
public virtual string IpAddress { get; set; }
public virtual string CountryName { get; set; }
public virtual List<CurrentContextOrganization> Organizations { get; set; }
public virtual List<CurrentContextProvider> Providers { get; set; }
public virtual Guid? InstallationId { get; set; }
@@ -104,6 +105,12 @@ public class CurrentContext : ICurrentContext
{
ClientVersionIsPrerelease = clientVersionIsPrerelease == "1";
}
if (httpContext.Request.Headers.TryGetValue("country-name", out var countryName))
{
CountryName = countryName;
}
}
public async virtual Task BuildAsync(ClaimsPrincipal user, GlobalSettings globalSettings)