Skip to content

Commit

Permalink
Merge branch 'main' into mariano/tss2
Browse files Browse the repository at this point in the history
  • Loading branch information
maraino committed Nov 30, 2023
2 parents 503dee3 + 368b738 commit b552c91
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 13 deletions.
1 change: 0 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ builds:

archives:
- id: step-kms-plugin
rlcp: true
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}"
format_overrides:
- goos: windows
Expand Down
12 changes: 8 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,16 @@ test:
fmt:
$Q goimports --local github.com/smallstep/step-kms-plugin -l -w $(SRC)

lint: SHELL:=/bin/bash
lint:
lint: golint govulncheck

golint: SHELL:=/bin/bash
golint:
$Q LOG_LEVEL=error golangci-lint run --config <(curl -s https://raw.githubusercontent.com/smallstep/workflows/master/.golangci.yml) --timeout=30m

govulncheck:
$Q govulncheck ./...

.PHONY: fmt lint
.PHONY: fmt lint golint govulncheck

#########################################
# Release
Expand All @@ -120,7 +124,7 @@ release-dry-run:
-v `pwd`:/go/src/$(PKG) \
-w /go/src/$(PKG) \
ghcr.io/goreleaser/goreleaser-cross:${GOLANG_CROSS_VERSION} \
--clean --skip-validate --skip-publish
--clean --skip=validate --skip=publish

release:
@if [ ! -f ".release-env" ]; then \
Expand Down
2 changes: 1 addition & 1 deletion cmd/certificate.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ var certificateCmd = &cobra.Command{
certFile := flagutil.MustString(flags, "import")
bundle := flagutil.MustBool(flags, "bundle")

kuri, name, err := getUriAndNameForFS(flagutil.MustString(flags, "kms"), args[0])
kuri, name, err := getURIAndNameForFS(flagutil.MustString(flags, "kms"), args[0])
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ var keyCmd = &cobra.Command{

flags := cmd.Flags()

kuri, name, err := getUriAndNameForFS(flagutil.MustString(flags, "kms"), args[0])
kuri, name, err := getURIAndNameForFS(flagutil.MustString(flags, "kms"), args[0])
if err != nil {
return err
}
Expand Down
6 changes: 3 additions & 3 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,11 @@ func ensureSchemePrefix(kuri string) string {
return kuri
}

// getUriAndNameForFS returns the kuri and name to be used by a KMS FS. If TPM
// getURIAndNameForFS returns the kuri and name to be used by a KMS FS. If TPM
// KMS is used it changes the kuri to add the default storage directory.
//
// If a storage-directory is already in the kuri, this will take preference.
func getUriAndNameForFS(kuri, name string) (string, string, error) {
func getURIAndNameForFS(kuri, name string) (string, string, error) {
kuri = ensureSchemePrefix(kuri)
if kuri == "" {
kuri = name
Expand All @@ -143,7 +143,7 @@ func getUriAndNameForFS(kuri, name string) (string, string, error) {
}

if typ == apiv1.TPMKMS {
if err = step.Init(); err != nil {
if err := step.Init(); err != nil {
return "", "", err
}
kuri, err = changeURI(kuri, url.Values{"storage-directory": []string{filepath.Join(step.Path(), "tpm")}})
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.debian
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang AS builder
FROM golang:bullseye AS builder

WORKDIR /src
COPY . .
Expand Down
4 changes: 2 additions & 2 deletions internal/termutil/tui.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//nolint:gocritic,errorlint // this file is borrowed from age
//nolint:gocritic,revive // this file is borrowed from age
package termutil

import (
Expand Down Expand Up @@ -55,7 +55,7 @@ func withTerminal(f func(in, out *os.File) error) error {
} else if term.IsTerminal(int(os.Stdin.Fd())) {
return f(os.Stdin, os.Stdin)
} else {
return fmt.Errorf("standard input is not a terminal, and /dev/tty is not available: %v", err)
return fmt.Errorf("standard input is not a terminal, and /dev/tty is not available: %w", err)
}
}

Expand Down

0 comments on commit b552c91

Please sign in to comment.