From ff1f54959019e08d1944685d2b3bebe62dff3744 Mon Sep 17 00:00:00 2001 From: cmeng Date: Thu, 20 Jul 2023 09:11:38 +1200 Subject: [PATCH] fix(edge-stack): edge stack git authentication issues EE-5595 (#9228) --- api/git/validate.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/git/validate.go b/api/git/validate.go index 2bf8375d7..04a27a55a 100644 --- a/api/git/validate.go +++ b/api/git/validate.go @@ -17,8 +17,8 @@ func ValidateRepoConfig(repoConfig *gittypes.RepoConfig) error { } func ValidateRepoAuthentication(auth *gittypes.GitAuthentication) error { - if auth != nil && govalidator.IsNull(auth.Password) { - return httperrors.NewInvalidPayloadError("Invalid repository credentials. Password must be specified when authentication is enabled") + if auth != nil && govalidator.IsNull(auth.Password) && auth.GitCredentialID == 0 { + return httperrors.NewInvalidPayloadError("Invalid repository credentials. Password or GitCredentialID must be specified when authentication is enabled") } return nil