fix(security): block refresh tokens as bearer and sandbox MCP uploads

Reject refresh JWTs in ValidateToken, revoke all user sessions on logout,
and restrict create_knowledge_from_file to allowed directories on network MCP transports.
This commit is contained in:
wizardchen
2026-07-02 15:26:43 +08:00
committed by lyingbug
parent cd65665894
commit 040504447e
7 changed files with 180 additions and 3 deletions
+3
View File
@@ -61,6 +61,9 @@ type UserService interface {
RefreshToken(ctx context.Context, refreshToken string) (accessToken, newRefreshToken string, err error)
// RevokeToken revokes a token
RevokeToken(ctx context.Context, token string) error
// Logout revokes every outstanding access/refresh token for the user
// identified by the presented JWT.
Logout(ctx context.Context, token string) error
// GetCurrentUser gets current user from context
GetCurrentUser(ctx context.Context) (*types.User, error)
// SearchUsers searches users by username or email