TypeError / secure

Lightweight modern Python library to add security headers (CSP, HSTS, etc.) to Django, Flask, FastAPI, and more. Secure defaults or fully customizable.
MIT License
900 stars 27 forks source link

Import Error: docs not updated? #15

Closed chhantyal closed 3 years ago

chhantyal commented 3 years ago

From Docs here: https://secure.readthedocs.io/en/latest/headers.html

from secure import SecureHeaders
secure_headers = SecureHeaders(csp=True, hsts=False, xfo="DENY")
. . .
secure_headers.framework(response)

but looks like it changed to:

from secure import Secure
klausmyrseth commented 3 years ago

Its not updated, feature is removed and docks are quite outdated so cant find what they replaced it with or anything.

chhantyal commented 3 years ago

Use this: from secure import Secure

klausmyrseth commented 3 years ago

and secure_headers.framework.servertype(response)

for me that is secure_headers.framework.sanic(response)

But it does not fix the fact that the docs are severely outdated.

cak commented 3 years ago

Thanks @klausmyrseth and @chhantyal for alerting me on the issues with the documentation. I think I have updated all references to old version. (28c4b6e126bcb549e2e942a9b617742c5155ae89)

The new version is supposed to leverage and embrace modern Python language features (including type hints), I would be interested in hearing your opinions of the syntax and API changes and/or any overall feedback!