Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: remove access token deny list (#18653)

p0nyfc87e0b120f7
diff --git a/backend/api/auth/auth.go b/backend/api/auth/auth.go
index afa8797509..faa5685ec7 100644
--- a/backend/api/auth/auth.go
+++ b/backend/api/auth/auth.go
@@ -141,9 +141,6 @@ func (in *APIAuthInterceptor) authenticate(ctx context.Context, accessTokenStr s
if accessTokenStr == "" {
return nil, nil, errs.New("access token not found")
}
- if _, ok := in.stateCfg.ExpireCache.Get(accessTokenStr); ok {
- return nil, nil, errs.New("access token expired")
- }
claims := &claimsMessage{}
if _, err := jwt.ParseWithClaims(accessTokenStr, claims, func(t *jwt.Token) (any, error) {
diff --git a/backend/api/v1/auth_service.go b/backend/api/v1/auth_service.go
index 9aa16b3a2e..e534d097c6 100644
--- a/backend/api/v1/auth_service.go
+++ b/backend/api/v1/auth_service.go
@@ -172,12 +172,6 @@ func (s *AuthService) needResetPassword(ctx context.Context, user *store.UserMes
// Logout is the auth logout method.
func (s *AuthService) Logout(ctx context.Context, req *connect.Request[v1pb.LogoutRequest]) (*connect.Response[emptypb.Empty], error) {
- accessTokenStr, err := auth.GetTokenFromHeaders(req.Header())
- if err != nil {
- return nil, connect.NewError(connect.CodeUnauthenticated, err)
- }
- s.stateCfg.ExpireCache.Add(accessTokenStr, true)
-
// Delete refresh token from database if present
if refreshToken := auth.GetRefreshTokenFromCookie(req.Header()); refreshToken != "" {
if err := s.store.DeleteWebRefreshToken(ctx, auth.HashToken(refreshToken)); err != nil {
@@ -189,8 +183,7 @@ func (s *AuthService) Logout(ctx context.Context, req *connect.Request[v1pb.Logo
origin := req.Header().Get("Origin")
// Clear access token cookie
- cookie := auth.GetTokenCookie(ctx, s.store, s.licenseService, origin, "")
- resp.Header().Add("Set-Cookie", cookie.String())
+ resp.Header().Add("Set-Cookie", auth.GetTokenCookie(ctx, s.store, s.licenseService, origin, "").String())
// Clear refresh token cookie
resp.Header().Add("Set-Cookie", auth.GetRefreshTokenCookie(origin, "", 0).String())
return resp, nil
diff --git a/backend/component/state/state.go b/backend/component/state/state.go
index b4462982fe..2b4f5b1ace 100644
--- a/backend/component/state/state.go
+++ b/backend/component/state/state.go
@@ -3,10 +3,6 @@ package state
import (
"sync"
-
- lru "github.com/hashicorp/golang-lru/v2"
-
- "github.com/pkg/errors"
)
// State is the state for all in-memory states within the server.
@@ -45,15 +41,9 @@ type State struct {
// RolloutCreationChan is the channel for automatic rollout creation.
RolloutCreationChan chan int64
-
- ExpireCache *lru.Cache[string, bool]
}
func New() (*State, error) {
- expireCache, err := lru.New[string, bool](128)
- if err != nil {
- return nil, errors.Wrapf(err, "failed to create auth expire cache")
- }
return &State{
InstanceOutstandingConnections: &resourceLimiter{connections: map[string]int{}},
RolloutOutstandingTasks: &resourceLimiter{connections: map[string]int{}},
@@ -61,7 +51,6 @@ func New() (*State, error) {
PlanCheckTickleChan: make(chan int, 1000),
TaskRunTickleChan: make(chan int, 1000),
RolloutCreationChan: make(chan int64, 100),
- ExpireCache: expireCache,
}, nil
}