policy

package
v0.0.5-0...-3bd4ab3 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2020 License: CC0-1.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Policy

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

Policy contains the necessary properties for testing *iam.Policy objects

func New

func New(client client.ConfigProvider) *Policy

New returns a new *Policy

func (*Policy) Arn

func (p *Policy) Arn(arn string) *Policy

Arn adds the Arn filter to the filter list the Arn filter: filters policies by Arn where 'arn' provided is the expected Arn value

func (*Policy) Assert

func (p *Policy) Assert(t *testing.T, policies ...*iam.Policy) *Policy

Assert applies all filters that have been called, resets the list of filters, fails the test if there is not exactly one match, and stores the matched policy if policies is not provided, *iam.Policy objects will be retreived from AWS

func (*Policy) Document

func (p *Policy) Document(t *testing.T, versionID string) *policy.Document

Document returns the unmarshaled policy document if versionID is empty, will return the default version

func (*Policy) Filter

func (p *Policy) Filter(filter shared.Filter) *Policy

Filter adds the 'filter' provided to the filter list

func (*Policy) First

func (p *Policy) First(t *testing.T, policies ...*iam.Policy) *Policy

First applies all filters that have been called, resets the list of filters, fails the test if there are no matches, and stores the first match if policies is not provided, *iam.Policy objects will be retreived from AWS

func (*Policy) ID

func (p *Policy) ID(id string) *Policy

ID adds the ID filter to the filter list the ID filter: filters policies by ID where 'id' provided is the expected PolicyId value

func (*Policy) Name

func (p *Policy) Name(name string) *Policy

Name adds the Name filter to the filter list the Name filter: filters policies by Name where 'name' provided is the expected PolicyName value

func (*Policy) Selected

func (p *Policy) Selected() *iam.Policy

Selected returns the currently selected *iam.Policy

func (*Policy) Statement

func (p *Policy) Statement(t *testing.T, doc *policy.Document) *statement.Statement

Statement returns a newly instantiated *statement.Statement object this is used for filtering by statements inside a policy. If doc is nil the default policy document will be retrieved from AWS

Jump to

Keyboard shortcuts

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