postgres

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: Apache-2.0 Imports: 42 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrGraphPrecondition     = errors.New("graph generation or indexed commit changed")
	ErrGraphProviderConflict = errors.New("graph provider change requires explicit replacement")
	// ErrGraphRepositoryUnavailable means the repository is disabled, archived
	// or belongs to an inactive installation, so no generation can be published.
	ErrGraphRepositoryUnavailable = errors.New("repository is unavailable for graph publication")
)
View Source
var (
	ErrInvalidSecurityPrincipal = errors.New("invalid security principal")
	ErrInvalidAuditLimit        = errors.New("invalid audit limit")
)
View Source
var ErrLeaseLost = errors.New("index job lease lost")
View Source
var ErrNoJob = errors.New("no index job available")
View Source
var ErrSupplyChainFenced = supplychain.ErrFenced

ErrSupplyChainFenced is supplychain.ErrFenced: a publication or completion lost its lease and nothing was written.

Functions

func Migrate

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

func Open

func Open(ctx context.Context, dsn string) (*pgxpool.Pool, error)

Types

type Delivery

type Delivery struct {
	ID, Event, State, ErrorCode  string
	InstallationID, RepositoryID *int64
}

type DeliveryTx

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

func (*DeliveryTx) DisableInstallation

func (tx *DeliveryTx) DisableInstallation(ctx context.Context, githubID int64, status string) error

func (*DeliveryTx) DisableRepository

func (tx *DeliveryTx) DisableRepository(ctx context.Context, githubID int64, errorCode string) error

func (*DeliveryTx) EnqueueIndex

func (tx *DeliveryTx) EnqueueIndex(ctx context.Context, request IndexRequest) error

func (*DeliveryTx) RenameRepository

func (tx *DeliveryTx) RenameRepository(ctx context.Context, githubID int64, owner, name, cloneURL, webURL string) error

func (*DeliveryTx) RepositoryForPush

func (tx *DeliveryTx) RepositoryForPush(ctx context.Context, installationID, githubID int64) (repository.Repository, error)

func (*DeliveryTx) UpdateRepositorySize

func (tx *DeliveryTx) UpdateRepositorySize(ctx context.Context, repositoryID, sizeBytes int64) error

type EnrichmentStatus

type EnrichmentStatus struct {
	Artifact  *graphartifact.Artifact
	ErrorCode string
}

type GraphJob

type GraphJob struct {
	ID, RepositoryID     int64
	TargetSHA            string
	State, LeaseOwner    string
	Attempt, MaxAttempts int
	LeaseExpiresAt       time.Time
}

type GraphPublication

type GraphPublication struct {
	Publisher           string
	Capabilities        []string
	ExpectedActiveID    int64
	AllowProviderChange bool
}

GraphPublication is trusted publication context, separate from producer facts. Zero ExpectedActiveID means no active generation, not an unconditional write. Callers authorize the publisher first; see graphingest.Service.Publish.

type GraphReplacement

type GraphReplacement struct {
	Upload       GraphUpload
	Applied      bool
	Deduplicated bool
	ReplacedID   int64
}

type GraphSource

type GraphSource string
const (
	GraphSourceManaged  GraphSource = "managed"
	GraphSourceExternal GraphSource = "external"
	GraphSourceSCIP     GraphSource = "scip"
)

type GraphUpload

type GraphUpload struct {
	ID, RepositoryID                    int64
	Commit                              string
	SchemaVersion, NodeCount, EdgeCount int
	Source                              GraphSource
}

type IndexJob

type IndexJob struct {
	ID, RepositoryID             int64
	TargetSHA, TargetRef, Reason string
	State, LeaseOwner            string
	Attempt, Priority            int
	MaxAttempts                  int
	LeaseExpiresAt               time.Time
}

type IndexRequest

type IndexRequest struct {
	RepositoryID                 int64
	TargetSHA, TargetRef, Reason string
	Priority, MaxAttempts        int
}

type InstallationUpdate

type InstallationUpdate struct {
	GitHubID                          int64
	AccountLogin, AccountType, Status string
	SuspendedAt                       *time.Time
}

type RepositoryUpdate

type RepositoryUpdate struct {
	GitHubID, InstallationID      int64
	SizeBytes                     int64
	Owner, Name, CloneURL, WebURL string
	DefaultBranch                 string
	Private, Archived, Enabled    bool
}

type Store

type Store struct {

	// Logger receives one record when a SCIP upload lands without its derived
	// v2 generation (see ReplaceSCIP); nil discards it.
	Logger *slog.Logger
	// contains filtered or unexported fields
}

func New

func New(pool *pgxpool.Pool) *Store

func (*Store) APIPrincipal

func (s *Store) APIPrincipal(ctx context.Context, tokenHash [32]byte, now time.Time) (authn.Principal, error)

func (*Store) ActiveGraphGeneration added in v0.7.0

func (s *Store) ActiveGraphGeneration(ctx context.Context, repositoryID int64) (*api.GraphActiveGeneration, error)

ActiveGraphGeneration describes the repository's active published v2 generation: the value a publisher names as its expected generation. It returns nil when none is active; the SCIP-derived generation is a separate slot (see ActiveGraphGenerations) and the v1 generation is reported by GraphStatus.

func (*Store) ActiveGraphGenerations added in v0.10.0

func (s *Store) ActiveGraphGenerations(ctx context.Context, repositoryID int64) ([]api.GraphActiveGeneration, error)

ActiveGraphGenerations returns every active v2 generation, the published one first and the SCIP-derived one second.

func (*Store) ActiveGraphJobIDs

func (s *Store) ActiveGraphJobIDs(ctx context.Context) (map[int64]struct{}, error)

func (*Store) ActiveJobIDs

func (s *Store) ActiveJobIDs(ctx context.Context) (map[int64]struct{}, error)

func (*Store) ActivePolicy added in v0.6.0

func (s *Store) ActivePolicy(ctx context.Context) (policy.Policy, error)

ActivePolicy returns the active policy or policy.ErrNoPolicy.

func (*Store) ActiveRepository added in v0.5.0

func (s *Store) ActiveRepository(ctx context.Context, repositoryID int64) (bool, error)

ActiveRepository reports whether repositoryID (a GitHub repository ID) is enabled, not archived, and belongs to an active installation. It applies no principal ceiling: the delegation-only path uses it to validate each requested repository, since such a principal has no ceiling of its own.

func (*Store) AdminDeliveries

func (s *Store) AdminDeliveries(ctx context.Context, installationID int64, repositoryIDs []int64, limit int) ([]admin.Delivery, bool, error)

func (*Store) AdminGitHub

func (s *Store) AdminGitHub(ctx context.Context, installationID int64, repositoryIDs []int64, c admin.GitHubConfig, limit int) (admin.GitHub, error)

func (*Store) AdminGroup

func (s *Store) AdminGroup(ctx context.Context, id int64) (admin.Group, error)

func (*Store) AdminGroups

func (s *Store) AdminGroups(ctx context.Context, limit int) ([]admin.Group, bool, error)

func (*Store) AdminJobs

func (s *Store) AdminJobs(ctx context.Context, installationID int64, repositoryIDs []int64, limit int, cursor *admin.JobCursor) ([]admin.Job, bool, error)

func (*Store) AdminOverview

func (s *Store) AdminOverview(ctx context.Context, installationID int64, repositoryIDs []int64) (admin.Overview, error)

func (*Store) AdminRepositories

func (s *Store) AdminRepositories(ctx context.Context, installationID int64, repositoryIDs []int64, limit int, cursor *admin.RepositoryCursor) ([]admin.Repository, bool, error)

AdminRepositories returns one page ordered by full name. The cursor is the last full name of the previous page; the keyset comparison keeps pages stable while repositories are added or renamed between requests.

func (*Store) AdminRepository

func (s *Store) AdminRepository(ctx context.Context, installationID int64, repositoryIDs []int64, githubID int64) (repository.Repository, error)

func (*Store) AdminSCIPDependencies

func (s *Store) AdminSCIPDependencies(ctx context.Context, installationID int64, repositoryIDs []int64, limit int) ([]admin.SCIPDependency, bool, error)

func (*Store) AdminSCIPUploads

func (s *Store) AdminSCIPUploads(ctx context.Context, installationID int64, repositoryIDs []int64, limit int) ([]admin.SCIPUpload, bool, error)

func (*Store) AdminUser

func (s *Store) AdminUser(ctx context.Context, id int64) (admin.User, error)

func (*Store) AdminUsers

func (s *Store) AdminUsers(ctx context.Context, limit int) ([]admin.User, bool, error)

func (*Store) AggregateStats

func (s *Store) AggregateStats(ctx context.Context, snapshot graphquery.QuerySnapshot) (graphprotocol.GraphStats, error)

func (*Store) AllAuthorizedRepositories

func (s *Store) AllAuthorizedRepositories(ctx context.Context, names []string) ([]repository.Repository, error)

func (*Store) AllowOAuthRequest

func (s *Store) AllowOAuthRequest(ctx context.Context, remoteAddr, endpoint string, now time.Time) (bool, error)

AllowOAuthRequest shares fixed-minute budgets across every server instance. Only the socket peer's canonical IP contributes to the source budget.

func (*Store) AnyAuthorizedRepository

func (s *Store) AnyAuthorizedRepository(ctx context.Context, repositoryID int64) (repository.Repository, error)

func (*Store) AppendAudit

func (s *Store) AppendAudit(ctx context.Context, event audit.Event) error

func (*Store) ApplyDelivery

func (s *Store) ApplyDelivery(ctx context.Context, delivery Delivery, callback func(context.Context, *DeliveryTx) error) (bool, error)

func (*Store) AuditEvents

func (s *Store) AuditEvents(ctx context.Context, limit int) ([]audit.Event, bool, error)

func (*Store) AuthorizedRepositories

func (s *Store) AuthorizedRepositories(ctx context.Context, installationID int64, repositoryIDs []int64, names []string) ([]repository.Repository, error)

func (*Store) AuthorizedRepository

func (s *Store) AuthorizedRepository(ctx context.Context, installationID int64, repositoryIDs []int64, repositoryID int64) (repository.Repository, error)

func (*Store) BindFederatedUser

func (s *Store) BindFederatedUser(ctx context.Context, issuer, subject, externalID string) (int64, error)

func (*Store) CancelSupplyChainJob added in v0.6.0

func (s *Store) CancelSupplyChainJob(ctx context.Context, id int64) (bool, error)

CancelSupplyChainJob cancels a queued or running job. A running job's worker learns of it when it next renews or publishes.

func (*Store) ClaimEnrichment added in v0.6.0

func (s *Store) ClaimEnrichment(ctx context.Context, owner string) (license.Job, error)

func (*Store) ClaimGraph

func (s *Store) ClaimGraph(ctx context.Context, owner string) (GraphJob, error)

func (*Store) ClaimIndex

func (s *Store) ClaimIndex(ctx context.Context, owner string) (IndexJob, error)

func (*Store) ClaimSupplyChainJob added in v0.6.0

func (s *Store) ClaimSupplyChainJob(ctx context.Context, owner string) (supplychain.Job, error)

ClaimSupplyChainJob leases the next runnable job. Repositories that are disabled, archived, in inactive installations, or opted out are skipped: their queued jobs are superseded instead of run.

func (*Store) ClearLoginFailures

func (s *Store) ClearLoginFailures(ctx context.Context, accountKey, sourceKey [32]byte) error

func (*Store) CompleteEnrichment added in v0.6.0

func (s *Store) CompleteEnrichment(ctx context.Context, id int64, owner string, fence int64, outcome license.Outcome, errorCode string) error

CompleteEnrichment finishes a leased job. Unavailable outcomes retry with backoff up to max_attempts; everything else is terminal (the evidence row records what happened).

func (*Store) CompleteGraph

func (s *Store) CompleteGraph(ctx context.Context, id int64, owner string, artifact graphartifact.Artifact) error

func (*Store) CompleteIndex

func (s *Store) CompleteIndex(ctx context.Context, id int64, owner string, enrichment ...EnrichmentStatus) error

func (*Store) ComponentDeclarations added in v0.6.0

func (s *Store) ComponentDeclarations(ctx context.Context, componentID int64) (*string, *string, error)

ComponentDeclarations returns the producer's raw declared and concluded values for one occurrence.

func (*Store) ComponentsForCoordinates added in v0.6.0

func (s *Store) ComponentsForCoordinates(ctx context.Context, coordinates license.Coordinates, limit int) ([][2]int64, error)

ComponentsForCoordinates returns (component_id, snapshot_id) of occurrences in every stream's latest snapshot that carry the exact coordinates.

func (*Store) ComponentsNeedingEvaluation added in v0.6.0

func (s *Store) ComponentsNeedingEvaluation(ctx context.Context, policyID int64, limit int) ([]review.EvaluationTarget, error)

ComponentsForPolicyEvaluation lists latest-stream components (with their assessments) for the authorized repositories that lack a current result for the given policy or whose result fingerprint differs from the assessment fingerprint. Bounded.

func (*Store) ConclusionHistory added in v0.6.0

func (s *Store) ConclusionHistory(ctx context.Context, coordinates license.Coordinates, limit int) ([]review.Conclusion, error)

ConclusionHistory lists conclusions for coordinates, newest first.

func (*Store) ConsumeLoginAttempt

func (s *Store) ConsumeLoginAttempt(ctx context.Context, key [32]byte, now time.Time) (bool, time.Time, error)

func (*Store) ConsumeLoginFlow

func (s *Store) ConsumeLoginFlow(ctx context.Context, stateHash, browserHash [32]byte, provider string, now time.Time) (authn.LoginFlow, error)

func (*Store) CountFiles

func (s *Store) CountFiles(ctx context.Context, q graphquery.FileQuery) (int64, error)

CountFiles aggregates only the same selected immutable uploads and filters as the bounded page. It never loads file payloads or whole artifacts.

func (*Store) CountGeneratedFiles

func (s *Store) CountGeneratedFiles(ctx context.Context, snapshots []graphquery.QuerySnapshot) (generated, total int64, err error)

func (*Store) CountHierarchyChildren added in v0.6.1

func (s *Store) CountHierarchyChildren(ctx context.Context, q graphquery.HierarchyCountQuery) (graphquery.HierarchyCount, error)

func (*Store) CreateAPIToken

func (s *Store) CreateAPIToken(ctx context.Context, token authn.APITokenRecord) (int64, error)

func (*Store) CreateAPITokenAudited

func (s *Store) CreateAPITokenAudited(ctx context.Context, token authn.APITokenRecord, event audit.Event) (int64, error)

func (*Store) CreateFederatedSessionAudited

func (s *Store) CreateFederatedSessionAudited(ctx context.Context, identity authn.Identity, session authn.SessionRecord, loginOperation string) error

func (*Store) CreateGroup

func (s *Store) CreateGroup(ctx context.Context, group scim.Group) (created scim.Group, err error)

func (*Store) CreateGroupAudited

func (s *Store) CreateGroupAudited(ctx context.Context, group scim.Group, events []audit.Event) (scim.Group, error)

func (*Store) CreateLoginFlow

func (s *Store) CreateLoginFlow(ctx context.Context, flow authn.LoginFlow) error

func (*Store) CreateOAuthAuthorizationRequest

func (s *Store) CreateOAuthAuthorizationRequest(ctx context.Context, request authn.OAuthAuthorizationRequest) error

func (*Store) CreateOAuthClient

func (s *Store) CreateOAuthClient(ctx context.Context, client authn.OAuthClient) error

func (*Store) CreateOAuthGrant

func (s *Store) CreateOAuthGrant(ctx context.Context, grant authn.OAuthGrant) (int64, error)

func (*Store) CreatePasswordSession

func (s *Store) CreatePasswordSession(ctx context.Context, userID int64, expected authn.PasswordCredential, session authn.SessionRecord, accountKey, sourceKey [32]byte) error

func (*Store) CreatePolicy added in v0.6.0

func (s *Store) CreatePolicy(ctx context.Context, item policy.Policy, activate bool) (policy.Policy, error)

CreatePolicy inserts an immutable policy version. When activate is true it deactivates the current active policy in the same transaction.

func (*Store) CreateSession

func (s *Store) CreateSession(ctx context.Context, session authn.SessionRecord) error

func (*Store) CreateSessionAudited

func (s *Store) CreateSessionAudited(ctx context.Context, session authn.SessionRecord, event audit.Event) error

func (*Store) CreateUser

func (s *Store) CreateUser(ctx context.Context, user scim.User) (created scim.User, err error)

func (*Store) CreateUserAudited

func (s *Store) CreateUserAudited(ctx context.Context, user scim.User, events []audit.Event) (scim.User, error)

func (*Store) CurrentDecision added in v0.6.0

func (s *Store) CurrentDecision(ctx context.Context, repositoryID int64, coordinates license.Coordinates) (review.Decision, bool, error)

CurrentDecision returns the non-superseded decision for a scope, if any.

func (*Store) DecisionHistory added in v0.6.0

func (s *Store) DecisionHistory(ctx context.Context, repositoryID int64, coordinates license.Coordinates, limit int) ([]review.Decision, error)

DecisionHistory lists every decision for a scope, newest first.

func (*Store) DeleteExpiredAuth

func (s *Store) DeleteExpiredAuth(ctx context.Context, now time.Time) (flows, sessions int64, err error)

func (*Store) DeleteExpiredOAuth

func (s *Store) DeleteExpiredOAuth(ctx context.Context, now time.Time) (requests, grants, clients int64, err error)

DeleteExpiredOAuth removes finished browser interactions, grants that have been dead for a week (kept briefly for audit correlation), and clients idle for ninety days.

func (*Store) DeleteGroup

func (s *Store) DeleteGroup(ctx context.Context, id int64) (err error)

func (*Store) DeleteGroupAudited

func (s *Store) DeleteGroupAudited(ctx context.Context, id int64, events []audit.Event) error

func (*Store) DeleteOAuthAuthorizationRequest

func (s *Store) DeleteOAuthAuthorizationRequest(ctx context.Context, id [32]byte) error

func (*Store) DeleteUser

func (s *Store) DeleteUser(ctx context.Context, id int64) (err error)

func (*Store) DeleteUserAudited

func (s *Store) DeleteUserAudited(ctx context.Context, id int64, events []audit.Event) error

func (*Store) DesiredSHA

func (s *Store) DesiredSHA(ctx context.Context, id int64) (string, error)

func (*Store) DisableInstallation

func (s *Store) DisableInstallation(ctx context.Context, githubID int64, status string) error

func (*Store) DueSupplyChainStreams added in v0.6.0

func (s *Store) DueSupplyChainStreams(ctx context.Context, streamKey string, before time.Time, limit int) ([]int64, error)

DueSupplyChainStreams lists enabled repositories in active installations whose GitHub source stream has never been collected or was last attempted before the cutoff and is not opted out. The result is bounded.

func (*Store) EnqueueAdminIndex

func (s *Store) EnqueueAdminIndex(ctx context.Context, r admin.IndexRequest) error

func (*Store) EnqueueEnrichment added in v0.6.0

func (s *Store) EnqueueEnrichment(ctx context.Context, coordinates license.Coordinates, route string) (bool, error)

EnqueueEnrichment queues a lookup unless one is active or fresh evidence exists for the route: a resolved row (any age; metadata changes are picked up by explicit re-enrichment), or an unexpired negative row.

func (*Store) EnqueueIndex

func (s *Store) EnqueueIndex(ctx context.Context, request IndexRequest) error

func (*Store) EnqueueSupplyChainJob added in v0.6.0

func (s *Store) EnqueueSupplyChainJob(ctx context.Context, repositoryID int64, streamKey, reason, requestedBy string, priority int, runAfter time.Time) (supplychain.Job, bool, error)

EnqueueSupplyChainJob queues one refresh for a repository stream. A queued job already covering the stream is returned unchanged (created=false); a manual request raises its priority so it runs before scheduled work.

func (*Store) EnrichmentQueueDepths added in v0.6.0

func (s *Store) EnrichmentQueueDepths(ctx context.Context) (map[string]int64, error)

EnrichmentQueueDepths reports queued/running enrichment jobs.

func (*Store) EntityGenerations

func (s *Store) EntityGenerations(ctx context.Context, snapshots []graphquery.QuerySnapshot) ([]graphprotocol.Generation, error)

Payload CASE expressions return a sentinel for oversized facts. Do not turn them into WHERE filters: dropping facts would falsely report complete answers. Only the caller's authorized repository set is inspected. The repository's current indexed SHA and active generation are checked together in one query; the published generation wins over the SCIP-derived one when both are active at that commit.

func (*Store) EntityNeighbors

func (*Store) ExchangeOAuthCode

func (s *Store) ExchangeOAuthCode(ctx context.Context, codeID [32]byte, grant authn.OAuthGrant) (int64, error)

func (*Store) FailGraph

func (s *Store) FailGraph(ctx context.Context, id int64, owner, errorCode string, retry bool) error

func (*Store) FailIndex

func (s *Store) FailIndex(ctx context.Context, id int64, owner, errorCode string, retry bool) error

func (*Store) GraphArtifact

func (s *Store) GraphArtifact(ctx context.Context, repositoryID, uploadID int64) (graphartifact.Artifact, error)

func (*Store) GraphManifests

func (s *Store) GraphManifests(ctx context.Context) ([]graphartifact.Manifest, error)

func (*Store) GraphPublicationAllowed added in v0.7.0

func (s *Store) GraphPublicationAllowed(ctx context.Context, repositoryID int64, subject string) (bool, error)

GraphPublicationAllowed reports whether a non-administrator subject holds a graph publication grant for the repository.

func (*Store) GraphQueueDepths

func (s *Store) GraphQueueDepths(ctx context.Context) (map[string]int64, error)

func (*Store) GraphRepositories

func (s *Store) GraphRepositories(ctx context.Context, principal authn.Principal) ([]repository.Repository, error)

func (*Store) GraphStatus

func (s *Store) GraphStatus(ctx context.Context, repositoryID int64) (api.GraphStatus, error)

func (*Store) Group

func (s *Store) Group(ctx context.Context, id int64) (scim.Group, error)

func (*Store) Health

func (s *Store) Health(ctx context.Context) error

func (*Store) InsertLicenseEvidence added in v0.6.0

func (s *Store) InsertLicenseEvidence(ctx context.Context, evidence license.Evidence) (int64, bool, error)

InsertLicenseEvidence appends an immutable evidence row. duplicate reports that the newest existing row for the same coordinates, source, and route has the same material fingerprint.

func (*Store) InstallationIDs

func (s *Store) InstallationIDs(ctx context.Context) ([]int64, error)

func (*Store) IssueOAuthCode

func (s *Store) IssueOAuthCode(ctx context.Context, pendingID, codeID, sessionHash [32]byte, userID int64, expiresAt, now time.Time) error

IssueOAuthCode atomically validates the consent session and re-keys a pending request as a code.

func (*Store) LatestLicenseEvidence added in v0.6.0

func (s *Store) LatestLicenseEvidence(ctx context.Context, coordinates license.Coordinates) ([]license.Evidence, error)

LatestLicenseEvidence returns, per (source, route), the newest row and, when that row is a negative outcome, also the newest resolved row, so an outage keeps earlier evidence visible with its age. Ordered by ID.

func (*Store) LatestSnapshotIDs added in v0.6.1

func (s *Store) LatestSnapshotIDs(ctx context.Context) ([]int64, error)

LatestSnapshotIDs lists every stream's current snapshot.

func (*Store) LicenseEvidenceHistory added in v0.6.0

func (s *Store) LicenseEvidenceHistory(ctx context.Context, coordinates license.Coordinates, limit int) ([]license.Evidence, error)

LicenseEvidenceHistory lists every evidence row for the coordinates, newest first, bounded. Callers authorize the coordinates through an authorized occurrence first.

func (*Store) ListAPITokens

func (s *Store) ListAPITokens(ctx context.Context, userID int64) ([]authn.APITokenMetadata, error)

func (*Store) ListGroups

func (s *Store) ListGroups(ctx context.Context, filter scim.Filter, page scim.Page) ([]scim.Group, int, error)

func (*Store) ListOAuthGrants

func (s *Store) ListOAuthGrants(ctx context.Context, userID, afterID int64, limit int) ([]authn.OAuthGrantMetadata, bool, error)

func (*Store) ListUsers

func (s *Store) ListUsers(ctx context.Context, filter scim.Filter, page scim.Page) ([]scim.User, int, error)

func (*Store) LoadGraph

func (s *Store) LoadGraph(ctx context.Context, uploadID int64) (graphartifact.Artifact, error)

func (*Store) LoadGraphV2

func (s *Store) LoadGraphV2(ctx context.Context, repositoryID, uploadID int64) (*graphv2.Artifact, error)

LoadGraphV2 loads an immutable generation, including retired generations. The caller must authorize the repository; this is not a public download API.

func (*Store) Locations

func (s *Store) Locations(ctx context.Context, principal authn.Principal, origin scipgraph.StoredOccurrence, operation string, max int) ([]scipgraph.Location, bool, error)

func (*Store) Manifests

func (s *Store) Manifests(ctx context.Context) (map[int64]graphartifact.Manifest, error)

func (*Store) Neighbors

func (s *Store) Neighbors(ctx context.Context, query graphquery.NeighborQuery) ([]graphquery.Neighbor, error)

func (*Store) OAuthAuthorizationRequest

func (s *Store) OAuthAuthorizationRequest(ctx context.Context, id [32]byte, phase string, now time.Time) (authn.OAuthAuthorizationRequest, error)

func (*Store) OAuthClient

func (s *Store) OAuthClient(ctx context.Context, id string, _ time.Time) (authn.OAuthClient, error)

OAuthClient loads a client.

func (*Store) OAuthGrantByRefresh

func (s *Store) OAuthGrantByRefresh(ctx context.Context, refreshHash [32]byte, now time.Time) (authn.OAuthGrant, error)

func (*Store) OAuthPrincipal

func (s *Store) OAuthPrincipal(ctx context.Context, accessHash [32]byte, now time.Time) (authn.Principal, error)

OAuthPrincipal resolves a live access token with the user's repository read access, without delegating administrative or write privileges.

func (*Store) OccurrenceAt

func (s *Store) OccurrenceAt(ctx context.Context, repositoryID int64, commit, path string, line int, position scipgraph.OccurrencePosition) (scipgraph.StoredOccurrence, error)

func (*Store) PasswordCredential

func (s *Store) PasswordCredential(ctx context.Context, userName string) (int64, authn.PasswordCredential, error)

func (*Store) PatchGroup

func (s *Store) PatchGroup(ctx context.Context, id int64, mutation scim.GroupMutation) (updated scim.Group, err error)

func (*Store) PatchGroupAudited

func (s *Store) PatchGroupAudited(ctx context.Context, id int64, mutation scim.GroupMutation, events []audit.Event) (scim.Group, error)

func (*Store) PatchUser

func (s *Store) PatchUser(ctx context.Context, id int64, mutation scim.UserMutation) (updated scim.User, err error)

func (*Store) PatchUserAudited

func (s *Store) PatchUserAudited(ctx context.Context, id int64, mutation scim.UserMutation, events []audit.Event) (scim.User, error)

func (*Store) Policies added in v0.6.0

func (s *Store) Policies(ctx context.Context, limit int) ([]policy.Policy, error)

func (*Store) Policy added in v0.6.0

func (s *Store) Policy(ctx context.Context, id int64) (policy.Policy, error)

func (*Store) PolicyResultHistory added in v0.6.0

func (s *Store) PolicyResultHistory(ctx context.Context, componentID int64, limit int) ([]review.PolicyResult, error)

PolicyResultHistory lists every evaluation of one component, newest first.

func (*Store) PolicyResults added in v0.6.0

func (s *Store) PolicyResults(ctx context.Context, snapshotID int64, componentIDs []int64) (map[int64]review.PolicyResult, error)

PolicyResults returns current results for a snapshot's components.

func (*Store) ProjectSupplyChainPackages added in v0.6.0

func (s *Store) ProjectSupplyChainPackages(ctx context.Context, repositoryID, snapshotID int64) (int, error)

ProjectSupplyChainPackages rebuilds the GitHub-sourced rows of repository_packages from a published snapshot so SCIP cross-repository navigation keeps working. Manual rows are never touched, and the flattened projection is never read back as inventory.

func (*Store) Prune

func (s *Store) Prune(ctx context.Context) (int64, int64, error)

func (*Store) PruneSupplyChainHistory added in v0.6.0

func (s *Store) PruneSupplyChainHistory(ctx context.Context, keepCollections int, finishedJobsOlderThan time.Duration) (int64, int64, error)

PruneSupplyChainHistory bounds collection attempts and finished jobs per stream so operational tables do not grow without limit.

func (*Store) PruneSupplyChainSnapshots added in v0.6.0

func (s *Store) PruneSupplyChainSnapshots(ctx context.Context, keep int, limit int) (int64, int64, error)

PruneSupplyChainSnapshots deletes, per repository stream, snapshots beyond the newest keep count, except the stream's latest snapshot and any snapshot referenced by a review record (a policy result, a decision's occurrence, or a conclusion basis through its components). Documents unreferenced by any remaining snapshot are removed afterwards. Returns snapshots and documents deleted. Bounded per call.

func (*Store) PublishIndex

func (s *Store) PublishIndex(ctx context.Context, id int64, owner string) error

func (*Store) PublishSupplyChainSnapshot added in v0.6.0

func (s *Store) PublishSupplyChainSnapshot(ctx context.Context, publication SupplyChainPublication) (supplychain.Collection, error)

PublishSupplyChainSnapshot atomically stores the document (reusing identical bytes), inserts the immutable snapshot with its components and edges, records the collection, advances the stream pointer, and completes the job. When the document is byte-identical to the stream's current snapshot the attempt is recorded as unchanged and no snapshot is created. The write is fenced by the job's lease so a stale worker cannot publish over a newer one.

func (*Store) QueryAggregateNames

func (s *Store) QueryAggregateNames(ctx context.Context, q graphquery.AggregateNamesQuery) ([]string, error)

func (*Store) QueryAnalysisEntities

func (s *Store) QueryAnalysisEntities(ctx context.Context, query graphquery.AnalysisEntityQuery) ([]graphprotocol.Entity, error)

func (*Store) QueryAnalysisEvidence

func (s *Store) QueryAnalysisEvidence(ctx context.Context, query graphquery.AnalysisEvidenceQuery) ([]graphprotocol.Evidence, error)

func (*Store) QueryDiscovery

func (*Store) QueryEntities

func (s *Store) QueryEntities(ctx context.Context, q graphquery.EntityQuery) ([]graphprotocol.Entity, error)

func (*Store) QueryFileNodes

func (s *Store) QueryFileNodes(ctx context.Context, snapshot graphquery.QuerySnapshot, paths []string) ([]graphprotocol.Entity, error)

func (*Store) QueryFiles

func (*Store) QueryModuleAggregation

func (s *Store) QueryModuleAggregation(ctx context.Context, q graphquery.AggregateModuleQuery) ([]graphquery.AggregateModuleRow, error)

func (*Store) QueryNodeMetrics

func (s *Store) QueryNodeMetrics(ctx context.Context, snapshot graphquery.QuerySnapshot, occurrence string) (graphprotocol.NodeMetrics, error)

func (*Store) QuerySegments

func (*Store) QueryTopCallingFiles

func (s *Store) QueryTopCallingFiles(ctx context.Context, q graphquery.AggregateLimitQuery) ([]graphprotocol.CallingFile, error)

func (*Store) QueryTopDependedOn

func (s *Store) QueryTopDependedOn(ctx context.Context, q graphquery.AggregateLimitQuery) ([]graphprotocol.DependedOn, error)

func (*Store) QueueDepths

func (s *Store) QueueDepths(ctx context.Context) (map[string]int64, error)

func (*Store) ReapExpired

func (s *Store) ReapExpired(ctx context.Context, limit int) (int64, error)

func (*Store) ReapExpiredEnrichment added in v0.6.0

func (s *Store) ReapExpiredEnrichment(ctx context.Context, limit int) (int64, error)

func (*Store) ReapExpiredGraph

func (s *Store) ReapExpiredGraph(ctx context.Context, limit int) (int64, error)

func (*Store) ReapExpiredSupplyChainJobs added in v0.6.0

func (s *Store) ReapExpiredSupplyChainJobs(ctx context.Context, limit int) (int64, error)

ReapExpiredSupplyChainJobs requeues or fails jobs whose lease expired without completion (worker crash).

func (*Store) RebuildGraphDiscovery

func (s *Store) RebuildGraphDiscovery(ctx context.Context, repositoryID, uploadID int64) error

RebuildGraphDiscovery is an explicit offline maintenance operation. It may load a full validated artifact; the request path never calls it. Immutable generation identity prevents a replacement from changing the facts rebuilt.

func (*Store) ReconcileAdminRepositories

func (s *Store) ReconcileAdminRepositories(ctx context.Context, installationID int64, repositoryIDs []int64, upstream []githubapp.Repository) error

func (*Store) ReconcileInstallation

func (s *Store) ReconcileInstallation(ctx context.Context, installation githubapp.Installation, repositories []githubapp.Repository) error

func (*Store) Record

func (s *Store) Record(ctx context.Context, event audit.Event) error

func (*Store) RecordConclusion added in v0.6.0

func (s *Store) RecordConclusion(ctx context.Context, conclusion review.Conclusion, evidence license.Evidence) (review.Conclusion, error)

RecordConclusion stores a human license conclusion as evidence plus its linkage, superseding the previous conclusion for the coordinates.

func (*Store) RecordDecision added in v0.6.0

func (s *Store) RecordDecision(ctx context.Context, decision review.Decision) (review.Decision, error)

RecordDecision stores a scoped decision and supersedes the previous current decision for the same scope.

func (*Store) RecordReviewEvent added in v0.6.0

func (s *Store) RecordReviewEvent(ctx context.Context, kind, actor string, repositoryID *int64, target string, detail map[string]any) error

RecordReviewEvent appends to the audit trail.

func (*Store) RecordSupplyChainFailure added in v0.6.0

func (s *Store) RecordSupplyChainFailure(ctx context.Context, failure SupplyChainFailure) (supplychain.Collection, error)

RecordSupplyChainFailure records a failed attempt, updates the stream's last-attempt fields without touching its latest snapshot, and moves the job to queued (with backoff), failed, or cancelled.

func (*Store) RecordSupplyChainImport added in v0.6.0

func (s *Store) RecordSupplyChainImport(ctx context.Context, record supplychain.ImportRecord) (int64, error)

func (*Store) RecordSupplyChainProjectionError added in v0.6.0

func (s *Store) RecordSupplyChainProjectionError(ctx context.Context, collectionID int64, code string) error

RecordSupplyChainProjectionError marks a collection whose snapshot published but whose compatibility projection failed, so the gap is visible and recoverable rather than silent.

func (*Store) RenewEnrichment added in v0.6.0

func (s *Store) RenewEnrichment(ctx context.Context, id int64, owner string, fence int64) error

func (*Store) RenewGraphLease

func (s *Store) RenewGraphLease(ctx context.Context, id int64, owner string) error

func (*Store) RenewLease

func (s *Store) RenewLease(ctx context.Context, id int64, owner string) error

func (*Store) RenewSupplyChainLease added in v0.6.0

func (s *Store) RenewSupplyChainLease(ctx context.Context, id int64, owner string, fence int64) error

func (*Store) ReplaceAdminGroupAccess

func (s *Store) ReplaceAdminGroupAccess(ctx context.Context, actorID, groupID int64, administrator bool, repositoryIDs []int64) error

func (*Store) ReplaceAdminGroupAccessAudited

func (s *Store) ReplaceAdminGroupAccessAudited(ctx context.Context, actorID, groupID int64, administrator bool, repositoryIDs []int64, event audit.Event) error

func (*Store) ReplaceAdminUserAccess

func (s *Store) ReplaceAdminUserAccess(ctx context.Context, actorID, userID int64, administrator bool, repositoryIDs []int64) error

func (*Store) ReplaceAdminUserAccessAudited

func (s *Store) ReplaceAdminUserAccessAudited(ctx context.Context, actorID, userID int64, administrator bool, repositoryIDs []int64, event audit.Event) error

func (*Store) ReplaceGitHubGrants

func (s *Store) ReplaceGitHubGrants(ctx context.Context, userID int64, repositoryIDs []int64) error

ReplaceGitHubGrants mirrors bindProviderUser's grant replacement for a refresh-time sync: unknown repository IDs are dropped by the join.

func (*Store) ReplaceGraph

func (s *Store) ReplaceGraph(ctx context.Context, repositoryID int64, source GraphSource, artifact graphartifact.Artifact) (GraphReplacement, error)

func (*Store) ReplaceGraphV2

func (s *Store) ReplaceGraphV2(ctx context.Context, repositoryID int64, publication GraphPublication, artifact *graphv2.Artifact) (GraphReplacement, error)

ReplaceGraphV2 publishes an external v2 generation into the repository's published slot. The v1 generation and the SCIP-derived v2 generation, if any, stay active; ExpectedActiveID names the published generation only.

func (*Store) ReplaceGroup

func (s *Store) ReplaceGroup(ctx context.Context, id int64, group scim.Group) (updated scim.Group, err error)

func (*Store) ReplaceGroupAudited

func (s *Store) ReplaceGroupAudited(ctx context.Context, id int64, group scim.Group, events []audit.Event) (scim.Group, error)

func (*Store) ReplacePackages

func (s *Store) ReplacePackages(ctx context.Context, repositoryID int64, source string, mappings []scipgraph.PackageMapping) error

func (*Store) ReplaceSCIP

func (s *Store) ReplaceSCIP(ctx context.Context, repositoryID int64, commit string, upload scipgraph.Upload) (err error)

func (*Store) ReplaceUser

func (s *Store) ReplaceUser(ctx context.Context, id int64, user scim.User) (updated scim.User, err error)

func (*Store) ReplaceUserAudited

func (s *Store) ReplaceUserAudited(ctx context.Context, id int64, user scim.User, events []audit.Event) (scim.User, error)

func (*Store) RepositoryForIndex

func (s *Store) RepositoryForIndex(ctx context.Context, id int64) (repository.Repository, error)

func (*Store) RetryAdminJob

func (s *Store) RetryAdminJob(ctx context.Context, installationID int64, repositoryIDs []int64, id int64) error

func (*Store) ReviewAllowed added in v0.6.0

func (s *Store) ReviewAllowed(ctx context.Context, repositoryID int64, subject string) (bool, error)

ReviewAllowed reports whether a subject holds a review grant for the repository.

func (*Store) ReviewEvents added in v0.6.0

func (s *Store) ReviewEvents(ctx context.Context, repositoryIDs []int64, limit int) ([]review.Event, error)

ReviewEvents lists audit events, newest first, optionally for one repository.

func (*Store) ReviewQueue added in v0.6.0

func (s *Store) ReviewQueue(ctx context.Context, repositoryIDs []int64, streamKey string, now time.Time, afterID int64, limit int) ([]review.QueueItem, error)

ReviewQueue lists latest-stream occurrences in the authorized repositories whose current policy verdict is not approved and that have no current, unexpired decision, ordered by verdict severity then component. Bounded.

func (*Store) RevokeAPIToken

func (s *Store) RevokeAPIToken(ctx context.Context, userID, tokenID int64) error

func (*Store) RevokeAPITokenAudited

func (s *Store) RevokeAPITokenAudited(ctx context.Context, userID, tokenID int64, event audit.Event) error

func (*Store) RevokeAdminUserCredentials

func (s *Store) RevokeAdminUserCredentials(ctx context.Context, userID int64) error

func (*Store) RevokeAdminUserCredentialsAudited

func (s *Store) RevokeAdminUserCredentialsAudited(ctx context.Context, userID int64, event audit.Event) error

func (*Store) RevokeOAuthGrant

func (s *Store) RevokeOAuthGrant(ctx context.Context, grantID int64) error

func (*Store) RevokeOAuthGrantByToken

func (s *Store) RevokeOAuthGrantByToken(ctx context.Context, hash [32]byte, clientID string) (bool, error)

func (*Store) RevokeSession

func (s *Store) RevokeSession(ctx context.Context, tokenHash [32]byte) error

func (*Store) RevokeSessionAudited

func (s *Store) RevokeSessionAudited(ctx context.Context, tokenHash [32]byte) error

func (*Store) RevokeUserOAuthGrant

func (s *Store) RevokeUserOAuthGrant(ctx context.Context, userID, grantID int64) error

func (*Store) RevokeUserOAuthGrantAudited

func (s *Store) RevokeUserOAuthGrantAudited(ctx context.Context, userID, grantID int64, event audit.Event) error

func (*Store) RotateOAuthGrant

func (s *Store) RotateOAuthGrant(ctx context.Context, refreshHash [32]byte, rotation authn.OAuthRotation) (authn.OAuthGrant, error)

RotateOAuthGrant implements refresh-token rotation with replay detection. Presenting any consumed refresh token after its rotation grace period revokes the grant and returns ErrOAuthReplay. Access use does not extend that grace.

func (*Store) RotatePasswordCredential

func (s *Store) RotatePasswordCredential(ctx context.Context, userID int64, expected, replacement authn.PasswordCredential, session authn.SessionRecord, accountKey, sourceKey [32]byte, event audit.Event) error

func (*Store) SCIPIndexCommit

func (s *Store) SCIPIndexCommit(ctx context.Context, repositoryID int64) (string, error)

func (*Store) SessionPrincipal

func (s *Store) SessionPrincipal(ctx context.Context, tokenHash [32]byte, now, idleUntil time.Time) (authn.Principal, error)

func (*Store) SetGraphPublicationGrant added in v0.7.0

func (s *Store) SetGraphPublicationGrant(ctx context.Context, repositoryID int64, subject, grantedBy string, allow bool) error

SetGraphPublicationGrant adds or removes a repository-scoped publication grant.

func (*Store) SetPasswordCredential

func (s *Store) SetPasswordCredential(ctx context.Context, userID int64, credential authn.PasswordCredential, event audit.Event) error

func (*Store) SetReviewGrant added in v0.6.0

func (s *Store) SetReviewGrant(ctx context.Context, repositoryID int64, subject, grantedBy string, allow bool) error

func (*Store) SetSupplyChainOptOut added in v0.6.0

func (s *Store) SetSupplyChainOptOut(ctx context.Context, repositoryID int64, streamKey string, producer supplychain.Producer, subject supplychain.Subject, optOut bool) error

func (*Store) SetSupplyChainUploadGrant added in v0.6.0

func (s *Store) SetSupplyChainUploadGrant(ctx context.Context, repositoryID int64, subject, grantedBy string, allow bool) error

SetSupplyChainUploadGrant adds or removes a repository-scoped upload grant.

func (*Store) SnapshotComponentKeys added in v0.6.0

func (s *Store) SnapshotComponentKeys(ctx context.Context, snapshotID int64) (map[string][2]string, error)

SnapshotComponentKeys returns the element-level coordinate set of a snapshot for comparison: element_id -> (coordinate key, declared license).

func (*Store) SnapshotComponents added in v0.9.2

func (s *Store) SnapshotComponents(ctx context.Context, snapshotID int64) ([]license.SnapshotComponent, error)

SnapshotComponents lists every component of a snapshot in ordinal order with its coordinates (empty when unknown) and raw license values.

func (*Store) SnapshotCoordinates added in v0.6.0

func (s *Store) SnapshotCoordinates(ctx context.Context, snapshotID int64) ([]license.Coordinates, error)

SnapshotCoordinates lists distinct exact coordinates of a snapshot's components that have a purl name and a version.

func (*Store) SnapshotEdgeKeys added in v0.6.0

func (s *Store) SnapshotEdgeKeys(ctx context.Context, snapshotID int64) (map[string]bool, error)

SnapshotEdgeKeys returns a snapshot's resolved edges as "from\x01type\x01to".

func (*Store) SnapshotRepositoryID added in v0.6.0

func (s *Store) SnapshotRepositoryID(ctx context.Context, snapshotID int64) (int64, error)

SnapshotRepositoryID maps a snapshot to its repository row.

func (*Store) SupplyChainActiveJob added in v0.6.0

func (s *Store) SupplyChainActiveJob(ctx context.Context, repositoryID int64, streamKey string) (supplychain.Job, bool, error)

SupplyChainActiveJob returns the queued or running job of a stream, if any.

func (*Store) SupplyChainAssessmentCounts added in v0.6.0

func (s *Store) SupplyChainAssessmentCounts(ctx context.Context, snapshotID int64) (map[string]int, error)

SupplyChainAssessmentCounts summarizes assessment statuses for a snapshot.

func (*Store) SupplyChainAssessments added in v0.6.0

func (s *Store) SupplyChainAssessments(ctx context.Context, snapshotID int64, componentIDs []int64) (map[int64]license.Assessment, error)

SupplyChainAssessments returns assessments for a snapshot's components, keyed by component ID. Callers authorize the snapshot first.

func (*Store) SupplyChainCollections added in v0.6.0

func (s *Store) SupplyChainCollections(ctx context.Context, repositoryID int64, streamKey string, beforeID int64, limit int) ([]supplychain.Collection, error)

func (*Store) SupplyChainComponentByElement added in v0.6.0

func (s *Store) SupplyChainComponentByElement(ctx context.Context, snapshotID int64, elementID string) (supplychain.Component, error)

SupplyChainComponentByElement resolves one occurrence in an authorized snapshot by its document element ID.

func (*Store) SupplyChainComponents added in v0.6.0

func (s *Store) SupplyChainComponents(ctx context.Context, snapshotID int64, afterOrdinal int, limit int, search string) ([]supplychain.Component, error)

SupplyChainComponents pages a snapshot's occurrences in document order after the given ordinal. Authorization is the caller's: it resolves the snapshot through SupplyChainSnapshot first.

func (*Store) SupplyChainCoordinateOccurrences added in v0.6.0

func (s *Store) SupplyChainCoordinateOccurrences(ctx context.Context, repositoryIDs []int64, streamKey, ecosystem, namespace, name, version string, limit int) ([]supplychain.PortfolioOccurrence, error)

SupplyChainCoordinateOccurrences lists where a coordinate appears within the authorized set (the "find repositories using a component" query).

func (*Store) SupplyChainDocument added in v0.6.0

func (s *Store) SupplyChainDocument(ctx context.Context, snapshotID int64, repositoryIDs []int64) ([]byte, string, []byte, error)

SupplyChainDocument returns the original bytes of a snapshot's document, again scoped to the authorized repositories.

func (*Store) SupplyChainExportRows added in v0.6.0

func (s *Store) SupplyChainExportRows(ctx context.Context, snapshotID int64) ([]supplychain.ExportRow, error)

SupplyChainExportRows streams a snapshot's components with assessments for CSV export. Bounded by the snapshot's own size.

func (*Store) SupplyChainImportByDigest added in v0.6.0

func (s *Store) SupplyChainImportByDigest(ctx context.Context, repositoryID int64, streamKey string, digest []byte) (supplychain.ImportRecord, bool, error)

func (*Store) SupplyChainImportCount added in v0.6.0

func (s *Store) SupplyChainImportCount(ctx context.Context, repositoryID int64, since time.Time) (int, error)

func (*Store) SupplyChainJob added in v0.6.0

func (s *Store) SupplyChainJob(ctx context.Context, jobID int64, repositoryIDs []int64) (supplychain.Job, error)

SupplyChainJob reads a job scoped to the authorized repositories.

func (*Store) SupplyChainOverview added in v0.6.0

func (s *Store) SupplyChainOverview(ctx context.Context, repositoryIDs []int64, streamKey string, staleBefore time.Time) (supplychain.PortfolioOverview, error)

SupplyChainOverview computes the overview for the stream across the authorized repositories. staleBefore is the freshness cutoff.

func (*Store) SupplyChainPortfolioComponents added in v0.6.0

func (s *Store) SupplyChainPortfolioComponents(ctx context.Context, filter supplychain.PortfolioFilter) ([]supplychain.PortfolioComponent, error)

SupplyChainPortfolioComponents lists unique coordinates over the authorized latest snapshots with stable keyset ordering.

func (*Store) SupplyChainPortfolioFacets added in v0.6.0

func (s *Store) SupplyChainPortfolioFacets(ctx context.Context, repositoryIDs []int64, streamKey string) (map[string][]supplychain.FacetCount, error)

PortfolioFacets returns bounded facet counts for the portfolio filters within the authorized scope (ecosystems, assessment statuses, expressions).

func (*Store) SupplyChainQueueDepths added in v0.6.0

func (s *Store) SupplyChainQueueDepths(ctx context.Context) (map[string]int64, error)

func (*Store) SupplyChainRelationships added in v0.6.0

func (s *Store) SupplyChainRelationships(ctx context.Context, snapshotID int64, element string, limit int) ([]supplychain.Relationship, error)

SupplyChainRelationships returns a snapshot's edges touching the given element (both directions), bounded.

func (*Store) SupplyChainSnapshot added in v0.6.0

func (s *Store) SupplyChainSnapshot(ctx context.Context, snapshotID int64, repositoryIDs []int64) (supplychain.Snapshot, error)

SupplyChainSnapshot reads one snapshot, but only when it belongs to one of the given repositories: the caller passes its authorized set so an unauthorized snapshot ID is indistinguishable from a missing one.

func (*Store) SupplyChainSnapshots added in v0.6.0

func (s *Store) SupplyChainSnapshots(ctx context.Context, repositoryID int64, streamKey string, beforeID int64, limit int) ([]supplychain.Snapshot, error)

SupplyChainSnapshots lists a repository stream's snapshots, newest first.

func (*Store) SupplyChainStream added in v0.6.0

func (s *Store) SupplyChainStream(ctx context.Context, repositoryID int64, streamKey string) (supplychain.Stream, error)

SupplyChainStream returns the stream pointer for a repository. It is a repository-internal read; callers authorize the repository first.

func (*Store) SupplyChainStreams added in v0.6.0

func (s *Store) SupplyChainStreams(ctx context.Context, repositoryID int64) ([]supplychain.Stream, error)

SupplyChainStreams lists the streams that exist for a repository so the UI can offer producer/subject selection.

func (*Store) SupplyChainUploadAllowed added in v0.6.0

func (s *Store) SupplyChainUploadAllowed(ctx context.Context, repositoryID int64, subject string) (bool, error)

SupplyChainUploadAllowed reports whether a non-administrator subject holds an upload grant for the repository.

func (*Store) SuspendAdminUser

func (s *Store) SuspendAdminUser(ctx context.Context, actorID, userID int64, suspended bool) error

func (*Store) SuspendAdminUserAudited

func (s *Store) SuspendAdminUserAudited(ctx context.Context, actorID, userID int64, suspended bool, event audit.Event) error

func (*Store) Symbols

func (s *Store) Symbols(ctx context.Context, query graphquery.SymbolQuery) ([]graphprotocol.Symbol, error)

func (*Store) UpdateOAuthGrantGitHubToken

func (s *Store) UpdateOAuthGrantGitHubToken(ctx context.Context, grantID int64, ciphertext []byte) error

func (*Store) UpsertAssessment added in v0.6.0

func (s *Store) UpsertAssessment(ctx context.Context, assessment license.Assessment) error

func (*Store) UpsertBreakGlassAdmin

func (s *Store) UpsertBreakGlassAdmin(ctx context.Context, userName string, credential authn.PasswordCredential, event audit.Event) (int64, error)

func (*Store) UpsertInstallation

func (s *Store) UpsertInstallation(ctx context.Context, update InstallationUpdate) error

func (*Store) UpsertPolicyResult added in v0.6.0

func (s *Store) UpsertPolicyResult(ctx context.Context, result review.PolicyResult) error

UpsertPolicyResult records a current evaluation for a component, retiring the previous current row rather than editing it.

func (*Store) UpsertRepository

func (s *Store) UpsertRepository(ctx context.Context, update RepositoryUpdate) (repository.Repository, error)

func (*Store) UpsertSearchNode

func (s *Store) UpsertSearchNode(ctx context.Context, nodeID, baseURL string) error

func (*Store) User

func (s *Store) User(ctx context.Context, id int64) (scim.User, error)

func (*Store) UserDisplayName

func (s *Store) UserDisplayName(ctx context.Context, userID int64) (string, error)

UserDisplayName renders "Display Name (user_name)" for the consent page.

func (*Store) UserPrincipal

func (s *Store) UserPrincipal(ctx context.Context, userID int64, ceiling []int64) (authn.Principal, error)

type SupplyChainFailure added in v0.6.0

type SupplyChainFailure = supplychain.Failure

SupplyChainPublication and SupplyChainFailure are the supplychain types.

type SupplyChainPublication added in v0.6.0

type SupplyChainPublication = supplychain.Publication

SupplyChainPublication and SupplyChainFailure are the supplychain types.

Jump to

Keyboard shortcuts

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