Documentation ¶
Overview ¶
Package azure implements utilities that relate to more than one thing we want to do with Azure for the plugin's validation logic.
Index ¶
Constants ¶
const TestClientTimeout = 10 * time.Second
TestClientTimeout is the timeout used for Azure clients during tests.
Variables ¶
This section is empty.
Functions ¶
func RoleNameFromRoleDefinitionID ¶
RoleNameFromRoleDefinitionID extracts the name of a role (aka the non-fully-qualified ID of the role) from an Azure role definition ID (aka the fully-qualified ID of the role definition).
Types ¶
type API ¶ added in v0.0.13
type API struct { DenyAssignmentsClient *armauthorization.DenyAssignmentsClient RoleAssignmentsClient *armauthorization.RoleAssignmentsClient RoleDefinitionsClient *armauthorization.RoleDefinitionsClient // Subscription ID is needed per API call for this client, so the client can't be created until // right before it's used while reconciling a rule. CommunityGalleryImagesClientProducer func(string) (*armcompute.CommunityGalleryImagesClient, error) }
API is an container that aggregates Azure service clients.
type CommunityGalleryImagesClient ¶ added in v0.0.13
type CommunityGalleryImagesClient struct {
// contains filtered or unexported fields
}
CommunityGalleryImagesClient is a facade over the Azure community gallery images client. Exists to make our code easier to test (it handles paging).
func NewCommunityGalleryImagesClient ¶ added in v0.0.13
func NewCommunityGalleryImagesClient(ctx context.Context, azClientProducer func(subscriptionID string) (*armcompute.CommunityGalleryImagesClient, error)) *CommunityGalleryImagesClient
NewCommunityGalleryImagesClient creates a new AzureRoleDefinitionsClient (our facade client) from a client from the Azure SDK.
func (*CommunityGalleryImagesClient) GetImagesForGallery ¶ added in v0.0.13
func (c *CommunityGalleryImagesClient) GetImagesForGallery(location, name, subscriptionID string) ([]*armcompute.CommunityGalleryImage, error)
GetImagesForGallery gets all the images in a community gallery.
type DenyAssignmentsClient ¶ added in v0.0.13
type DenyAssignmentsClient struct {
// contains filtered or unexported fields
}
DenyAssignmentsClient is a facade over the Azure deny assignments client. Exists to make our code easier to test (it handles paging).
func NewDenyAssignmentsClient ¶ added in v0.0.13
func NewDenyAssignmentsClient(ctx context.Context, azClient *armauthorization.DenyAssignmentsClient) *DenyAssignmentsClient
NewDenyAssignmentsClient creates a new AzureDenyAssignmentsClient (our facade client) from a client from the Azure SDK.
func (*DenyAssignmentsClient) GetDenyAssignmentsForScope ¶ added in v0.0.13
func (c *DenyAssignmentsClient) GetDenyAssignmentsForScope(scope string, filter *string) ([]*armauthorization.DenyAssignment, error)
GetDenyAssignmentsForScope gets all the deny assignments matching a scope and an optional filter.
type RoleAssignmentsClient ¶ added in v0.0.13
type RoleAssignmentsClient struct {
// contains filtered or unexported fields
}
RoleAssignmentsClient is a facade over the Azure role assignments client. Exists to make our code easier to test (it handles paging).
func NewRoleAssignmentsClient ¶ added in v0.0.13
func NewRoleAssignmentsClient(ctx context.Context, azClient *armauthorization.RoleAssignmentsClient) *RoleAssignmentsClient
NewRoleAssignmentsClient creates a new AzureRoleAssignmentsClient (our facade client) from a client from the Azure SDK.
func (*RoleAssignmentsClient) GetRoleAssignmentsForScope ¶ added in v0.0.13
func (c *RoleAssignmentsClient) GetRoleAssignmentsForScope(scope string, filter *string) ([]*armauthorization.RoleAssignment, error)
GetRoleAssignmentsForScope gets all the role assignments matching a scope and an optional filter.
type RoleDefinitionsClient ¶ added in v0.0.13
type RoleDefinitionsClient struct {
// contains filtered or unexported fields
}
RoleDefinitionsClient is a facade over the Azure role definitions client. Code that uses this instead of the actual Azure client is easier to test because it won't need to deal with finding the permissions part of the API response.
func NewRoleDefinitionsClient ¶ added in v0.0.13
func NewRoleDefinitionsClient(ctx context.Context, azClient *armauthorization.RoleDefinitionsClient) *RoleDefinitionsClient
NewRoleDefinitionsClient creates a new AzureRoleDefinitionsClient (our facade client) from a client from the Azure SDK.
func (*RoleDefinitionsClient) GetByID ¶ added in v0.0.13
func (c *RoleDefinitionsClient) GetByID(roleID string) (*armauthorization.RoleDefinition, error)
GetByID gets the role definition associated with a role assignment because it uses the fully-qualified role ID contained within the role assignment data to retrieve it from Azure.