iam

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetIAM

func SetIAM(i IdentityAccessManagement)

SetIAM allows injection of an IdentityAccessManagement helper.

Types

type IAM

type IAM struct {
	// contains filtered or unexported fields
}

IAM implements the IdentityAccessManagement interface.

func NewDefaultIAM

func NewDefaultIAM() *IAM

NewDefaultIAM creates a new IAM instance using the default kubernetes provider.

func (*IAM) AzureIdentityBindingExists

func (i *IAM) AzureIdentityBindingExists(namespace, aibName string) (bool, error)

AzureIdentityBindingExists gets the AzureIdentityBindings and filter for namespace (if supplied)

func (*IAM) AzureIdentityExists

func (i *IAM) AzureIdentityExists(namespace, aiName string) (bool, error)

AzureIdentityExists gets the AzureIdentityBindings and filter for namespace (if supplied)

func (*IAM) CreateAIB

func (i *IAM) CreateAIB(useDefaultNS bool, aibName, aiName string) error

CreateAIB creates an AzureIdentityBinding in the cluster

func (*IAM) CreateIAMProbePod

func (i *IAM) CreateIAMProbePod(y []byte, useDefaultNS bool, aibName string, probe *audit.Probe) (*apiv1.Pod, error)

CreateIAMProbePod creates a pod configured for IAM test cases.

func (*IAM) DeleteIAMProbePod

func (i *IAM) DeleteIAMProbePod(n string, useDefaultNS bool, e string) error

DeleteIAMProbePod deletes the IAM test pod with the supplied name.

func (*IAM) ExecuteVerificationCmd

func (i *IAM) ExecuteVerificationCmd(pn string, cmd IAMProbeCommand, ns string) (*kubernetes.CmdExecutionResult, error)

ExecuteVerificationCmd executes a verification command against the supplied pod name.

func (*IAM) GetAccessToken

func (i *IAM) GetAccessToken(pn string, useDefaultNS bool) (*string, error)

GetAccessToken attempts to retrieve an access token by executing a curl command requesting a token for the Azure Resource Manager.

type IAMProbeCommand

type IAMProbeCommand int

IAMProbeCommand defines commands for use in testing IAM

const (
	CatAzJSON IAMProbeCommand = iota
	CurlAuthToken
)

enum supporting IAMProbeCommand

func (IAMProbeCommand) String

func (c IAMProbeCommand) String() string

type IdentityAccessManagement

type IdentityAccessManagement interface {
	AzureIdentityExists(namespace, aiName string) (bool, error)
	AzureIdentityBindingExists(namespace, aibName string) (bool, error)
	CreateAIB(useDefaultNS bool, aibName, aiName string) error
	CreateIAMProbePod(y []byte, useDefaultNS bool, aibName string, probe *audit.Probe) (*apiv1.Pod, error)
	DeleteIAMProbePod(n string, useDefaultNS bool, e string) error
	ExecuteVerificationCmd(pn string, cmd IAMProbeCommand, ns string) (*kubernetes.CmdExecutionResult, error)
	GetAccessToken(pn string, useDefaultNS bool) (*string, error)
}

IdentityAccessManagement encapsulates functionality for querying and probing Identity and Access Management setup.

type ProbeStruct

type ProbeStruct struct{}
var Probe ProbeStruct

func (ProbeStruct) Name

func (p ProbeStruct) Name() string

func (ProbeStruct) Path added in v0.5.0

func (p ProbeStruct) Path() string

func (ProbeStruct) ProbeInitialize

func (p ProbeStruct) ProbeInitialize(ctx *godog.TestSuiteContext)

ProbeInitialize handles any overall Test Suite initialisation steps. This is registered with the test handler as part of the init() function.

func (ProbeStruct) ScenarioInitialize

func (p ProbeStruct) ScenarioInitialize(ctx *godog.ScenarioContext)

ScenarioInitialize initialises the specific test steps. This is essentially the creation of the test which reflects the tests described in the events directory. There must be a test step registered for each line in the feature files. Note: Godog will output stub steps and implementations if it doesn't find a step / function defined. See: https://github.com/cucumber/godog#example.

Jump to

Keyboard shortcuts

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