Skip to content

Commit b92ea5c

Browse files
authored
Merge branch 'master' into carl/goreleaser-make
2 parents 0d49ffe + 90703e4 commit b92ea5c

File tree

18 files changed

+160
-217
lines changed

18 files changed

+160
-217
lines changed

.github/workflows/actionlint.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Lint GitHub Actions workflows
2+
on:
3+
push:
4+
workflow_call:
5+
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
8+
cancel-in-progress: true
9+
10+
permissions:
11+
contents: write
12+
pull-requests: write
13+
14+
jobs:
15+
actionlint:
16+
uses: smallstep/workflows/.github/workflows/actionlint.yml@main
17+
secrets: inherit

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ jobs:
5353
echo "DOCKER_TAGS_DEBIAN=${{ env.DOCKER_TAGS_DEBIAN }},${{ env.DOCKER_IMAGE }}:${DEBIAN_TAG}" >> "${GITHUB_ENV}"
5454
- name: Create Release
5555
id: create_release
56-
uses: softprops/action-gh-release@a74c6b72af54cfa997e81df42d94703d6313a2d0 # v2.0.6
56+
uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 # v2.0.8
5757
env:
5858
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5959
with:
60-
tag_name: ${{ github.ref }}
61-
name: Release ${{ github.ref }}
60+
tag_name: ${{ github.ref_name }}
61+
name: Release ${{ github.ref_name }}
6262
draft: false
6363
prerelease: ${{ steps.is_prerelease.outputs.IS_PRERELEASE }}
6464

@@ -109,7 +109,7 @@ jobs:
109109
- name: Checkout
110110
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
111111
- name: Setup Go
112-
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
112+
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
113113
with:
114114
go-version: 'stable'
115115
check-latest: true

.goreleaser.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ builds:
4848
- linux_amd64
4949
- linux_arm64
5050
- windows_amd64
51+
- freebsd_amd64
5152
binary: 'step_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
5253
-
5354
# This build is for S3 unversioned binaries that follow our naming convention there.
@@ -59,6 +60,7 @@ builds:
5960
- linux_amd64
6061
- linux_arm64
6162
- windows_amd64
63+
- freebsd_amd64
6264
binary: 'step_latest_{{ .Os }}_{{ .Arch }}'
6365
-
6466
# This build is specifically for nFPM targets (.deb and .rpm files).
@@ -268,7 +270,7 @@ blobs:
268270
- s3-versioned
269271
- s3-unversioned
270272
acl: public-read
271-
disable: '{{ neq .Prerelease "" }}'
273+
disable: '{{ ne .Prerelease "" }}'
272274

273275

274276
winget:

CHANGELOG.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,38 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
2626

2727
---
2828

29+
## [0.27.2] - 2024-07-18
30+
31+
### Added
32+
33+
- `console` flag to SSH commands (smallstep/cli#1238)
34+
- Upload FreeBSD build to S3 (smallstep/cli#1239)
35+
36+
37+
## [0.27.1] - 2024-07-11
38+
39+
### Fixed
40+
41+
- Broken release process
42+
43+
44+
## [0.27.0] - 2024-07-11
45+
46+
### Changed
47+
48+
- Makefile: install to /usr/local/bin, not /usr/bin (smallstep/cli#1214)
49+
50+
### Fixed
51+
52+
- Set proper JOSE algorithm for Ed25519 keys (smallstep/cli#1208)
53+
- Makefile: usage of install command line flags on MacOS (smallstep/cli#1212)
54+
- Restore operation of '--bundle' flag in certificate inspect (smallstep/cli#1215)
55+
- Fish completion (smallstep/cli#1222)
56+
- Restore operation of inspect CSR from STDIN (smallstep/cli#1232)
57+
58+
### Security
59+
60+
2961
## [0.26.2] - 2024-06-13
3062

3163
### Added

Makefile

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ GOOS_OVERRIDE?=
2121
# CGO_OVERRIDE="CGO_ENABLED=1" to enable CGO
2222
CGO_OVERRIDE?=CGO_ENABLED=0
2323

24+
# which build id in .goreleaser.yml to build
25+
GORELEASER_BUILD_ID?=default
26+
ifdef DEBUG
27+
GORELEASER_BUILD_ID=debug
28+
endif
29+
2430
all: lint test build
2531

2632
ci: test build
@@ -68,23 +74,32 @@ Q=$(if $V,,@)
6874
SRC=$(shell find . -type f -name '*.go')
6975
OUTPUT_ROOT=output/
7076

71-
GORELEASER_BUILD_ID?=default
72-
ifdef DEBUG
73-
GORELEASER_BUILD_ID=debug
77+
ifeq ($(OS),Windows_NT)
78+
HOSTOS=Windows
79+
else
80+
HOSTOS=$(shell uname)
7481
endif
82+
HOSTARCH=$(shell go env GOHOSTARCH)
83+
84+
GORELEASER_PRO_URL=https://github.com/goreleaser/goreleaser-pro/releases/latest/download/goreleaser-pro_$(HOSTOS)_$(HOSTARCH).tar.gz
7585

7686
.PHONY: all
7787

7888
#########################################
7989
# Bootstrapping
8090
#########################################
81-
91+
TMPDIR := $(shell mktemp -d)
92+
bootstra%: GOPATH=$(shell go env GOPATH)
8293
bootstra%:
8394
$Q curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $$(go env GOPATH)/bin latest
8495
$Q go install golang.org/x/vuln/cmd/govulncheck@latest
8596
$Q go install gotest.tools/gotestsum@latest
8697
$Q go install golang.org/x/tools/cmd/goimports@latest
87-
$Q go install github.com/goreleaser/goreleaser@latest
98+
@echo "Installing GoReleaser Pro into $(GOPATH)/bin"
99+
$Q curl -o $(TMPDIR)/goreleaser.tar.gz -L $(GORELEASER_PRO_URL)
100+
$Q ls $(TMPDIR)
101+
$Q tar xvzf $(TMPDIR)/goreleaser.tar.gz -C $(TMPDIR)
102+
$Q cp $(TMPDIR)/goreleaser $(GOPATH)/bin
88103

89104
.PHONY: bootstra%
90105

command/ca/ca.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,6 @@ location being served by an existing fileserver in order to respond to ACME
137137
challenge validation requests.`,
138138
}
139139

140-
consoleFlag = cli.BoolFlag{
141-
Name: "console",
142-
Usage: "Complete the flow while remaining inside the terminal",
143-
}
144-
145140
fingerprintFlag = cli.StringFlag{
146141
Name: "fingerprint",
147142
Usage: "The <fingerprint> of the targeted root certificate.",

command/ca/certificate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ multiple SANs. The '--san' flag and the '--token' flag are mutually exclusive.`,
191191
flags.Force,
192192
flags.Offline,
193193
flags.PasswordFile,
194-
consoleFlag,
194+
flags.Console,
195195
flags.KMSUri,
196196
flags.X5cCert,
197197
flags.X5cKey,

command/ca/sign.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ $ step ca sign foo.csr foo.crt \
124124
flags.Force,
125125
flags.Offline,
126126
flags.PasswordFile,
127-
consoleFlag,
127+
flags.Console,
128128
flags.KMSUri,
129129
flags.X5cCert,
130130
flags.X5cKey,

command/certificate/inspect.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"github.com/pkg/errors"
1212
"github.com/smallstep/certinfo"
1313
"github.com/smallstep/cli/flags"
14+
"github.com/smallstep/cli/utils"
1415
zx509 "github.com/smallstep/zcrypto/x509"
1516
"github.com/urfave/cli"
1617
"go.step.sm/cli-utils/errs"
@@ -218,17 +219,22 @@ func inspectAction(ctx *cli.Context) error {
218219
}
219220
return inspectCertificates(ctx, peerCertificates[:1], os.Stdout)
220221
default: // is not URL
222+
b, err := utils.ReadFile(crtFile)
223+
if err != nil {
224+
return errors.Wrapf(err, "error reading file %s", crtFile)
225+
}
226+
221227
var pemError *pemutil.InvalidPEMError
222-
crts, err := pemutil.ReadCertificateBundle(crtFile)
228+
crts, err := pemutil.ParseCertificateBundle(b)
223229
switch {
224230
case errors.As(err, &pemError) && pemError.Type == pemutil.PEMTypeCertificate:
225-
csr, err := pemutil.ReadCertificateRequest(crtFile)
231+
csr, err := pemutil.ParseCertificateRequest(b)
226232
if err != nil {
227233
return errors.Errorf("file %s does not contain any valid CERTIFICATE or CERTIFICATE REQUEST blocks", crtFile)
228234
}
229235
return inspectCertificateRequest(ctx, csr, os.Stdout)
230236
case err != nil:
231-
return err
237+
return fmt.Errorf("error parsing %s: %w", crtFile, err)
232238
default:
233239
if bundle {
234240
return inspectCertificates(ctx, crts, os.Stdout)

command/oauth/cmd.go

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

33
import (
4-
"bufio"
54
"bytes"
65
"crypto/sha256"
76
"crypto/x509"
@@ -901,11 +900,9 @@ func (o *oauth) DoDeviceAuthorization() (*token, error) {
901900
idr.Interval = defaultDeviceAuthzInterval
902901
}
903902

904-
fmt.Fprintf(os.Stderr, "Visit %s and enter the code: (press 'ENTER' to open default browser)\n", idr.VerificationURI)
903+
fmt.Fprintf(os.Stderr, "Visit %s and enter the code:\n", idr.VerificationURI)
905904
fmt.Fprintln(os.Stderr, idr.UserCode)
906905

907-
go openBrowserIfAsked(o, idr.VerificationURI)
908-
909906
// Poll the Token endpoint until the user completes the flow.
910907
data = url.Values{}
911908
data.Set("client_id", o.clientID)
@@ -939,13 +936,6 @@ func (o *oauth) DoDeviceAuthorization() (*token, error) {
939936
}
940937
}
941938

942-
func openBrowserIfAsked(o *oauth, u string) {
943-
reader := bufio.NewReader(os.Stdin)
944-
reader.ReadString('\n')
945-
946-
exec.OpenInBrowser(u, o.browser)
947-
}
948-
949939
var errHTTPToken = errors.New("bad request; token not returned")
950940

951941
func (o *oauth) deviceAuthzTokenPoll(data url.Values) (*token, error) {

0 commit comments

Comments
 (0)