Baroshem / nuxt-security

🛡 Automatically configure your app to follow OWASP security patterns and principles by using HTTP Headers and Middleware
https://nuxt-security.vercel.app/
MIT License
737 stars 56 forks source link

Support enabling/disabling basic auth at runtime #443

Open rettrich opened 1 month ago

rettrich commented 1 month ago

Is your feature request related to a problem? Please describe.

In my app I want to enable / disable basic auth based on environment variables at boot time. I want to build the app only once and configure it dynamically at runtime. Currently, this is not possible, as basic auth can only be set at build time. The "nuxt-security:routeRules" hook does not respect changes to the basic Auth setting.

Describe the solution you'd like

Similar to the "nuxt-security:routeRules" hook, I want to be able to enable/disable basic auth at runtime.

Baroshem commented 1 month ago

Hey, thanks for this feature idea. I am not sure now how it could work as it is currently enabled globally as you mentioned. Do you maybe have an idea how this could be implemented?

Maybe you would be interested in contributing by creating a Proof of Concept branch with this feature? I can provide all help needed :)

rettrich commented 1 month ago

Sure, from taking a look at the current implementation I am also not sure how to do it. But I can try creating a PoC, probably won't get around to it though in the next 2 weeks or so.

Baroshem commented 2 weeks ago

Hey there, if you need my help, please let me know :)