mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 11:08:10 +00:00
update gofumpt to 0.3.1 and reformat the repo (#17055)
* update gofumpt to 0.3.1 and reformat the repo * output the version of the formatter we're using
This commit is contained in:
7
.circleci/config.yml
generated
7
.circleci/config.yml
generated
@@ -121,7 +121,7 @@ jobs:
|
|||||||
- CIRCLECI_CLI_VERSION: 0.1.5546
|
- CIRCLECI_CLI_VERSION: 0.1.5546
|
||||||
- GO_TAGS: ''
|
- GO_TAGS: ''
|
||||||
- GO_VERSION: 1.19.1
|
- GO_VERSION: 1.19.1
|
||||||
- GOFUMPT_VERSION: 0.2.1
|
- GOFUMPT_VERSION: 0.3.1
|
||||||
- GOTESTSUM_VERSION: 0.5.2
|
- GOTESTSUM_VERSION: 0.5.2
|
||||||
test-go-remote-docker:
|
test-go-remote-docker:
|
||||||
docker:
|
docker:
|
||||||
@@ -352,6 +352,7 @@ jobs:
|
|||||||
- checkout
|
- checkout
|
||||||
- run:
|
- run:
|
||||||
command: |
|
command: |
|
||||||
|
echo "Using gofumpt version ${GOFUMPT_VERSION}"
|
||||||
go install "mvdan.cc/gofumpt@v${GOFUMPT_VERSION}"
|
go install "mvdan.cc/gofumpt@v${GOFUMPT_VERSION}"
|
||||||
make fmt
|
make fmt
|
||||||
if ! git diff --exit-code; then
|
if ! git diff --exit-code; then
|
||||||
@@ -363,7 +364,7 @@ jobs:
|
|||||||
- CIRCLECI_CLI_VERSION: 0.1.5546
|
- CIRCLECI_CLI_VERSION: 0.1.5546
|
||||||
- GO_TAGS: ''
|
- GO_TAGS: ''
|
||||||
- GO_VERSION: 1.19.1
|
- GO_VERSION: 1.19.1
|
||||||
- GOFUMPT_VERSION: 0.2.1
|
- GOFUMPT_VERSION: 0.3.1
|
||||||
- GOTESTSUM_VERSION: 0.5.2
|
- GOTESTSUM_VERSION: 0.5.2
|
||||||
test-go-race:
|
test-go-race:
|
||||||
docker:
|
docker:
|
||||||
@@ -849,7 +850,7 @@ jobs:
|
|||||||
- CIRCLECI_CLI_VERSION: 0.1.5546
|
- CIRCLECI_CLI_VERSION: 0.1.5546
|
||||||
- GO_TAGS: ''
|
- GO_TAGS: ''
|
||||||
- GO_VERSION: 1.19.1
|
- GO_VERSION: 1.19.1
|
||||||
- GOFUMPT_VERSION: 0.2.1
|
- GOFUMPT_VERSION: 0.3.1
|
||||||
- GOTESTSUM_VERSION: 0.5.2
|
- GOTESTSUM_VERSION: 0.5.2
|
||||||
test-go-race-remote-docker:
|
test-go-race-remote-docker:
|
||||||
docker:
|
docker:
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ go-machine:
|
|||||||
CIRCLECI_CLI_VERSION: 0.1.5546 # Pin CircleCI CLI to patch version (ex: 1.2.3)
|
CIRCLECI_CLI_VERSION: 0.1.5546 # Pin CircleCI CLI to patch version (ex: 1.2.3)
|
||||||
GO_VERSION: 1.19.1 # Pin Go to patch version (ex: 1.2.3)
|
GO_VERSION: 1.19.1 # Pin Go to patch version (ex: 1.2.3)
|
||||||
GOTESTSUM_VERSION: 0.5.2 # Pin gotestsum to patch version (ex: 1.2.3)
|
GOTESTSUM_VERSION: 0.5.2 # Pin gotestsum to patch version (ex: 1.2.3)
|
||||||
GOFUMPT_VERSION: 0.2.1 # Pin gofumpt to patch version (ex: 1.2.3)
|
GOFUMPT_VERSION: 0.3.1 # Pin gofumpt to patch version (ex: 1.2.3)
|
||||||
GO_TAGS: ""
|
GO_TAGS: ""
|
||||||
working_directory: /home/circleci/go/src/github.com/hashicorp/vault
|
working_directory: /home/circleci/go/src/github.com/hashicorp/vault
|
||||||
node:
|
node:
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ steps:
|
|||||||
- run:
|
- run:
|
||||||
name: make fmt
|
name: make fmt
|
||||||
command: |
|
command: |
|
||||||
|
echo "Using gofumpt version ${GOFUMPT_VERSION}"
|
||||||
go install "mvdan.cc/gofumpt@v${GOFUMPT_VERSION}"
|
go install "mvdan.cc/gofumpt@v${GOFUMPT_VERSION}"
|
||||||
make fmt
|
make fmt
|
||||||
if ! git diff --exit-code; then
|
if ! git diff --exit-code; then
|
||||||
|
|||||||
@@ -16,7 +16,8 @@ import (
|
|||||||
// testHTTPServer creates a test HTTP server that handles requests until
|
// testHTTPServer creates a test HTTP server that handles requests until
|
||||||
// the listener returned is closed.
|
// the listener returned is closed.
|
||||||
func testHTTPServer(
|
func testHTTPServer(
|
||||||
t *testing.T, handler http.Handler) (*api.Config, net.Listener) {
|
t *testing.T, handler http.Handler,
|
||||||
|
) (*api.Config, net.Listener) {
|
||||||
ln, err := net.Listen("tcp", "127.0.0.1:0")
|
ln, err := net.Listen("tcp", "127.0.0.1:0")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("err: %s", err)
|
t.Fatalf("err: %s", err)
|
||||||
|
|||||||
@@ -16,7 +16,8 @@ import (
|
|||||||
// testHTTPServer creates a test HTTP server that handles requests until
|
// testHTTPServer creates a test HTTP server that handles requests until
|
||||||
// the listener returned is closed.
|
// the listener returned is closed.
|
||||||
func testHTTPServer(
|
func testHTTPServer(
|
||||||
t *testing.T, handler http.Handler) (*api.Config, net.Listener) {
|
t *testing.T, handler http.Handler,
|
||||||
|
) (*api.Config, net.Listener) {
|
||||||
ln, err := net.Listen("tcp", "127.0.0.1:0")
|
ln, err := net.Listen("tcp", "127.0.0.1:0")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("err: %s", err)
|
t.Fatalf("err: %s", err)
|
||||||
|
|||||||
@@ -16,7 +16,8 @@ import (
|
|||||||
// testHTTPServer creates a test HTTP server that handles requests until
|
// testHTTPServer creates a test HTTP server that handles requests until
|
||||||
// the listener returned is closed.
|
// the listener returned is closed.
|
||||||
func testHTTPServer(
|
func testHTTPServer(
|
||||||
t *testing.T, handler http.Handler) (*api.Config, net.Listener) {
|
t *testing.T, handler http.Handler,
|
||||||
|
) (*api.Config, net.Listener) {
|
||||||
ln, err := net.Listen("tcp", "127.0.0.1:0")
|
ln, err := net.Listen("tcp", "127.0.0.1:0")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("err: %s", err)
|
t.Fatalf("err: %s", err)
|
||||||
|
|||||||
@@ -69,7 +69,6 @@ const (
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
//
|
|
||||||
// `DoneCh` will return if renewal fails, or if the remaining lease duration is
|
// `DoneCh` will return if renewal fails, or if the remaining lease duration is
|
||||||
// under a built-in threshold and either renewing is not extending it or
|
// under a built-in threshold and either renewing is not extending it or
|
||||||
// renewing is disabled. In both cases, the caller should attempt a re-read of
|
// renewing is disabled. In both cases, the caller should attempt a re-read of
|
||||||
@@ -251,7 +250,8 @@ func (r *LifetimeWatcher) doRenew() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (r *LifetimeWatcher) doRenewWithOptions(tokenMode bool, nonRenewable bool, initLeaseDuration int, credString string,
|
func (r *LifetimeWatcher) doRenewWithOptions(tokenMode bool, nonRenewable bool, initLeaseDuration int, credString string,
|
||||||
renew renewFunc, initialRetryInterval time.Duration) error {
|
renew renewFunc, initialRetryInterval time.Duration,
|
||||||
|
) error {
|
||||||
if credString == "" ||
|
if credString == "" ||
|
||||||
(nonRenewable && r.renewBehavior == RenewBehaviorErrorOnErrors) {
|
(nonRenewable && r.renewBehavior == RenewBehaviorErrorOnErrors) {
|
||||||
return r.errLifetimeWatcherNotRenewable
|
return r.errLifetimeWatcherNotRenewable
|
||||||
|
|||||||
@@ -85,11 +85,10 @@ func (c *SSHHelperConfig) SetTLSParameters(clientConfig *Config, certPool *x509.
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Returns true if any of the following conditions are true:
|
// Returns true if any of the following conditions are true:
|
||||||
// * CA cert is configured
|
// - CA cert is configured
|
||||||
// * CA path is configured
|
// - CA path is configured
|
||||||
// * configured to skip certificate verification
|
// - configured to skip certificate verification
|
||||||
// * TLS server name is configured
|
// - TLS server name is configured
|
||||||
//
|
|
||||||
func (c *SSHHelperConfig) shouldSetTLSParameters() bool {
|
func (c *SSHHelperConfig) shouldSetTLSParameters() bool {
|
||||||
return c.CACert != "" || c.CAPath != "" || c.TLSServerName != "" || c.TLSSkipVerify
|
return c.CACert != "" || c.CAPath != "" || c.TLSServerName != "" || c.TLSSkipVerify
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,7 +87,8 @@ func (c *Sys) ListAuditWithContext(ctx context.Context) (map[string]*Audit, erro
|
|||||||
|
|
||||||
// DEPRECATED: Use EnableAuditWithOptions instead
|
// DEPRECATED: Use EnableAuditWithOptions instead
|
||||||
func (c *Sys) EnableAudit(
|
func (c *Sys) EnableAudit(
|
||||||
path string, auditType string, desc string, opts map[string]string) error {
|
path string, auditType string, desc string, opts map[string]string,
|
||||||
|
) error {
|
||||||
return c.EnableAuditWithOptions(path, &EnableAuditOptions{
|
return c.EnableAuditWithOptions(path, &EnableAuditOptions{
|
||||||
Type: auditType,
|
Type: auditType,
|
||||||
Description: desc,
|
Description: desc,
|
||||||
|
|||||||
@@ -1021,7 +1021,9 @@ func TestBackend_PathBlacklistRoleTag(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This is an acceptance test.
|
/*
|
||||||
|
This is an acceptance test.
|
||||||
|
|
||||||
Requires the following env vars:
|
Requires the following env vars:
|
||||||
TEST_AWS_EC2_RSA2048
|
TEST_AWS_EC2_RSA2048
|
||||||
TEST_AWS_EC2_PKCS7
|
TEST_AWS_EC2_PKCS7
|
||||||
|
|||||||
@@ -26,7 +26,9 @@ func init() {
|
|||||||
|
|
||||||
// These certificates are for verifying PKCS#7 DSA signatures.
|
// These certificates are for verifying PKCS#7 DSA signatures.
|
||||||
// Copied from:
|
// Copied from:
|
||||||
|
//
|
||||||
// curl https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/verify-pkcs7.html | pcregrep -M -o -e '(?s)-----BEGIN CERTIFICATE-----[^>]*-----END CERTIFICATE-----'
|
// curl https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/verify-pkcs7.html | pcregrep -M -o -e '(?s)-----BEGIN CERTIFICATE-----[^>]*-----END CERTIFICATE-----'
|
||||||
|
//
|
||||||
// Last updated: 2022-05-31
|
// Last updated: 2022-05-31
|
||||||
const pkcs7RawCerts = `-----BEGIN CERTIFICATE-----
|
const pkcs7RawCerts = `-----BEGIN CERTIFICATE-----
|
||||||
MIIC7TCCAq0CCQCWukjZ5V4aZzAJBgcqhkjOOAQDMFwxCzAJBgNVBAYTAlVTMRkw
|
MIIC7TCCAq0CCQCWukjZ5V4aZzAJBgcqhkjOOAQDMFwxCzAJBgNVBAYTAlVTMRkw
|
||||||
|
|||||||
@@ -305,7 +305,8 @@ func (b *backend) roleInternal(ctx context.Context, s logical.Storage, roleName
|
|||||||
// setRole creates or updates a role in the storage. The caller must hold
|
// setRole creates or updates a role in the storage. The caller must hold
|
||||||
// the write lock.
|
// the write lock.
|
||||||
func (b *backend) setRole(ctx context.Context, s logical.Storage, roleName string,
|
func (b *backend) setRole(ctx context.Context, s logical.Storage, roleName string,
|
||||||
roleEntry *awsRoleEntry) error {
|
roleEntry *awsRoleEntry,
|
||||||
|
) error {
|
||||||
if roleName == "" {
|
if roleName == "" {
|
||||||
return fmt.Errorf("missing role name")
|
return fmt.Errorf("missing role name")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -106,12 +106,12 @@ func lengthLength(i int) (numBytes int) {
|
|||||||
// added to 0x80. The length is encoded in big endian encoding follow after
|
// added to 0x80. The length is encoded in big endian encoding follow after
|
||||||
//
|
//
|
||||||
// Examples:
|
// Examples:
|
||||||
|
//
|
||||||
// length | byte 1 | bytes n
|
// length | byte 1 | bytes n
|
||||||
// 0 | 0x00 | -
|
// 0 | 0x00 | -
|
||||||
// 120 | 0x78 | -
|
// 120 | 0x78 | -
|
||||||
// 200 | 0x81 | 0xC8
|
// 200 | 0x81 | 0xC8
|
||||||
// 500 | 0x82 | 0x01 0xF4
|
// 500 | 0x82 | 0x01 0xF4
|
||||||
//
|
|
||||||
func encodeLength(out *bytes.Buffer, length int) (err error) {
|
func encodeLength(out *bytes.Buffer, length int) (err error) {
|
||||||
if length >= 128 {
|
if length >= 128 {
|
||||||
l := lengthLength(length)
|
l := lengthLength(length)
|
||||||
|
|||||||
@@ -1836,7 +1836,8 @@ func testAccStepLoginWithNameInvalid(t *testing.T, connState tls.ConnectionState
|
|||||||
}
|
}
|
||||||
|
|
||||||
func testAccStepListCerts(
|
func testAccStepListCerts(
|
||||||
t *testing.T, certs []string) []logicaltest.TestStep {
|
t *testing.T, certs []string,
|
||||||
|
) []logicaltest.TestStep {
|
||||||
return []logicaltest.TestStep{
|
return []logicaltest.TestStep{
|
||||||
{
|
{
|
||||||
Operation: logical.ListOperation,
|
Operation: logical.ListOperation,
|
||||||
@@ -1893,7 +1894,8 @@ type allowed struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func testAccStepCert(
|
func testAccStepCert(
|
||||||
t *testing.T, name string, cert []byte, policies string, testData allowed, expectError bool) logicaltest.TestStep {
|
t *testing.T, name string, cert []byte, policies string, testData allowed, expectError bool,
|
||||||
|
) logicaltest.TestStep {
|
||||||
return logicaltest.TestStep{
|
return logicaltest.TestStep{
|
||||||
Operation: logical.UpdateOperation,
|
Operation: logical.UpdateOperation,
|
||||||
Path: "certs/" + name,
|
Path: "certs/" + name,
|
||||||
@@ -1922,7 +1924,8 @@ func testAccStepCert(
|
|||||||
}
|
}
|
||||||
|
|
||||||
func testAccStepCertLease(
|
func testAccStepCertLease(
|
||||||
t *testing.T, name string, cert []byte, policies string) logicaltest.TestStep {
|
t *testing.T, name string, cert []byte, policies string,
|
||||||
|
) logicaltest.TestStep {
|
||||||
return logicaltest.TestStep{
|
return logicaltest.TestStep{
|
||||||
Operation: logical.UpdateOperation,
|
Operation: logical.UpdateOperation,
|
||||||
Path: "certs/" + name,
|
Path: "certs/" + name,
|
||||||
@@ -1936,7 +1939,8 @@ func testAccStepCertLease(
|
|||||||
}
|
}
|
||||||
|
|
||||||
func testAccStepCertTTL(
|
func testAccStepCertTTL(
|
||||||
t *testing.T, name string, cert []byte, policies string) logicaltest.TestStep {
|
t *testing.T, name string, cert []byte, policies string,
|
||||||
|
) logicaltest.TestStep {
|
||||||
return logicaltest.TestStep{
|
return logicaltest.TestStep{
|
||||||
Operation: logical.UpdateOperation,
|
Operation: logical.UpdateOperation,
|
||||||
Path: "certs/" + name,
|
Path: "certs/" + name,
|
||||||
@@ -1950,7 +1954,8 @@ func testAccStepCertTTL(
|
|||||||
}
|
}
|
||||||
|
|
||||||
func testAccStepCertMaxTTL(
|
func testAccStepCertMaxTTL(
|
||||||
t *testing.T, name string, cert []byte, policies string) logicaltest.TestStep {
|
t *testing.T, name string, cert []byte, policies string,
|
||||||
|
) logicaltest.TestStep {
|
||||||
return logicaltest.TestStep{
|
return logicaltest.TestStep{
|
||||||
Operation: logical.UpdateOperation,
|
Operation: logical.UpdateOperation,
|
||||||
Path: "certs/" + name,
|
Path: "certs/" + name,
|
||||||
@@ -1965,7 +1970,8 @@ func testAccStepCertMaxTTL(
|
|||||||
}
|
}
|
||||||
|
|
||||||
func testAccStepCertNoLease(
|
func testAccStepCertNoLease(
|
||||||
t *testing.T, name string, cert []byte, policies string) logicaltest.TestStep {
|
t *testing.T, name string, cert []byte, policies string,
|
||||||
|
) logicaltest.TestStep {
|
||||||
return logicaltest.TestStep{
|
return logicaltest.TestStep{
|
||||||
Operation: logical.UpdateOperation,
|
Operation: logical.UpdateOperation,
|
||||||
Path: "certs/" + name,
|
Path: "certs/" + name,
|
||||||
|
|||||||
@@ -390,10 +390,10 @@ func TestLdapAuthBackend_UserPolicies(t *testing.T) {
|
|||||||
* ...as well as existence of a person object, `cn=Hermes Conrad,dc=example,dc=com`,
|
* ...as well as existence of a person object, `cn=Hermes Conrad,dc=example,dc=com`,
|
||||||
* which is a member of a group, `cn=admin_staff,ou=people,dc=example,dc=com`
|
* which is a member of a group, `cn=admin_staff,ou=people,dc=example,dc=com`
|
||||||
*
|
*
|
||||||
* Querying the server from the command line:
|
- Querying the server from the command line:
|
||||||
* $ docker run --privileged -d -p 389:389 --name ldap --rm rroemhild/test-openldap
|
- $ docker run --privileged -d -p 389:389 --name ldap --rm rroemhild/test-openldap
|
||||||
* $ ldapsearch -x -H ldap://localhost -b dc=planetexpress,dc=com -s sub uid=hermes
|
- $ ldapsearch -x -H ldap://localhost -b dc=planetexpress,dc=com -s sub uid=hermes
|
||||||
* $ ldapsearch -x -H ldap://localhost -b dc=planetexpress,dc=com -s sub \
|
- $ ldapsearch -x -H ldap://localhost -b dc=planetexpress,dc=com -s sub \
|
||||||
'member=cn=Hermes Conrad,ou=people,dc=planetexpress,dc=com'
|
'member=cn=Hermes Conrad,ou=people,dc=planetexpress,dc=com'
|
||||||
*/
|
*/
|
||||||
func factory(t *testing.T) logical.Backend {
|
func factory(t *testing.T) logical.Backend {
|
||||||
|
|||||||
@@ -339,7 +339,8 @@ func testStepUserList(t *testing.T, users []string) logicaltest.TestStep {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func testStepUpdateUser(
|
func testStepUpdateUser(
|
||||||
t *testing.T, name string, policies string) logicaltest.TestStep {
|
t *testing.T, name string, policies string,
|
||||||
|
) logicaltest.TestStep {
|
||||||
return logicaltest.TestStep{
|
return logicaltest.TestStep{
|
||||||
Operation: logical.UpdateOperation,
|
Operation: logical.UpdateOperation,
|
||||||
Path: "users/" + name,
|
Path: "users/" + name,
|
||||||
|
|||||||
@@ -300,7 +300,8 @@ func testAccStepLogin(t *testing.T, user string, pass string, policies []string)
|
|||||||
}
|
}
|
||||||
|
|
||||||
func testUserCreateOperation(
|
func testUserCreateOperation(
|
||||||
t *testing.T, name string, password string, policies string) logicaltest.TestStep {
|
t *testing.T, name string, password string, policies string,
|
||||||
|
) logicaltest.TestStep {
|
||||||
return logicaltest.TestStep{
|
return logicaltest.TestStep{
|
||||||
Operation: logical.CreateOperation,
|
Operation: logical.CreateOperation,
|
||||||
Path: "users/" + name,
|
Path: "users/" + name,
|
||||||
@@ -312,7 +313,8 @@ func testUserCreateOperation(
|
|||||||
}
|
}
|
||||||
|
|
||||||
func testAccStepUser(
|
func testAccStepUser(
|
||||||
t *testing.T, name string, password string, policies string) logicaltest.TestStep {
|
t *testing.T, name string, password string, policies string,
|
||||||
|
) logicaltest.TestStep {
|
||||||
return logicaltest.TestStep{
|
return logicaltest.TestStep{
|
||||||
Operation: logical.UpdateOperation,
|
Operation: logical.UpdateOperation,
|
||||||
Path: "users/" + name,
|
Path: "users/" + name,
|
||||||
|
|||||||
@@ -32,7 +32,8 @@ func TestAccBackend_stepwise_UserCrud(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func testAccStepwiseUser(
|
func testAccStepwiseUser(
|
||||||
t *testing.T, name string, password string, policies string) stepwise.Step {
|
t *testing.T, name string, password string, policies string,
|
||||||
|
) stepwise.Step {
|
||||||
return stepwise.Step{
|
return stepwise.Step{
|
||||||
Operation: stepwise.UpdateOperation,
|
Operation: stepwise.UpdateOperation,
|
||||||
Path: "users/" + name,
|
Path: "users/" + name,
|
||||||
|
|||||||
@@ -278,7 +278,8 @@ func (b *backend) secretAccessKeysCreate(
|
|||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
s logical.Storage,
|
s logical.Storage,
|
||||||
displayName, policyName string,
|
displayName, policyName string,
|
||||||
role *awsRoleEntry) (*logical.Response, error) {
|
role *awsRoleEntry,
|
||||||
|
) (*logical.Response, error) {
|
||||||
iamClient, err := b.clientIAM(ctx, s)
|
iamClient, err := b.clientIAM(ctx, s)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return logical.ErrorResponse(err.Error()), nil
|
return logical.ErrorResponse(err.Error()), nil
|
||||||
|
|||||||
@@ -316,6 +316,7 @@ func TestOcsp_RevokedCertHasIssuerWithoutAKey(t *testing.T) {
|
|||||||
// the response to the caller on its behalf.
|
// the response to the caller on its behalf.
|
||||||
//
|
//
|
||||||
// NOTE: This test is a bit at the mercy of iteration order of the issuer ids.
|
// NOTE: This test is a bit at the mercy of iteration order of the issuer ids.
|
||||||
|
//
|
||||||
// If it becomes flaky, most likely something is wrong in the code
|
// If it becomes flaky, most likely something is wrong in the code
|
||||||
// and not the test.
|
// and not the test.
|
||||||
func TestOcsp_MultipleMatchingIssuersOneWithoutSigningUsage(t *testing.T) {
|
func TestOcsp_MultipleMatchingIssuersOneWithoutSigningUsage(t *testing.T) {
|
||||||
|
|||||||
@@ -2120,7 +2120,8 @@ func testDefaultUserTemplate(t *testing.T, testDefaultUserTemplate string,
|
|||||||
|
|
||||||
func testAllowedPrincipalsTemplate(t *testing.T, testAllowedDomainsTemplate string,
|
func testAllowedPrincipalsTemplate(t *testing.T, testAllowedDomainsTemplate string,
|
||||||
expectedValidPrincipal string, testEntityMetadata map[string]string,
|
expectedValidPrincipal string, testEntityMetadata map[string]string,
|
||||||
roleConfigPayload map[string]interface{}, signingPayload map[string]interface{}) {
|
roleConfigPayload map[string]interface{}, signingPayload map[string]interface{},
|
||||||
|
) {
|
||||||
cluster, userpassToken := getSshCaTestCluster(t, testUserName)
|
cluster, userpassToken := getSshCaTestCluster(t, testUserName)
|
||||||
defer cluster.Cleanup()
|
defer cluster.Cleanup()
|
||||||
client := cluster.Cores[0].Client
|
client := cluster.Cores[0].Client
|
||||||
@@ -2169,7 +2170,8 @@ func testAllowedPrincipalsTemplate(t *testing.T, testAllowedDomainsTemplate stri
|
|||||||
}
|
}
|
||||||
|
|
||||||
func testAllowedUsersTemplate(t *testing.T, testAllowedUsersTemplate string,
|
func testAllowedUsersTemplate(t *testing.T, testAllowedUsersTemplate string,
|
||||||
expectedValidPrincipal string, testEntityMetadata map[string]string) {
|
expectedValidPrincipal string, testEntityMetadata map[string]string,
|
||||||
|
) {
|
||||||
testAllowedPrincipalsTemplate(
|
testAllowedPrincipalsTemplate(
|
||||||
t, testAllowedUsersTemplate,
|
t, testAllowedUsersTemplate,
|
||||||
expectedValidPrincipal, testEntityMetadata,
|
expectedValidPrincipal, testEntityMetadata,
|
||||||
|
|||||||
@@ -623,7 +623,8 @@ func testAccStepReadPolicyWithVersions(t *testing.T, name string, expectNone, de
|
|||||||
}
|
}
|
||||||
|
|
||||||
func testAccStepEncrypt(
|
func testAccStepEncrypt(
|
||||||
t *testing.T, name, plaintext string, decryptData map[string]interface{}) logicaltest.TestStep {
|
t *testing.T, name, plaintext string, decryptData map[string]interface{},
|
||||||
|
) logicaltest.TestStep {
|
||||||
return logicaltest.TestStep{
|
return logicaltest.TestStep{
|
||||||
Operation: logical.UpdateOperation,
|
Operation: logical.UpdateOperation,
|
||||||
Path: "encrypt/" + name,
|
Path: "encrypt/" + name,
|
||||||
@@ -647,7 +648,8 @@ func testAccStepEncrypt(
|
|||||||
}
|
}
|
||||||
|
|
||||||
func testAccStepEncryptUpsert(
|
func testAccStepEncryptUpsert(
|
||||||
t *testing.T, name, plaintext string, decryptData map[string]interface{}) logicaltest.TestStep {
|
t *testing.T, name, plaintext string, decryptData map[string]interface{},
|
||||||
|
) logicaltest.TestStep {
|
||||||
return logicaltest.TestStep{
|
return logicaltest.TestStep{
|
||||||
Operation: logical.CreateOperation,
|
Operation: logical.CreateOperation,
|
||||||
Path: "encrypt/" + name,
|
Path: "encrypt/" + name,
|
||||||
@@ -671,7 +673,8 @@ func testAccStepEncryptUpsert(
|
|||||||
}
|
}
|
||||||
|
|
||||||
func testAccStepEncryptContext(
|
func testAccStepEncryptContext(
|
||||||
t *testing.T, name, plaintext, context string, decryptData map[string]interface{}) logicaltest.TestStep {
|
t *testing.T, name, plaintext, context string, decryptData map[string]interface{},
|
||||||
|
) logicaltest.TestStep {
|
||||||
return logicaltest.TestStep{
|
return logicaltest.TestStep{
|
||||||
Operation: logical.UpdateOperation,
|
Operation: logical.UpdateOperation,
|
||||||
Path: "encrypt/" + name,
|
Path: "encrypt/" + name,
|
||||||
@@ -697,7 +700,8 @@ func testAccStepEncryptContext(
|
|||||||
}
|
}
|
||||||
|
|
||||||
func testAccStepDecrypt(
|
func testAccStepDecrypt(
|
||||||
t *testing.T, name, plaintext string, decryptData map[string]interface{}) logicaltest.TestStep {
|
t *testing.T, name, plaintext string, decryptData map[string]interface{},
|
||||||
|
) logicaltest.TestStep {
|
||||||
return logicaltest.TestStep{
|
return logicaltest.TestStep{
|
||||||
Operation: logical.UpdateOperation,
|
Operation: logical.UpdateOperation,
|
||||||
Path: "decrypt/" + name,
|
Path: "decrypt/" + name,
|
||||||
@@ -725,7 +729,8 @@ func testAccStepDecrypt(
|
|||||||
}
|
}
|
||||||
|
|
||||||
func testAccStepRewrap(
|
func testAccStepRewrap(
|
||||||
t *testing.T, name string, decryptData map[string]interface{}, expectedVer int) logicaltest.TestStep {
|
t *testing.T, name string, decryptData map[string]interface{}, expectedVer int,
|
||||||
|
) logicaltest.TestStep {
|
||||||
return logicaltest.TestStep{
|
return logicaltest.TestStep{
|
||||||
Operation: logical.UpdateOperation,
|
Operation: logical.UpdateOperation,
|
||||||
Path: "rewrap/" + name,
|
Path: "rewrap/" + name,
|
||||||
@@ -757,7 +762,8 @@ func testAccStepRewrap(
|
|||||||
|
|
||||||
func testAccStepEncryptVX(
|
func testAccStepEncryptVX(
|
||||||
t *testing.T, name, plaintext string, decryptData map[string]interface{},
|
t *testing.T, name, plaintext string, decryptData map[string]interface{},
|
||||||
ver int, encryptHistory map[int]map[string]interface{}) logicaltest.TestStep {
|
ver int, encryptHistory map[int]map[string]interface{},
|
||||||
|
) logicaltest.TestStep {
|
||||||
return logicaltest.TestStep{
|
return logicaltest.TestStep{
|
||||||
Operation: logical.UpdateOperation,
|
Operation: logical.UpdateOperation,
|
||||||
Path: "encrypt/" + name,
|
Path: "encrypt/" + name,
|
||||||
@@ -788,7 +794,8 @@ func testAccStepEncryptVX(
|
|||||||
|
|
||||||
func testAccStepLoadVX(
|
func testAccStepLoadVX(
|
||||||
t *testing.T, name string, decryptData map[string]interface{},
|
t *testing.T, name string, decryptData map[string]interface{},
|
||||||
ver int, encryptHistory map[int]map[string]interface{}) logicaltest.TestStep {
|
ver int, encryptHistory map[int]map[string]interface{},
|
||||||
|
) logicaltest.TestStep {
|
||||||
// This is really a no-op to allow us to do data manip in the check function
|
// This is really a no-op to allow us to do data manip in the check function
|
||||||
return logicaltest.TestStep{
|
return logicaltest.TestStep{
|
||||||
Operation: logical.ReadOperation,
|
Operation: logical.ReadOperation,
|
||||||
@@ -801,7 +808,8 @@ func testAccStepLoadVX(
|
|||||||
}
|
}
|
||||||
|
|
||||||
func testAccStepDecryptExpectFailure(
|
func testAccStepDecryptExpectFailure(
|
||||||
t *testing.T, name, plaintext string, decryptData map[string]interface{}) logicaltest.TestStep {
|
t *testing.T, name, plaintext string, decryptData map[string]interface{},
|
||||||
|
) logicaltest.TestStep {
|
||||||
return logicaltest.TestStep{
|
return logicaltest.TestStep{
|
||||||
Operation: logical.UpdateOperation,
|
Operation: logical.UpdateOperation,
|
||||||
Path: "decrypt/" + name,
|
Path: "decrypt/" + name,
|
||||||
@@ -825,7 +833,8 @@ func testAccStepRotate(t *testing.T, name string) logicaltest.TestStep {
|
|||||||
|
|
||||||
func testAccStepWriteDatakey(t *testing.T, name string,
|
func testAccStepWriteDatakey(t *testing.T, name string,
|
||||||
noPlaintext bool, bits int,
|
noPlaintext bool, bits int,
|
||||||
dataKeyInfo map[string]interface{}) logicaltest.TestStep {
|
dataKeyInfo map[string]interface{},
|
||||||
|
) logicaltest.TestStep {
|
||||||
data := map[string]interface{}{}
|
data := map[string]interface{}{}
|
||||||
subPath := "plaintext"
|
subPath := "plaintext"
|
||||||
if noPlaintext {
|
if noPlaintext {
|
||||||
@@ -869,7 +878,8 @@ func testAccStepWriteDatakey(t *testing.T, name string,
|
|||||||
}
|
}
|
||||||
|
|
||||||
func testAccStepDecryptDatakey(t *testing.T, name string,
|
func testAccStepDecryptDatakey(t *testing.T, name string,
|
||||||
dataKeyInfo map[string]interface{}) logicaltest.TestStep {
|
dataKeyInfo map[string]interface{},
|
||||||
|
) logicaltest.TestStep {
|
||||||
return logicaltest.TestStep{
|
return logicaltest.TestStep{
|
||||||
Operation: logical.UpdateOperation,
|
Operation: logical.UpdateOperation,
|
||||||
Path: "decrypt/" + name,
|
Path: "decrypt/" + name,
|
||||||
|
|||||||
@@ -162,7 +162,8 @@ func testAccStepwiseReadPolicyWithVersions(t *testing.T, name string, expectNone
|
|||||||
}
|
}
|
||||||
|
|
||||||
func testAccStepwiseEncryptContext(
|
func testAccStepwiseEncryptContext(
|
||||||
t *testing.T, name, plaintext, context string, decryptData map[string]interface{}) stepwise.Step {
|
t *testing.T, name, plaintext, context string, decryptData map[string]interface{},
|
||||||
|
) stepwise.Step {
|
||||||
return stepwise.Step{
|
return stepwise.Step{
|
||||||
Operation: stepwise.UpdateOperation,
|
Operation: stepwise.UpdateOperation,
|
||||||
Path: "encrypt/" + name,
|
Path: "encrypt/" + name,
|
||||||
@@ -188,7 +189,8 @@ func testAccStepwiseEncryptContext(
|
|||||||
}
|
}
|
||||||
|
|
||||||
func testAccStepwiseDecrypt(
|
func testAccStepwiseDecrypt(
|
||||||
t *testing.T, name, plaintext string, decryptData map[string]interface{}) stepwise.Step {
|
t *testing.T, name, plaintext string, decryptData map[string]interface{},
|
||||||
|
) stepwise.Step {
|
||||||
return stepwise.Step{
|
return stepwise.Step{
|
||||||
Operation: stepwise.UpdateOperation,
|
Operation: stepwise.UpdateOperation,
|
||||||
Path: "decrypt/" + name,
|
Path: "decrypt/" + name,
|
||||||
|
|||||||
@@ -18,13 +18,11 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
Creds can be inferred from instance metadata, and those creds
|
Creds can be inferred from instance metadata, and those creds
|
||||||
expire every 60 minutes, so we're going to need to poll for new
|
expire every 60 minutes, so we're going to need to poll for new
|
||||||
creds. Since we're polling anyways, let's poll once a minute so
|
creds. Since we're polling anyways, let's poll once a minute so
|
||||||
all changes can be picked up rather quickly. This is configurable,
|
all changes can be picked up rather quickly. This is configurable,
|
||||||
however.
|
however.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
const defaultCredCheckFreqSeconds = 60
|
const defaultCredCheckFreqSeconds = 60
|
||||||
|
|
||||||
|
|||||||
@@ -46,10 +46,10 @@ var _ TokenHelper = (*ExternalTokenHelper)(nil)
|
|||||||
// BinaryPath is executed within a shell with environment Env. The last argument
|
// BinaryPath is executed within a shell with environment Env. The last argument
|
||||||
// appended will be the operation, which is:
|
// appended will be the operation, which is:
|
||||||
//
|
//
|
||||||
// * "get" - Read the value of the token and write it to stdout.
|
// - "get" - Read the value of the token and write it to stdout.
|
||||||
// * "store" - Store the value of the token which is on stdin. Output
|
// - "store" - Store the value of the token which is on stdin. Output
|
||||||
// nothing.
|
// nothing.
|
||||||
// * "erase" - Erase the contents stored. Output nothing.
|
// - "erase" - Erase the contents stored. Output nothing.
|
||||||
//
|
//
|
||||||
// Any errors can be written on stdout. If the helper exits with a non-zero
|
// Any errors can be written on stdout. If the helper exits with a non-zero
|
||||||
// exit code then the stderr will be made part of the error value.
|
// exit code then the stderr will be made part of the error value.
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// content is our static web server content.
|
// content is our static web server content.
|
||||||
|
//
|
||||||
//go:embed web_ui/*
|
//go:embed web_ui/*
|
||||||
var content embed.FS
|
var content embed.FS
|
||||||
|
|
||||||
|
|||||||
@@ -75,7 +75,8 @@ func UnixSocketListener(path string, unixSocketsConfig *UnixSocketsConfig) (net.
|
|||||||
func TLSConfig(
|
func TLSConfig(
|
||||||
l *configutil.Listener,
|
l *configutil.Listener,
|
||||||
props map[string]string,
|
props map[string]string,
|
||||||
ui cli.Ui) (*tls.Config, reloadutil.ReloadFunc, error) {
|
ui cli.Ui,
|
||||||
|
) (*tls.Config, reloadutil.ReloadFunc, error) {
|
||||||
props["tls"] = "disabled"
|
props["tls"] = "disabled"
|
||||||
|
|
||||||
if l.TLSDisable {
|
if l.TLSDisable {
|
||||||
|
|||||||
@@ -321,6 +321,7 @@ OUTER:
|
|||||||
//
|
//
|
||||||
// - lock does not exist
|
// - lock does not exist
|
||||||
// - write the lock
|
// - write the lock
|
||||||
|
//
|
||||||
// - lock exists
|
// - lock exists
|
||||||
// - if key is empty or identity is the same or timestamp exceeds TTL
|
// - if key is empty or identity is the same or timestamp exceeds TTL
|
||||||
// - update the lock to self
|
// - update the lock to self
|
||||||
|
|||||||
@@ -36,11 +36,9 @@ const (
|
|||||||
// Verify PostgreSQLBackend satisfies the correct interfaces
|
// Verify PostgreSQLBackend satisfies the correct interfaces
|
||||||
var _ physical.Backend = (*PostgreSQLBackend)(nil)
|
var _ physical.Backend = (*PostgreSQLBackend)(nil)
|
||||||
|
|
||||||
//
|
|
||||||
// HA backend was implemented based on the DynamoDB backend pattern
|
// HA backend was implemented based on the DynamoDB backend pattern
|
||||||
// With distinction using central postgres clock, hereby avoiding
|
// With distinction using central postgres clock, hereby avoiding
|
||||||
// possible issues with multiple clocks
|
// possible issues with multiple clocks
|
||||||
//
|
|
||||||
var (
|
var (
|
||||||
_ physical.HABackend = (*PostgreSQLBackend)(nil)
|
_ physical.HABackend = (*PostgreSQLBackend)(nil)
|
||||||
_ physical.Lock = (*PostgreSQLLock)(nil)
|
_ physical.Lock = (*PostgreSQLLock)(nil)
|
||||||
|
|||||||
@@ -320,6 +320,7 @@ OUTER:
|
|||||||
//
|
//
|
||||||
// - lock does not exist
|
// - lock does not exist
|
||||||
// - write the lock
|
// - write the lock
|
||||||
|
//
|
||||||
// - lock exists
|
// - lock exists
|
||||||
// - if key is empty or identity is the same or timestamp exceeds TTL
|
// - if key is empty or identity is the same or timestamp exceeds TTL
|
||||||
// - update the lock to self
|
// - update the lock to self
|
||||||
|
|||||||
@@ -734,6 +734,7 @@ func cleanResponse(resp *logical.Response) *cleanedResponse {
|
|||||||
// /sys/tools/random/{urlbytes} -> postSysToolsRandomUrlbytes
|
// /sys/tools/random/{urlbytes} -> postSysToolsRandomUrlbytes
|
||||||
//
|
//
|
||||||
// In the unlikely case of a duplicate ids, a numeric suffix is added:
|
// In the unlikely case of a duplicate ids, a numeric suffix is added:
|
||||||
|
//
|
||||||
// postSysToolsRandomUrlbytes_2
|
// postSysToolsRandomUrlbytes_2
|
||||||
//
|
//
|
||||||
// An optional user-provided suffix ("context") may also be appended.
|
// An optional user-provided suffix ("context") may also be appended.
|
||||||
|
|||||||
@@ -42,7 +42,8 @@ func (s *Secret) Renewable() bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *Secret) Response(
|
func (s *Secret) Response(
|
||||||
data, internal map[string]interface{}) *logical.Response {
|
data, internal map[string]interface{},
|
||||||
|
) *logical.Response {
|
||||||
internalData := make(map[string]interface{})
|
internalData := make(map[string]interface{})
|
||||||
for k, v := range internal {
|
for k, v := range internal {
|
||||||
internalData[k] = v
|
internalData[k] = v
|
||||||
|
|||||||
@@ -834,7 +834,8 @@ func Test_RSA_PSS(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
test_RSA_PSS := func(t *testing.T, p *Policy, rsaKey *rsa.PrivateKey, hashType HashType,
|
test_RSA_PSS := func(t *testing.T, p *Policy, rsaKey *rsa.PrivateKey, hashType HashType,
|
||||||
marshalingType MarshalingType) {
|
marshalingType MarshalingType,
|
||||||
|
) {
|
||||||
unsaltedOptions := SigningOptions{
|
unsaltedOptions := SigningOptions{
|
||||||
HashAlgorithm: hashType,
|
HashAlgorithm: hashType,
|
||||||
Marshaling: marshalingType,
|
Marshaling: marshalingType,
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ type LockEntry struct {
|
|||||||
// Lock B, Lock A
|
// Lock B, Lock A
|
||||||
//
|
//
|
||||||
// Where process 1 is now deadlocked trying to lock B, and process 2 deadlocked trying to lock A
|
// Where process 1 is now deadlocked trying to lock B, and process 2 deadlocked trying to lock A
|
||||||
//
|
|
||||||
func CreateLocks() []*LockEntry {
|
func CreateLocks() []*LockEntry {
|
||||||
ret := make([]*LockEntry, LockCount)
|
ret := make([]*LockEntry, LockCount)
|
||||||
for i := range ret {
|
for i := range ret {
|
||||||
|
|||||||
@@ -39,37 +39,48 @@ func Function(name string, f interface{}) Opt {
|
|||||||
// - random
|
// - random
|
||||||
// - Randomly generated characters. This uses the charset specified in RandomCharset. Must include a length.
|
// - Randomly generated characters. This uses the charset specified in RandomCharset. Must include a length.
|
||||||
// Example: {{ rand 20 }}
|
// Example: {{ rand 20 }}
|
||||||
|
//
|
||||||
// - truncate
|
// - truncate
|
||||||
// - Truncates the previous value to the specified length. Must include a maximum length.
|
// - Truncates the previous value to the specified length. Must include a maximum length.
|
||||||
// Example: {{ .DisplayName | truncate 10 }}
|
// Example: {{ .DisplayName | truncate 10 }}
|
||||||
|
//
|
||||||
// - truncate_sha256
|
// - truncate_sha256
|
||||||
// - Truncates the previous value to the specified length. If the original length is greater than the length
|
// - Truncates the previous value to the specified length. If the original length is greater than the length
|
||||||
// specified, the remaining characters will be sha256 hashed and appended to the end. The hash will be only the first 8 characters The maximum length will
|
// specified, the remaining characters will be sha256 hashed and appended to the end. The hash will be only the first 8 characters The maximum length will
|
||||||
// be no longer than the length specified.
|
// be no longer than the length specified.
|
||||||
// Example: {{ .DisplayName | truncate_sha256 30 }}
|
// Example: {{ .DisplayName | truncate_sha256 30 }}
|
||||||
|
//
|
||||||
// - uppercase
|
// - uppercase
|
||||||
// - Uppercases the previous value.
|
// - Uppercases the previous value.
|
||||||
// Example: {{ .RoleName | uppercase }}
|
// Example: {{ .RoleName | uppercase }}
|
||||||
|
//
|
||||||
// - lowercase
|
// - lowercase
|
||||||
// - Lowercases the previous value.
|
// - Lowercases the previous value.
|
||||||
// Example: {{ .DisplayName | lowercase }}
|
// Example: {{ .DisplayName | lowercase }}
|
||||||
|
//
|
||||||
// - replace
|
// - replace
|
||||||
// - Performs a string find & replace
|
// - Performs a string find & replace
|
||||||
// Example: {{ .DisplayName | replace - _ }}
|
// Example: {{ .DisplayName | replace - _ }}
|
||||||
|
//
|
||||||
// - sha256
|
// - sha256
|
||||||
// - SHA256 hashes the previous value.
|
// - SHA256 hashes the previous value.
|
||||||
// Example: {{ .DisplayName | sha256 }}
|
// Example: {{ .DisplayName | sha256 }}
|
||||||
|
//
|
||||||
// - base64
|
// - base64
|
||||||
// - base64 encodes the previous value.
|
// - base64 encodes the previous value.
|
||||||
// Example: {{ .DisplayName | base64 }}
|
// Example: {{ .DisplayName | base64 }}
|
||||||
|
//
|
||||||
// - unix_time
|
// - unix_time
|
||||||
// - Provides the current unix time in seconds.
|
// - Provides the current unix time in seconds.
|
||||||
// Example: {{ unix_time }}
|
// Example: {{ unix_time }}
|
||||||
|
//
|
||||||
// - unix_time_millis
|
// - unix_time_millis
|
||||||
// - Provides the current unix time in milliseconds.
|
// - Provides the current unix time in milliseconds.
|
||||||
// Example: {{ unix_time_millis }}
|
// Example: {{ unix_time_millis }}
|
||||||
|
//
|
||||||
// - timestamp
|
// - timestamp
|
||||||
// - Provides the current time. Must include a standard Go format string
|
// - Provides the current time. Must include a standard Go format string
|
||||||
|
//
|
||||||
// - uuid
|
// - uuid
|
||||||
// - Generates a UUID
|
// - Generates a UUID
|
||||||
// Example: {{ uuid }}
|
// Example: {{ uuid }}
|
||||||
|
|||||||
@@ -378,7 +378,6 @@ type MFACreds map[string][]string
|
|||||||
// InitializationRequest stores the parameters and context of an Initialize()
|
// InitializationRequest stores the parameters and context of an Initialize()
|
||||||
// call being made to a logical.Backend.
|
// call being made to a logical.Backend.
|
||||||
type InitializationRequest struct {
|
type InitializationRequest struct {
|
||||||
|
|
||||||
// Storage can be used to durably store and retrieve state.
|
// Storage can be used to durably store and retrieve state.
|
||||||
Storage Storage
|
Storage Storage
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -334,7 +334,8 @@ func migrateFromShamirToTransit_Pre14(t *testing.T, logger hclog.Logger, storage
|
|||||||
}
|
}
|
||||||
|
|
||||||
func validateMigration(t *testing.T, storage teststorage.ReusableStorage,
|
func validateMigration(t *testing.T, storage teststorage.ReusableStorage,
|
||||||
cluster *vault.TestCluster, leaderIdx int, f func(t *testing.T, core *vault.TestClusterCore)) {
|
cluster *vault.TestCluster, leaderIdx int, f func(t *testing.T, core *vault.TestClusterCore),
|
||||||
|
) {
|
||||||
t.Helper()
|
t.Helper()
|
||||||
|
|
||||||
leader := cluster.Cores[leaderIdx]
|
leader := cluster.Cores[leaderIdx]
|
||||||
@@ -693,7 +694,8 @@ func runShamir(t *testing.T, logger hclog.Logger, storage teststorage.ReusableSt
|
|||||||
|
|
||||||
// initializeTransit initializes a brand new backend storage with Transit.
|
// initializeTransit initializes a brand new backend storage with Transit.
|
||||||
func InitializeTransit(t *testing.T, logger hclog.Logger, storage teststorage.ReusableStorage, basePort int,
|
func InitializeTransit(t *testing.T, logger hclog.Logger, storage teststorage.ReusableStorage, basePort int,
|
||||||
tss *sealhelper.TransitSealServer, sealKeyName string) (*vault.TestCluster, *vault.TestClusterOptions) {
|
tss *sealhelper.TransitSealServer, sealKeyName string,
|
||||||
|
) (*vault.TestCluster, *vault.TestClusterOptions) {
|
||||||
t.Helper()
|
t.Helper()
|
||||||
|
|
||||||
baseClusterPort := basePort + 10
|
baseClusterPort := basePort + 10
|
||||||
|
|||||||
@@ -1083,6 +1083,7 @@ func TestIdentityStore_GroupMultiCase(t *testing.T) {
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
Test groups hierarchy:
|
Test groups hierarchy:
|
||||||
|
|
||||||
------- eng(entityID3) -------
|
------- eng(entityID3) -------
|
||||||
| |
|
| |
|
||||||
----- vault ----- -- ops(entityID2) --
|
----- vault ----- -- ops(entityID2) --
|
||||||
|
|||||||
Reference in New Issue
Block a user