Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fc9c56929f | ||
|
|
e27a6565df | ||
|
|
82b9dda5c6 | ||
|
|
2fd7d35760 | ||
|
|
7bf9fe2ecf | ||
|
|
c6687840d5 |
No files matched your search
@@ -1,7 +1,11 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
package credential
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"regexp"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws/endpoints"
|
||||
"github.com/hashicorp/boundary-plugin-aws/internal/errors"
|
||||
@@ -19,6 +23,8 @@ type CredentialAttributes struct {
|
||||
DisableCredentialRotation bool
|
||||
}
|
||||
|
||||
var accessKeyRegex = regexp.MustCompile(`^[\w]+$`)
|
||||
|
||||
// GetCredentialsConfig parses values out of a protobuf struct input and returns a
|
||||
// CredentialsConfig used for configuring an AWS session. An error is returned if
|
||||
// any of the following fields are missing from the protobuf struct input or have
|
||||
@@ -31,12 +37,18 @@ func GetCredentialsConfig(in *structpb.Struct, region string) (*awsutil.Credenti
|
||||
accessKey, err := values.GetStringValue(in, ConstAccessKeyId, true)
|
||||
if err != nil {
|
||||
badFields[fmt.Sprintf("secrets.%s", ConstAccessKeyId)] = err.Error()
|
||||
} else if len(accessKey) < 16 || len(accessKey) > 128 {
|
||||
badFields[fmt.Sprintf("secrets.%s", ConstAccessKeyId)] = "value must be between 16 and 128 characters"
|
||||
} else if !accessKeyRegex.MatchString(accessKey) {
|
||||
badFields[fmt.Sprintf("secrets.%s", ConstAccessKeyId)] = "value must only contain characters matching [\\w]+"
|
||||
}
|
||||
delete(unknownFields, ConstAccessKeyId)
|
||||
|
||||
secretKey, err := values.GetStringValue(in, ConstSecretAccessKey, true)
|
||||
if err != nil {
|
||||
badFields[fmt.Sprintf("secrets.%s", ConstSecretAccessKey)] = err.Error()
|
||||
} else if len(secretKey) != 40 {
|
||||
badFields[fmt.Sprintf("secrets.%s", ConstSecretAccessKey)] = "value must be 40 characters"
|
||||
}
|
||||
delete(unknownFields, ConstSecretAccessKey)
|
||||
|
||||
|
||||
@@ -120,29 +120,55 @@ func TestGetCredentialsConfig(t *testing.T) {
|
||||
expectedErrContains: "secrets.bar: unrecognized field, secrets.foo: unrecognized field",
|
||||
},
|
||||
{
|
||||
name: "valid ignore creds_last_rotated_time",
|
||||
name: "keys not right length",
|
||||
in: map[string]any{
|
||||
ConstAccessKeyId: "foobar",
|
||||
ConstSecretAccessKey: "bazqux",
|
||||
ConstCredsLastRotatedTime: "2006-01-02T15:04:05+07:00",
|
||||
},
|
||||
region: "us-west-2",
|
||||
expectedErrContains: "secrets.access_key_id: value must be between 16 and 128 characters, secrets.secret_access_key: value must be 40 characters",
|
||||
},
|
||||
{
|
||||
name: "key contains invalid chars",
|
||||
in: map[string]any{
|
||||
ConstAccessKeyId: "foobarbazbuzquintile-",
|
||||
ConstSecretAccessKey: "bazqux-not-thinking-of-40-chars-for-this",
|
||||
ConstCredsLastRotatedTime: "2006-01-02T15:04:05+07:00",
|
||||
},
|
||||
region: "us-west-2",
|
||||
expectedErrContains: "secrets.access_key_id: value must only contain characters matching [\\w]+",
|
||||
},
|
||||
{
|
||||
name: "getstring error doesn't trigger char len error",
|
||||
in: map[string]any{},
|
||||
region: "us-west-2",
|
||||
expectedErrContains: "[secrets.access_key_id: missing required value \"access_key_id\", secrets.secret_access_key: missing required value \"secret_access_key\"]",
|
||||
},
|
||||
{
|
||||
name: "valid ignore creds_last_rotated_time",
|
||||
in: map[string]any{
|
||||
ConstAccessKeyId: "foobarbazbuzquintile",
|
||||
ConstSecretAccessKey: "bazqux-not-thinking-of-40-chars-for-this",
|
||||
ConstCredsLastRotatedTime: "2006-01-02T15:04:05+07:00",
|
||||
},
|
||||
region: "us-west-2",
|
||||
expected: &awsutil.CredentialsConfig{
|
||||
AccessKey: "foobar",
|
||||
SecretKey: "bazqux",
|
||||
AccessKey: "foobarbazbuzquintile",
|
||||
SecretKey: "bazqux-not-thinking-of-40-chars-for-this",
|
||||
Region: "us-west-2",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "good",
|
||||
in: map[string]any{
|
||||
ConstAccessKeyId: "foobar",
|
||||
ConstSecretAccessKey: "bazqux",
|
||||
ConstAccessKeyId: "foobarbazbuzquintile",
|
||||
ConstSecretAccessKey: "bazqux-not-thinking-of-40-chars-for-this",
|
||||
},
|
||||
region: "us-west-2",
|
||||
expected: &awsutil.CredentialsConfig{
|
||||
AccessKey: "foobar",
|
||||
SecretKey: "bazqux",
|
||||
AccessKey: "foobarbazbuzquintile",
|
||||
SecretKey: "bazqux-not-thinking-of-40-chars-for-this",
|
||||
Region: "us-west-2",
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
package credential
|
||||
|
||||
const (
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
package credential
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
package credential
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
package credential
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
package errors
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
package values
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
package values
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
package plugin
|
||||
|
||||
import (
|
||||
|
||||
@@ -105,7 +105,7 @@ a configured IAM user for this provider:
|
||||
The following `attributes` are valid on an AWS host catalog resource:
|
||||
|
||||
- `disable_credential_rotation` (bool): If `true`, credential rotation will not
|
||||
be performed. See the [Credential Rotation](#credential-rotation) section
|
||||
be performed. See the [Credential Rotation](../../../README.md#credential-rotation) section
|
||||
above.
|
||||
- `region` (string): The region to configure the host catalog for. All host sets
|
||||
in this catalog will be configured for this region.
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
package host
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
package host
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
package host
|
||||
|
||||
const (
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
package host
|
||||
|
||||
import (
|
||||
@@ -89,8 +92,8 @@ func TestPluginOnCreateCatalogErr(t *testing.T) {
|
||||
Catalog: &hostcatalogs.HostCatalog{
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
}},
|
||||
Attrs: &hostcatalogs.HostCatalog_Attributes{
|
||||
Attributes: &structpb.Struct{
|
||||
@@ -110,8 +113,8 @@ func TestPluginOnCreateCatalogErr(t *testing.T) {
|
||||
Catalog: &hostcatalogs.HostCatalog{
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
}},
|
||||
Attrs: &hostcatalogs.HostCatalog_Attributes{
|
||||
Attributes: &structpb.Struct{
|
||||
@@ -136,8 +139,8 @@ func TestPluginOnCreateCatalogErr(t *testing.T) {
|
||||
Catalog: &hostcatalogs.HostCatalog{
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
}},
|
||||
Attrs: &hostcatalogs.HostCatalog_Attributes{
|
||||
Attributes: &structpb.Struct{
|
||||
@@ -166,8 +169,8 @@ func TestPluginOnCreateCatalogErr(t *testing.T) {
|
||||
Catalog: &hostcatalogs.HostCatalog{
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
}},
|
||||
Attrs: &hostcatalogs.HostCatalog_Attributes{
|
||||
Attributes: &structpb.Struct{
|
||||
@@ -277,8 +280,8 @@ func TestPluginOnUpdateCatalogErr(t *testing.T) {
|
||||
Persisted: &pb.HostCatalogPersisted{
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
credential.ConstCredsLastRotatedTime: structpb.NewStringValue("2006-01-02T15:04:05+07:00"),
|
||||
},
|
||||
},
|
||||
@@ -308,8 +311,8 @@ func TestPluginOnUpdateCatalogErr(t *testing.T) {
|
||||
Persisted: &pb.HostCatalogPersisted{
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
credential.ConstCredsLastRotatedTime: structpb.NewStringValue("2006-01-02T15:04:05+07:00"),
|
||||
},
|
||||
},
|
||||
@@ -334,8 +337,8 @@ func TestPluginOnUpdateCatalogErr(t *testing.T) {
|
||||
Persisted: &pb.HostCatalogPersisted{
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
credential.ConstCredsLastRotatedTime: structpb.NewStringValue("2006-01-02T15:04:05+07:00"),
|
||||
},
|
||||
},
|
||||
@@ -350,8 +353,8 @@ func TestPluginOnUpdateCatalogErr(t *testing.T) {
|
||||
NewCatalog: &hostcatalogs.HostCatalog{
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("onetwo"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("threefour"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("00000000000000onetwo"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("0000000000000000000000000000000threefour"),
|
||||
},
|
||||
},
|
||||
Attrs: &hostcatalogs.HostCatalog_Attributes{
|
||||
@@ -366,8 +369,8 @@ func TestPluginOnUpdateCatalogErr(t *testing.T) {
|
||||
Persisted: &pb.HostCatalogPersisted{
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
credential.ConstCredsLastRotatedTime: structpb.NewStringValue("2006-01-02T15:04:05+07:00"),
|
||||
},
|
||||
},
|
||||
@@ -400,8 +403,8 @@ func TestPluginOnUpdateCatalogErr(t *testing.T) {
|
||||
Persisted: &pb.HostCatalogPersisted{
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -459,8 +462,8 @@ func TestPluginOnDeleteCatalogErr(t *testing.T) {
|
||||
Persisted: &pb.HostCatalogPersisted{
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
credential.ConstCredsLastRotatedTime: structpb.NewStringValue("2006-01-02T15:04:05+07:00"),
|
||||
},
|
||||
},
|
||||
@@ -489,8 +492,8 @@ func TestPluginOnDeleteCatalogErr(t *testing.T) {
|
||||
Persisted: &pb.HostCatalogPersisted{
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
credential.ConstCredsLastRotatedTime: structpb.NewStringValue("2006-01-02T15:04:05+07:00"),
|
||||
},
|
||||
},
|
||||
@@ -594,8 +597,8 @@ func TestPluginOnCreateSetErr(t *testing.T) {
|
||||
Persisted: &pb.HostCatalogPersisted{
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
credential.ConstCredsLastRotatedTime: structpb.NewStringValue("2006-01-02T15:04:05+07:00"),
|
||||
},
|
||||
},
|
||||
@@ -624,8 +627,8 @@ func TestPluginOnCreateSetErr(t *testing.T) {
|
||||
Persisted: &pb.HostCatalogPersisted{
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
credential.ConstCredsLastRotatedTime: structpb.NewStringValue("2006-01-02T15:04:05+07:00"),
|
||||
},
|
||||
},
|
||||
@@ -649,8 +652,8 @@ func TestPluginOnCreateSetErr(t *testing.T) {
|
||||
Persisted: &pb.HostCatalogPersisted{
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
credential.ConstCredsLastRotatedTime: structpb.NewStringValue("2006-01-02T15:04:05+07:00"),
|
||||
},
|
||||
},
|
||||
@@ -675,8 +678,8 @@ func TestPluginOnCreateSetErr(t *testing.T) {
|
||||
Persisted: &pb.HostCatalogPersisted{
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
credential.ConstCredsLastRotatedTime: structpb.NewStringValue("2006-01-02T15:04:05+07:00"),
|
||||
},
|
||||
},
|
||||
@@ -710,8 +713,8 @@ func TestPluginOnCreateSetErr(t *testing.T) {
|
||||
Persisted: &pb.HostCatalogPersisted{
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
credential.ConstCredsLastRotatedTime: structpb.NewStringValue("2006-01-02T15:04:05+07:00"),
|
||||
},
|
||||
},
|
||||
@@ -755,8 +758,8 @@ func TestPluginOnCreateSetErr(t *testing.T) {
|
||||
Persisted: &pb.HostCatalogPersisted{
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
credential.ConstCredsLastRotatedTime: structpb.NewStringValue("2006-01-02T15:04:05+07:00"),
|
||||
},
|
||||
},
|
||||
@@ -801,8 +804,8 @@ func TestPluginOnCreateSetErr(t *testing.T) {
|
||||
Persisted: &pb.HostCatalogPersisted{
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
credential.ConstCredsLastRotatedTime: structpb.NewStringValue("2006-01-02T15:04:05+07:00"),
|
||||
},
|
||||
},
|
||||
@@ -846,8 +849,8 @@ func TestPluginOnCreateSetErr(t *testing.T) {
|
||||
Persisted: &pb.HostCatalogPersisted{
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
credential.ConstCredsLastRotatedTime: structpb.NewStringValue("2006-01-02T15:04:05+07:00"),
|
||||
},
|
||||
},
|
||||
@@ -963,8 +966,8 @@ func TestPluginOnUpdateSetErr(t *testing.T) {
|
||||
Persisted: &pb.HostCatalogPersisted{
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
credential.ConstCredsLastRotatedTime: structpb.NewStringValue("2006-01-02T15:04:05+07:00"),
|
||||
},
|
||||
},
|
||||
@@ -993,8 +996,8 @@ func TestPluginOnUpdateSetErr(t *testing.T) {
|
||||
Persisted: &pb.HostCatalogPersisted{
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
credential.ConstCredsLastRotatedTime: structpb.NewStringValue("2006-01-02T15:04:05+07:00"),
|
||||
},
|
||||
},
|
||||
@@ -1018,8 +1021,8 @@ func TestPluginOnUpdateSetErr(t *testing.T) {
|
||||
Persisted: &pb.HostCatalogPersisted{
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
credential.ConstCredsLastRotatedTime: structpb.NewStringValue("2006-01-02T15:04:05+07:00"),
|
||||
},
|
||||
},
|
||||
@@ -1044,8 +1047,8 @@ func TestPluginOnUpdateSetErr(t *testing.T) {
|
||||
Persisted: &pb.HostCatalogPersisted{
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
credential.ConstCredsLastRotatedTime: structpb.NewStringValue("2006-01-02T15:04:05+07:00"),
|
||||
},
|
||||
},
|
||||
@@ -1079,8 +1082,8 @@ func TestPluginOnUpdateSetErr(t *testing.T) {
|
||||
Persisted: &pb.HostCatalogPersisted{
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
credential.ConstCredsLastRotatedTime: structpb.NewStringValue("2006-01-02T15:04:05+07:00"),
|
||||
},
|
||||
},
|
||||
@@ -1124,8 +1127,8 @@ func TestPluginOnUpdateSetErr(t *testing.T) {
|
||||
Persisted: &pb.HostCatalogPersisted{
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
credential.ConstCredsLastRotatedTime: structpb.NewStringValue("2006-01-02T15:04:05+07:00"),
|
||||
},
|
||||
},
|
||||
@@ -1170,8 +1173,8 @@ func TestPluginOnUpdateSetErr(t *testing.T) {
|
||||
Persisted: &pb.HostCatalogPersisted{
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
credential.ConstCredsLastRotatedTime: structpb.NewStringValue("2006-01-02T15:04:05+07:00"),
|
||||
},
|
||||
},
|
||||
@@ -1287,8 +1290,8 @@ func TestPluginListHostsErr(t *testing.T) {
|
||||
Persisted: &pb.HostCatalogPersisted{
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
credential.ConstCredsLastRotatedTime: structpb.NewStringValue("2006-01-02T15:04:05+07:00"),
|
||||
},
|
||||
},
|
||||
@@ -1317,8 +1320,8 @@ func TestPluginListHostsErr(t *testing.T) {
|
||||
Persisted: &pb.HostCatalogPersisted{
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
credential.ConstCredsLastRotatedTime: structpb.NewStringValue("2006-01-02T15:04:05+07:00"),
|
||||
},
|
||||
},
|
||||
@@ -1342,8 +1345,8 @@ func TestPluginListHostsErr(t *testing.T) {
|
||||
Persisted: &pb.HostCatalogPersisted{
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
credential.ConstCredsLastRotatedTime: structpb.NewStringValue("2006-01-02T15:04:05+07:00"),
|
||||
},
|
||||
},
|
||||
@@ -1368,8 +1371,8 @@ func TestPluginListHostsErr(t *testing.T) {
|
||||
Persisted: &pb.HostCatalogPersisted{
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
credential.ConstCredsLastRotatedTime: structpb.NewStringValue("2006-01-02T15:04:05+07:00"),
|
||||
},
|
||||
},
|
||||
@@ -1398,8 +1401,8 @@ func TestPluginListHostsErr(t *testing.T) {
|
||||
Persisted: &pb.HostCatalogPersisted{
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
credential.ConstCredsLastRotatedTime: structpb.NewStringValue("2006-01-02T15:04:05+07:00"),
|
||||
},
|
||||
},
|
||||
@@ -1436,8 +1439,8 @@ func TestPluginListHostsErr(t *testing.T) {
|
||||
Persisted: &pb.HostCatalogPersisted{
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
credential.ConstCredsLastRotatedTime: structpb.NewStringValue("2006-01-02T15:04:05+07:00"),
|
||||
},
|
||||
},
|
||||
@@ -1484,8 +1487,8 @@ func TestPluginListHostsErr(t *testing.T) {
|
||||
Persisted: &pb.HostCatalogPersisted{
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
credential.ConstCredsLastRotatedTime: structpb.NewStringValue("2006-01-02T15:04:05+07:00"),
|
||||
},
|
||||
},
|
||||
@@ -1533,8 +1536,8 @@ func TestPluginListHostsErr(t *testing.T) {
|
||||
Persisted: &pb.HostCatalogPersisted{
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
credential.ConstCredsLastRotatedTime: structpb.NewStringValue("2006-01-02T15:04:05+07:00"),
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
package host
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
package host
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
package host
|
||||
|
||||
import (
|
||||
|
||||
@@ -66,7 +66,7 @@ Example policy:
|
||||
The following `attributes` are valid on an AWS storage bucket resource:
|
||||
|
||||
- `disable_credential_rotation` (bool): If `true`, credential rotation will not
|
||||
be performed. See the [Credential Rotation](#credential-rotation) section
|
||||
be performed. See the [Credential Rotation](../../../README.md#credential-rotation) section
|
||||
above.
|
||||
- `region` (string): The region to configure the storage bucket for.
|
||||
- `endpoint-url` (string): The endpoint to configure the storage.
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
package storage
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
package storage
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
package storage
|
||||
|
||||
const (
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
package storage
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
package storage
|
||||
|
||||
import (
|
||||
@@ -33,8 +36,8 @@ func TestStoragePlugin_OnCreateStorageBucket(t *testing.T) {
|
||||
BucketName: "foo",
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
}},
|
||||
Attributes: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
@@ -123,8 +126,8 @@ func TestStoragePlugin_OnCreateStorageBucket(t *testing.T) {
|
||||
BucketName: "foo",
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
}},
|
||||
Attributes: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
@@ -155,8 +158,8 @@ func TestStoragePlugin_OnCreateStorageBucket(t *testing.T) {
|
||||
BucketName: "foo",
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
}},
|
||||
Attributes: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
@@ -344,8 +347,8 @@ func TestStoragePlugin_OnUpdateStorageBucket(t *testing.T) {
|
||||
Persisted: &storagebuckets.StorageBucketPersisted{
|
||||
Data: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -425,8 +428,8 @@ func TestStoragePlugin_OnUpdateStorageBucket(t *testing.T) {
|
||||
Persisted: &storagebuckets.StorageBucketPersisted{
|
||||
Data: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
credential.ConstCredsLastRotatedTime: structpb.NewStringValue("2006-01-02T15:04:05+07:00"),
|
||||
},
|
||||
},
|
||||
@@ -455,8 +458,8 @@ func TestStoragePlugin_OnUpdateStorageBucket(t *testing.T) {
|
||||
Persisted: &storagebuckets.StorageBucketPersisted{
|
||||
Data: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
credential.ConstCredsLastRotatedTime: structpb.NewStringValue("2006-01-02T15:04:05+07:00"),
|
||||
},
|
||||
},
|
||||
@@ -480,8 +483,8 @@ func TestStoragePlugin_OnUpdateStorageBucket(t *testing.T) {
|
||||
Persisted: &storagebuckets.StorageBucketPersisted{
|
||||
Data: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
credential.ConstCredsLastRotatedTime: structpb.NewStringValue("2006-01-02T15:04:05+07:00"),
|
||||
},
|
||||
},
|
||||
@@ -497,8 +500,8 @@ func TestStoragePlugin_OnUpdateStorageBucket(t *testing.T) {
|
||||
BucketName: "foo",
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("onetwo"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("threefour"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("00000000000000onetwo"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("0000000000000000000000000000000threefour"),
|
||||
},
|
||||
},
|
||||
Attributes: &structpb.Struct{
|
||||
@@ -511,8 +514,8 @@ func TestStoragePlugin_OnUpdateStorageBucket(t *testing.T) {
|
||||
Persisted: &storagebuckets.StorageBucketPersisted{
|
||||
Data: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
credential.ConstCredsLastRotatedTime: structpb.NewStringValue("2006-01-02T15:04:05+07:00"),
|
||||
},
|
||||
},
|
||||
@@ -544,8 +547,8 @@ func TestStoragePlugin_OnUpdateStorageBucket(t *testing.T) {
|
||||
Persisted: &storagebuckets.StorageBucketPersisted{
|
||||
Data: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -668,8 +671,8 @@ func TestStoragePlugin_OnUpdateStorageBucket(t *testing.T) {
|
||||
Persisted: &storagebuckets.StorageBucketPersisted{
|
||||
Data: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -806,8 +809,8 @@ func TestStoragePlugin_OnDeleteStorageBucket(t *testing.T) {
|
||||
BucketName: "foo",
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
}},
|
||||
Attributes: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
@@ -832,8 +835,8 @@ func TestStoragePlugin_OnDeleteStorageBucket(t *testing.T) {
|
||||
Persisted: &storagebuckets.StorageBucketPersisted{
|
||||
Data: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
credential.ConstCredsLastRotatedTime: structpb.NewStringValue("2006-01-02T15:04:05+07:00"),
|
||||
},
|
||||
},
|
||||
@@ -860,8 +863,8 @@ func TestStoragePlugin_OnDeleteStorageBucket(t *testing.T) {
|
||||
Persisted: &storagebuckets.StorageBucketPersisted{
|
||||
Data: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
credential.ConstCredsLastRotatedTime: structpb.NewStringValue("2006-01-02T15:04:05+07:00"),
|
||||
},
|
||||
},
|
||||
@@ -892,8 +895,8 @@ func TestStoragePlugin_OnDeleteStorageBucket(t *testing.T) {
|
||||
Persisted: &storagebuckets.StorageBucketPersisted{
|
||||
Data: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
credential.ConstCredsLastRotatedTime: structpb.NewStringValue("2006-01-02T15:04:05+07:00"),
|
||||
},
|
||||
},
|
||||
@@ -939,8 +942,8 @@ func TestStoragePlugin_HeadObject(t *testing.T) {
|
||||
BucketName: "foo",
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
}},
|
||||
Attributes: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
@@ -1139,8 +1142,8 @@ func TestStoragePlugin_ValidatePermissions(t *testing.T) {
|
||||
BucketName: "foo",
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
}},
|
||||
Attributes: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
@@ -1382,8 +1385,8 @@ func TestStoragePlugin_GetObject(t *testing.T) {
|
||||
BucketName: "foo",
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
}},
|
||||
Attributes: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
@@ -1615,8 +1618,8 @@ func TestStoragePlugin_PutObject(t *testing.T) {
|
||||
BucketName: "external-obj-store",
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
},
|
||||
},
|
||||
Attributes: &structpb.Struct{
|
||||
@@ -1686,8 +1689,8 @@ func TestStoragePlugin_PutObject(t *testing.T) {
|
||||
BucketName: "external-obj-store",
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -1703,8 +1706,8 @@ func TestStoragePlugin_PutObject(t *testing.T) {
|
||||
BucketName: "external-obj-store",
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
},
|
||||
},
|
||||
Attributes: &structpb.Struct{
|
||||
@@ -1725,8 +1728,8 @@ func TestStoragePlugin_PutObject(t *testing.T) {
|
||||
BucketName: "external-obj-store",
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
},
|
||||
},
|
||||
Attributes: &structpb.Struct{
|
||||
@@ -1748,8 +1751,8 @@ func TestStoragePlugin_PutObject(t *testing.T) {
|
||||
BucketName: "external-obj-store",
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
},
|
||||
},
|
||||
Attributes: &structpb.Struct{
|
||||
@@ -1771,8 +1774,8 @@ func TestStoragePlugin_PutObject(t *testing.T) {
|
||||
BucketName: "external-obj-store",
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
},
|
||||
},
|
||||
Attributes: &structpb.Struct{
|
||||
@@ -1794,8 +1797,8 @@ func TestStoragePlugin_PutObject(t *testing.T) {
|
||||
BucketName: "external-obj-store",
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
},
|
||||
},
|
||||
Attributes: &structpb.Struct{
|
||||
@@ -1815,8 +1818,8 @@ func TestStoragePlugin_PutObject(t *testing.T) {
|
||||
BucketName: "external-obj-store",
|
||||
Secrets: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobar"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux"),
|
||||
credential.ConstAccessKeyId: structpb.NewStringValue("foobarbazbuzquintile"),
|
||||
credential.ConstSecretAccessKey: structpb.NewStringValue("bazqux-not-thinking-of-40-chars-for-this"),
|
||||
},
|
||||
},
|
||||
Attributes: &structpb.Struct{
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
package storage
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
package storage
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
package storage
|
||||
|
||||
import (
|
||||
|
||||
Reference in new issue
Block a user