Documentation ¶
Index ¶
- func AutocompleteRoles(ctx context.Context, orgID string, client organization_service.ClientService) complete.Predictor
- func FromMap(etag string, ...) *models.HashicorpCloudResourcemanagerPolicy
- func IamPrincipalTypeToBindingType(p *iamModels.HashicorpCloudIamPrincipal) (*models.HashicorpCloudResourcemanagerPolicyBindingMemberType, error)
- func ToMap(p *models.HashicorpCloudResourcemanagerPolicy) ...
- type Displayer
- type MockResourceUpdater
- func (_m *MockResourceUpdater) EXPECT() *MockResourceUpdater_Expecter
- func (_m *MockResourceUpdater) GetIamPolicy(_a0 context.Context) (*models.HashicorpCloudResourcemanagerPolicy, error)
- func (_m *MockResourceUpdater) SetIamPolicy(ctx context.Context, policy *models.HashicorpCloudResourcemanagerPolicy) (*models.HashicorpCloudResourcemanagerPolicy, error)
- type MockResourceUpdater_Expecter
- type MockResourceUpdater_GetIamPolicy_Call
- func (_c *MockResourceUpdater_GetIamPolicy_Call) Return(_a0 *models.HashicorpCloudResourcemanagerPolicy, _a1 error) *MockResourceUpdater_GetIamPolicy_Call
- func (_c *MockResourceUpdater_GetIamPolicy_Call) Run(run func(_a0 context.Context)) *MockResourceUpdater_GetIamPolicy_Call
- func (_c *MockResourceUpdater_GetIamPolicy_Call) RunAndReturn(run func(context.Context) (*models.HashicorpCloudResourcemanagerPolicy, error)) *MockResourceUpdater_GetIamPolicy_Call
- type MockResourceUpdater_SetIamPolicy_Call
- func (_c *MockResourceUpdater_SetIamPolicy_Call) Return(_a0 *models.HashicorpCloudResourcemanagerPolicy, _a1 error) *MockResourceUpdater_SetIamPolicy_Call
- func (_c *MockResourceUpdater_SetIamPolicy_Call) Run(...) *MockResourceUpdater_SetIamPolicy_Call
- func (_c *MockResourceUpdater_SetIamPolicy_Call) RunAndReturn(...) *MockResourceUpdater_SetIamPolicy_Call
- type MockSetter
- func (_m *MockSetter) AddBinding(ctx context.Context, principalID string, roleID string) (*models.HashicorpCloudResourcemanagerPolicy, error)
- func (_m *MockSetter) DeleteBinding(ctx context.Context, principalID string, roleID string) (*models.HashicorpCloudResourcemanagerPolicy, error)
- func (_m *MockSetter) EXPECT() *MockSetter_Expecter
- func (_m *MockSetter) SetPolicy(ctx context.Context, policy *models.HashicorpCloudResourcemanagerPolicy) (*models.HashicorpCloudResourcemanagerPolicy, error)
- type MockSetter_AddBinding_Call
- func (_c *MockSetter_AddBinding_Call) Return(_a0 *models.HashicorpCloudResourcemanagerPolicy, _a1 error) *MockSetter_AddBinding_Call
- func (_c *MockSetter_AddBinding_Call) Run(run func(ctx context.Context, principalID string, roleID string)) *MockSetter_AddBinding_Call
- func (_c *MockSetter_AddBinding_Call) RunAndReturn(...) *MockSetter_AddBinding_Call
- type MockSetter_DeleteBinding_Call
- func (_c *MockSetter_DeleteBinding_Call) Return(_a0 *models.HashicorpCloudResourcemanagerPolicy, _a1 error) *MockSetter_DeleteBinding_Call
- func (_c *MockSetter_DeleteBinding_Call) Run(run func(ctx context.Context, principalID string, roleID string)) *MockSetter_DeleteBinding_Call
- func (_c *MockSetter_DeleteBinding_Call) RunAndReturn(...) *MockSetter_DeleteBinding_Call
- type MockSetter_Expecter
- func (_e *MockSetter_Expecter) AddBinding(ctx interface{}, principalID interface{}, roleID interface{}) *MockSetter_AddBinding_Call
- func (_e *MockSetter_Expecter) DeleteBinding(ctx interface{}, principalID interface{}, roleID interface{}) *MockSetter_DeleteBinding_Call
- func (_e *MockSetter_Expecter) SetPolicy(ctx interface{}, policy interface{}) *MockSetter_SetPolicy_Call
- type MockSetter_SetPolicy_Call
- type ResourceUpdater
- type Setter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AutocompleteRoles ¶
func AutocompleteRoles(ctx context.Context, orgID string, client organization_service.ClientService) complete.Predictor
func FromMap ¶
func FromMap(etag string, bindings map[string]map[string]*models.HashicorpCloudResourcemanagerPolicyBindingMemberType) *models.HashicorpCloudResourcemanagerPolicy
FromMap converts the map generated by ToMap to an IAM Policy object.
func IamPrincipalTypeToBindingType ¶
func IamPrincipalTypeToBindingType(p *iamModels.HashicorpCloudIamPrincipal) (*models.HashicorpCloudResourcemanagerPolicyBindingMemberType, error)
IamPrincipalTypeToBindingType converts an IAM principal type to a resource manager binding member type.
func ToMap ¶
func ToMap(p *models.HashicorpCloudResourcemanagerPolicy) map[string]map[string]*models.HashicorpCloudResourcemanagerPolicyBindingMemberType
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 NewDisplayer ¶
func NewDisplayer(ctx context.Context, orgID string, policy *models.HashicorpCloudResourcemanagerPolicy, client iam_service.ClientService) (*Displayer, error)
func (*Displayer) DefaultFormat ¶
func (*Displayer) FieldTemplates ¶
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 ¶
Payload is the object to display. Payload may return a single object or a slice of objects.
func (*Displayer) TemplatedPayload ¶
If we are displaying templated data, return the underlying bindings.
type MockResourceUpdater ¶
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 (_m *MockResourceUpdater) EXPECT() *MockResourceUpdater_Expecter
func (*MockResourceUpdater) GetIamPolicy ¶
func (_m *MockResourceUpdater) GetIamPolicy(_a0 context.Context) (*models.HashicorpCloudResourcemanagerPolicy, error)
GetIamPolicy provides a mock function with given fields: _a0
func (*MockResourceUpdater) SetIamPolicy ¶
func (_m *MockResourceUpdater) SetIamPolicy(ctx context.Context, policy *models.HashicorpCloudResourcemanagerPolicy) (*models.HashicorpCloudResourcemanagerPolicy, error)
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 ¶
MockResourceUpdater_GetIamPolicy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetIamPolicy'
func (*MockResourceUpdater_GetIamPolicy_Call) Return ¶
func (_c *MockResourceUpdater_GetIamPolicy_Call) Return(_a0 *models.HashicorpCloudResourcemanagerPolicy, _a1 error) *MockResourceUpdater_GetIamPolicy_Call
func (*MockResourceUpdater_GetIamPolicy_Call) Run ¶
func (_c *MockResourceUpdater_GetIamPolicy_Call) Run(run func(_a0 context.Context)) *MockResourceUpdater_GetIamPolicy_Call
func (*MockResourceUpdater_GetIamPolicy_Call) RunAndReturn ¶
func (_c *MockResourceUpdater_GetIamPolicy_Call) RunAndReturn(run func(context.Context) (*models.HashicorpCloudResourcemanagerPolicy, error)) *MockResourceUpdater_GetIamPolicy_Call
type MockResourceUpdater_SetIamPolicy_Call ¶
MockResourceUpdater_SetIamPolicy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetIamPolicy'
func (*MockResourceUpdater_SetIamPolicy_Call) Return ¶
func (_c *MockResourceUpdater_SetIamPolicy_Call) Return(_a0 *models.HashicorpCloudResourcemanagerPolicy, _a1 error) *MockResourceUpdater_SetIamPolicy_Call
func (*MockResourceUpdater_SetIamPolicy_Call) Run ¶
func (_c *MockResourceUpdater_SetIamPolicy_Call) Run(run func(ctx context.Context, policy *models.HashicorpCloudResourcemanagerPolicy)) *MockResourceUpdater_SetIamPolicy_Call
func (*MockResourceUpdater_SetIamPolicy_Call) RunAndReturn ¶
func (_c *MockResourceUpdater_SetIamPolicy_Call) RunAndReturn(run func(context.Context, *models.HashicorpCloudResourcemanagerPolicy) (*models.HashicorpCloudResourcemanagerPolicy, error)) *MockResourceUpdater_SetIamPolicy_Call
type MockSetter ¶
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 ¶
func (_m *MockSetter) SetPolicy(ctx context.Context, policy *models.HashicorpCloudResourcemanagerPolicy) (*models.HashicorpCloudResourcemanagerPolicy, error)
SetPolicy provides a mock function with given fields: ctx, policy
type MockSetter_AddBinding_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 (_c *MockSetter_AddBinding_Call) Return(_a0 *models.HashicorpCloudResourcemanagerPolicy, _a1 error) *MockSetter_AddBinding_Call
func (*MockSetter_AddBinding_Call) Run ¶
func (_c *MockSetter_AddBinding_Call) Run(run func(ctx context.Context, principalID string, roleID string)) *MockSetter_AddBinding_Call
func (*MockSetter_AddBinding_Call) RunAndReturn ¶
func (_c *MockSetter_AddBinding_Call) RunAndReturn(run func(context.Context, string, string) (*models.HashicorpCloudResourcemanagerPolicy, error)) *MockSetter_AddBinding_Call
type MockSetter_DeleteBinding_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 (_c *MockSetter_DeleteBinding_Call) Return(_a0 *models.HashicorpCloudResourcemanagerPolicy, _a1 error) *MockSetter_DeleteBinding_Call
func (*MockSetter_DeleteBinding_Call) Run ¶
func (_c *MockSetter_DeleteBinding_Call) Run(run func(ctx context.Context, principalID string, roleID string)) *MockSetter_DeleteBinding_Call
func (*MockSetter_DeleteBinding_Call) RunAndReturn ¶
func (_c *MockSetter_DeleteBinding_Call) RunAndReturn(run func(context.Context, string, string) (*models.HashicorpCloudResourcemanagerPolicy, error)) *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 ¶
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 (_c *MockSetter_SetPolicy_Call) Return(_a0 *models.HashicorpCloudResourcemanagerPolicy, _a1 error) *MockSetter_SetPolicy_Call
func (*MockSetter_SetPolicy_Call) Run ¶
func (_c *MockSetter_SetPolicy_Call) Run(run func(ctx context.Context, policy *models.HashicorpCloudResourcemanagerPolicy)) *MockSetter_SetPolicy_Call
func (*MockSetter_SetPolicy_Call) RunAndReturn ¶
func (_c *MockSetter_SetPolicy_Call) RunAndReturn(run func(context.Context, *models.HashicorpCloudResourcemanagerPolicy) (*models.HashicorpCloudResourcemanagerPolicy, error)) *MockSetter_SetPolicy_Call
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