Skip to content

Commit

Permalink
Remove http basic auth from proxy (#3)
Browse files Browse the repository at this point in the history
In github/dependabot-update-job-proxy#988 we're
removing HTTP Basic Auth from the proxy. While passing them won't cause
any issues, it will no longer serve a purpose.

It should technically be fine to merge these changes _before_ that
lands, as the proxy can currently be ran without setting up basic auth,
but let's get that PR to land first.
  • Loading branch information
jurre authored Sep 29, 2022
1 parent f1fdfc2 commit 53def8c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 23 deletions.
1 change: 0 additions & 1 deletion internal/infra/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const ConfigFilePath = "/config.json"
type Config struct {
Credentials []map[string]string `json:"all_credentials"`
CA CertificateAuthority `json:"ca"`
ProxyAuth BasicAuthCredentials `json:"proxy_auth"`
}

// CertificateAuthority includes the MITM CA certificate and private key
Expand Down
14 changes: 0 additions & 14 deletions internal/infra/password.go

This file was deleted.

10 changes: 2 additions & 8 deletions internal/infra/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,9 @@ func NewProxy(ctx context.Context, cli *client.Client, params *RunParams, nets .
}

// Generate and write configuration to disk:
username := "cli-user"
password := generatePassword()
proxyConfig := &Config{
Credentials: params.Creds,
ProxyAuth: BasicAuthCredentials{
Username: username,
Password: password,
},
CA: ca,
CA: ca,
}
proxyConfigPath, err := StoreProxyConfig(params.TempDir, proxyConfig)
if err != nil {
Expand Down Expand Up @@ -111,7 +105,7 @@ func NewProxy(ctx context.Context, cli *client.Client, params *RunParams, nets .
cli: cli,
containerID: proxyContainer.ID,
containerName: hostName,
url: fmt.Sprintf("http://%s:%s@%s:1080", username, password, hostName),
url: fmt.Sprintf("http://%s:1080", hostName),
CertPath: certPath,
proxyConfigPath: proxyConfigPath,
}, nil
Expand Down

0 comments on commit 53def8c

Please sign in to comment.