diff --git a/src/Api/Controllers/TwoFactorController.cs b/src/Api/Controllers/TwoFactorController.cs index 9765f97920..eee501b784 100644 --- a/src/Api/Controllers/TwoFactorController.cs +++ b/src/Api/Controllers/TwoFactorController.cs @@ -135,33 +135,6 @@ namespace Bit.Api.Controllers } } - [HttpGet("~/app-id.json")] - [Produces("application/fido.trusted-apps+json")] - [AllowAnonymous] - public string GetU2fAppId() - { - return JsonConvert.SerializeObject(new - { - trustedFacets = new object[] - { - new - { - version = new - { - major = 1, - minor = 0 - }, - ids = new string[] - { - _globalSettings.U2f.AppId, - //"ios:bundle-id:com.8bit.bitwarden", - //"android:apk-key-hash:585215fd5153209a7e246f53286035838a0be227" - } - } - } - }); - } - [HttpPut("u2f")] [HttpPost("u2f")] public async Task PutU2f([FromBody]TwoFactorU2fRequestModel model) diff --git a/src/Api/Middleware/AdjustHeadersMiddleware.cs b/src/Api/Middleware/AdjustHeadersMiddleware.cs deleted file mode 100644 index a583c758be..0000000000 --- a/src/Api/Middleware/AdjustHeadersMiddleware.cs +++ /dev/null @@ -1,38 +0,0 @@ -using Bit.Core; -using Microsoft.AspNetCore.Http; -using System.Linq; -using System.Threading.Tasks; - -namespace Bit.Api.Middleware -{ - public class AdjustHeadersMiddleware - { - private readonly RequestDelegate _next; - - public AdjustHeadersMiddleware(RequestDelegate next) - { - _next = next; - } - - public async Task Invoke(HttpContext httpContext, CurrentContext currentContext) - { - httpContext.Response.OnStarting((state) => - { - if(httpContext.Response.Headers.Count > 0 && httpContext.Response.Headers.ContainsKey("Content-Type")) - { - var contentType = httpContext.Response.Headers["Content-Type"].ToString(); - if(contentType.StartsWith("application/fido.trusted-apps+json")) - { - httpContext.Response.Headers.Remove("Content-Type"); - httpContext.Response.Headers.Append("Content-Type", "application/fido.trusted-apps+json"); - } - } - - return Task.FromResult(0); - }, null); - - - await _next.Invoke(httpContext); - } - } -} diff --git a/src/Api/Startup.cs b/src/Api/Startup.cs index 77d44eaed1..89898342c8 100644 --- a/src/Api/Startup.cs +++ b/src/Api/Startup.cs @@ -150,8 +150,6 @@ namespace Bit.Api }) .AddDebug(); - app.UseMiddleware(); - // Rate limiting app.UseMiddleware(); diff --git a/src/Api/settings.json b/src/Api/settings.json index c67b8d510d..37a0820ab5 100644 --- a/src/Api/settings.json +++ b/src/Api/settings.json @@ -2,7 +2,6 @@ "globalSettings": { "siteName": "bitwarden", "baseVaultUri": "http://localhost:4001/#", - "baseApiUri": "http://localhost:4000/", "jwtSigningKey": "THIS IS A SECRET. IT KEEPS YOUR TOKEN SAFE. :)", "stripeApiKey": "SECRET", "sqlServer": { diff --git a/src/Billing/settings.json b/src/Billing/settings.json index cc5b06d6d9..a6d8e2e760 100644 --- a/src/Billing/settings.json +++ b/src/Billing/settings.json @@ -2,7 +2,6 @@ "globalSettings": { "siteName": "bitwarden", "baseVaultUri": "http://localhost:4001/#", - "baseApiUri": "http://localhost:4000/", "jwtSigningKey": "THIS IS A SECRET. IT KEEPS YOUR TOKEN SAFE. :)", "stripeApiKey": "SECRET", "sqlServer": { diff --git a/src/Core/GlobalSettings.cs b/src/Core/GlobalSettings.cs index 88e2926c16..aa22660be9 100644 --- a/src/Core/GlobalSettings.cs +++ b/src/Core/GlobalSettings.cs @@ -4,7 +4,6 @@ { public virtual string SiteName { get; set; } public virtual string BaseVaultUri { get; set; } - public virtual string BaseApiUri { get; set; } public virtual string JwtSigningKey { get; set; } public virtual string StripeApiKey { get; set; } public virtual SqlServerSettings SqlServer { get; set; } = new SqlServerSettings(); diff --git a/src/Core/Utilities/CoreHelpers.cs b/src/Core/Utilities/CoreHelpers.cs index 5c3abd74ff..b958d8ef3f 100644 --- a/src/Core/Utilities/CoreHelpers.cs +++ b/src/Core/Utilities/CoreHelpers.cs @@ -122,8 +122,8 @@ namespace Bit.Core.Utilities public static string U2fAppIdUrl(GlobalSettings globalSettings) { - //return $"{globalSettings.BaseApiUri}app-id.json"; return globalSettings.U2f.AppId; + //return "https://localhost:4001/app-id.fidou2f"; } } } diff --git a/src/Core/Utilities/ServiceCollectionExtensions.cs b/src/Core/Utilities/ServiceCollectionExtensions.cs index 63c31387b4..0d15ec7a48 100644 --- a/src/Core/Utilities/ServiceCollectionExtensions.cs +++ b/src/Core/Utilities/ServiceCollectionExtensions.cs @@ -48,7 +48,7 @@ namespace Bit.Core.Utilities public static void AddDefaultServices(this IServiceCollection services) { - services.AddSingleton(); + services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); diff --git a/src/Identity/settings.json b/src/Identity/settings.json index 467b1611eb..738b32619b 100644 --- a/src/Identity/settings.json +++ b/src/Identity/settings.json @@ -2,7 +2,6 @@ "globalSettings": { "siteName": "bitwarden", "baseVaultUri": "http://localhost:4001/#", - "baseApiUri": "http://localhost:4000/", "jwtSigningKey": "THIS IS A SECRET. IT KEEPS YOUR TOKEN SAFE. :)", "stripeApiKey": "SECRET", "sqlServer": {