Skip to content

Commit

Permalink
Merge branch 'alex-slynko-add_user_to_proxy'
Browse files Browse the repository at this point in the history
  • Loading branch information
drich10 committed Mar 5, 2018
2 parents a232987 + 3a1468c commit 8273133
Show file tree
Hide file tree
Showing 9 changed files with 392 additions and 84 deletions.
295 changes: 273 additions & 22 deletions Gopkg.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ resource_types:
* `jumpbox_url`: *Optional.* The URL, including port, of the jumpbox. If set, `jumpbox_ssh_key` must also be set. If omitted,
the BOSH director will be dialed directly.
* `jumpbox_ssh_key`: *Optional.* The private key of the jumpbox. If set, `jumpbox_url` must also be set.
* `jumpbox_username`: *Optional.* The username for the jumpbox. If not set, will default to `jumpbox`.
* `vars_store`: *Optional.* Configuration for a persisted variables store. Currently only the Google Cloud Storage (GCS)
provider is supported. `json_key` must be the the JSON key for your service account. Example:

Expand Down
22 changes: 14 additions & 8 deletions bosh/boshfakes/fake_proxy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion bosh/boshfakes/fake_runner.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions bosh/cli_coordinator.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (

//go:generate counterfeiter . Proxy
type Proxy interface {
Start(string, string) error
Start(string, string, string) error
Addr() (string, error)
}

Expand Down Expand Up @@ -97,7 +97,7 @@ func (c CLICoordinator) StartProxy() (string, error) {
return addr, nil
}

err = c.proxy.Start(c.source.JumpboxSSHKey, c.source.JumpboxURL)
err = c.proxy.Start(c.source.JumpboxUsername, c.source.JumpboxSSHKey, c.source.JumpboxURL)
if err != nil {
panic(err)
}
Expand Down
5 changes: 3 additions & 2 deletions bosh/cli_coordinator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var _ = Describe("CLI coordinator", func() {
fakeProxy = &boshfakes.FakeProxy{}
fakeProxy.AddrReturns("some-proxy-addr", nil)
fakeProxy.AddrReturnsOnCall(0, "", errors.New("proxy is not running"))
source = concourse.Source{JumpboxSSHKey: "some-key", JumpboxURL: "some-url"}
source = concourse.Source{JumpboxUsername: "some-user", JumpboxSSHKey: "some-key", JumpboxURL: "some-url"}
cliCoordinator = bosh.NewCLICoordinator(source, GinkgoWriter, fakeProxy)
})

Expand All @@ -31,7 +31,8 @@ var _ = Describe("CLI coordinator", func() {
Expect(err).NotTo(HaveOccurred())

Expect(fakeProxy.StartCallCount()).To(Equal(1))
key, url := fakeProxy.StartArgsForCall(0)
username, key, url := fakeProxy.StartArgsForCall(0)
Expect(username).To(Equal("some-user"))
Expect(key).To(Equal("some-key"))
Expect(url).To(Equal("some-url"))

Expand Down
17 changes: 9 additions & 8 deletions concourse/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ import (
)

type Source struct {
Deployment string `json:"deployment,omitempty" yaml:"deployment"`
Client string `json:"client,omitempty" yaml:"client"`
ClientSecret string `json:"client_secret,omitempty" yaml:"client_secret"`
Target string `json:"target,omitempty" yaml:"target"`
CACert string `json:"ca_cert,omitempty" yaml:"ca_cert"`
JumpboxSSHKey string `json:"jumpbox_ssh_key,omitempty" yaml:"jumpbox_ssh_key"`
JumpboxURL string `json:"jumpbox_url,omitempty" yaml:"jumpbox_url"`
VarsStore VarsStore `json:"vars_store,omitempty" yaml:"vars_store"`
Deployment string `json:"deployment,omitempty" yaml:"deployment"`
Client string `json:"client,omitempty" yaml:"client"`
ClientSecret string `json:"client_secret,omitempty" yaml:"client_secret"`
Target string `json:"target,omitempty" yaml:"target"`
CACert string `json:"ca_cert,omitempty" yaml:"ca_cert"`
JumpboxSSHKey string `json:"jumpbox_ssh_key,omitempty" yaml:"jumpbox_ssh_key"`
JumpboxURL string `json:"jumpbox_url,omitempty" yaml:"jumpbox_url"`
JumpboxUsername string `json:"jumpbox_username,omitempty" yaml:"jumpbox_username"`
VarsStore VarsStore `json:"vars_store,omitempty" yaml:"vars_store"`
}

type sourceRequest struct {
Expand Down
4 changes: 2 additions & 2 deletions vendor/github.com/cloudfoundry/socks5-proxy/socks5_proxy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

122 changes: 83 additions & 39 deletions vendor/github.com/cloudfoundry/socks5-proxy/socks5_proxy_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8273133

Please sign in to comment.