Remove dependency on before_first_request #500
Labels
code quality
Places where the code quality or readability can be improved
large
This is going to take a lot longer than most things
performance
Issues pertaining to performance (both CPU and RAM)
security
Critical issues regarding the security of Publ and the server it runs on
Flask's
before_first_request
function is going away. Publ currently uses it to bootstrap Authl's configuration at startup time in a user-friendly way; Authl's configuration requires that the Flask app be fully-formed (so that thesecret_key
property is available) but that it not yet be serving up any requests (so thatauthl.flask
can add the_login
and_logout
routes).There are three paths forward, both fraught with peril:
finalize_setup
method to the Publ application object that runs the previousbefore_first_request
functionalityauthl.flask
Option 2 is the best long-term one, but that was the original design to Publ, and I changed it to be inheritance-based rather than compositional for some reason that I can't recall (probably something to address issues with startup order and PonyORM's global state, but who even knows anymore).
Option 1 is definitely the easiest to do, though, and could probably be done as an expedient option in advance of Flask 2.3.
The text was updated successfully, but these errors were encountered: