File tree 20 files changed +336
-396
lines changed
20 files changed +336
-396
lines changed Original file line number Diff line number Diff line change
1
+ name : Release changelog
2
+
3
+ on :
4
+ push :
5
+ tags :
6
+ - v*
7
+
8
+ jobs :
9
+ changelog :
10
+ runs-on : ubuntu-latest
11
+ steps :
12
+ - name : Checkout code
13
+ uses : actions/checkout@v4
14
+ with :
15
+ ref : master
16
+
17
+ - uses : rhysd/changelog-from-release/action@v3
18
+ with :
19
+ file : docs/changelog.md
20
+ pull_request : true
21
+ github_token : ${{ secrets.GH_TOKEN }}
Original file line number Diff line number Diff line change 4
4
push :
5
5
branches :
6
6
- master
7
- tags :
8
- - ' **'
9
7
pull_request :
10
8
11
9
jobs :
@@ -17,10 +15,10 @@ jobs:
17
15
python-version : [ '3.10', '3.11', '3.12' ]
18
16
fail-fast : false
19
17
steps :
20
- - uses : actions/checkout@v3
18
+ - uses : actions/checkout@v4
21
19
22
20
- name : Setup PDM
23
- uses : pdm-project/setup-pdm@v3
21
+ uses : pdm-project/setup-pdm@v4
24
22
with :
25
23
python-version : ${{ matrix.python-version }}
26
24
Original file line number Diff line number Diff line change
1
+ name : docs
2
+ on :
3
+ push :
4
+ branches :
5
+ - master
6
+ permissions :
7
+ contents : write
8
+
9
+ jobs :
10
+ deploy :
11
+ runs-on : ubuntu-latest
12
+ if : github.event.repository.fork == false
13
+ steps :
14
+ - uses : actions/checkout@v4
15
+ - name : Configure Git Credentials
16
+ run : |
17
+ git config user.name github-actions[bot]
18
+ git config user.email 41898282+github-actions[bot]@users.noreply.github.com
19
+ - uses : actions/setup-python@v5
20
+ with :
21
+ python-version : 3.x
22
+ - run : echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
23
+ - uses : actions/cache@v4
24
+ with :
25
+ key : mkdocs-material-${{ env.cache_id }}
26
+ path : .cache
27
+ restore-keys : |
28
+ mkdocs-material-
29
+ - run : sudo apt-get install pngquant
30
+ - run : pip install git+https://${GH_TOKEN}@github.com/squidfunk/mkdocs-material.git
31
+ - run : mkdocs gh-deploy --force
32
+ env :
33
+ GH_TOKEN : ${{ secrets.GH_TOKEN }}
Original file line number Diff line number Diff line change 1
1
repos :
2
2
- repo : https://github.com/pre-commit/pre-commit-hooks
3
- rev : v4.6 .0
3
+ rev : v5.0 .0
4
4
hooks :
5
5
- id : end-of-file-fixer
6
- - id : check-yaml
7
6
- id : check-toml
8
7
9
8
- repo : https://github.com/charliermarsh/ruff-pre-commit
10
- rev : v0.5.0
9
+ rev : v0.9.9
11
10
hooks :
12
11
- id : ruff
13
12
args :
14
13
- ' --fix'
14
+ - ' --unsafe-fixes'
15
15
- id : ruff-format
16
16
17
17
- repo : https://github.com/pdm-project/pdm
18
- rev : 2.16.1
18
+ rev : 2.22.3
19
19
hooks :
20
20
- id : pdm-lock-check
Original file line number Diff line number Diff line change 1
- # fastapi_oauth20
1
+ # FastAPI OAuth 2.0
2
2
3
3
![ GitHub Workflow Status (with event)] ( https://img.shields.io/github/actions/workflow/status/fastapi-practices/fastapi_oauth20/ci.yml?logo=github )
4
4
[ ![ GitHub] ( https://img.shields.io/github/license/wu-clan/httpfpt )] ( https://github.com/wu-clan/httpfpt/blob/master/LICENSE )
5
- ![ Static Badge] ( https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12-blue )
5
+ ![ Static Badge] ( https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13 -blue )
6
6
![ GitHub release (with filter)] ( https://img.shields.io/github/v/release/fastapi-practices/fastapi_oauth20 )
7
7
[ ![ Ruff] ( https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json )] ( https://github.com/astral-sh/ruff )
8
8
9
- 在 FastAPI 中异步授权 OAuth2 客户端
9
+ 在 FastAPI 中异步授权 OAuth 2.0 客户端
10
10
11
11
我们的目标是集成多个 CN 第三方客户端,敬请期待(🐦)...
12
-
13
- #### TODO:
14
-
15
- 如果我们能够很容易获取测试客户端,或许这会很快
16
-
17
- - [ ] tests
18
- - [x] [ Google] ( https://developers.google.cn/identity/protocols/oauth2/javascript-implicit-flow?hl=en )
19
- - [ ] 微信
20
- - [ ] QQ
21
- - [ ] 抖音
22
- - [x] [ 飞书] ( https://open.feishu.cn/document/common-capabilities/sso/web-application-sso/web-app-overview )
23
- - [ ] 钉钉
24
- - [ ] 微博
25
- - [ ] 百度
26
- - [x] [ Gitee] ( https://gitee.com/api/v5/oauth_doc#/ )
27
- - [x] [ Github] ( https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app )
28
- - [X] [ 开源中国] ( https://www.oschina.net/openapi )
29
- - [ ] 阿里云
30
- - [ ] [ Linux Do] ( https://connect.linux.do/ )
Original file line number Diff line number Diff line change
1
+ TODO...
Original file line number Diff line number Diff line change
1
+ TODO...
Original file line number Diff line number Diff line change
1
+ TODO...
Original file line number Diff line number Diff line change
1
+ <div align =" center " >
2
+ <h1 >🔐</h1 >
3
+ </div >
4
+
5
+ ---
6
+
7
+ ** Documentation
8
+ ** : <a href =" https://fastapi-practices.github.io/fastapi-oauth20 " target =" _blank " >https://fastapi-practices.github.io/fastapi-oauth20 </a >
9
+
10
+ ** Source Code
11
+ ** : <a href =" https://github.com/fastapi-practices/fastapi-oauth20 " target =" _blank " >https://github.com/fastapi-practices/fastapi-oauth20 </a >
12
+
13
+ ---
14
+
15
+ 在 FastAPI 中异步授权 OAuth 2.0 客户端
16
+
17
+ 我们的目标是集成多个 CN 第三方客户端,敬请期待(🐦)...
18
+
19
+ 你可以在 [ 集成状态] ( integration.md ) 获取当前集成情况
20
+
21
+ ## 互动
22
+
23
+ [ TG / Discord] ( https://wu-clan.github.io/homepage/ )
24
+
25
+ ## 赞助
26
+
27
+ 如果此项目能够帮助到你,你可以赞助作者一些咖啡豆表示鼓励:[ Sponsor] ( https://wu-clan.github.io/sponsor/ )
Original file line number Diff line number Diff line change
1
+ ## 依赖
2
+
3
+ 在安装 fastapi-oauth20 之前,请确保您满足以下先决条件:
4
+
5
+ - ** Python** 版本 >= 3.10
6
+ - ** FastAPI** 版本 >= 0.100.0
7
+
8
+ ## 安装
9
+
10
+ === ":simple-piped: pip"
11
+
12
+ ```sh
13
+ pip install fastapi-oauth20
14
+ ```
15
+
16
+ === ":simple-pdm: pdm"
17
+
18
+ ```sh
19
+ pdm add fastapi-oauth20
20
+ ```
21
+
22
+ === ":simple-uv: uv"
23
+
24
+ ```sh
25
+ uv add fastapi-oauth20
26
+ ```
Original file line number Diff line number Diff line change
1
+ 如果你有更多需求,请在仓库内创建 Issues,我们将尽力完成所有目标
2
+
3
+ - [x] 表示已集成
4
+ - [ ] 表示待集成
5
+
6
+ ---
7
+
8
+ - [x] [ Linux Do] ( https://connect.linux.do/ )
9
+ - [x] [ GitHub] ( https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app )
10
+ - [x] [ Gitee] ( https://gitee.com/api/v5/oauth_doc#/ )
11
+ - [x] [ 开源中国] ( https://www.oschina.net/openapi )
12
+ - [ ] [ 微信小程序] ( https://mp.weixin.qq.com/ )
13
+ - [ ] [ 微信开放平台] ( https://open.weixin.qq.com/ )
14
+ - [ ] [ 企业微信二维码登录] ( https://work.weixin.qq.com/wework_admin/loginpage_wx?from=myhome_openApi )
15
+ - [x] [ 飞书] ( https://open.feishu.cn/document/common-capabilities/sso/web-application-sso/web-app-overview )
16
+ - [ ] [ 钉钉] ( https://open.dingtalk.com/document/orgapp/tutorial-obtaining-user-personal-information )
17
+ - [ ] [ 阿里云] ( https://help.aliyun.com/zh/ram/user-guide/access-alibaba-cloud-apis-from-a-web-application?spm=a2c4g.11186623.0.i2 )
18
+ - [ ] [ QQ] ( https://connect.qq.com/ )
19
+ - [ ] [ 微博] ( https://open.weibo.com/apps )
20
+ - [ ] [ 抖音] ( https://open.douyin.com/ )
21
+ - [x] [ Google] ( https://developers.google.cn/identity/protocols/oauth2/javascript-implicit-flow?hl=en )
Original file line number Diff line number Diff line change
1
+ TODO...
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
- """在 FastAPI 中异步授权 OAuth2 客户端"""
1
+ #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+ from .clients .feishu import FeiShuOAuth20 as FeiShuOAuth20
4
+ from .clients .gitee import GiteeOAuth20 as GiteeOAuth20
5
+ from .clients .github import GitHubOAuth20 as GitHubOAuth20
6
+ from .clients .google import GoogleOAuth20 as GoogleOAuth20
7
+ from .clients .linuxdo import LinuxDoOAuth20 as LinuxDoOAuth20
8
+ from .clients .oschina import OSChinaOAuth20 as OSChinaOAuth20
9
+ from .integrations .fastapi import FastAPIOAuth20 as FastAPIOAuth20
2
10
3
11
__version__ = '0.0.1a2'
4
-
5
- __all__ = [
6
- 'OSChinaOAuth20' ,
7
- 'GoogleOAuth20' ,
8
- 'FeiShuOAuth20' ,
9
- 'GiteeOAuth20' ,
10
- 'GitHubOAuth20' ,
11
- 'FastAPIOAuth20' ,
12
- 'LinuxDoOAuth20' ,
13
- ]
14
-
15
- from .clients .feishu import FeiShuOAuth20
16
- from .clients .gitee import GiteeOAuth20
17
- from .clients .github import GitHubOAuth20
18
- from .clients .google import GoogleOAuth20
19
- from .clients .linuxdo import LinuxDoOAuth20
20
- from .clients .oschina import OSChinaOAuth20
21
- from .integrations .fastapi import OAuth20 as FastAPIOAuth20
Original file line number Diff line number Diff line change 6
6
from fastapi_oauth20 .oauth20 import OAuth20Base
7
7
8
8
9
- class OAuth20 :
9
+ class FastAPIOAuth20 :
10
10
def __init__ (
11
11
self ,
12
12
client : OAuth20Base ,
Original file line number Diff line number Diff line change
1
+ # yaml-language-server: $schema=https://squidfunk.github.io/mkdocs-material/schema.json
2
+ site_name : FastAPI OAuth 2.0
3
+ site_description : 在 FastAPI 中异步授权 OAuth 2.0 客户端
4
+ site_url : https://wu-clan.github.io/fastapi-oauth20
5
+ site_author : Wu Clan
6
+ repo_name : fastapi-oauth20
7
+ repo_url : https://github.com/wu-clan/fastapi-oauth20
8
+ nav :
9
+ - Home :
10
+ - 主页 : index.md
11
+ - 集成状态 : integration.md
12
+ - Install : install.md
13
+ - Explanation : explanation.md
14
+ - Usage : usage.md
15
+ - Advanced : advanced.md
16
+ - Changelog : changelog.md
17
+ theme :
18
+ name : material
19
+ font :
20
+ code : Roboto Mono
21
+ palette :
22
+ - media : ' (prefers-color-scheme)'
23
+ toggle :
24
+ icon : material/brightness-auto
25
+ name : Switch to light mode
26
+ - media : ' (prefers-color-scheme: light)'
27
+ scheme : default
28
+ primary : pink
29
+ toggle :
30
+ icon : material/brightness-7
31
+ name : Switch to dark mode
32
+ - media : ' (prefers-color-scheme: dark)'
33
+ scheme : slate
34
+ primary : teal
35
+ toggle :
36
+ icon : material/brightness-4
37
+ name : Switch to system preference
38
+ features :
39
+ - content.code.annotate
40
+ - content.code.select
41
+ - navigation.instant
42
+ - navigation.instant.progress
43
+ - navigation.path
44
+ - navigation.tracking
45
+ - navigation.tabs
46
+ - navigation.tabs.sticky
47
+ - navigation.top
48
+ - navigation.footer
49
+ - search.suggest
50
+ - toc.follow
51
+ plugins :
52
+ - search
53
+ markdown_extensions :
54
+ - toc :
55
+ permalink : true
56
+ - tables
57
+ - admonition
58
+ - attr_list
59
+ - def_list
60
+ - md_in_html
61
+ - pymdownx.snippets
62
+ - pymdownx.superfences
63
+ - pymdownx.inlinehilite
64
+ - pymdownx.highlight :
65
+ anchor_linenums : true
66
+ line_spans : __span
67
+ pygments_lang_class : true
68
+ - pymdownx.tabbed :
69
+ alternate_style : true
70
+ - pymdownx.emoji :
71
+ emoji_index : !!python/name:material.extensions.emoji.twemoji
72
+ emoji_generator : !!python/name:material.extensions.emoji.to_svg
73
+ - pymdownx.tasklist :
74
+ custom_checkbox : true
You can’t perform that action at this time.
0 commit comments