Skip to content

Callback for skipping checks #20

@simonw

Description

@simonw

I need more flexibility with regard to skipping checks, for Datasette: simonw/datasette#1377

An optional callback function that gets the scope and specifies if it should be able to skip checks or not would be a great way to do this, and could be backwards-compatible since it could be implemented as a new optional keyword argument.

app = asgi_csrf(
    app,
    signing_secret="secret-goes-here",
    should_protect=lambda scope: True
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions