fix(edge-stack): edge stack git authentication issues EE-5595 (#9228)

pull/9232/head
cmeng 2023-07-20 09:11:38 +12:00 committed by GitHub
parent b8f20a4f05
commit ff1f549590
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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