Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

fix: resovled lint errors

=44d8f8a7afba
diff --git a/backend-go/internal/services/auth/classify.go b/backend-go/internal/services/auth/classify.go
index ffd9bf1d23..11298b478a 100644
--- a/backend-go/internal/services/auth/classify.go
+++ b/backend-go/internal/services/auth/classify.go
@@ -25,6 +25,15 @@ func ClassifyToken(token string) AuthMode {
return AuthModeJWT
case AuthTokenTypeIdentityAccessToken:
return AuthModeIdentityAccessToken
+ case AuthTokenTypeRefreshToken,
+ AuthTokenTypeSignupToken,
+ AuthTokenTypeMfaToken,
+ AuthTokenTypeProviderToken,
+ AuthTokenTypeAPIKey,
+ AuthTokenTypeServiceAccessToken,
+ AuthTokenTypeServiceRefreshToken,
+ AuthTokenTypeSCIMToken:
+ return ""
}
return ""
diff --git a/backend-go/internal/services/auth/handler.go b/backend-go/internal/services/auth/handler.go
index 67f6cb18b4..dc4130c179 100644
--- a/backend-go/internal/services/auth/handler.go
+++ b/backend-go/internal/services/auth/handler.go
@@ -49,7 +49,7 @@ func (h AuthHandler) JWTAuth(ctx context.Context, token string, sc *security.JWT
tokenMode := ClassifyToken(token)
if tokenMode == "" {
- return ctx, errutil.Unauthorized("You are not allowed to access this resource").WithErr(errors.New("Token classification failed"))
+ return ctx, errutil.Unauthorized("You are not allowed to access this resource").WithErr(errors.New("token classification failed"))
}
// Map scheme name to expected auth mode.
@@ -62,12 +62,12 @@ func (h AuthHandler) JWTAuth(ctx context.Context, token string, sc *security.JWT
case "service_token":
expectedMode = AuthModeServiceToken
default:
- return ctx, errutil.Unauthorized("You are not allowed to access this resource").WithErr(errors.New("Invalid token"))
+ return ctx, errutil.Unauthorized("You are not allowed to access this resource").WithErr(errors.New("invalid token"))
}
// Fast reject: token type doesn't match the scheme being tried.
if tokenMode != expectedMode {
- return ctx, errutil.Unauthorized("You are not allowed to access this resource").WithErr(fmt.Errorf("Provider token %v not support", tokenMode))
+ return ctx, errutil.Unauthorized("You are not allowed to access this resource").WithErr(fmt.Errorf("provider token %v not supported", tokenMode))
}
var (