Skip to content

Commit 7f62410

Browse files
authored
Merge branch 'master' into carl/install-goreleaser-pro
2 parents 0d9d309 + eeb9a40 commit 7f62410

File tree

18 files changed

+202
-269
lines changed

18 files changed

+202
-269
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: 3 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ jobs:
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

@@ -100,45 +100,6 @@ jobs:
100100

101101
# All jobs below this are for full releases (non release candidates e.g. *-rc.*)
102102

103-
build_upload_aws_s3_binaries:
104-
name: Build & Upload AWS S3 Binaries
105-
runs-on: ubuntu-latest
106-
needs: create_release
107-
if: needs.create_release.outputs.is_prerelease == 'false'
108-
steps:
109-
- name: Checkout
110-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
111-
- name: Setup Go
112-
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
113-
with:
114-
go-version: 'stable'
115-
check-latest: true
116-
- name: Build
117-
id: build
118-
run: |
119-
PATH=$PATH:/usr/local/go/bin:/home/admin/go/bin
120-
make -j1 binary-linux-amd64 binary-linux-arm64 binary-darwin-amd64 binary-windows-amd64
121-
mkdir -p ./.releases
122-
cp ./output/binary/linux-amd64/bin/step ./.releases/step_${{ needs.create_release.outputs.version }}_linux_amd64
123-
cp ./output/binary/linux-amd64/bin/step ./.releases/step_latest_linux_amd64
124-
cp ./output/binary/linux-arm64/bin/step ./.releases/step_${{ needs.create_release.outputs.version }}_linux_arm64
125-
cp ./output/binary/linux-arm64/bin/step ./.releases/step_latest_linux_arm64
126-
cp ./output/binary/darwin-amd64/bin/step ./.releases/step_${{ needs.create_release.outputs.version }}_darwin_amd64
127-
cp ./output/binary/darwin-amd64/bin/step ./.releases/step_latest_darwin_amd64
128-
cp ./output/binary/windows-amd64/bin/step ./.releases/step_${{ needs.create_release.outputs.version }}_windows.exe
129-
cp ./output/binary/windows-amd64/bin/step ./.releases/step_latest_windows.exe
130-
- name: Upload s3
131-
id: upload-s3
132-
uses: jakejarvis/s3-sync-action@be0c4ab89158cac4278689ebedd8407dd5f35a83 # v0.5.1
133-
with:
134-
args: --acl public-read --follow-symlinks
135-
env:
136-
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
137-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
138-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
139-
AWS_REGION: us-east-1
140-
SOURCE_DIR: ./.releases
141-
142103
update_reference_docs:
143104
name: Update Reference Docs
144105
runs-on: ubuntu-latest
@@ -148,7 +109,7 @@ jobs:
148109
- name: Checkout
149110
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
150111
- name: Setup Go
151-
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
112+
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
152113
with:
153114
go-version: 'stable'
154115
check-latest: true

.goreleaser.yml

Lines changed: 46 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,17 @@ before:
99
# - go generate ./...
1010

1111
builds:
12-
-
13-
id: default
12+
- &COMMON
1413
env:
1514
- CGO_ENABLED=0
15+
main: ./cmd/step/main.go
16+
flags:
17+
- -trimpath
18+
ldflags:
19+
- -w -X main.Version={{.Version}} -X main.BuildTime={{.Date}}
20+
-
21+
<< : *COMMON
22+
id: default
1623
targets:
1724
- darwin_amd64
1825
- darwin_arm64
@@ -28,31 +35,46 @@ builds:
2835
- linux_ppc64le
2936
- windows_amd64
3037
- windows_arm64
31-
flags:
32-
- -trimpath
33-
main: ./cmd/step/main.go
3438
binary: bin/step
3539
ldflags:
3640
- -w -X main.Version={{.Version}} -X main.BuildTime={{.Date}}
41+
-
42+
# This build is for S3 binaries that follow our naming convention there.
43+
<< : *COMMON
44+
id: s3-versioned
45+
targets:
46+
- darwin_amd64
47+
- darwin_arm64
48+
- linux_amd64
49+
- linux_arm64
50+
- windows_amd64
51+
- freebsd_amd64
52+
binary: 'step_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
53+
-
54+
# This build is for S3 unversioned binaries that follow our naming convention there.
55+
<< : *COMMON
56+
id: s3-unversioned
57+
targets:
58+
- darwin_amd64
59+
- darwin_arm64
60+
- linux_amd64
61+
- linux_arm64
62+
- windows_amd64
63+
- freebsd_amd64
64+
binary: 'step_latest_{{ .Os }}_{{ .Arch }}'
3765
-
3866
# This build is specifically for nFPM targets (.deb and .rpm files).
3967
# It's exactly the same as the default build above, except:
4068
# - it only builds the archs we want to produce .deb and .rpm files for
4169
# - the name of the output binary is step-cli
70+
<< : *COMMON
4271
id: nfpm
43-
env:
44-
- CGO_ENABLED=0
4572
goos:
4673
- linux
4774
goarch:
4875
- amd64
4976
- arm64
50-
flags:
51-
- -trimpath
52-
main: ./cmd/step/main.go
5377
binary: step-cli
54-
ldflags:
55-
- -w -X main.Version={{.Version}} -X main.BuildTime={{.Date}}
5678

5779
archives:
5880
- &ARCHIVE
@@ -239,6 +261,18 @@ release:
239261
# - glob: ./glob/**/to/**/file/**/*
240262
# - glob: ./glob/foo/to/bar/file/foobar/override_from_previous
241263

264+
blobs:
265+
-
266+
provider: s3
267+
region: us-east-1
268+
bucket: '{{ .Env.AWS_S3_BUCKET }}'
269+
ids:
270+
- s3-versioned
271+
- s3-unversioned
272+
acl: public-read
273+
disable: '{{ ne .Prerelease "" }}'
274+
275+
242276
winget:
243277
-
244278
# IDs of the archives to use.

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

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/certificate/sign.go

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,17 @@ const customIntermediateTemplate = `{
3131
}
3232
}`
3333

34+
const customLeafTemplate = `{
35+
"rawSubject": {{ toJson .Insecure.CR.RawSubject }},
36+
"sans": {{ toJson .SANs }},
37+
{{- if typeIs "*rsa.PublicKey" .Insecure.CR.PublicKey }}
38+
"keyUsage": ["keyEncipherment", "digitalSignature"],
39+
{{- else }}
40+
"keyUsage": ["digitalSignature"],
41+
{{- end }}
42+
"extKeyUsage": ["serverAuth", "clientAuth"]
43+
}`
44+
3445
func signCommand() cli.Command {
3546
return cli.Command{
3647
Name: "sign",
@@ -294,7 +305,7 @@ func signAction(ctx *cli.Context) error {
294305
} else {
295306
switch profile {
296307
case profileLeaf:
297-
template = x509util.DefaultLeafTemplate
308+
template = customLeafTemplate
298309
case profileIntermediateCA:
299310
template = customIntermediateTemplate
300311
case profileCSR:
@@ -465,6 +476,7 @@ func createTemplateData(cr *x509.CertificateRequest, maxPathLen int, omitCNSAN b
465476
PostalCode: cr.Subject.PostalCode,
466477
SerialNumber: cr.Subject.SerialNumber,
467478
CommonName: cr.Subject.CommonName,
479+
ExtraNames: x509util.NewExtraNames(cr.Subject.ExtraNames),
468480
})
469481
data.SetSANs(sans)
470482
return data

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)