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

Respect default scope["actor"] if one exists #854

Closed
simonw opened this issue Jun 18, 2020 · 0 comments
Closed

Respect default scope["actor"] if one exists #854

simonw opened this issue Jun 18, 2020 · 0 comments

Comments

@simonw
Copy link
Owner

simonw commented Jun 18, 2020

ASGI wrapper plugins that themselves set the actor scope variable should be respected (though actor_from_request plugins should still execute and get the chance to replace that initial actor value).

Relevant code:

datasette/datasette/app.py

Lines 910 to 921 in 09a3479

# Handle authentication
actor = None
for actor in pm.hook.actor_from_request(
datasette=self.ds, request=Request(scope, receive)
):
if callable(actor):
actor = actor()
if asyncio.iscoroutine(actor):
actor = await actor
if actor:
break
scope_modifications["actor"] = actor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant