markets / sudo_rails

🔒 Sudo mode for your Rails controllers
https://rubygems.org/gems/sudo_rails
MIT License
80 stars 2 forks source link

It would be cool to support password or 2fa for escalation #13

Closed ChrisMacNaughton closed 2 years ago

ChrisMacNaughton commented 3 years ago

It's not super hard to implement but it does mean deviating from this gem's handling of confirm almost completely :-P

markets commented 2 years ago

Hey @ChrisMacNaughton 👋🏼 sorry the late reply 🙏🏼

As you said, this is probably out of the scope of this gem! But since you can use a custom "Confirmation strategy" (https://github.com/markets/sudo_rails#confirmation-strategy), you have some flexibility to handle it at your own.

markets commented 7 months ago

Hey @ChrisMacNaughton 👋🏼

I just shipped (v0.9.0) with something that brings some extra flexibility and will probably allow some other workflows to be implemented. With the new Callbacks, you can now add custom callable objects at some points of the lifecycle.