mocks

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CanExecuteConjurVar bool

Determines if Conjur secrets have 'execute' privileges by mapping `execute` to true or false. We don't dive deeper into the granularity at the level of each Conjur variable because for this suite of tests we aren't concerned with if some Conjur secrets have permissions and others don't. Our main priority is validating that those secrets with 'execute' permissions can be fetched.

View Source
var CanGetK8sSecrets bool
View Source
var CanUpdateK8sSecrets bool
View Source
var MockConjurDB map[string][]byte

Mocks a Conjur data base. Maps variable IDs to secrets

View Source
var MockK8sDB map[string]map[string][]byte

Mocks a K8s database. Maps k8s secret names to mock K8s secrets.

Functions

func CreateMockK8sSecret added in v0.3.0

func CreateMockK8sSecret(dataEntries map[string]string) map[string][]byte

func RetrieveConjurSecrets added in v0.3.0

func RetrieveConjurSecrets(_ []byte, variableIDs []string) (map[string][]byte, error)

func RetrieveK8sSecret added in v0.3.0

func RetrieveK8sSecret(_ string, secretName string) (*v1.Secret, error)

func UpdateK8sSecret added in v1.0.0

func UpdateK8sSecret(_ string, secretName string, originalK8sSecret *v1.Secret, stringDataEntriesMap map[string][]byte) error

Types

type MockAccessToken added in v0.3.0

type MockAccessToken struct{}

Mocks a Conjur access token.

func (MockAccessToken) Delete added in v0.3.0

func (accessToken MockAccessToken) Delete() error

This method implementation is only so MockAccessToken will implement the MockAccessToken interface

func (MockAccessToken) Read added in v0.3.0

func (accessToken MockAccessToken) Read() ([]byte, error)

Returns an arbitrary byte array as an access token data as we don't really need it

func (MockAccessToken) Write added in v0.3.0

func (accessToken MockAccessToken) Write(Data []byte) error

This method implementation is only so MockAccessToken will implement the MockAccessToken interface

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL