Skip to content
This repository was archived by the owner on Feb 16, 2023. It is now read-only.

Commit db78e76

Browse files
authored
Merge pull request #213 from secrethub/release/v0.31.0
Release v0.31.0
2 parents 815b5d1 + d0ba269 commit db78e76

43 files changed

Lines changed: 156 additions & 314 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.circleci/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ jobs:
55
- image: circleci/golang:1.12
66
steps:
77
- checkout
8+
- restore_cache:
9+
keys:
10+
- go-modules-{{ checksum "go.mod" }}
11+
- run: go mod download
12+
- save_cache:
13+
key: go-modules-{{ checksum "go.mod" }}
14+
paths:
15+
- /go/pkg/mod
816
- run: make test
917
verify-goreleaser:
1018
docker:

.goreleaser.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
project_name: secrethub
1+
project_name: secrethub-cli
22

33
builds:
44
- &default
@@ -40,7 +40,7 @@ builds:
4040
binary: "secrethub"
4141

4242
archives:
43-
- name_template: "{{ .ProjectName }}-{{ .Tag }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
43+
- name_template: "secrethub-{{ .Tag }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
4444
builds:
4545
- default
4646
format_overrides:
@@ -50,7 +50,7 @@ archives:
5050
- LICENSE
5151

5252
checksum:
53-
name_template: "{{ .ProjectName }}-{{ .Tag }}-checksums.txt"
53+
name_template: "secrethub-{{ .Tag }}-checksums.txt"
5454

5555
brews:
5656
- name: secrethub-cli
@@ -90,7 +90,7 @@ scoop:
9090
license: Apache-2.0
9191

9292
nfpms:
93-
-
93+
- name_template: "secrethub-{{ .Tag }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
9494
builds:
9595
- without-bin-dir
9696
vendor: SecretHub
@@ -102,6 +102,8 @@ nfpms:
102102
formats:
103103
- rpm
104104
- deb
105+
dependencies:
106+
- ca-certificates
105107
recommends:
106108
- xclip
107109
scripts:

go.mod

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,19 @@ go 1.12
44

55
require (
66
bitbucket.org/zombiezen/cardcpx v0.0.0-20150417151802-902f68ff43ef
7-
github.com/alecthomas/kingpin v0.0.0-20190930021037-0a108b7f5563
7+
github.com/alecthomas/kingpin v0.0.0-20191009151950-9e366cbf24ad
88
github.com/atotto/clipboard v0.1.2
99
github.com/aws/aws-sdk-go v1.19.38
10-
github.com/danieljoos/wincred v1.0.2 // indirect
1110
github.com/docker/go-units v0.3.3
1211
github.com/fatih/color v1.7.0
13-
github.com/godbus/dbus v4.1.0+incompatible // indirect
1412
github.com/masterzen/winrm v0.0.0-20190308153735-1d17eaf15943
1513
github.com/mattn/go-colorable v0.1.1
1614
github.com/mattn/go-isatty v0.0.7
1715
github.com/mitchellh/go-homedir v1.1.0
1816
github.com/mitchellh/mapstructure v1.1.2
1917
github.com/op/go-logging v0.0.0-20160315200505-970db520ece7
20-
github.com/secrethub/secrethub-go v0.21.0
21-
github.com/stretchr/objx v0.2.0 // indirect
18+
github.com/secrethub/demo-app v0.1.0
19+
github.com/secrethub/secrethub-go v0.23.0
2220
github.com/zalando/go-keyring v0.0.0-20190208082241-fbe81aec3a07
2321
golang.org/x/crypto v0.0.0-20190313024323-a1f597ede03a
2422
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223

go.sum

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ github.com/alecthomas/kingpin v0.0.0-20190705085659-95eb9edaa399 h1:NoJOfPUP5uDd
88
github.com/alecthomas/kingpin v0.0.0-20190705085659-95eb9edaa399/go.mod h1:idxgS9pV6OOpAhZvx+gcoGRMX9/tt0iqkw/pNxI0C14=
99
github.com/alecthomas/kingpin v0.0.0-20190930021037-0a108b7f5563 h1:YT8l7Flq7VNXnjqwtjCF9bzffTPGgedBC+xyj88lVe4=
1010
github.com/alecthomas/kingpin v0.0.0-20190930021037-0a108b7f5563/go.mod h1:idxgS9pV6OOpAhZvx+gcoGRMX9/tt0iqkw/pNxI0C14=
11+
github.com/alecthomas/kingpin v0.0.0-20191009151950-9e366cbf24ad h1:tMnaQBlddYTQC6SHj8IrLTuOf006vB7yUmYn79/QXlM=
12+
github.com/alecthomas/kingpin v0.0.0-20191009151950-9e366cbf24ad/go.mod h1:idxgS9pV6OOpAhZvx+gcoGRMX9/tt0iqkw/pNxI0C14=
1113
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc h1:cAKDfWh5VpdgMhJosfJnn5/FoN2SRZ4p7fJNX58YPaU=
1214
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
1315
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf h1:qet1QNfXsQxTZqLG4oE62mJzwPIB8+Tee4RNCL9ulrY=
@@ -68,10 +70,21 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
6870
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
6971
github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww=
7072
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
73+
github.com/secrethub/demo-app v0.0.0-20191015143627-8b86c8671e54 h1:u1tfHZH5FE6Lv8CcV9dnimz5uMZUFvHKTyOqbsqlGFo=
74+
github.com/secrethub/demo-app v0.0.0-20191015143627-8b86c8671e54/go.mod h1:ymjm8+WXTSDTFqsGVBNVmHSnwtZMYi7KptHvpo/fLH4=
75+
github.com/secrethub/demo-app v0.0.0-20191015144738-eed4af2178f4 h1:04IDTEVBJUVXqXAFwdoOvHeO87a8uTzMHb5nzqHtIVk=
76+
github.com/secrethub/demo-app v0.0.0-20191015144738-eed4af2178f4/go.mod h1:ymjm8+WXTSDTFqsGVBNVmHSnwtZMYi7KptHvpo/fLH4=
77+
github.com/secrethub/demo-app v0.0.0-20191015145040-d297a9c939a6 h1:BA2nciOEMOjuy0xMcMyEDcaKhvAyB7cVG8H6LW1/XUg=
78+
github.com/secrethub/demo-app v0.0.0-20191015145040-d297a9c939a6/go.mod h1:ymjm8+WXTSDTFqsGVBNVmHSnwtZMYi7KptHvpo/fLH4=
79+
github.com/secrethub/demo-app v0.1.0 h1:HwPPxuiSvx4TBE7Qppzu3A9eHqmsBrIz4Ko8u8pqMqw=
80+
github.com/secrethub/demo-app v0.1.0/go.mod h1:ymjm8+WXTSDTFqsGVBNVmHSnwtZMYi7KptHvpo/fLH4=
7181
github.com/secrethub/kingpin v0.0.0-20190920111600-67b1cb231087 h1:n4V94OQPe04crRRmcyAURLk3AImueFd44Ne99sN5TO8=
7282
github.com/secrethub/kingpin v0.0.0-20190920111600-67b1cb231087/go.mod h1:idxgS9pV6OOpAhZvx+gcoGRMX9/tt0iqkw/pNxI0C14=
83+
github.com/secrethub/secrethub-cli v0.30.0/go.mod h1:dC0wd40v+iQdV83/0rUrOa01LYq+8Yj2AtJB1vzh2ao=
7384
github.com/secrethub/secrethub-go v0.21.0 h1:5xbC+gdku7MXUQmlP5SPhAPLF+/U31soLKbyXwNyM+M=
7485
github.com/secrethub/secrethub-go v0.21.0/go.mod h1:rc2IfKKBJ4L0wGec0u4XnF5/pe0FFPE4Q1MWfrFso7s=
86+
github.com/secrethub/secrethub-go v0.23.0 h1:6NzVGcAJDXeORUc2uZyuaYRCXCawmOKYvhNPP3ASNSM=
87+
github.com/secrethub/secrethub-go v0.23.0/go.mod h1:rc2IfKKBJ4L0wGec0u4XnF5/pe0FFPE4Q1MWfrFso7s=
7588
github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4=
7689
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
7790
github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48=

internals/cli/ui/ask.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package ui
33
import (
44
"fmt"
55
"io"
6+
"io/ioutil"
67
"os"
78
"strconv"
89
"strings"
@@ -57,6 +58,27 @@ func AskSecret(io IO, question string) (string, error) {
5758
return string(raw), nil
5859
}
5960

61+
// AskMultiline prints out the question and reads back the input until an EOF is reached.
62+
// The input is displayed to the user.
63+
func AskMultiline(io IO, question string) ([]byte, error) {
64+
promptIn, promptOut, err := io.Prompts()
65+
if err != nil {
66+
return nil, err
67+
}
68+
69+
_, err = fmt.Fprintf(promptOut, "%s\n", question)
70+
if err != nil {
71+
return nil, err
72+
}
73+
74+
raw, err := ioutil.ReadAll(promptIn)
75+
if err != nil {
76+
return nil, err
77+
}
78+
fmt.Fprintln(promptOut)
79+
return raw, nil
80+
}
81+
6082
// AskAndValidate asks the user a question and re-prompts the configured amount of times
6183
// when the users answer does not validate.
6284
func AskAndValidate(io IO, question string, n int, validationFunc func(string) error) (string, error) {

internals/cli/ui/io.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,3 +115,9 @@ func (f file) IsPiped() bool {
115115

116116
return (stat.Mode() & os.ModeCharDevice) == 0
117117
}
118+
119+
// EOFKey returns the key that should be pressed to enter an EOF.
120+
// This can be used to end multiline input.
121+
func EOFKey() string {
122+
return eofKey()
123+
}

internals/cli/ui/io_unix.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,7 @@ func NewUserIO() UserIO {
1818

1919
return NewStdUserIO()
2020
}
21+
22+
func eofKey() string {
23+
return "CTRL-D"
24+
}

internals/cli/ui/io_windows.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,7 @@ func (c colorStdout) IsPiped() bool {
3030
return os.Getenv("TERM") == "dumb" ||
3131
(!isatty.IsTerminal(os.Stdout.Fd()) && !isatty.IsCygwinTerminal(os.Stdout.Fd()))
3232
}
33+
34+
func eofKey() string {
35+
return "CTRL-Z + ENTER"
36+
}

internals/demo/app/page.go

Lines changed: 0 additions & 101 deletions
This file was deleted.

internals/demo/app/serve.go

Lines changed: 0 additions & 80 deletions
This file was deleted.

0 commit comments

Comments
 (0)