serviceaccount

package
v0.0.0-...-dc91eb8 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateStaticServiceAccount

func CreateStaticServiceAccount(ctx context.Context, name string, roles []string, secret string) error

TODO: Remove once static service accounts has been removed

func Delete

func DeleteStaticServiceAccounts

func DeleteStaticServiceAccounts(ctx context.Context) error

TODO: Remove once static service accounts has been removed

func GetBySecret

func GetBySecret(ctx context.Context, token string) (*ServiceAccount, *ServiceAccountToken, error)

func HashToken

func HashToken(token string) (string, error)

func LastUsedAt

func LastUsedAt(ctx context.Context, id uuid.UUID) (*time.Time, error)

func NewLoaderContext

func NewLoaderContext(ctx context.Context, pool *pgxpool.Pool) context.Context

func UpdateTokenLastUsedAt

func UpdateTokenLastUsedAt(ctx context.Context, id uuid.UUID) error

Types

type AssignRoleToServiceAccountInput

type AssignRoleToServiceAccountInput struct {
	ServiceAccountID ident.Ident `json:"serviceAccountID"`
	RoleName         string      `json:"roleName"`
}

type AssignRoleToServiceAccountPayload

type AssignRoleToServiceAccountPayload struct {
	ServiceAccount *ServiceAccount `json:"serviceAccount,omitempty"`
}

type CreateServiceAccountInput

type CreateServiceAccountInput struct {
	Name        string     `json:"name"`
	Description string     `json:"description"`
	TeamSlug    *slug.Slug `json:"teamSlug,omitempty"`
}

type CreateServiceAccountPayload

type CreateServiceAccountPayload struct {
	ServiceAccount *ServiceAccount `json:"serviceAccount"`
}

type CreateServiceAccountTokenInput

type CreateServiceAccountTokenInput struct {
	ServiceAccountID ident.Ident  `json:"serviceAccountID"`
	Name             string       `json:"name"`
	Description      string       `json:"description"`
	ExpiresAt        *scalar.Date `json:"expiresAt,omitempty"`
}

type CreateServiceAccountTokenPayload

type CreateServiceAccountTokenPayload struct {
	Secret              *string              `json:"secret,omitempty"`
	ServiceAccount      *ServiceAccount      `json:"serviceAccount,omitempty"`
	ServiceAccountToken *ServiceAccountToken `json:"serviceAccountToken,omitempty"`
}

type DeleteServiceAccountInput

type DeleteServiceAccountInput struct {
	ServiceAccountID ident.Ident `json:"serviceAccountID"`
}

type DeleteServiceAccountPayload

type DeleteServiceAccountPayload struct {
	ServiceAccountDeleted *bool `json:"serviceAccountDeleted,omitempty"`
}

type DeleteServiceAccountTokenInput

type DeleteServiceAccountTokenInput struct {
	ServiceAccountTokenID ident.Ident `json:"serviceAccountTokenID"`
}

type DeleteServiceAccountTokenPayload

type DeleteServiceAccountTokenPayload struct {
	ServiceAccountTokenDeleted *bool           `json:"serviceAccountTokenDeleted,omitempty"`
	ServiceAccount             *ServiceAccount `json:"serviceAccount,omitempty"`
}

type ErrNotFound

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

func (*ErrNotFound) As

func (e *ErrNotFound) As(v any) bool

func (ErrNotFound) Error

func (e ErrNotFound) Error() string

func (ErrNotFound) GraphError

func (e ErrNotFound) GraphError() string

func (*ErrNotFound) Is

func (e *ErrNotFound) Is(v error) bool

type RevokeRoleFromServiceAccountInput

type RevokeRoleFromServiceAccountInput struct {
	ServiceAccountID ident.Ident `json:"serviceAccountID"`
	RoleName         string      `json:"roleName"`
}

type RevokeRoleFromServiceAccountPayload

type RevokeRoleFromServiceAccountPayload struct {
	ServiceAccount *ServiceAccount `json:"serviceAccount,omitempty"`
}

type RoleAssignedToServiceAccountActivityLogEntry

type RoleAssignedToServiceAccountActivityLogEntry struct {
	activitylog.GenericActivityLogEntry
	Data *RoleAssignedToServiceAccountActivityLogEntryData `json:"data"`
}

type RoleAssignedToServiceAccountActivityLogEntryData

type RoleAssignedToServiceAccountActivityLogEntryData struct {
	RoleName string `json:"roleName"`
}

type RoleRevokedFromServiceAccountActivityLogEntry

type RoleRevokedFromServiceAccountActivityLogEntry struct {
	activitylog.GenericActivityLogEntry
	Data *RoleRevokedFromServiceAccountActivityLogEntryData `json:"data"`
}

type RoleRevokedFromServiceAccountActivityLogEntryData

type RoleRevokedFromServiceAccountActivityLogEntryData struct {
	RoleName string `json:"roleName"`
}

type ServiceAccount

type ServiceAccount struct {
	Name        string     `json:"name"`
	Description string     `json:"description"`
	CreatedAt   time.Time  `json:"created_at"`
	UpdatedAt   time.Time  `json:"updated_at"`
	UUID        uuid.UUID  `json:"-"`
	TeamSlug    *slug.Slug `json:"-"`
}

func Get

func Get(ctx context.Context, serviceAccountID uuid.UUID) (*ServiceAccount, error)

func GetByIdent

func GetByIdent(ctx context.Context, ident ident.Ident) (*ServiceAccount, error)

func (*ServiceAccount) GetID

func (s *ServiceAccount) GetID() uuid.UUID

func (*ServiceAccount) ID

func (s *ServiceAccount) ID() ident.Ident

func (*ServiceAccount) Identity

func (s *ServiceAccount) Identity() string

func (*ServiceAccount) IsAdmin

func (s *ServiceAccount) IsAdmin() bool

func (ServiceAccount) IsNode

func (ServiceAccount) IsNode()

func (*ServiceAccount) IsServiceAccount

func (s *ServiceAccount) IsServiceAccount() bool

type ServiceAccountCreatedActivityLogEntry

type ServiceAccountCreatedActivityLogEntry struct {
	activitylog.GenericActivityLogEntry
}

type ServiceAccountDeletedActivityLogEntry

type ServiceAccountDeletedActivityLogEntry struct {
	activitylog.GenericActivityLogEntry
}

type ServiceAccountEdge

type ServiceAccountEdge = pagination.Edge[*ServiceAccount]

type ServiceAccountToken

type ServiceAccountToken struct {
	Name             string       `json:"name"`
	Description      string       `json:"description"`
	CreatedAt        time.Time    `json:"createdAt"`
	UpdatedAt        time.Time    `json:"updatedAt,omitempty"`
	LastUsedAt       *time.Time   `json:"lastUsedAt,omitempty"`
	ExpiresAt        *scalar.Date `json:"expiresAt,omitempty"`
	UUID             uuid.UUID    `json:"-"`
	ServiceAccountID uuid.UUID    `json:"-"`
}

func GetToken

func GetToken(ctx context.Context, serviceAccountTokenID uuid.UUID) (*ServiceAccountToken, error)

func GetTokenByIdent

func GetTokenByIdent(ctx context.Context, ident ident.Ident) (*ServiceAccountToken, error)

func (*ServiceAccountToken) ID

func (ServiceAccountToken) IsNode

func (ServiceAccountToken) IsNode()

type ServiceAccountTokenConnection

type ServiceAccountTokenConnection = pagination.Connection[*ServiceAccountToken]

func ListTokensForServiceAccount

func ListTokensForServiceAccount(ctx context.Context, page *pagination.Pagination, serviceAccountID uuid.UUID) (*ServiceAccountTokenConnection, error)

type ServiceAccountTokenCreatedActivityLogEntry

type ServiceAccountTokenCreatedActivityLogEntry struct {
	activitylog.GenericActivityLogEntry
	Data *ServiceAccountTokenCreatedActivityLogEntryData `json:"data"`
}

type ServiceAccountTokenCreatedActivityLogEntryData

type ServiceAccountTokenCreatedActivityLogEntryData struct {
	TokenName string `json:"tokenName"`
}

type ServiceAccountTokenDeletedActivityLogEntry

type ServiceAccountTokenDeletedActivityLogEntry struct {
	activitylog.GenericActivityLogEntry
	Data *ServiceAccountTokenDeletedActivityLogEntryData `json:"data"`
}

type ServiceAccountTokenDeletedActivityLogEntryData

type ServiceAccountTokenDeletedActivityLogEntryData struct {
	TokenName string `json:"tokenName"`
}

type ServiceAccountTokenEdge

type ServiceAccountTokenEdge = pagination.Edge[*ServiceAccountToken]

type ServiceAccountTokenUpdatedActivityLogEntry

type ServiceAccountTokenUpdatedActivityLogEntry struct {
	activitylog.GenericActivityLogEntry
	Data *ServiceAccountTokenUpdatedActivityLogEntryData `json:"data"`
}

type ServiceAccountTokenUpdatedActivityLogEntryData

type ServiceAccountTokenUpdatedActivityLogEntryData struct {
	UpdatedFields []*ServiceAccountTokenUpdatedActivityLogEntryDataUpdatedField `json:"updatedFields"`
}

type ServiceAccountTokenUpdatedActivityLogEntryDataUpdatedField

type ServiceAccountTokenUpdatedActivityLogEntryDataUpdatedField struct {
	Field    string  `json:"field"`
	OldValue *string `json:"oldValue,omitempty"`
	NewValue *string `json:"newValue,omitempty"`
}

type ServiceAccountUpdatedActivityLogEntry

type ServiceAccountUpdatedActivityLogEntry struct {
	activitylog.GenericActivityLogEntry
	Data *ServiceAccountUpdatedActivityLogEntryData `json:"data"`
}

type ServiceAccountUpdatedActivityLogEntryData

type ServiceAccountUpdatedActivityLogEntryData struct {
	UpdatedFields []*ServiceAccountUpdatedActivityLogEntryDataUpdatedField `json:"updatedFields"`
}

type ServiceAccountUpdatedActivityLogEntryDataUpdatedField

type ServiceAccountUpdatedActivityLogEntryDataUpdatedField struct {
	Field    string  `json:"field"`
	OldValue *string `json:"oldValue,omitempty"`
	NewValue *string `json:"newValue,omitempty"`
}

type UpdateServiceAccountInput

type UpdateServiceAccountInput struct {
	ServiceAccountID ident.Ident `json:"serviceAccountID"`
	Description      *string     `json:"description,omitempty"`
}

type UpdateServiceAccountPayload

type UpdateServiceAccountPayload struct {
	ServiceAccount *ServiceAccount `json:"serviceAccount,omitempty"`
}

type UpdateServiceAccountTokenInput

type UpdateServiceAccountTokenInput struct {
	ServiceAccountTokenID ident.Ident `json:"serviceAccountTokenID"`
	Name                  *string     `json:"name,omitempty"`
	Description           *string     `json:"description,omitempty"`
}

type UpdateServiceAccountTokenPayload

type UpdateServiceAccountTokenPayload struct {
	ServiceAccount      *ServiceAccount      `json:"serviceAccount,omitempty"`
	ServiceAccountToken *ServiceAccountToken `json:"serviceAccountToken,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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