You've already forked agentic-coding-workflow
完善 MCP 工具
This commit is contained in:
@@ -22,6 +22,7 @@ type AuthSession struct {
|
||||
TokenID string // 用于审计 metadata 写入
|
||||
UserID string // user_id 字符串形式(避免反复 uuid.UUID -> string 转换)
|
||||
Scope Scope
|
||||
Issuer Issuer // system token(agent 会话持有)受额外限制,见 create_acp_session
|
||||
}
|
||||
|
||||
// FromContext 从 ctx 取出 AuthSession,未鉴权时返 (nil, false)。
|
||||
@@ -53,6 +54,7 @@ func NewAuthMiddleware(svc TokenService) func(http.Handler) http.Handler {
|
||||
TokenID: tok.ID.String(),
|
||||
UserID: tok.UserID.String(),
|
||||
Scope: tok.Scope,
|
||||
Issuer: tok.Issuer,
|
||||
}
|
||||
ctx := context.WithValue(r.Context(), AuthContextKey, sess)
|
||||
next.ServeHTTP(w, r.WithContext(ctx))
|
||||
|
||||
Reference in New Issue
Block a user