Documentation
¶
Index ¶
- func CreateStaticServiceAccount(ctx context.Context, name string, roles []string, secret string) error
- func CreateToken(ctx context.Context, input CreateServiceAccountTokenInput) (*ServiceAccount, *ServiceAccountToken, *string, error)
- func Delete(ctx context.Context, input DeleteServiceAccountInput) error
- func DeleteStaticServiceAccounts(ctx context.Context) error
- func GetBySecret(ctx context.Context, token string) (*ServiceAccount, *ServiceAccountToken, error)
- func HashToken(token string) (string, error)
- func LastUsedAt(ctx context.Context, id uuid.UUID) (*time.Time, error)
- func NewLoaderContext(ctx context.Context, pool *pgxpool.Pool) context.Context
- func UpdateToken(ctx context.Context, input UpdateServiceAccountTokenInput) (*ServiceAccount, *ServiceAccountToken, error)
- func UpdateTokenLastUsedAt(ctx context.Context, id uuid.UUID) error
- type AssignRoleToServiceAccountInput
- type AssignRoleToServiceAccountPayload
- type CreateServiceAccountInput
- type CreateServiceAccountPayload
- type CreateServiceAccountTokenInput
- type CreateServiceAccountTokenPayload
- type DeleteServiceAccountInput
- type DeleteServiceAccountPayload
- type DeleteServiceAccountTokenInput
- type DeleteServiceAccountTokenPayload
- type ErrNotFound
- type RevokeRoleFromServiceAccountInput
- type RevokeRoleFromServiceAccountPayload
- type RoleAssignedToServiceAccountActivityLogEntry
- type RoleAssignedToServiceAccountActivityLogEntryData
- type RoleRevokedFromServiceAccountActivityLogEntry
- type RoleRevokedFromServiceAccountActivityLogEntryData
- type ServiceAccount
- func AssignRole(ctx context.Context, input AssignRoleToServiceAccountInput) (*ServiceAccount, error)
- func Create(ctx context.Context, input CreateServiceAccountInput) (*ServiceAccount, error)
- func DeleteToken(ctx context.Context, input DeleteServiceAccountTokenInput) (*ServiceAccount, error)
- func Get(ctx context.Context, serviceAccountID uuid.UUID) (*ServiceAccount, error)
- func GetByIdent(ctx context.Context, ident ident.Ident) (*ServiceAccount, error)
- func RevokeRole(ctx context.Context, input RevokeRoleFromServiceAccountInput) (*ServiceAccount, error)
- func Update(ctx context.Context, input UpdateServiceAccountInput) (*ServiceAccount, error)
- type ServiceAccountConnection
- type ServiceAccountCreatedActivityLogEntry
- type ServiceAccountDeletedActivityLogEntry
- type ServiceAccountEdge
- type ServiceAccountToken
- type ServiceAccountTokenConnection
- type ServiceAccountTokenCreatedActivityLogEntry
- type ServiceAccountTokenCreatedActivityLogEntryData
- type ServiceAccountTokenDeletedActivityLogEntry
- type ServiceAccountTokenDeletedActivityLogEntryData
- type ServiceAccountTokenEdge
- type ServiceAccountTokenUpdatedActivityLogEntry
- type ServiceAccountTokenUpdatedActivityLogEntryData
- type ServiceAccountTokenUpdatedActivityLogEntryDataUpdatedField
- type ServiceAccountUpdatedActivityLogEntry
- type ServiceAccountUpdatedActivityLogEntryData
- type ServiceAccountUpdatedActivityLogEntryDataUpdatedField
- type UpdateServiceAccountInput
- type UpdateServiceAccountPayload
- type UpdateServiceAccountTokenInput
- type UpdateServiceAccountTokenPayload
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 CreateToken ¶
func CreateToken(ctx context.Context, input CreateServiceAccountTokenInput) (*ServiceAccount, *ServiceAccountToken, *string, error)
func DeleteStaticServiceAccounts ¶
TODO: Remove once static service accounts has been removed
func GetBySecret ¶
func GetBySecret(ctx context.Context, token string) (*ServiceAccount, *ServiceAccountToken, error)
func NewLoaderContext ¶
func UpdateToken ¶
func UpdateToken(ctx context.Context, input UpdateServiceAccountTokenInput) (*ServiceAccount, *ServiceAccountToken, error)
Types ¶
type AssignRoleToServiceAccountPayload ¶
type AssignRoleToServiceAccountPayload struct {
ServiceAccount *ServiceAccount `json:"serviceAccount,omitempty"`
}
type CreateServiceAccountPayload ¶
type CreateServiceAccountPayload struct {
ServiceAccount *ServiceAccount `json:"serviceAccount"`
}
type CreateServiceAccountTokenPayload ¶
type CreateServiceAccountTokenPayload struct { Secret *string `json:"secret,omitempty"` ServiceAccount *ServiceAccount `json:"serviceAccount,omitempty"` ServiceAccountToken *ServiceAccountToken `json:"serviceAccountToken,omitempty"` }
type DeleteServiceAccountPayload ¶
type DeleteServiceAccountPayload struct {
ServiceAccountDeleted *bool `json:"serviceAccountDeleted,omitempty"`
}
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 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 AssignRole ¶
func AssignRole(ctx context.Context, input AssignRoleToServiceAccountInput) (*ServiceAccount, error)
func Create ¶
func Create(ctx context.Context, input CreateServiceAccountInput) (*ServiceAccount, error)
func DeleteToken ¶
func DeleteToken(ctx context.Context, input DeleteServiceAccountTokenInput) (*ServiceAccount, error)
func GetByIdent ¶
func RevokeRole ¶
func RevokeRole(ctx context.Context, input RevokeRoleFromServiceAccountInput) (*ServiceAccount, error)
func Update ¶
func Update(ctx context.Context, input UpdateServiceAccountInput) (*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 ServiceAccountConnection ¶
type ServiceAccountConnection = pagination.Connection[*ServiceAccount]
func List ¶
func List(ctx context.Context, page *pagination.Pagination) (*ServiceAccountConnection, error)
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 GetTokenByIdent ¶
func (*ServiceAccountToken) ID ¶
func (t *ServiceAccountToken) ID() ident.Ident
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 ServiceAccountUpdatedActivityLogEntry ¶
type ServiceAccountUpdatedActivityLogEntry struct { activitylog.GenericActivityLogEntry Data *ServiceAccountUpdatedActivityLogEntryData `json:"data"` }
type ServiceAccountUpdatedActivityLogEntryData ¶
type ServiceAccountUpdatedActivityLogEntryData struct {
UpdatedFields []*ServiceAccountUpdatedActivityLogEntryDataUpdatedField `json:"updatedFields"`
}
type UpdateServiceAccountPayload ¶
type UpdateServiceAccountPayload struct {
ServiceAccount *ServiceAccount `json:"serviceAccount,omitempty"`
}
type UpdateServiceAccountTokenPayload ¶
type UpdateServiceAccountTokenPayload struct { ServiceAccount *ServiceAccount `json:"serviceAccount,omitempty"` ServiceAccountToken *ServiceAccountToken `json:"serviceAccountToken,omitempty"` }
Source Files
¶
Click to show internal directories.
Click to hide internal directories.