azureiam

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package azureiam provides an in-memory mock implementation of Azure Active Directory / IAM.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mock

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

Mock is an in-memory mock implementation of the Azure IAM service.

func New

func New(opts *config.Options) *Mock

New creates a new Azure IAM mock with the given configuration options.

func (*Mock) AttachRolePolicy

func (m *Mock) AttachRolePolicy(_ context.Context, roleName, policyARN string) error

AttachRolePolicy attaches a policy to a role (role assignment).

func (*Mock) AttachUserPolicy

func (m *Mock) AttachUserPolicy(_ context.Context, userName, policyARN string) error

AttachUserPolicy attaches a policy to a user (role assignment).

func (*Mock) CheckPermission

func (m *Mock) CheckPermission(_ context.Context, principal, action, resource string) (bool, error)

CheckPermission evaluates attached policies to determine if a principal is allowed to perform the given action on the given resource. Explicit Deny wins over Allow.

func (*Mock) CreatePolicy

func (m *Mock) CreatePolicy(_ context.Context, cfg driver.PolicyConfig) (*driver.PolicyInfo, error)

CreatePolicy creates a new Azure policy definition.

func (*Mock) CreateRole

func (m *Mock) CreateRole(_ context.Context, cfg driver.RoleConfig) (*driver.RoleInfo, error)

CreateRole creates a new Azure role definition.

func (*Mock) CreateUser

func (m *Mock) CreateUser(_ context.Context, cfg driver.UserConfig) (*driver.UserInfo, error)

CreateUser creates a new Azure AD user.

func (*Mock) DeletePolicy

func (m *Mock) DeletePolicy(_ context.Context, arn string) error

DeletePolicy deletes the Azure policy definition with the given ARN.

func (*Mock) DeleteRole

func (m *Mock) DeleteRole(_ context.Context, name string) error

DeleteRole deletes the Azure role definition with the given name.

func (*Mock) DeleteUser

func (m *Mock) DeleteUser(_ context.Context, name string) error

DeleteUser deletes the Azure AD user with the given name.

func (*Mock) DetachRolePolicy

func (m *Mock) DetachRolePolicy(_ context.Context, roleName, policyARN string) error

DetachRolePolicy detaches a policy from a role.

func (*Mock) DetachUserPolicy

func (m *Mock) DetachUserPolicy(_ context.Context, userName, policyARN string) error

DetachUserPolicy detaches a policy from a user.

func (*Mock) GetPolicy

func (m *Mock) GetPolicy(_ context.Context, arn string) (*driver.PolicyInfo, error)

GetPolicy returns the Azure policy definition with the given ARN.

func (*Mock) GetRole

func (m *Mock) GetRole(_ context.Context, name string) (*driver.RoleInfo, error)

GetRole returns the Azure role definition with the given name.

func (*Mock) GetUser

func (m *Mock) GetUser(_ context.Context, name string) (*driver.UserInfo, error)

GetUser returns the Azure AD user with the given name.

func (*Mock) ListAttachedRolePolicies

func (m *Mock) ListAttachedRolePolicies(_ context.Context, roleName string) ([]string, error)

ListAttachedRolePolicies returns the ARNs of policies attached to the given role.

func (*Mock) ListAttachedUserPolicies

func (m *Mock) ListAttachedUserPolicies(_ context.Context, userName string) ([]string, error)

ListAttachedUserPolicies returns the ARNs of policies attached to the given user.

func (*Mock) ListPolicies

func (m *Mock) ListPolicies(_ context.Context) ([]driver.PolicyInfo, error)

ListPolicies returns all Azure policy definitions.

func (*Mock) ListRoles

func (m *Mock) ListRoles(_ context.Context) ([]driver.RoleInfo, error)

ListRoles returns all Azure role definitions.

func (*Mock) ListUsers

func (m *Mock) ListUsers(_ context.Context) ([]driver.UserInfo, error)

ListUsers returns all Azure AD users.

Jump to

Keyboard shortcuts

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