Skip to content

Commit

Permalink
Rename "Secret" to "WebHookSecret"
Browse files Browse the repository at this point in the history
  • Loading branch information
bobheadxi committed Jun 16, 2018
1 parent 40c01b5 commit 622273b
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions cfg/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ type RemoteVPS struct {

// DaemonConfig contains parameters for the Daemon
type DaemonConfig struct {
Port string `toml:"port"`
Token string `toml:"token"`
Secret string `toml:"secret"`
Port string `toml:"port"`
Token string `toml:"token"`
WebHookSecret string `toml:"webhook_secret"`
}

// GetHost creates the user@IP string.
Expand Down
4 changes: 2 additions & 2 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func (c *Client) BootstrapRemote(repoName string) error {
// Output Webhook url to user.
println(">> GitHub WebHook URL (add to https://www.github.com/" + repoName + "/settings/hooks/new): ")
println("WebHook Address: https://" + c.IP + ":" + c.Daemon.Port + "/webhook")
println("WebHook Secret: " + c.Daemon.Secret)
println("WebHook Secret: " + c.Daemon.WebHookSecret)
println(`Note that you will have to disable SSH verification in your webhook
settings - Inertia uses self-signed certificates that GitHub won't
be able to verify.` + "\n")
Expand Down Expand Up @@ -206,7 +206,7 @@ func (c *Client) Up(gitRemoteURL, buildType string, stream bool) (*http.Response
Stream: stream,
Project: c.project,
BuildType: buildType,
Secret: c.RemoteVPS.Daemon.Secret,
WebHookSecret: c.RemoteVPS.Daemon.WebHookSecret,
BuildFilePath: c.buildFilePath,
GitOptions: &common.GitOptions{
RemoteURL: common.GetSSHRemoteURL(gitRemoteURL),
Expand Down
8 changes: 4 additions & 4 deletions client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ func getMockClient(ts *httptest.Server) *Client {
IP: url,
PEM: "",
Daemon: &cfg.DaemonConfig{
Port: port,
Secret: "arjan",
Token: fakeAuth,
Port: port,
WebHookSecret: "arjan",
Token: fakeAuth,
},
}

Expand Down Expand Up @@ -211,7 +211,7 @@ func TestUp(t *testing.T) {
err = json.Unmarshal(body, &upReq)
assert.Nil(t, err)
assert.Equal(t, "myremote.git", upReq.GitOptions.RemoteURL)
assert.Equal(t, "arjan", upReq.Secret)
assert.Equal(t, "arjan", upReq.WebHookSecret)
assert.Equal(t, "test_project", upReq.Project)
assert.Equal(t, "docker-compose", upReq.BuildType)

Expand Down
2 changes: 1 addition & 1 deletion common/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type UpRequest struct {
BuildType string `json:"build_type"`
BuildFilePath string `json:"build_file_path"`
GitOptions *GitOptions `json:"git_options"`
Secret string `json:"webhook_secret"`
WebHookSecret string `json:"webhook_secret"`
}

// GitOptions represents GitHub-related deployment options
Expand Down
2 changes: 1 addition & 1 deletion daemon/inertiad/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func upHandler(w http.ResponseWriter, r *http.Request) {
})
defer logger.Close()

webhookSecret = upReq.Secret
webhookSecret = upReq.WebHookSecret

// Check for existing git repository, clone if no git repository exists.
skipUpdate := false
Expand Down
4 changes: 2 additions & 2 deletions input.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ func addRemoteWalkthrough(
Branch: branch,
SSHPort: sshPort,
Daemon: &cfg.DaemonConfig{
Port: port,
Secret: secret,
Port: port,
WebHookSecret: secret,
},
})
return nil
Expand Down

0 comments on commit 622273b

Please sign in to comment.