Skip to content

feat: add jwt authentication - #38

Closed
torrid-fish wants to merge 9 commits into
mainfrom
feat/security-check
Closed

feat: add jwt authentication#38
torrid-fish wants to merge 9 commits into
mainfrom
feat/security-check

Conversation

@torrid-fish

@torrid-fish torrid-fish commented Dec 24, 2025

Copy link
Copy Markdown
Member

目的

新增了Json Web Token (JWT) Authentication的機制來驗證client。使用方法可以參考auth/README.md

簡單來說就是client要保存private key,然後把public key放到server。
然後client要再生成token,之後呼叫的時候會用生成的token進行驗證。
整體的架構圖如下:

┌─────────┐                                  ┌─────────┐
│ Client  │                                  │ Server  │
│         │                                  │         │
│ Private │ ←───── Generate Token ─────────→ │ Public  │
│ Key     │     (Signed JWT, 1 hour valid)   │ Key     │
│         │                                  │         │
│         │ ←───── Request with Token ─────→ │Verify   │
│         │     (Header: Bearer <token>)     │Signature│
│         │                                  │         │
│         │ ←───── Response (if valid) ────→ │         │
└─────────┘                                  └─────────┘

在目前的實作中,我只會去檢查signature, exp(過期時間), 還有 client_id,來決定這個client是不是我們的。

Copilot AI review requested due to automatic review settings December 24, 2025 16:28

This comment was marked as resolved.

@github-actions

Copy link
Copy Markdown

🛡️ PR Quality Check Summary

PR Title: Passed (Length: 28/75, Format: OK). feat: add jwt authentication
Branch Name: Follows naming convention (feat/security-check)
Commit Messages: All 9 commit(s) passed (Length, Format, Case)
Conflicts: No merge conflict markers found
Python Quality: All checks passed.


🎉 All checks passed!

@wade00754

Copy link
Copy Markdown
Member

Pending for futher implementation details consideration.

@wade00754 wade00754 closed this Dec 26, 2025
@wade00754
wade00754 deleted the feat/security-check branch May 16, 2026 12:18
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.

3 participants