refactor(deps): use foundation shared utilities

This commit is contained in:
zenfun
2025-12-14 23:52:46 +08:00
parent 71c183a480
commit d1d1b1c42a
9 changed files with 22 additions and 78 deletions

View File

@@ -6,7 +6,7 @@ import (
"fmt"
"strconv"
"github.com/ez-api/ez-api/internal/util"
"github.com/ez-api/foundation/tokenhash"
"github.com/redis/go-redis/v9"
)
@@ -28,7 +28,7 @@ type TokenInfo struct {
// ValidateToken checks a child key against Redis for validity.
// This is designed to be called by the data plane (balancer).
func (s *TokenService) ValidateToken(ctx context.Context, token string) (*TokenInfo, error) {
tokenHash := util.HashToken(token)
tokenHash := tokenhash.HashToken(token)
tokenKey := fmt.Sprintf("auth:token:%s", tokenHash)
// 1. Get token metadata from Redis