mirror of
https://github.com/bitwarden/server.git
synced 2025-04-07 05:58:13 -05:00
appid no longer served from api
This commit is contained in:
parent
8b40863472
commit
6c16a988c3
@ -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")]
|
[HttpPut("u2f")]
|
||||||
[HttpPost("u2f")]
|
[HttpPost("u2f")]
|
||||||
public async Task<TwoFactorU2fResponseModel> PutU2f([FromBody]TwoFactorU2fRequestModel model)
|
public async Task<TwoFactorU2fResponseModel> PutU2f([FromBody]TwoFactorU2fRequestModel model)
|
||||||
|
@ -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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -150,8 +150,6 @@ namespace Bit.Api
|
|||||||
})
|
})
|
||||||
.AddDebug();
|
.AddDebug();
|
||||||
|
|
||||||
app.UseMiddleware<AdjustHeadersMiddleware>();
|
|
||||||
|
|
||||||
// Rate limiting
|
// Rate limiting
|
||||||
app.UseMiddleware<CustomIpRateLimitMiddleware>();
|
app.UseMiddleware<CustomIpRateLimitMiddleware>();
|
||||||
|
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
"globalSettings": {
|
"globalSettings": {
|
||||||
"siteName": "bitwarden",
|
"siteName": "bitwarden",
|
||||||
"baseVaultUri": "http://localhost:4001/#",
|
"baseVaultUri": "http://localhost:4001/#",
|
||||||
"baseApiUri": "http://localhost:4000/",
|
|
||||||
"jwtSigningKey": "THIS IS A SECRET. IT KEEPS YOUR TOKEN SAFE. :)",
|
"jwtSigningKey": "THIS IS A SECRET. IT KEEPS YOUR TOKEN SAFE. :)",
|
||||||
"stripeApiKey": "SECRET",
|
"stripeApiKey": "SECRET",
|
||||||
"sqlServer": {
|
"sqlServer": {
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
"globalSettings": {
|
"globalSettings": {
|
||||||
"siteName": "bitwarden",
|
"siteName": "bitwarden",
|
||||||
"baseVaultUri": "http://localhost:4001/#",
|
"baseVaultUri": "http://localhost:4001/#",
|
||||||
"baseApiUri": "http://localhost:4000/",
|
|
||||||
"jwtSigningKey": "THIS IS A SECRET. IT KEEPS YOUR TOKEN SAFE. :)",
|
"jwtSigningKey": "THIS IS A SECRET. IT KEEPS YOUR TOKEN SAFE. :)",
|
||||||
"stripeApiKey": "SECRET",
|
"stripeApiKey": "SECRET",
|
||||||
"sqlServer": {
|
"sqlServer": {
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
{
|
{
|
||||||
public virtual string SiteName { get; set; }
|
public virtual string SiteName { get; set; }
|
||||||
public virtual string BaseVaultUri { get; set; }
|
public virtual string BaseVaultUri { get; set; }
|
||||||
public virtual string BaseApiUri { get; set; }
|
|
||||||
public virtual string JwtSigningKey { get; set; }
|
public virtual string JwtSigningKey { get; set; }
|
||||||
public virtual string StripeApiKey { get; set; }
|
public virtual string StripeApiKey { get; set; }
|
||||||
public virtual SqlServerSettings SqlServer { get; set; } = new SqlServerSettings();
|
public virtual SqlServerSettings SqlServer { get; set; } = new SqlServerSettings();
|
||||||
|
@ -122,8 +122,8 @@ namespace Bit.Core.Utilities
|
|||||||
|
|
||||||
public static string U2fAppIdUrl(GlobalSettings globalSettings)
|
public static string U2fAppIdUrl(GlobalSettings globalSettings)
|
||||||
{
|
{
|
||||||
//return $"{globalSettings.BaseApiUri}app-id.json";
|
|
||||||
return globalSettings.U2f.AppId;
|
return globalSettings.U2f.AppId;
|
||||||
|
//return "https://localhost:4001/app-id.fidou2f";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ namespace Bit.Core.Utilities
|
|||||||
|
|
||||||
public static void AddDefaultServices(this IServiceCollection services)
|
public static void AddDefaultServices(this IServiceCollection services)
|
||||||
{
|
{
|
||||||
services.AddSingleton<IMailService, SendGridTemplateMailService>();
|
services.AddSingleton<IMailService, RazorViewMailService>();
|
||||||
services.AddSingleton<IMailDeliveryService, SendGridMailDeliveryService>();
|
services.AddSingleton<IMailDeliveryService, SendGridMailDeliveryService>();
|
||||||
services.AddSingleton<IPushNotificationService, NotificationHubPushNotificationService>();
|
services.AddSingleton<IPushNotificationService, NotificationHubPushNotificationService>();
|
||||||
services.AddSingleton<IBlockIpService, AzureQueueBlockIpService>();
|
services.AddSingleton<IBlockIpService, AzureQueueBlockIpService>();
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
"globalSettings": {
|
"globalSettings": {
|
||||||
"siteName": "bitwarden",
|
"siteName": "bitwarden",
|
||||||
"baseVaultUri": "http://localhost:4001/#",
|
"baseVaultUri": "http://localhost:4001/#",
|
||||||
"baseApiUri": "http://localhost:4000/",
|
|
||||||
"jwtSigningKey": "THIS IS A SECRET. IT KEEPS YOUR TOKEN SAFE. :)",
|
"jwtSigningKey": "THIS IS A SECRET. IT KEEPS YOUR TOKEN SAFE. :)",
|
||||||
"stripeApiKey": "SECRET",
|
"stripeApiKey": "SECRET",
|
||||||
"sqlServer": {
|
"sqlServer": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user