Skip to content

Commit 8136454

Browse files
committed
Update the usage documentation
1 parent cca1de1 commit 8136454

File tree

4 files changed

+54
-19
lines changed

4 files changed

+54
-19
lines changed

docs/explanation.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,25 @@
1-
TODO...
1+
!!! note
2+
3+
- `开发者` 指使用JustAuth的开发者
4+
- `第三方` 指开发者对接的第三方客户端,比如:Google、GitHub、Gitee 等
5+
- `用户` 指最终服务的真实用户
6+
7+
- ==client_id== 客户端身份标识符(应用id),一般在申请完 `OAuth` 应用后,由第三方客户端颁发
8+
- ==client_secret== 客户端密钥,一般在申请完 `OAuth` 应用后,由第三方客户端颁发
9+
- ==redirect_uri== 开发者项目中真实有效的 API 地址。用户在确认第三方客户端授权(登录)后,第三方客户端会自动重定向到该地址,并携带
10+
code 等参数
11+
- ==state== 用于在请求和回调之间维护状态,主要用于防止跨站请求伪造(CSRF)攻击
12+
- ==source== 支持的第三方客户端,比如:GitHub、LinuxDo 等
13+
- ==sid== 第三方客户端的用户 ID。以下是关于各平台的 sid 存储逻辑:
14+
15+
!!! warning
16+
17+
建议通过 `sid` + `source` 的方式确定唯一用户,这样可以解决用户身份归属的问题。因为 单个用户ID
18+
在某一平台中是唯一的,但不能保证在所有平台中都是唯一的。
19+
20+
## 参考资料
21+
22+
关于 OAuth2 相关的内容、原理可以自行参阅以下资料:
23+
24+
- [The OAuth 2.0 Authorization Framework](https://tools.ietf.org/html/rfc6749)
25+
- [OAuth 2.0](https://oauth.net/2/)

docs/install.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@
77

88
## 安装
99

10-
=== ":simple-piped: pip"
10+
=== ":simple-python: pip"
1111

1212
```sh
1313
pip install fastapi-oauth20
1414
```
1515

16-
=== ":simple-pdm: pdm"
16+
=== ":simple-uv: uv"
1717

1818
```sh
19-
pdm add fastapi-oauth20
19+
uv add fastapi-oauth20
2020
```
2121

22-
=== ":simple-uv: uv"
22+
=== ":simple-pdm: pdm"
2323

2424
```sh
25-
uv add fastapi-oauth20
25+
pdm add fastapi-oauth20
2626
```

docs/integration.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1-
如果你有更多需求,请在仓库内创建 Issues,我们将尽力完成所有目标
1+
!!! tip
22

3-
- [x] 表示已集成
4-
- [ ] 表示待集成
3+
如果你有更多需求,请在仓库内创建 Issues,我们将尽力完成所有目标
4+
5+
!!! danger ""
6+
7+
对于强制要求【实名 + 人脸认证】的平台,集成变得困难,所以它们不会很快到来
8+
9+
- [x] 表示{++已集成++}
10+
- [ ] 表示{--未集成--}
511

612
---
713

mkdocs.yml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@ site_author: Wu Clan
66
repo_name: fastapi-oauth20
77
repo_url: https://github.com/wu-clan/fastapi-oauth20
88
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
9+
- 主页: index.md
10+
- 集成状态: integration.md
11+
- 安装: install.md
12+
- 名词解释: explanation.md
13+
- 用法: usage.md
14+
- 高级用法: advanced.md
15+
- 变更日志: changelog.md
1716
theme:
1817
name: material
1918
font:
@@ -42,7 +41,6 @@ theme:
4241
- navigation.instant.progress
4342
- navigation.path
4443
- navigation.tracking
45-
- navigation.tabs
4644
- navigation.tabs.sticky
4745
- navigation.top
4846
- navigation.footer
@@ -58,9 +56,16 @@ markdown_extensions:
5856
- attr_list
5957
- def_list
6058
- md_in_html
61-
- pymdownx.snippets
59+
- admonition
60+
- pymdownx.details
6261
- pymdownx.superfences
62+
- pymdownx.snippets
6363
- pymdownx.inlinehilite
64+
- pymdownx.critic
65+
- pymdownx.caret
66+
- pymdownx.keys
67+
- pymdownx.mark
68+
- pymdownx.tilde
6469
- pymdownx.highlight:
6570
anchor_linenums: true
6671
line_spans: __span

0 commit comments

Comments
 (0)