Skip to content

Commit

Permalink
Do not pass host credentials to the updater
Browse files Browse the repository at this point in the history
  • Loading branch information
JamieMagee committed Mar 5, 2024
1 parent ee39507 commit f0330de
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions cmd/dependabot/internal/cmd/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,13 +336,6 @@ func processInput(input *model.Input, flags *UpdateFlags) {
"username": "x-access-token",
"password": "$LOCAL_AZURE_ACCESS_TOKEN",
})
if len(input.Job.CredentialsMetadata) > 0 {
// Add the metadata since the next section will be skipped.
input.Job.CredentialsMetadata = append(input.Job.CredentialsMetadata, map[string]any{
"type": "git_source",
"host": "dev.azure.com",
})
}

// Add the Azure Artifacts credentials for each host if the package manager is supported.
if _, ok := azureArtifactsPackageManagerCredentialType[input.Job.PackageManager]; ok {
Expand All @@ -367,6 +360,11 @@ func processInput(input *model.Input, flags *UpdateFlags) {
// Calculate the credentials-metadata as it cannot be provided by the user anymore.
input.Job.CredentialsMetadata = []model.Credential{}
for _, credential := range input.Credentials {
// If the credential type is not a git_source and only has a host, skip it.
// This avoids issues in the updater where fully qualified registry URLs are required.
if credential["type"] != "git_source" && credential["host"] != "" {
continue
}
entry := make(map[string]any)
for k, v := range credential {
// Updater does not get credentials.
Expand Down

0 comments on commit f0330de

Please sign in to comment.