1
0
mirror of https://github.com/bitwarden/server synced 2026-01-08 11:33:26 +00:00

[PM-28265] storage reconciliation job (#6615)

This commit is contained in:
Kyle Denney
2025-11-24 16:11:52 -06:00
committed by GitHub
parent 9573cab37e
commit 931f0c65af
10 changed files with 993 additions and 15 deletions

View File

@@ -0,0 +1,24 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.Extensions.Hosting;
namespace Bit.Core.Utilities;
/// <summary>
/// Authorization attribute that restricts controller/action access to Development and QA environments only.
/// Returns 404 Not Found in all other environments.
/// </summary>
public class RequireLowerEnvironmentAttribute() : TypeFilterAttribute(typeof(LowerEnvironmentFilter))
{
private class LowerEnvironmentFilter(IWebHostEnvironment environment) : IAuthorizationFilter
{
public void OnAuthorization(AuthorizationFilterContext context)
{
if (!environment.IsDevelopment() && !environment.IsEnvironment("QA"))
{
context.Result = new NotFoundResult();
}
}
}
}