Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for csp_clear decorator. #202

Closed
wants to merge 2 commits into from

Conversation

tim-schilling
Copy link
Contributor

This allows a directive to be cleared / unset entirely for a particular view.

Closes #201

This allows a directive to be cleared / unset entirely for a
particular view.

Closes mozilla#201
Copy link
Contributor

@stevejalim stevejalim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this @tim-schilling -- in my capacity as not-the-official-maintainer-but-keen-to-help, I can see how this could be useful to others -- and certainly makes it easier to get out of a hole if, say, auth has to happen on a different domain compared to the iframed content.

I've suggested some minor docs tweaks, and then it'll need rebasing and conflicts fixing, I'm afraid.

I'm thinking that if a 3.8 release remains focused on Django+Python updates and generally bringing the project up to date, this changeset could be a good one for 3.9

================

The ``@csp_clear`` decorator allows you to **clear** a CSP directive. Clearing
a directive will take priority over any of the other options.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if an admonition directive here like warning or even danger might be worthwhile.

docs/decorators.rst Outdated Show resolved Hide resolved
docs/decorators.rst Outdated Show resolved Hide resolved
@robhudson
Copy link
Member

Since the underlying code changed drastically I'm going to close this. We're discussing the need for this in #201.

@robhudson robhudson closed this Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support clearing/unsetting directives via decorator
3 participants