feat: Add AllowAllDashboardAuthorizationFilter for development
- Create authorization filter to bypass Hangfire dashboard authentication - Allow unrestricted access to /hangfire dashboard for local development - Note: Should be replaced with proper authentication in production
This commit is contained in:
17
ECMJobRunner.WebCron/AllowAllDashboardAuthorizationFilter.cs
Normal file
17
ECMJobRunner.WebCron/AllowAllDashboardAuthorizationFilter.cs
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
using Hangfire.Dashboard;
|
||||||
|
|
||||||
|
namespace ECMJobRunner.WebCron
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Authorization filter that allows all users to access Hangfire Dashboard
|
||||||
|
/// WARNING: This is for development only! Use proper authentication in production.
|
||||||
|
/// </summary>
|
||||||
|
public class AllowAllDashboardAuthorizationFilter : IDashboardAuthorizationFilter
|
||||||
|
{
|
||||||
|
public bool Authorize(DashboardContext context)
|
||||||
|
{
|
||||||
|
// Allow all users - FOR DEVELOPMENT ONLY
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user