You've already forked agentic-coding-workflow
原型阶段
This commit is contained in:
@@ -62,6 +62,7 @@ var defaultSystemTools = []string{
|
||||
"get_issue", "get_requirement",
|
||||
"create_issue", "update_issue", "close_issue", "reopen_issue", "assign_issue",
|
||||
"create_requirement", "update_requirement", "close_requirement", "reopen_requirement", "set_requirement_phase",
|
||||
"add_requirement_prototype", "list_requirement_prototypes",
|
||||
}
|
||||
|
||||
// NewTokenService 构造 service。now 用于测试注入;nil 时默认 time.Now。
|
||||
@@ -209,6 +210,7 @@ func (s *tokenService) issueSystemToken(ctx context.Context, repo Repository, in
|
||||
ExpiresAt: created.ExpiresAt,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// Authenticate 校验 plaintext token:
|
||||
// 1. 计算 hash 反查 row
|
||||
// 2. 检查 revoked_at IS NULL
|
||||
@@ -245,6 +247,7 @@ func (s *tokenService) Authenticate(ctx context.Context, plaintext string) (*Tok
|
||||
|
||||
return tok, nil
|
||||
}
|
||||
|
||||
// Revoke 由 admin 后台或持有者主动调用。
|
||||
// 写一条 audit `mcp.token.revoke`。
|
||||
func (s *tokenService) Revoke(ctx context.Context, id, byUserID uuid.UUID) error {
|
||||
@@ -258,8 +261,8 @@ func (s *tokenService) Revoke(ctx context.Context, id, byUserID uuid.UUID) error
|
||||
TargetType: "mcp_token",
|
||||
TargetID: revokedID.String(),
|
||||
Metadata: map[string]any{
|
||||
"token_id": revokedID.String(),
|
||||
"by_user_id": byUserID.String(),
|
||||
"token_id": revokedID.String(),
|
||||
"by_user_id": byUserID.String(),
|
||||
},
|
||||
})
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user