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 async security enforcers in AioHTTP #102

Merged
merged 4 commits into from
Oct 24, 2019

Conversation

janbuchar
Copy link
Collaborator

No description provided.

self._extension.security_enforcers[security_scheme](request, required_scopes)
enforcer = self._extension.security_enforcers[security_scheme]

if inspect.iscoroutinefunction(enforcer):
Copy link
Contributor

Choose a reason for hiding this comment

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

cool

from apistrap.schemas import ErrorResponse


def enforcer(request: BaseRequest, scopes: Sequence[str]):
Copy link
Contributor

Choose a reason for hiding this comment

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

What about ensure_rw_only, enforcer is a bit generic name...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure!

@janbuchar janbuchar merged commit 3c03914 into dev Oct 24, 2019
@janbuchar janbuchar deleted the async-security-enforcement branch October 24, 2019 10:11
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.

None yet

2 participants