Documentation
¶
Index ¶
- Variables
- func Migrate(ctx context.Context, pool *pgxpool.Pool) error
- func Open(ctx context.Context, dsn string) (*pgxpool.Pool, error)
- type Delivery
- type DeliveryTx
- func (tx *DeliveryTx) DisableInstallation(ctx context.Context, githubID int64, status string) error
- func (tx *DeliveryTx) DisableRepository(ctx context.Context, githubID int64, errorCode string) error
- func (tx *DeliveryTx) EnqueueIndex(ctx context.Context, request IndexRequest) error
- func (tx *DeliveryTx) RenameRepository(ctx context.Context, githubID int64, owner, name, cloneURL, webURL string) error
- func (tx *DeliveryTx) RepositoryForPush(ctx context.Context, installationID, githubID int64) (repository.Repository, error)
- func (tx *DeliveryTx) UpdateRepositorySize(ctx context.Context, repositoryID, sizeBytes int64) error
- type EnrichmentStatus
- type GraphJob
- type GraphPublication
- type GraphReplacement
- type GraphSource
- type GraphUpload
- type IndexJob
- type IndexRequest
- type InstallationUpdate
- type RepositoryUpdate
- type Store
- func (s *Store) APIPrincipal(ctx context.Context, tokenHash [32]byte, now time.Time) (authn.Principal, error)
- func (s *Store) ActiveGraphGeneration(ctx context.Context, repositoryID int64) (*api.GraphActiveGeneration, error)
- func (s *Store) ActiveGraphGenerations(ctx context.Context, repositoryID int64) ([]api.GraphActiveGeneration, error)
- func (s *Store) ActiveGraphJobIDs(ctx context.Context) (map[int64]struct{}, error)
- func (s *Store) ActiveJobIDs(ctx context.Context) (map[int64]struct{}, error)
- func (s *Store) ActivePolicy(ctx context.Context) (policy.Policy, error)
- func (s *Store) ActiveRepository(ctx context.Context, repositoryID int64) (bool, error)
- func (s *Store) AdminDeliveries(ctx context.Context, installationID int64, repositoryIDs []int64, limit int) ([]admin.Delivery, bool, error)
- func (s *Store) AdminGitHub(ctx context.Context, installationID int64, repositoryIDs []int64, ...) (admin.GitHub, error)
- func (s *Store) AdminGroup(ctx context.Context, id int64) (admin.Group, error)
- func (s *Store) AdminGroups(ctx context.Context, limit int) ([]admin.Group, bool, error)
- func (s *Store) AdminJobs(ctx context.Context, installationID int64, repositoryIDs []int64, limit int, ...) ([]admin.Job, bool, error)
- func (s *Store) AdminOverview(ctx context.Context, installationID int64, repositoryIDs []int64) (admin.Overview, error)
- func (s *Store) AdminRepositories(ctx context.Context, installationID int64, repositoryIDs []int64, limit int, ...) ([]admin.Repository, bool, error)
- func (s *Store) AdminRepository(ctx context.Context, installationID int64, repositoryIDs []int64, ...) (repository.Repository, error)
- func (s *Store) AdminSCIPDependencies(ctx context.Context, installationID int64, repositoryIDs []int64, limit int) ([]admin.SCIPDependency, bool, error)
- func (s *Store) AdminSCIPUploads(ctx context.Context, installationID int64, repositoryIDs []int64, limit int) ([]admin.SCIPUpload, bool, error)
- func (s *Store) AdminUser(ctx context.Context, id int64) (admin.User, error)
- func (s *Store) AdminUsers(ctx context.Context, limit int) ([]admin.User, bool, error)
- func (s *Store) AggregateStats(ctx context.Context, snapshot graphquery.QuerySnapshot) (graphprotocol.GraphStats, error)
- func (s *Store) AllAuthorizedRepositories(ctx context.Context, names []string) ([]repository.Repository, error)
- func (s *Store) AllowOAuthRequest(ctx context.Context, remoteAddr, endpoint string, now time.Time) (bool, error)
- func (s *Store) AnyAuthorizedRepository(ctx context.Context, repositoryID int64) (repository.Repository, error)
- func (s *Store) AppendAudit(ctx context.Context, event audit.Event) error
- func (s *Store) ApplyDelivery(ctx context.Context, delivery Delivery, ...) (bool, error)
- func (s *Store) AuditEvents(ctx context.Context, limit int) ([]audit.Event, bool, error)
- func (s *Store) AuthorizedRepositories(ctx context.Context, installationID int64, repositoryIDs []int64, ...) ([]repository.Repository, error)
- func (s *Store) AuthorizedRepository(ctx context.Context, installationID int64, repositoryIDs []int64, ...) (repository.Repository, error)
- func (s *Store) BindFederatedUser(ctx context.Context, issuer, subject, externalID string) (int64, error)
- func (s *Store) CancelSupplyChainJob(ctx context.Context, id int64) (bool, error)
- func (s *Store) ClaimEnrichment(ctx context.Context, owner string) (license.Job, error)
- func (s *Store) ClaimGraph(ctx context.Context, owner string) (GraphJob, error)
- func (s *Store) ClaimIndex(ctx context.Context, owner string) (IndexJob, error)
- func (s *Store) ClaimSupplyChainJob(ctx context.Context, owner string) (supplychain.Job, error)
- func (s *Store) ClassifyFiles(ctx context.Context, q graphquery.FileClassificationQuery) ([]graphquery.FileClassificationRow, error)
- func (s *Store) ClearLoginFailures(ctx context.Context, accountKey, sourceKey [32]byte) error
- func (s *Store) CompleteEnrichment(ctx context.Context, id int64, owner string, fence int64, ...) error
- func (s *Store) CompleteGraph(ctx context.Context, id int64, owner string, artifact graphartifact.Artifact) error
- func (s *Store) CompleteIndex(ctx context.Context, id int64, owner string, enrichment ...EnrichmentStatus) error
- func (s *Store) ComponentDeclarations(ctx context.Context, componentID int64) (*string, *string, error)
- func (s *Store) ComponentsForCoordinates(ctx context.Context, coordinates license.Coordinates, limit int) ([][2]int64, error)
- func (s *Store) ComponentsNeedingEvaluation(ctx context.Context, policyID int64, limit int) ([]review.EvaluationTarget, error)
- func (s *Store) ConclusionHistory(ctx context.Context, coordinates license.Coordinates, limit int) ([]review.Conclusion, error)
- func (s *Store) ConsumeLoginAttempt(ctx context.Context, key [32]byte, now time.Time) (bool, time.Time, error)
- func (s *Store) ConsumeLoginFlow(ctx context.Context, stateHash, browserHash [32]byte, provider string, ...) (authn.LoginFlow, error)
- func (s *Store) CountFiles(ctx context.Context, q graphquery.FileQuery) (int64, error)
- func (s *Store) CountGeneratedFiles(ctx context.Context, snapshots []graphquery.QuerySnapshot) (generated, total int64, err error)
- func (s *Store) CountHierarchyChildren(ctx context.Context, q graphquery.HierarchyCountQuery) (graphquery.HierarchyCount, error)
- func (s *Store) CreateAPIToken(ctx context.Context, token authn.APITokenRecord) (int64, error)
- func (s *Store) CreateAPITokenAudited(ctx context.Context, token authn.APITokenRecord, event audit.Event) (int64, error)
- func (s *Store) CreateFederatedSessionAudited(ctx context.Context, identity authn.Identity, session authn.SessionRecord, ...) error
- func (s *Store) CreateGroup(ctx context.Context, group scim.Group) (created scim.Group, err error)
- func (s *Store) CreateGroupAudited(ctx context.Context, group scim.Group, events []audit.Event) (scim.Group, error)
- func (s *Store) CreateLoginFlow(ctx context.Context, flow authn.LoginFlow) error
- func (s *Store) CreateOAuthAuthorizationRequest(ctx context.Context, request authn.OAuthAuthorizationRequest) error
- func (s *Store) CreateOAuthClient(ctx context.Context, client authn.OAuthClient) error
- func (s *Store) CreateOAuthGrant(ctx context.Context, grant authn.OAuthGrant) (int64, error)
- func (s *Store) CreatePasswordSession(ctx context.Context, userID int64, expected authn.PasswordCredential, ...) error
- func (s *Store) CreatePolicy(ctx context.Context, item policy.Policy, activate bool) (policy.Policy, error)
- func (s *Store) CreateSession(ctx context.Context, session authn.SessionRecord) error
- func (s *Store) CreateSessionAudited(ctx context.Context, session authn.SessionRecord, event audit.Event) error
- func (s *Store) CreateUser(ctx context.Context, user scim.User) (created scim.User, err error)
- func (s *Store) CreateUserAudited(ctx context.Context, user scim.User, events []audit.Event) (scim.User, error)
- func (s *Store) CurrentDecision(ctx context.Context, repositoryID int64, coordinates license.Coordinates) (review.Decision, bool, error)
- func (s *Store) DecisionHistory(ctx context.Context, repositoryID int64, coordinates license.Coordinates, ...) ([]review.Decision, error)
- func (s *Store) DeleteExpiredAuth(ctx context.Context, now time.Time) (flows, sessions int64, err error)
- func (s *Store) DeleteExpiredOAuth(ctx context.Context, now time.Time) (requests, grants, clients int64, err error)
- func (s *Store) DeleteGroup(ctx context.Context, id int64) (err error)
- func (s *Store) DeleteGroupAudited(ctx context.Context, id int64, events []audit.Event) error
- func (s *Store) DeleteOAuthAuthorizationRequest(ctx context.Context, id [32]byte) error
- func (s *Store) DeleteUser(ctx context.Context, id int64) (err error)
- func (s *Store) DeleteUserAudited(ctx context.Context, id int64, events []audit.Event) error
- func (s *Store) DesiredSHA(ctx context.Context, id int64) (string, error)
- func (s *Store) DisableInstallation(ctx context.Context, githubID int64, status string) error
- func (s *Store) DueSupplyChainStreams(ctx context.Context, streamKey string, before time.Time, limit int) ([]int64, error)
- func (s *Store) EnqueueAdminIndex(ctx context.Context, r admin.IndexRequest) error
- func (s *Store) EnqueueEnrichment(ctx context.Context, coordinates license.Coordinates, route string) (bool, error)
- func (s *Store) EnqueueIndex(ctx context.Context, request IndexRequest) error
- func (s *Store) EnqueueSupplyChainJob(ctx context.Context, repositoryID int64, streamKey, reason, requestedBy string, ...) (supplychain.Job, bool, error)
- func (s *Store) EnrichmentQueueDepths(ctx context.Context) (map[string]int64, error)
- func (s *Store) EntityGenerations(ctx context.Context, snapshots []graphquery.QuerySnapshot) ([]graphprotocol.Generation, error)
- func (s *Store) EntityNeighbors(ctx context.Context, q graphquery.EntityNeighborQuery) ([]graphquery.EntityNeighbor, error)
- func (s *Store) ExchangeOAuthCode(ctx context.Context, codeID [32]byte, grant authn.OAuthGrant) (int64, error)
- func (s *Store) FailGraph(ctx context.Context, id int64, owner, errorCode string, retry bool) error
- func (s *Store) FailIndex(ctx context.Context, id int64, owner, errorCode string, retry bool) error
- func (s *Store) GraphArtifact(ctx context.Context, repositoryID, uploadID int64) (graphartifact.Artifact, error)
- func (s *Store) GraphManifests(ctx context.Context) ([]graphartifact.Manifest, error)
- func (s *Store) GraphPublicationAllowed(ctx context.Context, repositoryID int64, subject string) (bool, error)
- func (s *Store) GraphQueueDepths(ctx context.Context) (map[string]int64, error)
- func (s *Store) GraphRepositories(ctx context.Context, principal authn.Principal) ([]repository.Repository, error)
- func (s *Store) GraphStatus(ctx context.Context, repositoryID int64) (api.GraphStatus, error)
- func (s *Store) Group(ctx context.Context, id int64) (scim.Group, error)
- func (s *Store) Health(ctx context.Context) error
- func (s *Store) InsertLicenseEvidence(ctx context.Context, evidence license.Evidence) (int64, bool, error)
- func (s *Store) InstallationIDs(ctx context.Context) ([]int64, error)
- func (s *Store) IssueOAuthCode(ctx context.Context, pendingID, codeID, sessionHash [32]byte, userID int64, ...) error
- func (s *Store) LatestLicenseEvidence(ctx context.Context, coordinates license.Coordinates) ([]license.Evidence, error)
- func (s *Store) LatestSnapshotIDs(ctx context.Context) ([]int64, error)
- func (s *Store) LicenseEvidenceHistory(ctx context.Context, coordinates license.Coordinates, limit int) ([]license.Evidence, error)
- func (s *Store) ListAPITokens(ctx context.Context, userID int64) ([]authn.APITokenMetadata, error)
- func (s *Store) ListGroups(ctx context.Context, filter scim.Filter, page scim.Page) ([]scim.Group, int, error)
- func (s *Store) ListOAuthGrants(ctx context.Context, userID, afterID int64, limit int) ([]authn.OAuthGrantMetadata, bool, error)
- func (s *Store) ListUsers(ctx context.Context, filter scim.Filter, page scim.Page) ([]scim.User, int, error)
- func (s *Store) LoadGraph(ctx context.Context, uploadID int64) (graphartifact.Artifact, error)
- func (s *Store) LoadGraphV2(ctx context.Context, repositoryID, uploadID int64) (*graphv2.Artifact, error)
- func (s *Store) Locations(ctx context.Context, principal authn.Principal, ...) ([]scipgraph.Location, bool, error)
- func (s *Store) Manifests(ctx context.Context) (map[int64]graphartifact.Manifest, error)
- func (s *Store) Neighbors(ctx context.Context, query graphquery.NeighborQuery) ([]graphquery.Neighbor, error)
- func (s *Store) OAuthAuthorizationRequest(ctx context.Context, id [32]byte, phase string, now time.Time) (authn.OAuthAuthorizationRequest, error)
- func (s *Store) OAuthClient(ctx context.Context, id string, _ time.Time) (authn.OAuthClient, error)
- func (s *Store) OAuthGrantByRefresh(ctx context.Context, refreshHash [32]byte, now time.Time) (authn.OAuthGrant, error)
- func (s *Store) OAuthPrincipal(ctx context.Context, accessHash [32]byte, now time.Time) (authn.Principal, error)
- func (s *Store) OccurrenceAt(ctx context.Context, repositoryID int64, commit, path string, line int, ...) (scipgraph.StoredOccurrence, error)
- func (s *Store) PasswordCredential(ctx context.Context, userName string) (int64, authn.PasswordCredential, error)
- func (s *Store) PatchGroup(ctx context.Context, id int64, mutation scim.GroupMutation) (updated scim.Group, err error)
- func (s *Store) PatchGroupAudited(ctx context.Context, id int64, mutation scim.GroupMutation, ...) (scim.Group, error)
- func (s *Store) PatchUser(ctx context.Context, id int64, mutation scim.UserMutation) (updated scim.User, err error)
- func (s *Store) PatchUserAudited(ctx context.Context, id int64, mutation scim.UserMutation, ...) (scim.User, error)
- func (s *Store) Policies(ctx context.Context, limit int) ([]policy.Policy, error)
- func (s *Store) Policy(ctx context.Context, id int64) (policy.Policy, error)
- func (s *Store) PolicyResultHistory(ctx context.Context, componentID int64, limit int) ([]review.PolicyResult, error)
- func (s *Store) PolicyResults(ctx context.Context, snapshotID int64, componentIDs []int64) (map[int64]review.PolicyResult, error)
- func (s *Store) ProjectSupplyChainPackages(ctx context.Context, repositoryID, snapshotID int64) (int, error)
- func (s *Store) Prune(ctx context.Context) (int64, int64, error)
- func (s *Store) PruneSupplyChainHistory(ctx context.Context, keepCollections int, finishedJobsOlderThan time.Duration) (int64, int64, error)
- func (s *Store) PruneSupplyChainSnapshots(ctx context.Context, keep int, limit int) (int64, int64, error)
- func (s *Store) PublishIndex(ctx context.Context, id int64, owner string) error
- func (s *Store) PublishSupplyChainSnapshot(ctx context.Context, publication SupplyChainPublication) (supplychain.Collection, error)
- func (s *Store) QueryAggregateNames(ctx context.Context, q graphquery.AggregateNamesQuery) ([]string, error)
- func (s *Store) QueryAnalysisEntities(ctx context.Context, query graphquery.AnalysisEntityQuery) ([]graphprotocol.Entity, error)
- func (s *Store) QueryAnalysisEvidence(ctx context.Context, query graphquery.AnalysisEvidenceQuery) ([]graphprotocol.Evidence, error)
- func (s *Store) QueryDiscovery(ctx context.Context, q graphquery.DiscoverySearch) ([]graphprotocol.DiscoveryMatch, error)
- func (s *Store) QueryEntities(ctx context.Context, q graphquery.EntityQuery) ([]graphprotocol.Entity, error)
- func (s *Store) QueryFan(ctx context.Context, q graphquery.AggregateFanQuery) ([]graphprotocol.AggregateCount, error)
- func (s *Store) QueryFileDependencyPairs(ctx context.Context, q graphquery.FileDependencyQuery) ([]graphquery.FileDependencyPairRow, error)
- func (s *Store) QueryFileNodes(ctx context.Context, snapshot graphquery.QuerySnapshot, paths []string) ([]graphprotocol.Entity, error)
- func (s *Store) QueryFiles(ctx context.Context, q graphquery.FileQuery) ([]graphprotocol.IndexedFile, error)
- func (s *Store) QueryModuleAggregation(ctx context.Context, q graphquery.AggregateModuleQuery) ([]graphquery.AggregateModuleRow, error)
- func (s *Store) QueryNodeMetrics(ctx context.Context, snapshot graphquery.QuerySnapshot, occurrence string) (graphprotocol.NodeMetrics, error)
- func (s *Store) QuerySegments(ctx context.Context, q graphquery.SegmentSearch) ([]graphprotocol.SegmentMatch, error)
- func (s *Store) QueryTopCallingFiles(ctx context.Context, q graphquery.AggregateLimitQuery) ([]graphprotocol.CallingFile, error)
- func (s *Store) QueryTopDependedOn(ctx context.Context, q graphquery.AggregateLimitQuery) ([]graphprotocol.DependedOn, error)
- func (s *Store) QueryUnresolvedReferences(ctx context.Context, q graphquery.AggregateUnresolvedQuery) ([]graphprotocol.UnresolvedReference, error)
- func (s *Store) QueueDepths(ctx context.Context) (map[string]int64, error)
- func (s *Store) ReapExpired(ctx context.Context, limit int) (int64, error)
- func (s *Store) ReapExpiredEnrichment(ctx context.Context, limit int) (int64, error)
- func (s *Store) ReapExpiredGraph(ctx context.Context, limit int) (int64, error)
- func (s *Store) ReapExpiredSupplyChainJobs(ctx context.Context, limit int) (int64, error)
- func (s *Store) RebuildGraphDiscovery(ctx context.Context, repositoryID, uploadID int64) error
- func (s *Store) ReconcileAdminRepositories(ctx context.Context, installationID int64, repositoryIDs []int64, ...) error
- func (s *Store) ReconcileInstallation(ctx context.Context, installation githubapp.Installation, ...) error
- func (s *Store) Record(ctx context.Context, event audit.Event) error
- func (s *Store) RecordConclusion(ctx context.Context, conclusion review.Conclusion, evidence license.Evidence) (review.Conclusion, error)
- func (s *Store) RecordDecision(ctx context.Context, decision review.Decision) (review.Decision, error)
- func (s *Store) RecordReviewEvent(ctx context.Context, kind, actor string, repositoryID *int64, target string, ...) error
- func (s *Store) RecordSupplyChainFailure(ctx context.Context, failure SupplyChainFailure) (supplychain.Collection, error)
- func (s *Store) RecordSupplyChainImport(ctx context.Context, record supplychain.ImportRecord) (int64, error)
- func (s *Store) RecordSupplyChainProjectionError(ctx context.Context, collectionID int64, code string) error
- func (s *Store) RenewEnrichment(ctx context.Context, id int64, owner string, fence int64) error
- func (s *Store) RenewGraphLease(ctx context.Context, id int64, owner string) error
- func (s *Store) RenewLease(ctx context.Context, id int64, owner string) error
- func (s *Store) RenewSupplyChainLease(ctx context.Context, id int64, owner string, fence int64) error
- func (s *Store) ReplaceAdminGroupAccess(ctx context.Context, actorID, groupID int64, administrator bool, ...) error
- func (s *Store) ReplaceAdminGroupAccessAudited(ctx context.Context, actorID, groupID int64, administrator bool, ...) error
- func (s *Store) ReplaceAdminUserAccess(ctx context.Context, actorID, userID int64, administrator bool, ...) error
- func (s *Store) ReplaceAdminUserAccessAudited(ctx context.Context, actorID, userID int64, administrator bool, ...) error
- func (s *Store) ReplaceGitHubGrants(ctx context.Context, userID int64, repositoryIDs []int64) error
- func (s *Store) ReplaceGraph(ctx context.Context, repositoryID int64, source GraphSource, ...) (GraphReplacement, error)
- func (s *Store) ReplaceGraphV2(ctx context.Context, repositoryID int64, publication GraphPublication, ...) (GraphReplacement, error)
- func (s *Store) ReplaceGroup(ctx context.Context, id int64, group scim.Group) (updated scim.Group, err error)
- func (s *Store) ReplaceGroupAudited(ctx context.Context, id int64, group scim.Group, events []audit.Event) (scim.Group, error)
- func (s *Store) ReplacePackages(ctx context.Context, repositoryID int64, source string, ...) error
- func (s *Store) ReplaceSCIP(ctx context.Context, repositoryID int64, commit string, ...) (err error)
- func (s *Store) ReplaceUser(ctx context.Context, id int64, user scim.User) (updated scim.User, err error)
- func (s *Store) ReplaceUserAudited(ctx context.Context, id int64, user scim.User, events []audit.Event) (scim.User, error)
- func (s *Store) RepositoryForIndex(ctx context.Context, id int64) (repository.Repository, error)
- func (s *Store) RetryAdminJob(ctx context.Context, installationID int64, repositoryIDs []int64, id int64) error
- func (s *Store) ReviewAllowed(ctx context.Context, repositoryID int64, subject string) (bool, error)
- func (s *Store) ReviewEvents(ctx context.Context, repositoryIDs []int64, limit int) ([]review.Event, error)
- func (s *Store) ReviewQueue(ctx context.Context, repositoryIDs []int64, streamKey string, now time.Time, ...) ([]review.QueueItem, error)
- func (s *Store) RevokeAPIToken(ctx context.Context, userID, tokenID int64) error
- func (s *Store) RevokeAPITokenAudited(ctx context.Context, userID, tokenID int64, event audit.Event) error
- func (s *Store) RevokeAdminUserCredentials(ctx context.Context, userID int64) error
- func (s *Store) RevokeAdminUserCredentialsAudited(ctx context.Context, userID int64, event audit.Event) error
- func (s *Store) RevokeOAuthGrant(ctx context.Context, grantID int64) error
- func (s *Store) RevokeOAuthGrantByToken(ctx context.Context, hash [32]byte, clientID string) (bool, error)
- func (s *Store) RevokeSession(ctx context.Context, tokenHash [32]byte) error
- func (s *Store) RevokeSessionAudited(ctx context.Context, tokenHash [32]byte) error
- func (s *Store) RevokeUserOAuthGrant(ctx context.Context, userID, grantID int64) error
- func (s *Store) RevokeUserOAuthGrantAudited(ctx context.Context, userID, grantID int64, event audit.Event) error
- func (s *Store) RotateOAuthGrant(ctx context.Context, refreshHash [32]byte, rotation authn.OAuthRotation) (authn.OAuthGrant, error)
- func (s *Store) RotatePasswordCredential(ctx context.Context, userID int64, ...) error
- func (s *Store) SCIPIndexCommit(ctx context.Context, repositoryID int64) (string, error)
- func (s *Store) SessionPrincipal(ctx context.Context, tokenHash [32]byte, now, idleUntil time.Time) (authn.Principal, error)
- func (s *Store) SetGraphPublicationGrant(ctx context.Context, repositoryID int64, subject, grantedBy string, allow bool) error
- func (s *Store) SetPasswordCredential(ctx context.Context, userID int64, credential authn.PasswordCredential, ...) error
- func (s *Store) SetReviewGrant(ctx context.Context, repositoryID int64, subject, grantedBy string, allow bool) error
- func (s *Store) SetSupplyChainOptOut(ctx context.Context, repositoryID int64, streamKey string, ...) error
- func (s *Store) SetSupplyChainUploadGrant(ctx context.Context, repositoryID int64, subject, grantedBy string, allow bool) error
- func (s *Store) SnapshotComponentKeys(ctx context.Context, snapshotID int64) (map[string][2]string, error)
- func (s *Store) SnapshotComponents(ctx context.Context, snapshotID int64) ([]license.SnapshotComponent, error)
- func (s *Store) SnapshotCoordinates(ctx context.Context, snapshotID int64) ([]license.Coordinates, error)
- func (s *Store) SnapshotEdgeKeys(ctx context.Context, snapshotID int64) (map[string]bool, error)
- func (s *Store) SnapshotRepositoryID(ctx context.Context, snapshotID int64) (int64, error)
- func (s *Store) SupplyChainActiveJob(ctx context.Context, repositoryID int64, streamKey string) (supplychain.Job, bool, error)
- func (s *Store) SupplyChainAssessmentCounts(ctx context.Context, snapshotID int64) (map[string]int, error)
- func (s *Store) SupplyChainAssessments(ctx context.Context, snapshotID int64, componentIDs []int64) (map[int64]license.Assessment, error)
- func (s *Store) SupplyChainCollections(ctx context.Context, repositoryID int64, streamKey string, beforeID int64, ...) ([]supplychain.Collection, error)
- func (s *Store) SupplyChainComponentByElement(ctx context.Context, snapshotID int64, elementID string) (supplychain.Component, error)
- func (s *Store) SupplyChainComponents(ctx context.Context, snapshotID int64, afterOrdinal int, limit int, ...) ([]supplychain.Component, error)
- func (s *Store) SupplyChainCoordinateOccurrences(ctx context.Context, repositoryIDs []int64, ...) ([]supplychain.PortfolioOccurrence, error)
- func (s *Store) SupplyChainDependencyGraph(ctx context.Context, filter supplychain.GraphFilter) ([]supplychain.GraphDependency, int, error)
- func (s *Store) SupplyChainDocument(ctx context.Context, snapshotID int64, repositoryIDs []int64) ([]byte, string, []byte, error)
- func (s *Store) SupplyChainExportRows(ctx context.Context, snapshotID int64) ([]supplychain.ExportRow, error)
- func (s *Store) SupplyChainImportByDigest(ctx context.Context, repositoryID int64, streamKey string, digest []byte) (supplychain.ImportRecord, bool, error)
- func (s *Store) SupplyChainImportCount(ctx context.Context, repositoryID int64, since time.Time) (int, error)
- func (s *Store) SupplyChainJob(ctx context.Context, jobID int64, repositoryIDs []int64) (supplychain.Job, error)
- func (s *Store) SupplyChainOverview(ctx context.Context, repositoryIDs []int64, streamKey string, ...) (supplychain.PortfolioOverview, error)
- func (s *Store) SupplyChainPortfolioComponents(ctx context.Context, filter supplychain.PortfolioFilter) ([]supplychain.PortfolioComponent, error)
- func (s *Store) SupplyChainPortfolioFacets(ctx context.Context, repositoryIDs []int64, streamKey string) (map[string][]supplychain.FacetCount, error)
- func (s *Store) SupplyChainQueueDepths(ctx context.Context) (map[string]int64, error)
- func (s *Store) SupplyChainRelationships(ctx context.Context, snapshotID int64, element string, limit int) ([]supplychain.Relationship, error)
- func (s *Store) SupplyChainSnapshot(ctx context.Context, snapshotID int64, repositoryIDs []int64) (supplychain.Snapshot, error)
- func (s *Store) SupplyChainSnapshots(ctx context.Context, repositoryID int64, streamKey string, beforeID int64, ...) ([]supplychain.Snapshot, error)
- func (s *Store) SupplyChainStream(ctx context.Context, repositoryID int64, streamKey string) (supplychain.Stream, error)
- func (s *Store) SupplyChainStreams(ctx context.Context, repositoryID int64) ([]supplychain.Stream, error)
- func (s *Store) SupplyChainUploadAllowed(ctx context.Context, repositoryID int64, subject string) (bool, error)
- func (s *Store) SuspendAdminUser(ctx context.Context, actorID, userID int64, suspended bool) error
- func (s *Store) SuspendAdminUserAudited(ctx context.Context, actorID, userID int64, suspended bool, event audit.Event) error
- func (s *Store) Symbols(ctx context.Context, query graphquery.SymbolQuery) ([]graphprotocol.Symbol, error)
- func (s *Store) UpdateOAuthGrantGitHubToken(ctx context.Context, grantID int64, ciphertext []byte) error
- func (s *Store) UpsertAssessment(ctx context.Context, assessment license.Assessment) error
- func (s *Store) UpsertBreakGlassAdmin(ctx context.Context, userName string, credential authn.PasswordCredential, ...) (int64, error)
- func (s *Store) UpsertInstallation(ctx context.Context, update InstallationUpdate) error
- func (s *Store) UpsertPolicyResult(ctx context.Context, result review.PolicyResult) error
- func (s *Store) UpsertRepository(ctx context.Context, update RepositoryUpdate) (repository.Repository, error)
- func (s *Store) UpsertSearchNode(ctx context.Context, nodeID, baseURL string) error
- func (s *Store) User(ctx context.Context, id int64) (scim.User, error)
- func (s *Store) UserDisplayName(ctx context.Context, userID int64) (string, error)
- func (s *Store) UserPrincipal(ctx context.Context, userID int64, ceiling []int64) (authn.Principal, error)
- type SupplyChainFailure
- type SupplyChainPublication
Constants ¶
This section is empty.
Variables ¶
var ( ErrGraphPrecondition = errors.New("graph generation or indexed commit changed") ErrGraphProviderConflict = errors.New("graph provider change requires explicit replacement") // or belongs to an inactive installation, so no generation can be published. ErrGraphRepositoryUnavailable = errors.New("repository is unavailable for graph publication") )
var ( ErrInvalidSecurityPrincipal = errors.New("invalid security principal") ErrInvalidAuditLimit = errors.New("invalid audit limit") )
var ErrLeaseLost = errors.New("index job lease lost")
var ErrNoJob = errors.New("no index job available")
var ErrSupplyChainFenced = supplychain.ErrFenced
ErrSupplyChainFenced is supplychain.ErrFenced: a publication or completion lost its lease and nothing was written.
Functions ¶
Types ¶
type DeliveryTx ¶
type DeliveryTx struct {
// contains filtered or unexported fields
}
func (*DeliveryTx) DisableInstallation ¶
func (*DeliveryTx) DisableRepository ¶
func (*DeliveryTx) EnqueueIndex ¶
func (tx *DeliveryTx) EnqueueIndex(ctx context.Context, request IndexRequest) error
func (*DeliveryTx) RenameRepository ¶
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 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 IndexRequest ¶
type InstallationUpdate ¶
type RepositoryUpdate ¶
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 (*Store) APIPrincipal ¶
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 (*Store) ActiveJobIDs ¶
func (*Store) ActivePolicy ¶ added in v0.6.0
ActivePolicy returns the active policy or policy.ErrNoPolicy.
func (*Store) ActiveRepository ¶ added in v0.5.0
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 (*Store) AdminGitHub ¶
func (*Store) AdminGroup ¶
func (*Store) AdminGroups ¶
func (*Store) AdminOverview ¶
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 (*Store) AdminSCIPUploads ¶
func (*Store) AdminUsers ¶
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 (*Store) ApplyDelivery ¶
func (*Store) AuditEvents ¶
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 (*Store) CancelSupplyChainJob ¶ added in v0.6.0
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 (*Store) ClaimGraph ¶
func (*Store) ClaimIndex ¶
func (*Store) ClaimSupplyChainJob ¶ added in v0.6.0
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) ClassifyFiles ¶
func (s *Store) ClassifyFiles(ctx context.Context, q graphquery.FileClassificationQuery) ([]graphquery.FileClassificationRow, error)
func (*Store) ClearLoginFailures ¶
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 (*Store) CompleteIndex ¶
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 (*Store) ConsumeLoginFlow ¶
func (*Store) CountFiles ¶
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 (*Store) CreateAPITokenAudited ¶
func (*Store) CreateFederatedSessionAudited ¶
func (*Store) CreateGroup ¶
func (*Store) CreateGroupAudited ¶
func (*Store) CreateLoginFlow ¶
func (*Store) CreateOAuthAuthorizationRequest ¶
func (*Store) CreateOAuthClient ¶
func (*Store) CreateOAuthGrant ¶
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 (*Store) CreateSessionAudited ¶
func (*Store) CreateUser ¶
func (*Store) CreateUserAudited ¶
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 (*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) DeleteGroupAudited ¶
func (*Store) DeleteOAuthAuthorizationRequest ¶
func (*Store) DeleteUserAudited ¶
func (*Store) DesiredSHA ¶
func (*Store) DisableInstallation ¶
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 (*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
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 (s *Store) EntityNeighbors(ctx context.Context, q graphquery.EntityNeighborQuery) ([]graphquery.EntityNeighbor, error)
func (*Store) ExchangeOAuthCode ¶
func (*Store) GraphArtifact ¶
func (*Store) GraphManifests ¶
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 (*Store) GraphRepositories ¶
func (s *Store) GraphRepositories(ctx context.Context, principal authn.Principal) ([]repository.Repository, error)
func (*Store) GraphStatus ¶
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 (*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
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 (*Store) ListGroups ¶
func (*Store) ListOAuthGrants ¶
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) Neighbors ¶
func (s *Store) Neighbors(ctx context.Context, query graphquery.NeighborQuery) ([]graphquery.Neighbor, error)
func (*Store) OAuthAuthorizationRequest ¶
func (*Store) OAuthClient ¶
OAuthClient loads a client.
func (*Store) OAuthGrantByRefresh ¶
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 (*Store) PasswordCredential ¶
func (*Store) PatchGroup ¶
func (*Store) PatchGroupAudited ¶
func (*Store) PatchUserAudited ¶
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) 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 (*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 (s *Store) QueryDiscovery(ctx context.Context, q graphquery.DiscoverySearch) ([]graphprotocol.DiscoveryMatch, error)
func (*Store) QueryEntities ¶
func (s *Store) QueryEntities(ctx context.Context, q graphquery.EntityQuery) ([]graphprotocol.Entity, error)
func (*Store) QueryFan ¶
func (s *Store) QueryFan(ctx context.Context, q graphquery.AggregateFanQuery) ([]graphprotocol.AggregateCount, error)
func (*Store) QueryFileDependencyPairs ¶
func (s *Store) QueryFileDependencyPairs(ctx context.Context, q graphquery.FileDependencyQuery) ([]graphquery.FileDependencyPairRow, error)
func (*Store) QueryFileNodes ¶
func (s *Store) QueryFileNodes(ctx context.Context, snapshot graphquery.QuerySnapshot, paths []string) ([]graphprotocol.Entity, error)
func (*Store) QueryFiles ¶
func (s *Store) QueryFiles(ctx context.Context, q graphquery.FileQuery) ([]graphprotocol.IndexedFile, error)
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 (s *Store) QuerySegments(ctx context.Context, q graphquery.SegmentSearch) ([]graphprotocol.SegmentMatch, error)
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) QueryUnresolvedReferences ¶
func (s *Store) QueryUnresolvedReferences(ctx context.Context, q graphquery.AggregateUnresolvedQuery) ([]graphprotocol.UnresolvedReference, error)
func (*Store) QueueDepths ¶
func (*Store) ReapExpired ¶
func (*Store) ReapExpiredEnrichment ¶ added in v0.6.0
func (*Store) ReapExpiredGraph ¶
func (*Store) ReapExpiredSupplyChainJobs ¶ added in v0.6.0
ReapExpiredSupplyChainJobs requeues or fails jobs whose lease expired without completion (worker crash).
func (*Store) RebuildGraphDiscovery ¶
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 (*Store) ReconcileInstallation ¶
func (s *Store) ReconcileInstallation(ctx context.Context, installation githubapp.Installation, repositories []githubapp.Repository) 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 (*Store) RenewGraphLease ¶
func (*Store) RenewLease ¶
func (*Store) RenewSupplyChainLease ¶ added in v0.6.0
func (*Store) ReplaceAdminGroupAccess ¶
func (*Store) ReplaceAdminGroupAccessAudited ¶
func (*Store) ReplaceAdminUserAccess ¶
func (*Store) ReplaceAdminUserAccessAudited ¶
func (*Store) ReplaceGitHubGrants ¶
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 (*Store) ReplaceGroupAudited ¶
func (*Store) ReplacePackages ¶
func (*Store) ReplaceSCIP ¶
func (*Store) ReplaceUser ¶
func (*Store) ReplaceUserAudited ¶
func (*Store) RepositoryForIndex ¶
func (s *Store) RepositoryForIndex(ctx context.Context, id int64) (repository.Repository, error)
func (*Store) RetryAdminJob ¶
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 (*Store) RevokeAPITokenAudited ¶
func (*Store) RevokeAdminUserCredentials ¶
func (*Store) RevokeAdminUserCredentialsAudited ¶
func (*Store) RevokeOAuthGrant ¶
func (*Store) RevokeOAuthGrantByToken ¶
func (*Store) RevokeSession ¶
func (*Store) RevokeSessionAudited ¶
func (*Store) RevokeUserOAuthGrant ¶
func (*Store) RevokeUserOAuthGrantAudited ¶
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 (*Store) SCIPIndexCommit ¶
func (*Store) SessionPrincipal ¶
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 (*Store) SetReviewGrant ¶ added in v0.6.0
func (*Store) SetSupplyChainOptOut ¶ added in v0.6.0
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
SnapshotEdgeKeys returns a snapshot's resolved edges as "from\x01type\x01to".
func (*Store) SnapshotRepositoryID ¶ added in v0.6.0
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) SupplyChainDependencyGraph ¶ added in v0.14.0
func (s *Store) SupplyChainDependencyGraph(ctx context.Context, filter supplychain.GraphFilter) ([]supplychain.GraphDependency, int, error)
SupplyChainDependencyGraph returns the packages (coordinates without their version) that at least filter.MinRepositories repositories of the scope use, most shared first, and how many packages qualify in total.
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 (*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 (*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 (*Store) SuspendAdminUserAudited ¶
func (*Store) Symbols ¶
func (s *Store) Symbols(ctx context.Context, query graphquery.SymbolQuery) ([]graphprotocol.Symbol, error)
func (*Store) UpdateOAuthGrantGitHubToken ¶
func (*Store) UpsertAssessment ¶ added in v0.6.0
func (*Store) UpsertBreakGlassAdmin ¶
func (*Store) UpsertInstallation ¶
func (s *Store) UpsertInstallation(ctx context.Context, update InstallationUpdate) error
func (*Store) UpsertPolicyResult ¶ added in v0.6.0
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 (*Store) UserDisplayName ¶
UserDisplayName renders "Display Name (user_name)" for the consent page.
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.
Source Files
¶
- admin_identity.go
- auth.go
- delivery.go
- directory.go
- graph.go
- graph_aggregates.go
- graph_discovery.go
- graph_discovery_variants.go
- graph_entity.go
- graph_entity_impact.go
- graph_file_classification.go
- graph_file_dependencies.go
- graph_files.go
- graph_query.go
- graph_type_hierarchy.go
- graph_v2.go
- migrate.go
- oauth.go
- oauth_security.go
- queue.go
- repository.go
- scim_directory.go
- scip.go
- security.go
- store.go
- supply_chain.go
- supply_chain_import.go
- supply_chain_license.go
- supply_chain_portfolio.go
- supply_chain_review.go