iampolicy

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromMap

FromMap converts the map generated by ToMap to an IAM Policy object.

func IamPrincipalTypeToBindingType

IamPrincipalTypeToBindingType converts an IAM principal type to a resource manager binding member type.

func ToMap

ToMap to map converts an IAM policy to a set of maps. The first map is keyed by Role ID, and the second map is keyed by PrincipalID.

Types

type Displayer

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

func (*Displayer) DefaultFormat

func (d *Displayer) DefaultFormat() format.Format

func (*Displayer) FieldTemplates

func (d *Displayer) FieldTemplates() []format.Field

FieldTemplates returns a slice of Fields. Each Field represents an field based on the payload to display to the user. It is common that the Field is simply a specific field of the payload struct being outputted.

func (*Displayer) Payload

func (d *Displayer) Payload() any

Payload is the object to display. Payload may return a single object or a slice of objects.

func (*Displayer) TemplatedPayload

func (d *Displayer) TemplatedPayload() any

If we are displaying templated data, return the underlying bindings.

type MockResourceUpdater

type MockResourceUpdater struct {
	mock.Mock
}

MockResourceUpdater is an autogenerated mock type for the ResourceUpdater type

func NewMockResourceUpdater

func NewMockResourceUpdater(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockResourceUpdater

NewMockResourceUpdater creates a new instance of MockResourceUpdater. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockResourceUpdater) EXPECT

func (*MockResourceUpdater) GetIamPolicy

GetIamPolicy provides a mock function with given fields: _a0

func (*MockResourceUpdater) SetIamPolicy

SetIamPolicy provides a mock function with given fields: ctx, policy

type MockResourceUpdater_Expecter

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

func (*MockResourceUpdater_Expecter) GetIamPolicy

func (_e *MockResourceUpdater_Expecter) GetIamPolicy(_a0 interface{}) *MockResourceUpdater_GetIamPolicy_Call

GetIamPolicy is a helper method to define mock.On call

  • _a0 context.Context

func (*MockResourceUpdater_Expecter) SetIamPolicy

func (_e *MockResourceUpdater_Expecter) SetIamPolicy(ctx interface{}, policy interface{}) *MockResourceUpdater_SetIamPolicy_Call

SetIamPolicy is a helper method to define mock.On call

  • ctx context.Context
  • policy *models.HashicorpCloudResourcemanagerPolicy

type MockResourceUpdater_GetIamPolicy_Call

type MockResourceUpdater_GetIamPolicy_Call struct {
	*mock.Call
}

MockResourceUpdater_GetIamPolicy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetIamPolicy'

func (*MockResourceUpdater_GetIamPolicy_Call) Run

type MockResourceUpdater_SetIamPolicy_Call

type MockResourceUpdater_SetIamPolicy_Call struct {
	*mock.Call
}

MockResourceUpdater_SetIamPolicy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetIamPolicy'

func (*MockResourceUpdater_SetIamPolicy_Call) Run

type MockSetter

type MockSetter struct {
	mock.Mock
}

MockSetter is an autogenerated mock type for the Setter type

func NewMockSetter

func NewMockSetter(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockSetter

NewMockSetter creates a new instance of MockSetter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockSetter) AddBinding

func (_m *MockSetter) AddBinding(ctx context.Context, principalID string, roleID string) (*models.HashicorpCloudResourcemanagerPolicy, error)

AddBinding provides a mock function with given fields: ctx, principalID, roleID

func (*MockSetter) DeleteBinding

func (_m *MockSetter) DeleteBinding(ctx context.Context, principalID string, roleID string) (*models.HashicorpCloudResourcemanagerPolicy, error)

DeleteBinding provides a mock function with given fields: ctx, principalID, roleID

func (*MockSetter) EXPECT

func (_m *MockSetter) EXPECT() *MockSetter_Expecter

func (*MockSetter) SetPolicy

SetPolicy provides a mock function with given fields: ctx, policy

type MockSetter_AddBinding_Call

type MockSetter_AddBinding_Call struct {
	*mock.Call
}

MockSetter_AddBinding_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddBinding'

func (*MockSetter_AddBinding_Call) Return

func (*MockSetter_AddBinding_Call) Run

func (_c *MockSetter_AddBinding_Call) Run(run func(ctx context.Context, principalID string, roleID string)) *MockSetter_AddBinding_Call

type MockSetter_DeleteBinding_Call

type MockSetter_DeleteBinding_Call struct {
	*mock.Call
}

MockSetter_DeleteBinding_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteBinding'

func (*MockSetter_DeleteBinding_Call) Return

func (*MockSetter_DeleteBinding_Call) Run

func (_c *MockSetter_DeleteBinding_Call) Run(run func(ctx context.Context, principalID string, roleID string)) *MockSetter_DeleteBinding_Call

type MockSetter_Expecter

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

func (*MockSetter_Expecter) AddBinding

func (_e *MockSetter_Expecter) AddBinding(ctx interface{}, principalID interface{}, roleID interface{}) *MockSetter_AddBinding_Call

AddBinding is a helper method to define mock.On call

  • ctx context.Context
  • principalID string
  • roleID string

func (*MockSetter_Expecter) DeleteBinding

func (_e *MockSetter_Expecter) DeleteBinding(ctx interface{}, principalID interface{}, roleID interface{}) *MockSetter_DeleteBinding_Call

DeleteBinding is a helper method to define mock.On call

  • ctx context.Context
  • principalID string
  • roleID string

func (*MockSetter_Expecter) SetPolicy

func (_e *MockSetter_Expecter) SetPolicy(ctx interface{}, policy interface{}) *MockSetter_SetPolicy_Call

SetPolicy is a helper method to define mock.On call

  • ctx context.Context
  • policy *models.HashicorpCloudResourcemanagerPolicy

type MockSetter_SetPolicy_Call

type MockSetter_SetPolicy_Call struct {
	*mock.Call
}

MockSetter_SetPolicy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetPolicy'

func (*MockSetter_SetPolicy_Call) Return

func (*MockSetter_SetPolicy_Call) Run

type ResourceUpdater

type ResourceUpdater interface {
	// GetIamPolicy gets the existing IAM policy attached to a resource.
	GetIamPolicy(context.Context) (*models.HashicorpCloudResourcemanagerPolicy, error)

	// SetIamPolicy replaces the existing IAM Policy attached to a resource.
	SetIamPolicy(ctx context.Context, policy *models.HashicorpCloudResourcemanagerPolicy) (*models.HashicorpCloudResourcemanagerPolicy, error)
}

type Setter

type Setter interface {
	SetPolicy(ctx context.Context, policy *models.HashicorpCloudResourcemanagerPolicy) (*models.HashicorpCloudResourcemanagerPolicy, error)
	AddBinding(ctx context.Context, principalID, roleID string) (*models.HashicorpCloudResourcemanagerPolicy, error)
	DeleteBinding(ctx context.Context, principalID, roleID string) (*models.HashicorpCloudResourcemanagerPolicy, error)
}

func NewSetter

func NewSetter(organizationID string, updater ResourceUpdater, iam iam_service.ClientService, logger hclog.Logger) Setter

Jump to

Keyboard shortcuts

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