Documentation ¶
Index ¶
- Constants
- Variables
- func CreateAppRoleRoleForReadSecretPolicy(t *testing.T, client *api.Client)
- func CreateAppRoleSecretID(t *testing.T, client *api.Client) string
- func CreateAwsRoleForReadSecretPolicy(t *testing.T, client *api.Client)
- func CreateRootVaultClient(t *testing.T, vaultAddr string) *api.Client
- func DumpValidationErrors(t *testing.T, err error)
- func EnableAppRoleAuthEngine(t *testing.T, client *api.Client)
- func EnableAwsAuthEngine(t *testing.T, client *api.Client)
- func EnsureAwsEC2Instance(t *testing.T)
- func EnsureVaultAvailability(t *testing.T) string
- func GetAppRoleRoleID(t *testing.T, client *api.Client) string
- func GetEC2InstanceVpcId(t *testing.T) string
- func PathFromSecretKey(key string) string
- func QuoteValue(v string) string
- func ScopedEnvVars(vars map[string]string) func()
- func ToKeys(srcMap map[string]interface{}) []string
- func ToStringStringMap(srcMap map[string]interface{}) map[string]string
- func WriteVaultSecrets(t *testing.T, client *api.Client, key string, secrets map[string]interface{})
- type AtomicError
- type TestSettings
- type TestSettingsMongoDB
- type TestSettingsNode
- type TestSettingsServer
Constants ¶
View Source
const ( VaultAppRoleRoleName = "test-approle" VaultAppRoleRenewPolicy = "approle-renew-policy" )
View Source
const (
VaultAwsRoleName = "test-aws"
)
View Source
const (
VaultReadSecretPolicy = "read-secret-policy"
)
Variables ¶
View Source
var BadSettingsMap = map[string]interface{}{
"TEST_NAME": "string test",
"TEST_INTEGER": 100,
"TEST_FLOAT": "abc",
"TEST_SERVER_IP": "127.0.0.1.2",
"TEST_SERVER_PORT": 8001,
"TEST_SERVER_POOLSIZE": 64,
"TEST_SERVER_ALLOWED": "[ \"127.0.0.1\", \"::1\" ]",
"TEST_NODE_url": "http://127.0.0.1:8003",
"TEST_NODE_apiToken": "some-api-access-token",
"TEST_MONGODB_URL": "mongodb://user:pass@127.0.0.1:27017",
}
View Source
var GoodSettings = TestSettings{ Name: "string test", PtrToName: addressOf[string]("string test"), IntegerValue: 100, PtrToIntegerValue: addressOf[int](100), FloatValue: 100.3, PtrToFloatValue: addressOf[float64](100.3), Server: TestSettingsServer{ Ip: "127.0.0.1", Port: 8001, PoolSize: 64, AllowedAddresses: []string{"127.0.0.1", "::1"}, }, Node: &TestSettingsNode{ Url: "http://127.0.0.1:8003", ApiToken: "some-api-access-token", }, MongoDB: TestSettingsMongoDB{ Url: "mongodb://user:pass@127.0.0.1:27017/sample_database?replSet=rs0", }, }
View Source
var GoodSettingsMap = map[string]interface{}{
"TEST_NAME": "string test",
"TEST_INTEGER": 100,
"TEST_FLOAT": 100.3,
"TEST_SERVER_IP": "127.0.0.1",
"TEST_SERVER_PORT": "8001",
"TEST_SERVER_POOLSIZE": 64,
"TEST_SERVER_ALLOWED": "[ \"127.0.0.1\", \"::1\" ]",
"TEST_NODE_URL": "http://127.0.0.1:8003",
"TEST_NODE_APITOKEN": "some-api-access-token",
"TEST_MONGODB_URL": "mongodb://user:pass@127.0.0.1:27017/sample_database?replSet=rs0",
}
Functions ¶
func DumpValidationErrors ¶
func EnsureAwsEC2Instance ¶
func EnsureVaultAvailability ¶
func GetEC2InstanceVpcId ¶
func PathFromSecretKey ¶
func QuoteValue ¶ added in v0.2.0
func ScopedEnvVars ¶ added in v0.2.0
func ToStringStringMap ¶ added in v0.2.0
Types ¶
type AtomicError ¶
type AtomicError struct {
// contains filtered or unexported fields
}
func NewAtomicError ¶
func NewAtomicError() *AtomicError
func (*AtomicError) Err ¶
func (ae *AtomicError) Err() error
func (*AtomicError) Set ¶
func (ae *AtomicError) Set(err error)
type TestSettings ¶
type TestSettings struct { Name string `config:"TEST_NAME" validate:"required,min=1,max=64"` PtrToName *string `config:"TEST_NAME" validate:"required,min=1,max=64"` IntegerValue int `config:"TEST_INTEGER" validate:"required,number"` PtrToIntegerValue *int `config:"TEST_INTEGER" validate:"required,number"` FloatValue float64 `config:"TEST_FLOAT" validate:"required,number"` PtrToFloatValue *float64 `config:"TEST_FLOAT" validate:"required,number"` Server TestSettingsServer Node *TestSettingsNode MongoDB TestSettingsMongoDB }
type TestSettingsMongoDB ¶
type TestSettingsMongoDB struct {
Url string `config:"TEST_MONGODB_URL" validate:"required,url"`
}
type TestSettingsNode ¶
type TestSettingsServer ¶
type TestSettingsServer struct { Ip string `config:"TEST_SERVER_IP" validate:"required,ip"` Port int `config:"TEST_SERVER_PORT" validate:"required,min=0,max=65535"` PoolSize int `config:"TEST_SERVER_POOLSIZE" validate:"required,gte=1"` AllowedAddresses []string `config:"TEST_SERVER_ALLOWED" is-json:"1" validate:"required"` }
Click to show internal directories.
Click to hide internal directories.