Skip to content

Commit 97451ab

Browse files
samphillips-f3piotrolchawa-f3
authored andcommitted
fix: use localhost for test and add docstrings to errors
1 parent 89faa2d commit 97451ab

File tree

5 files changed

+6
-3
lines changed

5 files changed

+6
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
# Test binary, built with `go test -c`
99
*.test
10+
tools/
1011

1112
# Output of the go coverage tool, specifically when used with LiteIDE
1213
*.out

config/error.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package config
22

3+
// ValidationError describes an error validating the provided config.
34
type ValidationError struct {
45
message string
56
}

config/loader_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ func TestLoadConfig(t *testing.T) {
105105

106106
expectedCfg := Config{
107107
Proxy: ProxyConfig{
108-
UpstreamTarget: "https://princesscarolyn.net",
108+
UpstreamTarget: "http://localhost",
109109
Signer: SignerConfig{
110110
KeyId: "6f33b219-137c-467e-9a61-f61040a03363",
111111
KeyFilePath: "/etc/form3/private/private.key",
@@ -138,7 +138,7 @@ func TestLoadConfig(t *testing.T) {
138138

139139
configFile := "config_test.yaml"
140140
overrides := []string{
141-
"proxy.upstreamTarget=https://princesscarolyn.net",
141+
"proxy.upstreamTarget=http://localhost",
142142
"log.level=debug",
143143
}
144144
_ = os.Setenv("SERVER_PORT", "9090")

proxy/error.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package proxy
22

33
import "fmt"
44

5+
// InvalidRequestError is raised when the contents of the request cause signing to fail.
56
type InvalidRequestError struct {
67
reason error
78
}

signer/signer_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func TestLoadKey(t *testing.T) {
6868
}
6969

7070
func TestGetSignatureHeaders(t *testing.T) {
71-
dummyUrl := "https://oompaloompa.localhost:1234"
71+
dummyUrl := "https://localhost:1234"
7272
dummyBody := "{\"name\":\"travis\"}"
7373

7474
tests := []struct {

0 commit comments

Comments
 (0)