serviceaccount

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 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 CreateServiceAccountInput

type CreateServiceAccountInput struct {
	Scope             models.ScopeType
	OrgID             *string
	ProjectID         *string
	Name              string
	Description       string
	OIDCTrustPolicies []models.OIDCTrustPolicy
}

CreateServiceAccountInput is the input for creating a service account

type CreateTokenInput

type CreateTokenInput struct {
	ServiceAccountID string
	Token            []byte
}

CreateTokenInput for logging into a service account

type CreateTokenResponse

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

CreateTokenResponse returned after logging into a service account

type DeleteServiceAccountInput

type DeleteServiceAccountInput struct {
	MetadataVersion *int
	ID              string
}

DeleteServiceAccountInput is the input for deleting 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
	// AgentID will filter service accounts that are assigned to the specified agent
	AgentID *string
	// OrganizationID will filter service accounts that are assigned to the specified organization
	OrganizationID *string
	// ProjectID will filter service accounts that are assigned to the specified project
	ProjectID *string
	// Search will filter service accounts that match the specified search string
	Search *string
	// ServiceAccountScopes will filter service accounts that are scope to specific level
	ServiceAccountScopes []models.ScopeType
}

GetServiceAccountsInput is the input for querying a list of service accounts

type Service

type Service interface {
	GetServiceAccountByID(ctx context.Context, id string) (*models.ServiceAccount, error)
	GetServiceAccountByPRN(ctx context.Context, prn 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 *CreateServiceAccountInput) (*models.ServiceAccount, error)
	UpdateServiceAccount(ctx context.Context, input *UpdateServiceAccountInput) (*models.ServiceAccount, error)
	DeleteServiceAccount(ctx context.Context, input *DeleteServiceAccountInput) 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

type UpdateServiceAccountInput

type UpdateServiceAccountInput struct {
	ID                string
	Description       *string
	MetadataVersion   *int
	OIDCTrustPolicies []models.OIDCTrustPolicy
}

UpdateServiceAccountInput is the input for updating a service account

Jump to

Keyboard shortcuts

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