From 3cec28fd318af09c45203e827336193f32c68608 Mon Sep 17 00:00:00 2001 From: Gage Krumbach Date: Wed, 4 Feb 2026 09:38:53 -0600 Subject: [PATCH 1/2] Fix: Disable integration credential validation and add nil checks - Disabled active validation for GitHub PAT, Google, and GitLab credentials - Integration status now assumes stored credentials are valid - Added nil checks in git package initialization to prevent nil pointer dereferences - Integrations will fail gracefully if credentials are actually invalid --- .../backend/handlers/integrations_status.go | 22 ++++++++----------- components/backend/main.go | 18 ++++++++++++--- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/components/backend/handlers/integrations_status.go b/components/backend/handlers/integrations_status.go index 848917a19..b5bf88ece 100644 --- a/components/backend/handlers/integrations_status.go +++ b/components/backend/handlers/integrations_status.go @@ -63,13 +63,13 @@ func getGitHubStatusForUser(ctx context.Context, userID string) gin.H { // Check GitHub PAT patCreds, err := GetGitHubPATCredentials(ctx, userID) if err == nil && patCreds != nil { - // Validate PAT token - valid, _ := ValidateGitHubToken(ctx, patCreds.Token) + // NOTE: Validation disabled - if credentials are stored, assume they're valid + // The integration will fail gracefully if credentials are actually invalid status["pat"] = gin.H{ "configured": true, "updatedAt": patCreds.UpdatedAt.Format("2006-01-02T15:04:05Z07:00"), - "valid": valid, + "valid": true, } } @@ -89,19 +89,15 @@ func getGoogleStatusForUser(ctx context.Context, userID string) gin.H { return gin.H{"connected": false} } - // Check if token is expired - isExpired := time.Now().After(creds.ExpiresAt) - valid := !isExpired - - // If near expiry, could validate with Google API, but checking expiry is sufficient - // since backend auto-refreshes tokens + // NOTE: Validation disabled - if credentials are stored, assume they're valid + // The backend auto-refreshes tokens and the integration will fail gracefully if invalid return gin.H{ "connected": true, "email": creds.Email, "expiresAt": creds.ExpiresAt.Format("2006-01-02T15:04:05Z07:00"), "updatedAt": creds.UpdatedAt.Format("2006-01-02T15:04:05Z07:00"), - "valid": valid, + "valid": true, } } @@ -131,13 +127,13 @@ func getGitLabStatusForUser(ctx context.Context, userID string) gin.H { return gin.H{"connected": false} } - // Validate token - valid, _ := ValidateGitLabToken(ctx, creds.Token, creds.InstanceURL) + // NOTE: Validation disabled - if credentials are stored, assume they're valid + // The integration will fail gracefully if credentials are actually invalid return gin.H{ "connected": true, "instanceUrl": creds.InstanceURL, "updatedAt": creds.UpdatedAt, - "valid": valid, + "valid": true, } } diff --git a/components/backend/main.go b/components/backend/main.go index 59b997eaa..39c3d5c52 100644 --- a/components/backend/main.go +++ b/components/backend/main.go @@ -94,13 +94,25 @@ func main() { // Initialize git package git.GetProjectSettingsResource = k8s.GetProjectSettingsResource git.GetGitHubInstallation = func(ctx context.Context, userID string) (interface{}, error) { - return github.GetInstallation(ctx, userID) + installation, err := github.GetInstallation(ctx, userID) + if installation == nil { + return nil, err + } + return installation, err } git.GetGitHubPATCredentials = func(ctx context.Context, userID string) (interface{}, error) { - return handlers.GetGitHubPATCredentials(ctx, userID) + creds, err := handlers.GetGitHubPATCredentials(ctx, userID) + if creds == nil { + return nil, err + } + return creds, err } git.GetGitLabCredentials = func(ctx context.Context, userID string) (interface{}, error) { - return handlers.GetGitLabCredentials(ctx, userID) + creds, err := handlers.GetGitLabCredentials(ctx, userID) + if creds == nil { + return nil, err + } + return creds, err } git.GitHubTokenManager = github.Manager git.GetBackendNamespace = func() string { From 22ea1c7c325ed38f4b161a8291d9c49545ff25f0 Mon Sep 17 00:00:00 2001 From: Gage Krumbach Date: Wed, 4 Feb 2026 09:41:03 -0600 Subject: [PATCH 2/2] Remove unused time import --- components/backend/handlers/integrations_status.go | 1 - 1 file changed, 1 deletion(-) diff --git a/components/backend/handlers/integrations_status.go b/components/backend/handlers/integrations_status.go index b5bf88ece..649c30845 100644 --- a/components/backend/handlers/integrations_status.go +++ b/components/backend/handlers/integrations_status.go @@ -3,7 +3,6 @@ package handlers import ( "context" "net/http" - "time" "github.com/gin-gonic/gin" )