Skip to content

Commit

Permalink
Transit BYOK formatting fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Schultz committed May 13, 2022
1 parent 41d6bc5 commit e05a5fb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
17 changes: 9 additions & 8 deletions builtin/logical/transit/path_import.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ import (
"errors"
"fmt"
"hash"
"strconv"
"strings"
"time"

"strconv"

"github.com/google/tink/go/kwp/subtle"
"github.com/hashicorp/vault/sdk/framework"
"github.com/hashicorp/vault/sdk/helper/keysutil"
Expand All @@ -27,7 +26,7 @@ func (b *backend) pathImport() *framework.Path {
return &framework.Path{
Pattern: "keys/" + framework.GenericNameRegex("name") + "/import",
Fields: map[string]*framework.FieldSchema{
"name": &framework.FieldSchema{
"name": {
Type: framework.TypeString,
Description: "The name of the key",
},
Expand Down Expand Up @@ -120,7 +119,7 @@ func (b *backend) pathImportVersion() *framework.Path {
return &framework.Path{
Pattern: "keys/" + framework.GenericNameRegex("name") + "/import_version",
Fields: map[string]*framework.FieldSchema{
"name": &framework.FieldSchema{
"name": {
Type: framework.TypeString,
Description: "The name of the key",
},
Expand Down Expand Up @@ -350,10 +349,12 @@ func parseHashFn(hashFn string) (hash.Hash, error) {
}
}

const pathImportWriteSyn = "Imports an externally-generated key into a new transit key"
const pathImportWriteDesc = "This path is used to import an externally-generated " +
"key into Vault. The import operation creates a new key and cannot be used to " +
"replace an existing key."
const (
pathImportWriteSyn = "Imports an externally-generated key into a new transit key"
pathImportWriteDesc = "This path is used to import an externally-generated " +
"key into Vault. The import operation creates a new key and cannot be used to " +
"replace an existing key."
)

const pathImportVersionWriteSyn = "Imports an externally-generated key into an " +
"existing imported key"
Expand Down
6 changes: 4 additions & 2 deletions builtin/logical/transit/path_import_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ var hashFns = []string{
"SHA512",
}

var keysLock sync.RWMutex
var keys = map[string]interface{}{}
var (
keysLock sync.RWMutex
keys = map[string]interface{}{}
)

func generateKeys(t *testing.T) {
t.Helper()
Expand Down
3 changes: 2 additions & 1 deletion sdk/helper/keysutil/policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ import (
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"golang.org/x/crypto/ed25519"
"reflect"
"strconv"
"sync"
"testing"
"time"

"golang.org/x/crypto/ed25519"

"github.com/hashicorp/vault/sdk/helper/jsonutil"
"github.com/hashicorp/vault/sdk/logical"
"github.com/mitchellh/copystructure"
Expand Down

0 comments on commit e05a5fb

Please sign in to comment.