pycontw / pycon.tw

PyCon TW Proposal System & Backend Server
https://tw.pycon.org/prs
MIT License
94 stars 107 forks source link

Feat/swagger auth #1141

Open Dawn0472 opened 1 year ago

Dawn0472 commented 1 year ago

add swagger authorization

  1. add auth button in swagger
  2. add auth url to get token (逾7天更新一次,若無token則新增,有token直接取得- one user vs one token)
  3. update core.models.Token(預設 one user vs multiple token)
  4. update BearerAuthentication function(swagger authorization)
  5. update api import BearerAuthentication
josix commented 1 year ago

Hello @Dawn0472, thank you for working on this. There are some coding style issues, could you help me fix it, thanks!

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage: 65.82% and project coverage change: +0.01 :tada:

Comparison is base (4b520ac) 69.56% compared to head (287fc55) 69.57%.

:exclamation: Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1141 +/- ## ========================================== + Coverage 69.56% 69.57% +0.01% ========================================== Files 82 87 +5 Lines 3364 3444 +80 ========================================== + Hits 2340 2396 +56 - Misses 1024 1048 +24 ``` | [Impacted Files](https://app.codecov.io/gh/pycontw/pycon.tw/pull/1141?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pycontw) | Coverage Δ | | |---|---|---| | [src/core/models.py](https://app.codecov.io/gh/pycontw/pycon.tw/pull/1141?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pycontw#diff-c3JjL2NvcmUvbW9kZWxzLnB5) | `95.71% <ø> (-0.49%)` | :arrow_down: | | [src/users/api/views.py](https://app.codecov.io/gh/pycontw/pycon.tw/pull/1141?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pycontw#diff-c3JjL3VzZXJzL2FwaS92aWV3cy5weQ==) | `36.66% <36.66%> (ø)` | | | [src/pycontw2016/urls.py](https://app.codecov.io/gh/pycontw/pycon.tw/pull/1141?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pycontw#diff-c3JjL3B5Y29udHcyMDE2L3VybHMucHk=) | `84.21% <66.66%> (-1.51%)` | :arrow_down: | | [src/core/authentication.py](https://app.codecov.io/gh/pycontw/pycon.tw/pull/1141?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pycontw#diff-c3JjL2NvcmUvYXV0aGVudGljYXRpb24ucHk=) | `81.25% <79.31%> (-18.75%)` | :arrow_down: | | [src/attendee/api/views.py](https://app.codecov.io/gh/pycontw/pycon.tw/pull/1141?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pycontw#diff-c3JjL2F0dGVuZGVlL2FwaS92aWV3cy5weQ==) | `42.85% <100.00%> (ø)` | | | [src/events/api/views.py](https://app.codecov.io/gh/pycontw/pycon.tw/pull/1141?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pycontw#diff-c3JjL2V2ZW50cy9hcGkvdmlld3MucHk=) | `52.00% <100.00%> (ø)` | | | [src/sponsors/api/views.py](https://app.codecov.io/gh/pycontw/pycon.tw/pull/1141?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pycontw#diff-c3JjL3Nwb25zb3JzL2FwaS92aWV3cy5weQ==) | `41.17% <100.00%> (ø)` | | | [src/users/api/urls.py](https://app.codecov.io/gh/pycontw/pycon.tw/pull/1141?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pycontw#diff-c3JjL3VzZXJzL2FwaS91cmxzLnB5) | `100.00% <100.00%> (ø)` | | ... and [6 files with indirect coverage changes](https://app.codecov.io/gh/pycontw/pycon.tw/pull/1141/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pycontw)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.