Documentation
¶
Overview ¶
Snapshot repository — namespaced CRUD over types.Snapshot.
Package repos — StorageClass and Volume repositories.
Volume repository — namespaced CRUD over types.Volume.
Index ¶
- Constants
- func HashSecret(secret string) string
- func MakeAuditRef(namespace, name string) string
- type AlertRuleRepo
- func (r *AlertRuleRepo) Delete(ctx context.Context, name string) error
- func (r *AlertRuleRepo) Get(ctx context.Context, name string) (*types.AlertRule, error)
- func (r *AlertRuleRepo) List(ctx context.Context) ([]*types.AlertRule, error)
- func (r *AlertRuleRepo) Save(ctx context.Context, rule *types.AlertRule) (*types.AlertRule, error)
- type AuditFilter
- type AuditRepo
- type BaseRepo
- func (r *BaseRepo[T]) Core() store.Store
- func (r *BaseRepo[T]) Create(ctx context.Context, namespace, name string, obj *T) error
- func (r *BaseRepo[T]) CreateRef(ctx context.Context, ref string, obj *T) error
- func (r *BaseRepo[T]) Delete(ctx context.Context, namespace, name string) error
- func (r *BaseRepo[T]) DeleteRef(ctx context.Context, ref string) error
- func (r *BaseRepo[T]) Get(ctx context.Context, namespace, name string) (*T, error)
- func (r *BaseRepo[T]) GetHistory(ctx context.Context, ref string) ([]store.HistoricalVersion, error)
- func (r *BaseRepo[T]) GetRef(ctx context.Context, ref string) (*T, error)
- func (r *BaseRepo[T]) GetVersion(ctx context.Context, ref string, version string) (*T, error)
- func (r *BaseRepo[T]) List(ctx context.Context, namespace string) ([]*T, error)
- func (r *BaseRepo[T]) Update(ctx context.Context, namespace, name string, obj *T, ...) error
- func (r *BaseRepo[T]) UpdateRef(ctx context.Context, ref string, obj *T, opts ...store.UpdateOption) error
- func (r *BaseRepo[T]) Watch(ctx context.Context, namespace string) (<-chan store.WatchEvent, error)
- type ChannelRepo
- func (r *ChannelRepo) Delete(ctx context.Context, name string) error
- func (r *ChannelRepo) Get(ctx context.Context, name string) (*types.Channel, error)
- func (r *ChannelRepo) List(ctx context.Context) ([]*types.Channel, error)
- func (r *ChannelRepo) Save(ctx context.Context, c *types.Channel) (*types.Channel, error)
- type ConfigOption
- type ConfigmapRepo
- func (r *ConfigmapRepo) Create(ctx context.Context, ref string, c *types.Configmap) error
- func (r *ConfigmapRepo) Delete(ctx context.Context, namespace, name string) error
- func (r *ConfigmapRepo) Get(ctx context.Context, namespace, name string) (*types.Configmap, error)
- func (r *ConfigmapRepo) GetVersionN(ctx context.Context, namespace, name string, version int) (*types.Configmap, error)
- func (r *ConfigmapRepo) List(ctx context.Context, namespace string) ([]*types.Configmap, error)
- func (r *ConfigmapRepo) ListVersions(ctx context.Context, namespace, name string) ([]*types.Configmap, error)
- func (r *ConfigmapRepo) Rollback(ctx context.Context, namespace, name string, toVersion int, ...) (*types.Configmap, error)
- func (r *ConfigmapRepo) Update(ctx context.Context, namespace, name string, c *types.Configmap, ...) error
- type InstanceOption
- type InstanceRepo
- func (r *InstanceRepo) Core() store.Store
- func (r *InstanceRepo) CountByService(ctx context.Context, namespace, serviceID string) (int, error)
- func (r *InstanceRepo) CountByStatus(ctx context.Context, namespace string, status types.InstanceStatus) (int, error)
- func (r *InstanceRepo) Create(ctx context.Context, i *types.Instance) error
- func (r *InstanceRepo) CreateRef(ctx context.Context, ref string, i *types.Instance) error
- func (r *InstanceRepo) Delete(ctx context.Context, ref string) error
- func (r *InstanceRepo) Get(ctx context.Context, ref string) (*types.Instance, error)
- func (r *InstanceRepo) GetByInstanceID(ctx context.Context, namespace, instanceID string) (*types.Instance, error)
- func (r *InstanceRepo) GetByName(ctx context.Context, namespace, name string) (*types.Instance, error)
- func (r *InstanceRepo) GetHistory(ctx context.Context, ref string) ([]store.HistoricalVersion, error)
- func (r *InstanceRepo) GetServiceInstances(ctx context.Context, serviceID string) ([]*types.Instance, error)
- func (r *InstanceRepo) GetVersion(ctx context.Context, ref string, version string) (*types.Instance, error)
- func (r *InstanceRepo) IncrementRestartCount(ctx context.Context, ref string) error
- func (r *InstanceRepo) List(ctx context.Context, namespace string) ([]*types.Instance, error)
- func (r *InstanceRepo) ListByNode(ctx context.Context, namespace, nodeID string) ([]*types.Instance, error)
- func (r *InstanceRepo) ListByService(ctx context.Context, namespace, serviceID string) ([]*types.Instance, error)
- func (r *InstanceRepo) ListByServiceName(ctx context.Context, namespace, serviceName string) ([]*types.Instance, error)
- func (r *InstanceRepo) ListByStatus(ctx context.Context, namespace string, status types.InstanceStatus) ([]*types.Instance, error)
- func (r *InstanceRepo) ListFailed(ctx context.Context, namespace string) ([]*types.Instance, error)
- func (r *InstanceRepo) ListPending(ctx context.Context, namespace string) ([]*types.Instance, error)
- func (r *InstanceRepo) ListRunning(ctx context.Context, namespace string) ([]*types.Instance, error)
- func (r *InstanceRepo) MarkForDeletion(ctx context.Context, ref string) error
- func (r *InstanceRepo) Update(ctx context.Context, ref string, i *types.Instance, opts ...store.UpdateOption) error
- func (r *InstanceRepo) UpdateContainerID(ctx context.Context, ref string, containerID string) error
- func (r *InstanceRepo) UpdateIP(ctx context.Context, ref string, ip string) error
- func (r *InstanceRepo) UpdatePID(ctx context.Context, ref string, pid int) error
- func (r *InstanceRepo) UpdateStatus(ctx context.Context, ref string, status types.InstanceStatus, ...) error
- func (r *InstanceRepo) Watch(ctx context.Context, namespace string) (<-chan store.WatchEvent, error)
- type NamespaceOption
- type NamespaceRepo
- func (r *NamespaceRepo) BootstrapDefaultNamespaces(ctx context.Context) error
- func (r *NamespaceRepo) Create(ctx context.Context, ns *types.Namespace) error
- func (r *NamespaceRepo) CreateBuiltIns(ctx context.Context, ns *types.Namespace) error
- func (r *NamespaceRepo) Delete(ctx context.Context, name string) error
- func (r *NamespaceRepo) Exists(ctx context.Context, name string) (bool, error)
- func (r *NamespaceRepo) Get(ctx context.Context, name string) (*types.Namespace, error)
- func (r *NamespaceRepo) List(ctx context.Context) ([]*types.Namespace, error)
- func (r *NamespaceRepo) Update(ctx context.Context, ns *types.Namespace) error
- func (r *NamespaceRepo) Watch(ctx context.Context) (<-chan store.WatchEvent, error)
- type PolicyRepo
- func (r *PolicyRepo) Create(ctx context.Context, p *types.Policy) error
- func (r *PolicyRepo) Delete(ctx context.Context, name string) error
- func (r *PolicyRepo) Get(ctx context.Context, name string) (*types.Policy, error)
- func (r *PolicyRepo) List(ctx context.Context) ([]types.Policy, error)
- func (r *PolicyRepo) Update(ctx context.Context, p *types.Policy) error
- type ReleaseRepo
- func (r *ReleaseRepo) Core() store.Store
- func (r *ReleaseRepo) Create(ctx context.Context, rel *types.Release) error
- func (r *ReleaseRepo) Delete(ctx context.Context, namespace, name string) error
- func (r *ReleaseRepo) Get(ctx context.Context, ref string) (*types.Release, error)
- func (r *ReleaseRepo) GetByName(ctx context.Context, namespace, name string) (*types.Release, error)
- func (r *ReleaseRepo) GetVersion(ctx context.Context, ref, version string) (*types.Release, error)
- func (r *ReleaseRepo) History(ctx context.Context, ref string) ([]store.HistoricalVersion, error)
- func (r *ReleaseRepo) List(ctx context.Context, namespace string) ([]*types.Release, error)
- func (r *ReleaseRepo) ListAll(ctx context.Context) ([]*types.Release, error)
- func (r *ReleaseRepo) SetStatus(ctx context.Context, namespace, name string, status types.ReleaseStatus) error
- func (r *ReleaseRepo) Update(ctx context.Context, rel *types.Release, opts ...store.UpdateOption) error
- func (r *ReleaseRepo) Watch(ctx context.Context, namespace string) (<-chan store.WatchEvent, error)
- type SavedViewRepo
- func (r *SavedViewRepo) Delete(ctx context.Context, name string) error
- func (r *SavedViewRepo) Get(ctx context.Context, name string) (*types.SavedView, error)
- func (r *SavedViewRepo) List(ctx context.Context) ([]*types.SavedView, error)
- func (r *SavedViewRepo) Save(ctx context.Context, v *types.SavedView) (*types.SavedView, error)
- type SecretOption
- type SecretRepo
- func (r *SecretRepo) Create(ctx context.Context, s *types.Secret) error
- func (r *SecretRepo) CreateRef(ctx context.Context, ref string, s *types.Secret) error
- func (r *SecretRepo) Delete(ctx context.Context, namespace, name string) error
- func (r *SecretRepo) Get(ctx context.Context, namespace, name string) (*types.Secret, error)
- func (r *SecretRepo) GetVersionN(ctx context.Context, namespace, name string, version int) (*types.Secret, error)
- func (r *SecretRepo) List(ctx context.Context, namespace string) ([]*types.Secret, error)
- func (r *SecretRepo) ListVersions(ctx context.Context, namespace, name string) ([]*types.Secret, error)
- func (r *SecretRepo) Rollback(ctx context.Context, namespace, name string, toVersion int, ...) (*types.Secret, error)
- func (r *SecretRepo) Update(ctx context.Context, namespace, name string, s *types.Secret, ...) error
- type ServiceOption
- type ServiceRepo
- func (r *ServiceRepo) Core() store.Store
- func (r *ServiceRepo) Create(ctx context.Context, s *types.Service) error
- func (r *ServiceRepo) CreateRef(ctx context.Context, ref string, s *types.Service) error
- func (r *ServiceRepo) Delete(ctx context.Context, ref string) error
- func (r *ServiceRepo) Get(ctx context.Context, ref string) (*types.Service, error)
- func (r *ServiceRepo) GetByName(ctx context.Context, namespace, name string) (*types.Service, error)
- func (r *ServiceRepo) GetByServiceID(ctx context.Context, namespace, serviceID string) (*types.Service, error)
- func (r *ServiceRepo) GetDependents(ctx context.Context, ref string) ([]*types.Service, error)
- func (r *ServiceRepo) GetHistory(ctx context.Context, ref string) ([]store.HistoricalVersion, error)
- func (r *ServiceRepo) GetVersion(ctx context.Context, ref string, version string) (*types.Service, error)
- func (r *ServiceRepo) List(ctx context.Context, namespace string) ([]*types.Service, error)
- func (r *ServiceRepo) ListByLabelSelector(ctx context.Context, namespace string, selector map[string]string) ([]*types.Service, error)
- func (r *ServiceRepo) ListByStatus(ctx context.Context, namespace string, status types.ServiceStatus) ([]*types.Service, error)
- func (r *ServiceRepo) Update(ctx context.Context, ref string, s *types.Service, opts ...store.UpdateOption) error
- func (r *ServiceRepo) UpdateScale(ctx context.Context, ref string, scale int) error
- func (r *ServiceRepo) UpdateStatus(ctx context.Context, ref string, status types.ServiceStatus) error
- func (r *ServiceRepo) UpdateStatusByName(ctx context.Context, namespace, name string, status types.ServiceStatus) error
- func (r *ServiceRepo) Watch(ctx context.Context, namespace string) (<-chan store.WatchEvent, error)
- type SnapshotRepo
- func (r *SnapshotRepo) Create(ctx context.Context, s *types.Snapshot) error
- func (r *SnapshotRepo) Delete(ctx context.Context, namespace, name string) error
- func (r *SnapshotRepo) Get(ctx context.Context, namespace, name string) (*types.Snapshot, error)
- func (r *SnapshotRepo) List(ctx context.Context, namespace string) ([]*types.Snapshot, error)
- func (r *SnapshotRepo) ListAll(ctx context.Context) ([]*types.Snapshot, error)
- func (r *SnapshotRepo) Update(ctx context.Context, s *types.Snapshot, opts ...store.UpdateOption) error
- type StorageClassRepo
- func (r *StorageClassRepo) Create(ctx context.Context, sc *types.StorageClass) error
- func (r *StorageClassRepo) Delete(ctx context.Context, name string) error
- func (r *StorageClassRepo) Get(ctx context.Context, name string) (*types.StorageClass, error)
- func (r *StorageClassRepo) List(ctx context.Context) ([]*types.StorageClass, error)
- func (r *StorageClassRepo) Update(ctx context.Context, sc *types.StorageClass, opts ...store.UpdateOption) error
- type TokenRepo
- func (r *TokenRepo) Delete(ctx context.Context, id string) error
- func (r *TokenRepo) DeleteExpiredTokens(ctx context.Context, now time.Time) (int, error)
- func (r *TokenRepo) FindRefreshGrant(ctx context.Context, secret string) (*types.Token, error)
- func (r *TokenRepo) FindRefreshGrantByPrevHash(ctx context.Context, secret string) (*types.Token, error)
- func (r *TokenRepo) FindRequestBearer(ctx context.Context, secret string) (*types.Token, error)
- func (r *TokenRepo) Get(ctx context.Context, id string) (*types.Token, error)
- func (r *TokenRepo) IssueAccess(ctx context.Context, subjectID, subjectType string, ttl time.Duration) (*types.Token, string, error)
- func (r *TokenRepo) IssueRefreshGrant(ctx context.Context, name, subjectID, subjectType string, ttl time.Duration) (*types.Token, string, error)
- func (r *TokenRepo) IssueStatic(ctx context.Context, name, subjectID, subjectType string, desc string, ...) (*types.Token, string, error)
- func (r *TokenRepo) List(ctx context.Context) ([]types.Token, error)
- func (r *TokenRepo) Revoke(ctx context.Context, id string) error
- func (r *TokenRepo) RotateGrantSecret(ctx context.Context, grant *types.Token, slidingTTL time.Duration) (string, error)
- func (r *TokenRepo) Update(ctx context.Context, t *types.Token) error
- type UserRepo
- func (r *UserRepo) Create(ctx context.Context, u *types.User) (*types.User, error)
- func (r *UserRepo) Delete(ctx context.Context, id string) error
- func (r *UserRepo) Get(ctx context.Context, id string) (*types.User, error)
- func (r *UserRepo) GetByName(ctx context.Context, name string) (*types.User, error)
- func (r *UserRepo) GetByNameOrID(ctx context.Context, nameOrID string) (*types.User, error)
- func (r *UserRepo) List(ctx context.Context) ([]*types.User, error)
- func (r *UserRepo) Update(ctx context.Context, u *types.User) error
- type VolumeRepo
- func (r *VolumeRepo) Create(ctx context.Context, v *types.Volume) error
- func (r *VolumeRepo) Delete(ctx context.Context, namespace, name string) error
- func (r *VolumeRepo) Get(ctx context.Context, namespace, name string) (*types.Volume, error)
- func (r *VolumeRepo) List(ctx context.Context, namespace string) ([]*types.Volume, error)
- func (r *VolumeRepo) ListAll(ctx context.Context) ([]*types.Volume, error)
- func (r *VolumeRepo) Update(ctx context.Context, v *types.Volume, opts ...store.UpdateOption) error
Constants ¶
const TokenSecretPrefix = "rune_"
TokenSecretPrefix is the human-visible prefix on every Rune token secret. It exists so the secrets are easy to spot in the wild (logs, screenshots, terraform output, leaked configs) and so that secret scanners (gitleaks, GitHub secret scanning, etc.) can match on a stable, distinctive marker. The prefix is mandatory: tokens presented without it are rejected at validation time.
Variables ¶
This section is empty.
Functions ¶
func HashSecret ¶
HashSecret exposes the canonical secret hashing used for token storage so callers outside this package (e.g. the refresh manager) can match a presented secret against stored hashes without re-implementing it.
func MakeAuditRef ¶
MakeRef returns the canonical "<namespace>/<name>" string used as ResourceRef in audit events. Returns just the name when namespace is empty.
Types ¶
type AlertRuleRepo ¶
type AlertRuleRepo struct {
// contains filtered or unexported fields
}
AlertRuleRepo persists RuneSight alert rules.
func NewAlertRuleRepo ¶
func NewAlertRuleRepo(core store.Store) *AlertRuleRepo
func (*AlertRuleRepo) Delete ¶
func (r *AlertRuleRepo) Delete(ctx context.Context, name string) error
type AuditFilter ¶
type AuditFilter struct {
Resource string // exact match on Resource
ResourceRef string // exact match on ResourceRef ("ns/name")
Namespace string // exact match on Namespace
Actor string // exact match on Actor
Action string // exact match on Action
Since time.Time // events with Timestamp >= Since
Until time.Time // events with Timestamp < Until (zero = no bound)
}
AuditFilter narrows a List query. Zero-value fields are ignored.
type AuditRepo ¶
type AuditRepo struct {
// contains filtered or unexported fields
}
AuditRepo provides append-only persistence and query access for audit events.
Events are stored under the reserved namespace "system" with names of the form "<rfc3339nano-ts>-<uuid>" so that the natural list order from the underlying store is roughly chronological. The id field on the event is the authoritative identifier; the storage name is an implementation detail.
func NewAuditRepo ¶
NewAuditRepo constructs an audit repository backed by the given store.
func (*AuditRepo) Append ¶
Append persists an audit event. ID and Timestamp are populated if unset. Append never errors out the caller's request path on failure; callers should log the error and continue. Returning the error here lets callers decide.
func (*AuditRepo) List ¶
func (r *AuditRepo) List(ctx context.Context, f AuditFilter, limit int) ([]*types.AuditEvent, error)
List returns audit events matching the filter, newest first, capped at limit. A limit of 0 or less applies a default cap of 200.
type BaseRepo ¶
type BaseRepo[T any] struct { // contains filtered or unexported fields }
BaseRepo provides common CRUD over the core store for a specific resource type. T is the typed payload struct (e.g., *types.Service, *types.Secret).
func NewBaseRepo ¶
func (*BaseRepo[T]) GetHistory ¶
func (*BaseRepo[T]) GetVersion ¶
type ChannelRepo ¶
type ChannelRepo struct {
// contains filtered or unexported fields
}
ChannelRepo persists notification channels.
func NewChannelRepo ¶
func NewChannelRepo(core store.Store) *ChannelRepo
type ConfigOption ¶
type ConfigOption func(*ConfigmapRepo)
func WithConfigLimits ¶
func WithConfigLimits(limits store.Limits) ConfigOption
type ConfigmapRepo ¶
type ConfigmapRepo struct {
// contains filtered or unexported fields
}
func NewConfigRepo ¶
func NewConfigRepo(core store.Store, opts ...ConfigOption) *ConfigmapRepo
func (*ConfigmapRepo) Delete ¶
func (r *ConfigmapRepo) Delete(ctx context.Context, namespace, name string) error
func (*ConfigmapRepo) GetVersionN ¶
func (r *ConfigmapRepo) GetVersionN(ctx context.Context, namespace, name string, version int) (*types.Configmap, error)
GetVersionN returns a specific historical version by its user-facing integer Version (not the opaque store version ID).
func (*ConfigmapRepo) ListVersions ¶
func (r *ConfigmapRepo) ListVersions(ctx context.Context, namespace, name string) ([]*types.Configmap, error)
ListVersions returns every historical version of a configmap, newest first. The core store keeps each Update as a distinct version row (the same machinery that backs `rune secret versions`), so this just reads that history — configmaps are plaintext, so no decryption is involved.
type InstanceOption ¶
type InstanceOption func(*InstanceRepo)
type InstanceRepo ¶
type InstanceRepo struct {
// contains filtered or unexported fields
}
func NewInstanceRepo ¶
func NewInstanceRepo(core store.Store, opts ...InstanceOption) *InstanceRepo
func (*InstanceRepo) Core ¶
func (r *InstanceRepo) Core() store.Store
Core returns the underlying store
func (*InstanceRepo) CountByService ¶
func (r *InstanceRepo) CountByService(ctx context.Context, namespace, serviceID string) (int, error)
CountByService returns the count of instances for a specific service
func (*InstanceRepo) CountByStatus ¶
func (r *InstanceRepo) CountByStatus(ctx context.Context, namespace string, status types.InstanceStatus) (int, error)
CountByStatus returns the count of instances with a specific status
func (*InstanceRepo) GetByInstanceID ¶
func (r *InstanceRepo) GetByInstanceID(ctx context.Context, namespace, instanceID string) (*types.Instance, error)
GetByInstanceID retrieves an instance by its ID (not name)
func (*InstanceRepo) GetByName ¶
func (r *InstanceRepo) GetByName(ctx context.Context, namespace, name string) (*types.Instance, error)
GetByName retrieves an instance by name and namespace
func (*InstanceRepo) GetHistory ¶
func (r *InstanceRepo) GetHistory(ctx context.Context, ref string) ([]store.HistoricalVersion, error)
GetHistory returns version history for an instance
func (*InstanceRepo) GetServiceInstances ¶
func (r *InstanceRepo) GetServiceInstances(ctx context.Context, serviceID string) ([]*types.Instance, error)
GetServiceInstances returns all instances for a service across all namespaces
func (*InstanceRepo) GetVersion ¶
func (r *InstanceRepo) GetVersion(ctx context.Context, ref string, version string) (*types.Instance, error)
GetVersion returns a specific version of an instance
func (*InstanceRepo) IncrementRestartCount ¶
func (r *InstanceRepo) IncrementRestartCount(ctx context.Context, ref string) error
IncrementRestartCount increments the restart count for an instance
func (*InstanceRepo) ListByNode ¶
func (r *InstanceRepo) ListByNode(ctx context.Context, namespace, nodeID string) ([]*types.Instance, error)
ListByNode returns all instances running on a specific node
func (*InstanceRepo) ListByService ¶
func (r *InstanceRepo) ListByService(ctx context.Context, namespace, serviceID string) ([]*types.Instance, error)
ListByService returns all instances belonging to a specific service
func (*InstanceRepo) ListByServiceName ¶
func (r *InstanceRepo) ListByServiceName(ctx context.Context, namespace, serviceName string) ([]*types.Instance, error)
ListByServiceName returns all instances belonging to a service by name
func (*InstanceRepo) ListByStatus ¶
func (r *InstanceRepo) ListByStatus(ctx context.Context, namespace string, status types.InstanceStatus) ([]*types.Instance, error)
ListByStatus returns instances with the given status
func (*InstanceRepo) ListFailed ¶
ListFailed returns all failed instances in a namespace
func (*InstanceRepo) ListPending ¶
func (r *InstanceRepo) ListPending(ctx context.Context, namespace string) ([]*types.Instance, error)
ListPending returns all pending instances in a namespace
func (*InstanceRepo) ListRunning ¶
func (r *InstanceRepo) ListRunning(ctx context.Context, namespace string) ([]*types.Instance, error)
ListRunning returns all running instances in a namespace
func (*InstanceRepo) MarkForDeletion ¶
func (r *InstanceRepo) MarkForDeletion(ctx context.Context, ref string) error
MarkForDeletion marks an instance for deletion
func (*InstanceRepo) Update ¶
func (r *InstanceRepo) Update(ctx context.Context, ref string, i *types.Instance, opts ...store.UpdateOption) error
func (*InstanceRepo) UpdateContainerID ¶
UpdateContainerID updates only the container ID of an instance
func (*InstanceRepo) UpdateStatus ¶
func (r *InstanceRepo) UpdateStatus(ctx context.Context, ref string, status types.InstanceStatus, statusMessage string) error
UpdateStatus updates only the status of an instance
func (*InstanceRepo) Watch ¶
func (r *InstanceRepo) Watch(ctx context.Context, namespace string) (<-chan store.WatchEvent, error)
Watch proxies to the base store
type NamespaceOption ¶
type NamespaceOption func(*NamespaceRepo)
type NamespaceRepo ¶
type NamespaceRepo struct {
// contains filtered or unexported fields
}
func NewNamespaceRepo ¶
func NewNamespaceRepo(core store.Store, opts ...NamespaceOption) *NamespaceRepo
func (*NamespaceRepo) BootstrapDefaultNamespaces ¶
func (r *NamespaceRepo) BootstrapDefaultNamespaces(ctx context.Context) error
BootstrapDefaultNamespaces creates the default and system namespaces if they don't exist
func (*NamespaceRepo) CreateBuiltIns ¶
CreateBuiltIns creates a new namespace
func (*NamespaceRepo) Delete ¶
func (r *NamespaceRepo) Delete(ctx context.Context, name string) error
Delete removes a namespace
func (*NamespaceRepo) Watch ¶
func (r *NamespaceRepo) Watch(ctx context.Context) (<-chan store.WatchEvent, error)
Watch watches for namespace changes
type PolicyRepo ¶
type PolicyRepo struct {
// contains filtered or unexported fields
}
func NewPolicyRepo ¶
func NewPolicyRepo(st store.Store) *PolicyRepo
type ReleaseRepo ¶
type ReleaseRepo struct {
// contains filtered or unexported fields
}
ReleaseRepo persists stateful runeset releases (RUNESET_STATEFUL_RELEASES.md). A release is the tracked, revisioned record of what a `rune cast` installed.
func NewReleaseRepo ¶
func NewReleaseRepo(core store.Store) *ReleaseRepo
func (*ReleaseRepo) Core ¶
func (r *ReleaseRepo) Core() store.Store
Core returns the underlying store.
func (*ReleaseRepo) Create ¶
Create persists a new release record. Callers (the cast reconcile loop) supply Name/Namespace and the planned Owns set; this sets timestamps and sensible defaults.
func (*ReleaseRepo) Delete ¶
func (r *ReleaseRepo) Delete(ctx context.Context, namespace, name string) error
Delete hard-removes the release record (used by `--purge`; soft uninstall instead sets Status=uninstalled via SetStatus — Decision D4).
func (*ReleaseRepo) Get ¶
Get retrieves a release by resource ref (e.g. "release:name.namespace.rune").
func (*ReleaseRepo) GetByName ¶
func (r *ReleaseRepo) GetByName(ctx context.Context, namespace, name string) (*types.Release, error)
GetByName retrieves a release by name within a namespace.
func (*ReleaseRepo) GetVersion ¶
GetVersion returns a specific historical revision of a release.
func (*ReleaseRepo) History ¶
func (r *ReleaseRepo) History(ctx context.Context, ref string) ([]store.HistoricalVersion, error)
History returns the revision history of a release for rollback/diff.
func (*ReleaseRepo) ListAll ¶
ListAll returns releases across all namespaces (for `rune release list`).
func (*ReleaseRepo) SetStatus ¶
func (r *ReleaseRepo) SetStatus(ctx context.Context, namespace, name string, status types.ReleaseStatus) error
SetStatus updates only the status of a release.
func (*ReleaseRepo) Update ¶
func (r *ReleaseRepo) Update(ctx context.Context, rel *types.Release, opts ...store.UpdateOption) error
Update persists changes to an existing release, refreshing UpdatedAt. Revision is owned by the reconcile loop, not bumped here.
func (*ReleaseRepo) Watch ¶
func (r *ReleaseRepo) Watch(ctx context.Context, namespace string) (<-chan store.WatchEvent, error)
Watch proxies to the base store.
type SavedViewRepo ¶
type SavedViewRepo struct {
// contains filtered or unexported fields
}
SavedViewRepo persists RuneSight saved views (named Log Explorer queries).
func NewSavedViewRepo ¶
func NewSavedViewRepo(core store.Store) *SavedViewRepo
func (*SavedViewRepo) Delete ¶
func (r *SavedViewRepo) Delete(ctx context.Context, name string) error
func (*SavedViewRepo) List ¶
List returns every saved view, pinned first, then newest-updated first.
type SecretOption ¶
type SecretOption func(*SecretRepo)
func WithKEKBytes ¶
func WithKEKBytes(key []byte) SecretOption
func WithKEKOptions ¶
func WithKEKOptions(opts *crypto.KEKOptions) SecretOption
func WithSecretLimits ¶
func WithSecretLimits(limits store.Limits) SecretOption
type SecretRepo ¶
type SecretRepo struct {
// contains filtered or unexported fields
}
func NewSecretRepo ¶
func NewSecretRepo(core store.Store, opts ...SecretOption) *SecretRepo
func (*SecretRepo) Delete ¶
func (r *SecretRepo) Delete(ctx context.Context, namespace, name string) error
func (*SecretRepo) GetVersionN ¶
func (r *SecretRepo) GetVersionN(ctx context.Context, namespace, name string, version int) (*types.Secret, error)
GetVersionN returns a specific historical version of a secret. The version numbers are the monotonically-increasing user-facing integers carried on types.Secret.Version, NOT the opaque store version IDs.
func (*SecretRepo) ListVersions ¶
func (r *SecretRepo) ListVersions(ctx context.Context, namespace, name string) ([]*types.Secret, error)
ListVersions returns every historical version of a secret, decrypted, in descending Version order. Useful for `rune secret versions`.
The underlying store keeps every Update as a distinct version row so this includes plaintext data for each one — callers must therefore gate access behind the secrets:reveal verb if they expose Data downstream.
func (*SecretRepo) Rollback ¶
func (r *SecretRepo) Rollback(ctx context.Context, namespace, name string, toVersion int, opts ...store.UpdateOption) (*types.Secret, error)
Rollback rewrites the secret to the contents of a prior version, producing a NEW version (head+1). The old versions are retained in history. Returns the freshly-written secret on success.
type ServiceOption ¶
type ServiceOption func(*ServiceRepo)
type ServiceRepo ¶
type ServiceRepo struct {
// contains filtered or unexported fields
}
func NewServiceRepo ¶
func NewServiceRepo(core store.Store, opts ...ServiceOption) *ServiceRepo
func (*ServiceRepo) Core ¶
func (r *ServiceRepo) Core() store.Store
Core returns the underlying store
func (*ServiceRepo) GetByName ¶
func (r *ServiceRepo) GetByName(ctx context.Context, namespace, name string) (*types.Service, error)
GetByName retrieves a service by name and namespace
func (*ServiceRepo) GetByServiceID ¶
func (r *ServiceRepo) GetByServiceID(ctx context.Context, namespace, serviceID string) (*types.Service, error)
GetByServiceID retrieves a service by its ID (not name)
func (*ServiceRepo) GetDependents ¶
GetDependents returns all services that depend on the given service
func (*ServiceRepo) GetHistory ¶
func (r *ServiceRepo) GetHistory(ctx context.Context, ref string) ([]store.HistoricalVersion, error)
GetHistory returns version history for a service
func (*ServiceRepo) GetVersion ¶
func (r *ServiceRepo) GetVersion(ctx context.Context, ref string, version string) (*types.Service, error)
GetVersion returns a specific version of a service
func (*ServiceRepo) ListByLabelSelector ¶
func (r *ServiceRepo) ListByLabelSelector(ctx context.Context, namespace string, selector map[string]string) ([]*types.Service, error)
ListByLabelSelector returns services matching the given label selector
func (*ServiceRepo) ListByStatus ¶
func (r *ServiceRepo) ListByStatus(ctx context.Context, namespace string, status types.ServiceStatus) ([]*types.Service, error)
ListByStatus returns services with the given status
func (*ServiceRepo) Update ¶
func (r *ServiceRepo) Update(ctx context.Context, ref string, s *types.Service, opts ...store.UpdateOption) error
func (*ServiceRepo) UpdateScale ¶
UpdateScale updates only the scale of a service
func (*ServiceRepo) UpdateStatus ¶
func (r *ServiceRepo) UpdateStatus(ctx context.Context, ref string, status types.ServiceStatus) error
UpdateStatus updates only the status of a service
func (*ServiceRepo) UpdateStatusByName ¶
func (r *ServiceRepo) UpdateStatusByName(ctx context.Context, namespace, name string, status types.ServiceStatus) error
UpdateStatusByName updates only the status of a service by name and namespace
func (*ServiceRepo) Watch ¶
func (r *ServiceRepo) Watch(ctx context.Context, namespace string) (<-chan store.WatchEvent, error)
Watch proxies to the base store
type SnapshotRepo ¶
type SnapshotRepo struct {
// contains filtered or unexported fields
}
SnapshotRepo provides CRUD over Snapshot resources.
func NewSnapshotRepo ¶
func NewSnapshotRepo(core store.Store) *SnapshotRepo
NewSnapshotRepo constructs a SnapshotRepo.
func (*SnapshotRepo) Create ¶
Create writes a new Snapshot row, populating ID, timestamps, and a default Pending phase if the caller did not supply one.
func (*SnapshotRepo) Delete ¶
func (r *SnapshotRepo) Delete(ctx context.Context, namespace, name string) error
Delete removes a Snapshot row. The orchestrator's SnapshotController watches for the resulting DELETED event and runs the per-driver reclaim path.
func (*SnapshotRepo) ListAll ¶
ListAll returns every Snapshot across every namespace. Mirrors VolumeRepo.ListAll: enumerates via NamespaceRepo + per-namespace List so it works on backends that don't support cross-namespace listing.
func (*SnapshotRepo) Update ¶
func (r *SnapshotRepo) Update(ctx context.Context, s *types.Snapshot, opts ...store.UpdateOption) error
Update writes an updated Snapshot, preserving CreatedAt/ID and refreshing UpdatedAt.
type StorageClassRepo ¶
type StorageClassRepo struct {
// contains filtered or unexported fields
}
StorageClassRepo provides CRUD over StorageClass resources.
func NewStorageClassRepo ¶
func NewStorageClassRepo(core store.Store) *StorageClassRepo
NewStorageClassRepo constructs a StorageClassRepo.
func (*StorageClassRepo) Create ¶
func (r *StorageClassRepo) Create(ctx context.Context, sc *types.StorageClass) error
Create writes a new StorageClass row, populating ID and timestamps.
func (*StorageClassRepo) Delete ¶
func (r *StorageClassRepo) Delete(ctx context.Context, name string) error
Delete removes a StorageClass.
func (*StorageClassRepo) Get ¶
func (r *StorageClassRepo) Get(ctx context.Context, name string) (*types.StorageClass, error)
Get retrieves a StorageClass by name.
func (*StorageClassRepo) List ¶
func (r *StorageClassRepo) List(ctx context.Context) ([]*types.StorageClass, error)
List returns every StorageClass.
func (*StorageClassRepo) Update ¶
func (r *StorageClassRepo) Update(ctx context.Context, sc *types.StorageClass, opts ...store.UpdateOption) error
Update writes an updated StorageClass, refreshing UpdatedAt and preserving CreatedAt from the existing row.
type TokenRepo ¶
type TokenRepo struct {
// contains filtered or unexported fields
}
func NewTokenRepo ¶
func (*TokenRepo) DeleteExpiredTokens ¶
DeleteExpiredTokens evicts any token whose expiry has passed as of `now`, regardless of kind (short-lived access tokens, unused refresh grants that were never rotated forward, and static tokens issued with a TTL). Tokens with no expiry (ExpiresAt == nil) are kept. Returns the number deleted. Revoked rows are intentionally retained for audit (`token list` shows revoked=true).
func (*TokenRepo) FindRefreshGrant ¶
FindRefreshGrant validates a token presented to the refresh endpoint. It requires refresh-kind; anything else (access/static) is rejected.
func (*TokenRepo) FindRefreshGrantByPrevHash ¶
func (r *TokenRepo) FindRefreshGrantByPrevHash(ctx context.Context, secret string) (*types.Token, error)
FindRefreshGrantByPrevHash finds a (non-revoked) refresh grant whose PrevSecretHash matches h. Used to detect genuinely stale reuse of an already-rotated refresh secret — i.e. theft, past the grace window.
func (*TokenRepo) FindRequestBearer ¶
FindRequestBearer validates a token presented as a request bearer. It rejects refresh-kind tokens — they are never valid bearers (RUNE-201). All request-authentication paths (gRPC authFunc, dashboard ui middleware, exec WS, WhoAmI) MUST use this, never lookupBySecret directly.
func (*TokenRepo) IssueAccess ¶
func (r *TokenRepo) IssueAccess(ctx context.Context, subjectID, subjectType string, ttl time.Duration) (*types.Token, string, error)
IssueAccess mints a short-lived access token (RUNE-201). Accepted as a request bearer; expires after ttl.
func (*TokenRepo) IssueRefreshGrant ¶
func (r *TokenRepo) IssueRefreshGrant(ctx context.Context, name, subjectID, subjectType string, ttl time.Duration) (*types.Token, string, error)
IssueRefreshGrant mints a long-lived refresh grant (RUNE-201). It is NEVER a valid request bearer — only the refresh endpoint accepts it. ttl is the sliding idle window; 0 means no expiry (discouraged for humans).
func (*TokenRepo) IssueStatic ¶
func (r *TokenRepo) IssueStatic(ctx context.Context, name, subjectID, subjectType string, desc string, ttl time.Duration) (*types.Token, string, error)
IssueStatic creates a new long-lived (static) token with a freshly generated secret. Returns the plaintext secret once. Static tokens are full bearers and are not subject to RUNE-201 refresh; service accounts, CI (`cast`), and the bootstrap/break-glass root token use this path.
func (*TokenRepo) RotateGrantSecret ¶
func (r *TokenRepo) RotateGrantSecret(ctx context.Context, grant *types.Token, slidingTTL time.Duration) (string, error)
RotateGrantSecret mints a fresh secret for an existing refresh grant: the current secret hash is preserved as PrevSecretHash (for post-grace theft detection), the new hash is stored, LastUsedAt is stamped, and the sliding idle expiry is extended by slidingTTL (0 = leave expiry unchanged). Returns the new plaintext secret once.
type UserRepo ¶
type UserRepo struct {
// contains filtered or unexported fields
}
func NewUserRepo ¶
func (*UserRepo) GetByNameOrID ¶
type VolumeRepo ¶
type VolumeRepo struct {
// contains filtered or unexported fields
}
VolumeRepo provides CRUD over Volume resources.
func NewVolumeRepo ¶
func NewVolumeRepo(core store.Store) *VolumeRepo
NewVolumeRepo constructs a VolumeRepo.
func (*VolumeRepo) Create ¶
Create writes a new Volume row, populating ID, timestamps, and a default Pending status if the caller did not supply one.
func (*VolumeRepo) Delete ¶
func (r *VolumeRepo) Delete(ctx context.Context, namespace, name string) error
Delete removes a Volume row. The orchestrator's VolumeController watches for the resulting DELETED event and runs the per-driver reclaim path.
func (*VolumeRepo) ListAll ¶
ListAll returns every Volume across every namespace. This is the cross-namespace projection used by cluster-scoped operations like the StorageClass cascade-delete safety check.
We deliberately enumerate via NamespaceRepo + per-namespace List rather than the underlying store.ListAll, because the in-memory test stores do not implement true cross-namespace listing — they treat the empty namespace as a literal key. Going through the namespace list keeps this correct on every backend.
func (*VolumeRepo) Update ¶
func (r *VolumeRepo) Update(ctx context.Context, v *types.Volume, opts ...store.UpdateOption) error
Update writes an updated Volume, preserving CreatedAt/ID and refreshing UpdatedAt.