Add comprehensive OAuth2 server documentation#877
Conversation
- Added detailed English documentation in docs/en/components/oauth2-server.md - Added Chinese Simplified documentation in docs/zh-cn/components/oauth2-server.md - Added Chinese Traditional (Hong Kong) documentation in docs/zh-hk/components/oauth2-server.md - Added Chinese Traditional (Taiwan) documentation in docs/zh-tw/components/oauth2-server.md Documentation includes: - Complete installation and setup guide - Configuration examples and environment variables - All supported grant types with examples - API endpoints and usage examples - Available commands for client management - Event system documentation - Security best practices - Testing guidelines - Error handling reference 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Walkthrough本次变更新增并完善了 Hyperf 框架下 OAuth2 服务器组件的多语言文档,涵盖英文、简体中文、繁体中文(台湾、香港)四个版本。文档详细介绍了 OAuth2 服务器的特性、安装配置、命令行工具、API 接口、事件系统、定制方式、安全建议、测试方法及常见错误响应。同时,文档侧边栏配置也相应添加了 OAuth2 服务器条目。 Changes
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (5)
docs/zh-hk/components/oauth2-server.md (2)
213-217: 為程式碼區塊補充語言標註
Step 1的 URL 片段缺少語言標註,違反了 MD040 規範,也會影響渲染器的語法高亮。建議在開頭三個反引號後加上text(或bash)說明內容類型。-``` +```text https://your-server/...
255-257: 示例 Token 使用佔位符防止誤洩漏
your-access-token已是佔位符,但仍建議在示例上方加一句註釋說明「僅供演示,請勿填入真實 Token」,可避免誤把真實憑證提交到版本庫。docs/en/components/oauth2-server.md (1)
213-217: 為純文字 URL 區塊加上語言標註缺少語言標註導致 markdownlint MD040 報錯,亦影響 IDE/網站高亮;建議指定為
text:-``` +```text https://your-server/oauth/authorize?...docs/zh-tw/components/oauth2-server.md (1)
213-217: 補充步驟1區塊的語言標註與其他程式碼片段一致,建議標註為
text,避免 markdownlint MD040 警告。-``` +```text https://your-server/...docs/zh-cn/components/oauth2-server.md (1)
213-217: 在纯文本 URL 代码块中添加语言说明为保持文档一致性并通过 MD040 校验,建议为
步骤1的代码块指定语言,如text:-``` +```text https://your-server/...
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
docs/en/components/oauth2-server.md(1 hunks)docs/zh-cn/components/oauth2-server.md(1 hunks)docs/zh-hk/components/oauth2-server.md(1 hunks)docs/zh-tw/components/oauth2-server.md(1 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/zh-hk/components/oauth2-server.md
[uncategorized] ~213-~213: 您的意思是“"不"驟”?
Context: ...}' ### 3. 授權碼授權 用於需要用戶交互的網頁應用: **步驟1:重定向用戶到授權端點** https://your-server...
(BU)
[uncategorized] ~219-~219: 您的意思是“"不"驟”?
Context: ...lenge&code_challenge_method=S256 **步驟2:交換授權碼獲取令牌** bash curl -X POST htt...
(BU)
[uncategorized] ~362-~362: 您的意思是“"不"伺服”?
Context: ...rant_type: 不支持的授權類型 - server_error`: 內部伺服器錯誤 ## 許可證 MIT
(BU)
docs/zh-cn/components/oauth2-server.md
[uncategorized] ~236-~236: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:新"地"访问
Context: ...redirect" }' ### 4. 刷新令牌授权 获取新的访问令牌: bash curl -X POST http://your-...
(wb4)
docs/zh-tw/components/oauth2-server.md
[uncategorized] ~213-~213: 您的意思是“"不"驟”?
Context: ...}' ### 3. 授權碼授權 用於需要用戶交互的網頁應用: **步驟1:重定向用戶到授權端點** https://your-server...
(BU)
[uncategorized] ~219-~219: 您的意思是“"不"驟”?
Context: ...lenge&code_challenge_method=S256 **步驟2:交換授權碼獲取令牌** bash curl -X POST htt...
(BU)
[uncategorized] ~362-~362: 您的意思是“"不"伺服”?
Context: ...rant_type: 不支持的授權類型 - server_error`: 內部伺服器錯誤 ## 許可證 MIT
(BU)
🪛 Gitleaks (8.27.2)
docs/zh-hk/components/oauth2-server.md
255-256: Discovered a potential authorization token provided in a curl command header, which could compromise the curl accessed resource.
(curl-auth-header)
docs/zh-cn/components/oauth2-server.md
255-256: Discovered a potential authorization token provided in a curl command header, which could compromise the curl accessed resource.
(curl-auth-header)
docs/zh-tw/components/oauth2-server.md
255-256: Discovered a potential authorization token provided in a curl command header, which could compromise the curl accessed resource.
(curl-auth-header)
🪛 markdownlint-cli2 (0.17.2)
docs/zh-hk/components/oauth2-server.md
213-213: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
215-215: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
219-219: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
docs/en/components/oauth2-server.md
213-213: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
215-215: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
219-219: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
docs/zh-cn/components/oauth2-server.md
213-213: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
215-215: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
219-219: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: translate
| - 客户端凭证授权 (Client Credentials Grant) | ||
| - 密码授权 (Password Grant) | ||
| - 刷新令牌授权 (Refresh Token Grant) | ||
| - 授权码授权 (Authorization Code Grant,支持 PKCE) |
There was a problem hiding this comment.
| - 授权码授权 (Authorization Code Grant,支持 PKCE) | |
| - 授权码授权 (Authorization Code Grant,支持 PKCE) | |
| - 设备码授权 (Device Code Grant) |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (5)
docs/en/components/oauth2-server.md (1)
213-217: 为代码块显式指定语言以通过 MarkdownLint
MD040报告此处缺少语言标识。建议:-``` +```text https://your-server/...同时,如果只是展示 URL,可直接使用内联代码或普通段落,无需三引号。
docs/zh-hk/components/oauth2-server.md (2)
165-173: 建議:為 PHP 代碼塊補充語言標識為了獲得正確的語法高亮並通過 lint,請在開頭添加
php:-```php -use FriendsOfHyperf\Oauth2\Server\Middleware\ResourceServerMiddleware; +```php +use FriendsOfHyperf\Oauth2\Server\Middleware\ResourceServerMiddleware;
213-217: 缺少代码块语言,MarkdownLint 报错与英文版相同,补充
text或改用内联代码即可:-``` +```text https://your-server/...docs/zh-tw/components/oauth2-server.md (2)
165-173: 請補充 PHP 語言標識同上,添加
php後可消除 lint 警告並改善閱讀體驗。
213-217: 補充代码块语言-``` +```text https://your-server/...
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
docs/en/components/oauth2-server.md(1 hunks)docs/zh-hk/components/oauth2-server.md(1 hunks)docs/zh-tw/components/oauth2-server.md(1 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
docs/en/components/oauth2-server.md
213-213: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
215-215: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
219-219: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
🪛 LanguageTool
docs/zh-hk/components/oauth2-server.md
[uncategorized] ~213-~213: 您的意思是“"不"驟”?
Context: ...}' ### 3. 授權碼授權 用於需要用户交互的網頁應用: **步驟1:重定向用户到授權端點** https://your-server...
(BU)
[uncategorized] ~219-~219: 您的意思是“"不"驟”?
Context: ...lenge&code_challenge_method=S256 **步驟2:交換授權碼獲取令牌** bash curl -X POST htt...
(BU)
[uncategorized] ~362-~362: 您的意思是“"不"服”?
Context: ...rant_type: 不支持的授權類型 - server_error`: 內部服務器錯誤 ## 許可證 MIT
(BU)
docs/zh-tw/components/oauth2-server.md
[uncategorized] ~213-~213: 您的意思是“"不"驟”?
Context: ...' ### 3. 授權碼授權 用於需要使用者互動的網頁應用: **步驟1:重定向使用者到授權端點** https://your-serve...
(BU)
[uncategorized] ~219-~219: 您的意思是“"不"驟”?
Context: ...lenge&code_challenge_method=S256 **步驟2:交換授權碼獲取令牌** bash curl -X POST htt...
(BU)
[uncategorized] ~362-~362: 您的意思是“"不"伺服”?
Context: ...rant_type: 不支援的授權型別 - server_error`: 內部伺服器錯誤 ## 許可證 MIT
(BU)
🪛 Gitleaks (8.27.2)
docs/zh-hk/components/oauth2-server.md
255-256: Discovered a potential authorization token provided in a curl command header, which could compromise the curl accessed resource.
(curl-auth-header)
docs/zh-tw/components/oauth2-server.md
255-256: Discovered a potential authorization token provided in a curl command header, which could compromise the curl accessed resource.
(curl-auth-header)
🔇 Additional comments (1)
docs/en/components/oauth2-server.md (1)
166-168: 命名空间已纠正,问题解决 👍此前由于“/”与“\”混用导致的
use语句错误已修复,现在符合 PHP 命名空间规范。
- Added OAuth2 Server entry to English sidebar - Added OAuth2 服务器 to Chinese Simplified sidebar - Added OAuth2 服務器 to Chinese Traditional (Hong Kong) sidebar - Added OAuth2 伺服器 to Chinese Traditional (Taiwan) sidebar 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Introduces .claude/settings.local.json to specify allowed Bash commands for Claude, including git and GitHub CLI operations.
* Add comprehensive documentation for OAuth2 server component - Added detailed English documentation in docs/en/components/oauth2-server.md - Added Chinese Simplified documentation in docs/zh-cn/components/oauth2-server.md - Added Chinese Traditional (Hong Kong) documentation in docs/zh-hk/components/oauth2-server.md - Added Chinese Traditional (Taiwan) documentation in docs/zh-tw/components/oauth2-server.md Documentation includes: - Complete installation and setup guide - Configuration examples and environment variables - All supported grant types with examples - API endpoints and usage examples - Available commands for client management - Event system documentation - Security best practices - Testing guidelines - Error handling reference 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * Update docs and translate * Add OAuth2 Server to sidebar navigation - Added OAuth2 Server entry to English sidebar - Added OAuth2 服务器 to Chinese Simplified sidebar - Added OAuth2 服務器 to Chinese Traditional (Hong Kong) sidebar - Added OAuth2 伺服器 to Chinese Traditional (Taiwan) sidebar 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * Add local settings for Claude permissions Introduces .claude/settings.local.json to specify allowed Bash commands for Claude, including git and GitHub CLI operations. --------- Co-authored-by: Deeka Wong <8337659+huangdijia@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com>
Summary
This PR adds comprehensive documentation for the new OAuth2 server component across all supported languages.
Changes
Documentation includes
✅ Installation and setup guide
✅ Configuration examples and environment variables
✅ All OAuth2 grant types with practical examples:
✅ API endpoints and usage examples
✅ Available CLI commands for client management
✅ Event system documentation
✅ Security best practices and recommendations
✅ Testing guidelines
✅ Error handling reference
Testing
Checklist
The documentation is ready for review and will help developers quickly adopt the new OAuth2 server component.
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com
Summary by CodeRabbit