Flask-CloudflareRemote
Cloudflare proxy support for flask application.
It gets client ip from cloudflare headers and can allow request from cloudflare ips only. If you are behind a proxy remember to use werkzeug.middleware.proxy_fix.ProxyFix, alternative you can override CloudflareRemote.get_remote() in order to fetch the correct client ip for example via HTTP_X_FORWARDED_FOR.
Quickstart
Install flask_cloudflare_remote using pip:
$ pip install Flask-CloudflareRemote
Example usage
import flask
from flask_cloudflare_remote import CloudflareRemote
app = Flask(__name__)
cf = CloudflareRemote()
cf.init_app(app)
Configuration
CF_DOMAIN: (default: ‘www.cloudflare.com’)
CF_REQ_TIMEOUT: (default: 10)
CF_IPs: (default: None) list of allowed cloudflare ips
CF_IP4_URI: (default: ‘/ips-v4’) ipv4 list uri
CF_IP6_URI: (default: ‘/ips-v6’) ipv6 list uri
CF_IPv6_ENABLED: (default: False) enable ipv6
CF_STRICT_ACCESS: (default: True) return forbidden if remote ip is not in allowed list
CF_OVERRIDE_REMOTE: (default: True) override flask REMOTE_ADDR from request
CF_HDR_CLIENT_IP: (default: ‘CF-Connecting-IP’) header key used for client ip
License MIT
Metadata
Release files for Flask-CloudflareRemote 1.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| Flask-CloudflareRemote-1.1.2.tar.gz | 3.8 kB | Without provenance | Details for Flask-CloudflareRemote-1.1.2.tar.gz |
Release files / Flask-CloudflareRemote-1.1.2.tar.gz
| Download URL | Flask-CloudflareRemote-1.1.2.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5d47906b4a8d4915b7ee8623f057c195d589f6ad320d8551aac51ce513aa776f
|
|
BLAKE2b-256 checksum How to use checksums |
159af5df5e2d1b2bdd3f415048df3a3a48d4c81a7395ee863d32dee402864359
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7
|
Security for Flask-CloudflareRemote 1.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.