Skip to content

basic auth#35

Merged
trim21 merged 31 commits intobangumi:masterfrom
trim21:auth
Dec 23, 2021
Merged

basic auth#35
trim21 merged 31 commits intobangumi:masterfrom
trim21:auth

Conversation

@trim21
Copy link
Contributor

@trim21 trim21 commented Dec 21, 2021

仅允许 HTTP Header 验证 (https://github.com/bangumi/api/pull/75)

非认证用户(无token,过新的注册用户)在请求NSFW条目会收到404响应。

加了一个根据当前token反查当前用户的API

GET /v0/me

{
  "id": 382951,
  "url": "https://bgm.tv/user/382951",
  "username": "382951",
  "nickname": "树洞酱",
  "user_group": 10,
  "avatar": {
    "large": "https://lain.bgm.tv/pic/user/l/000/38/29/382951.jpg?r=1571167246",
    "medium": "https://lain.bgm.tv/pic/user/m/000/38/29/382951.jpg?r=1571167246",
    "small": "https://lain.bgm.tv/pic/user/s/000/38/29/382951.jpg?r=1571167246"
  },
  "sign": "[email protected] 密码:lovemeplease"
}

close #32

@codecov
Copy link

codecov bot commented Dec 21, 2021

Codecov Report

Merging #35 (2648223) into master (e1c87d6) will increase coverage by 0.21%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #35      +/-   ##
==========================================
+ Coverage   98.87%   99.09%   +0.21%     
==========================================
  Files          43       52       +9     
  Lines        1783     2100     +317     
==========================================
+ Hits         1763     2081     +318     
+ Misses         20       19       -1     
Impacted Files Coverage Δ
pol/api/v0/__init__.py 100.00% <100.00%> (ø)
pol/api/v0/depends/auth/__init__.py 100.00% <100.00%> (ø)
pol/api/v0/depends/auth/schema.py 100.00% <100.00%> (ø)
pol/api/v0/depends/auth/schema_test.py 100.00% <100.00%> (ø)
pol/api/v0/me.py 100.00% <100.00%> (ø)
pol/api/v0/subject.py 100.00% <100.00%> (ø)
pol/curd/__init__.py 100.00% <100.00%> (ø)
pol/curd/user.py 100.00% <100.00%> (ø)
pol/permission/__init__.py 100.00% <100.00%> (ø)
pol/sa.py 100.00% <100.00%> (ø)
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e1c87d6...2648223. Read the comment docs.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@trim21 trim21 marked this pull request as ready for review December 22, 2021 18:09
@trim21 trim21 merged commit 4fd748a into bangumi:master Dec 23, 2021
@trim21 trim21 deleted the auth branch December 23, 2021 08:39
trim21 referenced this pull request in trim21/server Dec 23, 2021
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.

用户鉴权

1 participant