Commit Graph

4 Commits

Author SHA1 Message Date
Samuel Williams
9b0b63465a Add support for Flask.host_matching
Allows configuration of Flask-DebugToolbar to support a Flask app
running in `host_matching` mode.

When Flask is configured this way, routes are each tied to a `host`
definition. This can either be a single explicit host, or a host
definition that includes variable values similar to Werkzeug path
definitions, eg `<subdomain>.toolbar.com`.

Handling explicit domains is simple, as the host can be passed through
directly - and this happens automatically.

If the host contains any variable parts, then calls to `url_for` need to
be able to access the appropriate values for those variables. If the
host string specified by the user contains arbitrary variables, it's
difficult for the toolbar to know what those should evaluate to. So we
restrict the possible options for the toolbar host to one of two options
here: either a single explicit host, or a full-wildcard host. The
wildcard host is managed internally by Flask-DebugToolbar so that we
know: 1) the variable name, and 2) what value to inject for it (the
current request's host).
2024-07-02 08:42:27 +01:00
David Lord
cdcf917044 add static type annotations 2024-04-30 10:55:06 -07:00
David Lord
3573841522 apply formatting and linting rules 2024-04-30 08:28:03 -07:00
David Lord
128bd5af6f update project files
use standard project layout and tool config across all pallets and
pallets-eco projects

* add issue templates
* add dependabot grouped updates for actions and pypi
* add lock inactive closed issues workflow
* add publish workflow with slsa and trusted publishing
* simplify tests workflow matrix
* simplify docs config.py
* show license in docs
* use pip-compile to pin development dependencies
* rename test to tests
* add .editorconfig
* simplify .gitignore
* add pre-commit hooks (will run formatters  in a subsequent PR)
* pin os and python in .readthedocs.yaml
* update license with original commit date and pallets-eco
* use pyproject.toml and flit_core instead of setuptools
* only declare flask dependency
* add config for mypy and pyright (will add typing in a subsequent PR)
* readme is markdown
* add pallets-eco message to readme
* remove install and docs links from readme
* add style, typing, docs tox envs
* use faster wheel building tox config
* add tox command to update dev dependencies
2024-04-29 10:54:08 -07:00