driver

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package driver defines the interface for IAM service implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessKeyConfig added in v1.3.2

type AccessKeyConfig struct {
	UserName string
}

AccessKeyConfig describes an access key to create.

type AccessKeyInfo added in v1.3.2

type AccessKeyInfo struct {
	AccessKeyID     string
	SecretAccessKey string
	UserName        string
	Status          string
	CreatedAt       string
}

AccessKeyInfo describes an IAM access key.

type GroupConfig added in v1.3.2

type GroupConfig struct {
	Name string
	Path string
}

GroupConfig describes a group to create.

type GroupInfo added in v1.3.2

type GroupInfo struct {
	Name      string
	Path      string
	ARN       string
	CreatedAt string
}

GroupInfo describes an IAM group.

type IAM

type IAM interface {
	CreateUser(ctx context.Context, config UserConfig) (*UserInfo, error)
	DeleteUser(ctx context.Context, name string) error
	GetUser(ctx context.Context, name string) (*UserInfo, error)
	ListUsers(ctx context.Context) ([]UserInfo, error)

	CreateRole(ctx context.Context, config RoleConfig) (*RoleInfo, error)
	DeleteRole(ctx context.Context, name string) error
	GetRole(ctx context.Context, name string) (*RoleInfo, error)
	ListRoles(ctx context.Context) ([]RoleInfo, error)

	CreatePolicy(ctx context.Context, config PolicyConfig) (*PolicyInfo, error)
	DeletePolicy(ctx context.Context, arn string) error
	GetPolicy(ctx context.Context, arn string) (*PolicyInfo, error)
	ListPolicies(ctx context.Context) ([]PolicyInfo, error)

	AttachUserPolicy(ctx context.Context, userName, policyARN string) error
	DetachUserPolicy(ctx context.Context, userName, policyARN string) error
	AttachRolePolicy(ctx context.Context, roleName, policyARN string) error
	DetachRolePolicy(ctx context.Context, roleName, policyARN string) error

	ListAttachedUserPolicies(ctx context.Context, userName string) ([]string, error)
	ListAttachedRolePolicies(ctx context.Context, roleName string) ([]string, error)

	CheckPermission(ctx context.Context, principal, action, resource string) (bool, error)

	CreateGroup(ctx context.Context, config GroupConfig) (*GroupInfo, error)
	DeleteGroup(ctx context.Context, name string) error
	GetGroup(ctx context.Context, name string) (*GroupInfo, error)
	ListGroups(ctx context.Context) ([]GroupInfo, error)

	AddUserToGroup(ctx context.Context, userName, groupName string) error
	RemoveUserFromGroup(ctx context.Context, userName, groupName string) error
	ListGroupsForUser(ctx context.Context, userName string) ([]GroupInfo, error)

	CreateAccessKey(ctx context.Context, config AccessKeyConfig) (*AccessKeyInfo, error)
	DeleteAccessKey(ctx context.Context, userName, accessKeyID string) error
	ListAccessKeys(ctx context.Context, userName string) ([]AccessKeyInfo, error)

	CreateInstanceProfile(ctx context.Context, config InstanceProfileConfig) (*InstanceProfileInfo, error)
	DeleteInstanceProfile(ctx context.Context, name string) error
	GetInstanceProfile(ctx context.Context, name string) (*InstanceProfileInfo, error)
	ListInstanceProfiles(ctx context.Context) ([]InstanceProfileInfo, error)
	AddRoleToInstanceProfile(ctx context.Context, profileName, roleName string) error
	RemoveRoleFromInstanceProfile(ctx context.Context, profileName, roleName string) error
}

IAM is the interface that IAM provider implementations must satisfy.

type InstanceProfileConfig added in v1.4.0

type InstanceProfileConfig struct {
	Name     string
	RoleName string
	Tags     map[string]string
}

InstanceProfileConfig describes an instance profile to create.

type InstanceProfileInfo added in v1.4.0

type InstanceProfileInfo struct {
	ID        string
	Name      string
	RoleName  string
	ARN       string
	CreatedAt string
	Tags      map[string]string
}

InstanceProfileInfo describes an IAM instance profile.

type PolicyConfig

type PolicyConfig struct {
	Name           string
	Path           string
	PolicyDocument string
	Description    string
}

PolicyConfig describes a policy to create.

type PolicyInfo

type PolicyInfo struct {
	Name           string
	ID             string
	ARN            string
	Path           string
	PolicyDocument string
	Description    string
}

PolicyInfo describes an IAM policy.

type RoleConfig

type RoleConfig struct {
	Name                string
	Path                string
	AssumeRolePolicyDoc string
	Tags                map[string]string
}

RoleConfig describes a role to create.

type RoleInfo

type RoleInfo struct {
	Name                string
	ID                  string
	ARN                 string
	Path                string
	AssumeRolePolicyDoc string
	Tags                map[string]string
}

RoleInfo describes an IAM role.

type UserConfig

type UserConfig struct {
	Name string
	Path string
	Tags map[string]string
}

UserConfig describes a user to create.

type UserInfo

type UserInfo struct {
	Name      string
	ID        string
	ARN       string
	Path      string
	Tags      map[string]string
	CreatedAt string
}

UserInfo describes an IAM user.

Jump to

Keyboard shortcuts

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