serviceaccount

package
v0.29.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MPL-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package serviceaccount package

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateTokenInput added in v0.2.0

type CreateTokenInput struct {
	// ServiceAccount ID or resource path
	ServiceAccount string
	Token          []byte
}

CreateTokenInput for logging into a service account

type CreateTokenResponse added in v0.2.0

type CreateTokenResponse struct {
	Token     []byte
	ExpiresIn int32 // seconds
}

CreateTokenResponse returned after logging into a service account

type GetServiceAccountsInput

type GetServiceAccountsInput struct {
	// Sort specifies the field to sort on and direction
	Sort *db.ServiceAccountSortableField
	// PaginationOptions supports cursor based pagination
	PaginationOptions *pagination.Options
	// Search returns only the service accounts with a name or resource path that starts with the value of search
	Search *string
	// RunnerID will filter service accounts that are assigned to the specified runner
	RunnerID *string
	// NamespacePath is the namespace to return service accounts for
	NamespacePath string
	// IncludeInherited includes inherited services accounts in the result
	IncludeInherited bool
}

GetServiceAccountsInput is the input for querying a list of service accounts

type Service

type Service interface {
	GetServiceAccountByPath(ctx context.Context, path string) (*models.ServiceAccount, error)
	GetServiceAccountByID(ctx context.Context, id string) (*models.ServiceAccount, error)
	GetServiceAccounts(ctx context.Context, input *GetServiceAccountsInput) (*db.ServiceAccountsResult, error)
	GetServiceAccountsByIDs(ctx context.Context, idList []string) ([]models.ServiceAccount, error)
	CreateServiceAccount(ctx context.Context, input *models.ServiceAccount) (*models.ServiceAccount, error)
	UpdateServiceAccount(ctx context.Context, serviceAccount *models.ServiceAccount) (*models.ServiceAccount, error)
	DeleteServiceAccount(ctx context.Context, serviceAccount *models.ServiceAccount) error
	CreateToken(ctx context.Context, input *CreateTokenInput) (*CreateTokenResponse, error)
}

Service implements all service account related functionality

func NewService

func NewService(
	logger logger.Logger,
	dbClient *db.Client,
	limitChecker limits.LimitChecker,
	idp *auth.IdentityProvider,
	openIDConfigFetcher *auth.OpenIDConfigFetcher,
	activityService activityevent.Service,
) Service

NewService creates an instance of Service

Jump to

Keyboard shortcuts

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