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

POC for security classes using Protocol #79

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

Conversation

adriangb
Copy link
Owner

@adriangb adriangb commented Feb 28, 2022

This uses Protocols to create "template classes": classes that give you errors if you don't implement all of the required class variables.

This at least allows some typechecking of missing parameters and wrongly typed parameters

Screenshot 2022-02-27 223825

Screenshot 2022-02-27 223609

@codecov-commenter
Copy link

codecov-commenter commented Feb 28, 2022

Codecov Report

Merging #79 (0ab0a77) into main (6e46ab0) will decrease coverage by 0.04%.
The diff coverage is 96.24%.

@@            Coverage Diff             @@
##             main      #79      +/-   ##
==========================================
- Coverage   98.11%   98.07%   -0.05%     
==========================================
  Files         144      151       +7     
  Lines        4565     4778     +213     
  Branches      738      770      +32     
==========================================
+ Hits         4479     4686     +207     
- Misses         44       47       +3     
- Partials       42       45       +3     
Impacted Files Coverage Δ
xpresso/binders/_security/apikey.py 88.46% <88.46%> (ø)
xpresso/binders/_security/oauth2.py 89.65% <89.65%> (ø)
xpresso/binders/api.py 97.50% <94.11%> (-2.50%) ⬇️
tests/test_security/test_multiple_models.py 98.30% <98.30%> (ø)
tests/test_security/test_security_key_header.py 100.00% <100.00%> (ø)
.../test_security_oauth2_authorization_code_bearer.py 100.00% <100.00%> (ø)
xpresso/binders/_security/utils.py 100.00% <100.00%> (ø)
xpresso/security.py 100.00% <100.00%> (ø)
xpresso/exception_handlers.py 100.00% <0.00%> (+20.00%) ⬆️

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