managedidentity

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2023 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewManagedIdentityDelegateMap

func NewManagedIdentityDelegateMap(ctx context.Context, cfg *config.Config, pluginCatalog *plugin.Catalog) (map[models.ManagedIdentityType]Delegate, error)

NewManagedIdentityDelegateMap creates a map containing a delegate for each managed identity type

Types

type Delegate

type Delegate interface {
	CreateCredentials(ctx context.Context, identity *models.ManagedIdentity, job *models.Job) ([]byte, error)
	SetManagedIdentityData(ctx context.Context, managedIdentity *models.ManagedIdentity, input []byte) error
}

Delegate handles the logic for a specific type of managed identity

type DeleteManagedIdentityInput

type DeleteManagedIdentityInput struct {
	ManagedIdentity *models.ManagedIdentity
	Force           bool
}

DeleteManagedIdentityInput is the input for deleting a managed identity

type GetManagedIdentitiesInput

type GetManagedIdentitiesInput struct {
	// Sort specifies the field to sort on and direction
	Sort *db.ManagedIdentitySortableField
	// PaginationOptions supports cursor based pagination
	PaginationOptions *db.PaginationOptions
	// Search returns only the managed identities with a name or resource path that starts with the value of search
	Search *string
	// NamespacePath is the namespace to return service accounts for
	NamespacePath string
	// IncludeInherited includes inherited managed identities in the result
	IncludeInherited bool
}

GetManagedIdentitiesInput is the input for listing managed identities

type Service

type Service interface {
	GetManagedIdentityByID(ctx context.Context, id string) (*models.ManagedIdentity, error)
	GetManagedIdentityByPath(ctx context.Context, path string) (*models.ManagedIdentity, error)
	GetManagedIdentities(ctx context.Context, input *GetManagedIdentitiesInput) (*db.ManagedIdentitiesResult, error)
	GetManagedIdentitiesByIDs(ctx context.Context, ids []string) ([]models.ManagedIdentity, error)
	CreateManagedIdentity(ctx context.Context, input *types.CreateManagedIdentityInput) (*models.ManagedIdentity, error)
	UpdateManagedIdentity(ctx context.Context, input *types.UpdateManagedIdentityInput) (*models.ManagedIdentity, error)
	DeleteManagedIdentity(ctx context.Context, input *DeleteManagedIdentityInput) error
	CreateCredentials(ctx context.Context, identity *models.ManagedIdentity) ([]byte, error)
	GetManagedIdentitiesForWorkspace(ctx context.Context, workspaceID string) ([]models.ManagedIdentity, error)
	AddManagedIdentityToWorkspace(ctx context.Context, managedIdentityID string, workspaceID string) error
	RemoveManagedIdentityFromWorkspace(ctx context.Context, managedIdentityID string, workspaceID string) error
	GetManagedIdentityAccessRules(ctx context.Context, managedIdentity *models.ManagedIdentity) ([]models.ManagedIdentityAccessRule, error)
	GetManagedIdentityAccessRulesByIDs(ctx context.Context, ids []string) ([]models.ManagedIdentityAccessRule, error)
	GetManagedIdentityAccessRule(ctx context.Context, ruleID string) (*models.ManagedIdentityAccessRule, error)
	CreateManagedIdentityAccessRule(ctx context.Context, input *models.ManagedIdentityAccessRule) (*models.ManagedIdentityAccessRule, error)
	UpdateManagedIdentityAccessRule(ctx context.Context, input *models.ManagedIdentityAccessRule) (*models.ManagedIdentityAccessRule, error)
	DeleteManagedIdentityAccessRule(ctx context.Context, rule *models.ManagedIdentityAccessRule) error
}

Service implements managed identity functionality

func NewService

func NewService(
	logger logger.Logger,
	dbClient *db.Client,
	managedIdentityDelegateMap map[models.ManagedIdentityType]Delegate,
	workspaceService workspace.Service,
	jobService job.Service,
	activityService activityevent.Service,
) Service

NewService creates an instance of Service

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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