Skip to content

Releases: CheeseCake87/flask-imp

6.4.0

25 Apr 17:08

Choose a tag to compare

  • generated apps now have globals.py, config.py and
    extensions.py this allows for separation of concerns.
    • globals.py contains global variables and a good place for dotenv
    • config.py contains configuration for Flask and Imp
    • extensions.py contains flask extension initialisation

6.3.0

19 Apr 11:41

Choose a tag to compare

  • fix missing raise on scope_import is None check in process_folder_file_scope
  • use context manager for multiprocessing.Pool in authenticate_password to stop worker leak
  • fix disable_default_fail semantics on checkpoint_callable — default now aborts with fail_status
    when no fail handler is set (previously it silently called the protected view)
  • use secrets.compare_digest for bearer token comparison in BearerCheckpoint
  • mix secrets.token_hex entropy into generate_csrf_token output
  • ImpBlueprint.import_resources now routes through cast_to_import_str, fixing import paths for
    nested resource folders
  • preserve order when deduping scoped import results (dict.fromkeys instead of set)
  • URL-encode username/password when building database URIs to avoid breakage on special characters
  • chain ImportError re-raises with from e to preserve the original traceback
  • add testing for checkpoints

6.2.0

14 Apr 13:06

Choose a tag to compare

🚨 BREAKING CHANGES TO:

  • auth.generate_private_key
  • auth.authenticate_password
  • auth.encrypt_password

The function argument encryption_level has been changed to algorithm and has a new type of Literal

This was done to allow for more algorithms to be added in the future.

6.1.5

22 Feb 12:35

Choose a tag to compare

  • bugfix, return missing from disable default fail on checkpoint

6.1.4

22 Feb 12:26

Choose a tag to compare

  • add disable_default_fail option to checkpoints

6.1.3

21 Feb 17:20

Choose a tag to compare

  • adjust fail_response to accept a callable to avoid out of context error

6.1.2

21 Feb 16:45

Choose a tag to compare

  • fix checkpoint type checking, bump version, add checkpoint protocol

6.1.1

21 Feb 16:31

Choose a tag to compare

  • checkpoint bug fix, docs fix, bump version

6.1.0

21 Feb 16:19

Choose a tag to compare

Ability to pass a Flask Response as a failure option in a checkpoint.

from flask import render_template
from flask_imp import Flask

from flask_imp.security import checkpoint, SessionCheckpoint

from flask import make_response

def failed_response():
    return make_response({
        "message": "You must be logged in to access this page."
    })

CHECKPOINT = SessionCheckpoint("logged_in", True).action(
    fail_response=failed_response
)

def include(app: Flask):
    @app.route("/", methods=["GET"])
    @checkpoint(CHECKPOINT)
    def index():
        return render_template(bp.tmpl("index.html"))

6.0.3

16 Nov 22:28

Choose a tag to compare

  • fix to 'SessionCheckpoint' value checker

🚨 REMIDER 🚨

⚠️ There are multiple breaking changes from 5.7.0 -> 6.0.0 , please read the documentation ⚠️

https://flask-imp.readthedocs.io/en/latest/