Documentation
¶
Index ¶
- Constants
- type CredentialReader
- type DeletePort
- type Dependencies
- type Error
- type ErrorKind
- type InspectionMode
- type InspectionOptions
- type InventoryPort
- type ObjectScopeDeleter
- type ProbePort
- type ProjectCleanupResult
- type Providers
- type RecordRepairer
- type ScopeCatalog
- type ScopeResolver
- type Service
- func (s *Service) ApplyAuthorized(ctx context.Context, options internalapi.ScopeRepairOptions) (internalapi.ScopeRepairApplyResult, error)
- func (s *Service) AuditAuthorized(ctx context.Context, options internalapi.ScopeRepairOptions) (internalapi.ScopeRepairReport, error)
- func (s *Service) DeleteProjectDataAuthorized(ctx context.Context, organization, project string) (ProjectCleanupResult, error)
- func (s *Service) DeleteProjectObjects(ctx context.Context, organization, project string, objectURLs []string) []internalapi.InternalDeleteProjectBucketObjectsItem
- func (s *Service) InspectProjectRecords(ctx context.Context, organization, project, pathPrefix string) ([]drs.DrsObject, error)
- func (s *Service) InspectProjectStorage(ctx context.Context, organization, project string, options InspectionOptions) (*internalapi.InternalInspectProjectBucketResponse, error)
- func (s *Service) ProbeObject(ctx context.Context, request internalapi.InternalInspectObjectRequest) (*internalapi.InternalInspectObjectResponse, error)
- func (s *Service) ProbeObjects(ctx context.Context, requests []internalapi.InternalInspectObjectRequest) []internalapi.InternalInspectObjectBulkItem
- func (s *Service) ValidateInventoryObjects(ctx context.Context, requests []internalapi.InternalInspectObjectRequest) []internalapi.InternalInspectObjectBulkItem
- type VisibilityReader
Constants ¶
const ( FindingLegacyAccessURLRemovable = "legacy_access_url_removable" FindingLegacyAccessURLRewritable = "legacy_access_url_rewritable" FindingNonCanonicalAccessURL = "non_canonical_access_url" FindingMissingControlledAccess = "missing_controlled_access" FindingDuplicateSHA256Sibling = "duplicate_sha256_sibling" FindingStorageObjectMissing = "storage_object_missing" FindingStorageProbeError = "storage_probe_error" SeverityInfo = "info" SeverityWarn = "warn" SeverityError = "error" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CredentialReader ¶
type DeletePort ¶
type DeletePort interface {
DeleteExact(context.Context, []storage.DeleteTarget) error
}
type Dependencies ¶
type Dependencies struct {
ScopeResolver ScopeResolver
Credentials CredentialReader
Visibility VisibilityReader
Records RecordRepairer
ObjectCleanup ObjectScopeDeleter
ScopeCatalog ScopeCatalog
Providers Providers
}
type Error ¶
Error is a typed maintenance error. HTTP adapters map its Kind to status codes; domain callers can use errors.As without importing HTTP packages.
func (*Error) ErrorCategory ¶ added in v0.4.1
func (e *Error) ErrorCategory() errorapi.ErrorCategory
func (*Error) PublicMessage ¶ added in v0.4.1
type ErrorKind ¶
type ErrorKind string
const ( ErrorInvalidInput ErrorKind = "invalid_input" ErrorScopeNotFound ErrorKind = "scope_not_found" ErrorCredentialMissing ErrorKind = "credential_missing" ErrorPermissionDenied ErrorKind = "permission_denied" ErrorObjectNotFound ErrorKind = "object_not_found" ErrorListingIncomplete ErrorKind = "listing_incomplete" ErrorUnsupported ErrorKind = "unsupported" )
type InspectionMode ¶
type InspectionMode string
InspectionMode controls the amount of inventory returned by InspectProjectStorage.
const ( ModeItems InspectionMode = "items" ModeExists InspectionMode = "exists" ModeSummary InspectionMode = "summary" )
type InspectionOptions ¶
type InspectionOptions struct {
Mode InspectionMode
IncludeHead bool
PathPrefix string
}
type InventoryPort ¶
type InventoryPort interface {
Inventory(context.Context, storage.InventoryRequest) (storage.InventoryResult, error)
}
type ObjectScopeDeleter ¶
type ProbePort ¶
type ProbePort interface {
Probe(context.Context, []storage.ProbeTarget) []storage.ProbeResult
}
type ProjectCleanupResult ¶
type ProjectCleanupResult struct {
Organization string
ProjectID string
DeletedObjects int
DeletedBucketScopes int
}
ProjectCleanupResult reports the durable rows removed by one project cleanup.
type Providers ¶ added in v0.4.2
type Providers struct {
Inventory InventoryPort
Probe ProbePort
Delete DeletePort
}
type RecordRepairer ¶ added in v0.4.2
type RecordRepairer interface {
ListObjects(context.Context, objects.RecordListQuery) ([]drs.DrsObject, error)
ListRepairCandidates(context.Context, objects.RepairCandidateQuery) (objects.RepairCandidatePage, error)
ListPhysicalObjectsByScope(context.Context, string, string, string) ([]drs.DrsObject, error)
RepairMissingControlledAccess(context.Context, string, string, objects.Scope) error
UpdateObjectMetadata(context.Context, string, drs.DrsObject, objects.Scope, *int64) (drs.DrsObject, error)
CollapseProjectChecksumDuplicates(context.Context, string, string) (int, error)
}
type ScopeCatalog ¶
type ScopeResolver ¶ added in v0.4.2
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(deps Dependencies) *Service
func (*Service) ApplyAuthorized ¶ added in v0.4.2
func (s *Service) ApplyAuthorized(ctx context.Context, options internalapi.ScopeRepairOptions) (internalapi.ScopeRepairApplyResult, error)
ApplyAuthorized requires read and update access for the requested scope before applying repairs.
func (*Service) AuditAuthorized ¶ added in v0.4.2
func (s *Service) AuditAuthorized(ctx context.Context, options internalapi.ScopeRepairOptions) (internalapi.ScopeRepairReport, error)
AuditAuthorized checks read access for the requested scope before auditing it.
func (*Service) DeleteProjectDataAuthorized ¶ added in v0.4.2
func (s *Service) DeleteProjectDataAuthorized(ctx context.Context, organization, project string) (ProjectCleanupResult, error)
DeleteProjectDataAuthorized applies the maintenance write policy before entering the trusted cleanup sequence.
func (*Service) DeleteProjectObjects ¶ added in v0.4.2
func (s *Service) DeleteProjectObjects(ctx context.Context, organization, project string, objectURLs []string) []internalapi.InternalDeleteProjectBucketObjectsItem
DeleteProjectObjects authorizes each URL against the resolved S3 scope, deduplicates in first-seen order, and dispatches exact physical URLs one at a time. This preserves per-item provider failures and retry ordering.
func (*Service) InspectProjectRecords ¶ added in v0.4.2
func (s *Service) InspectProjectRecords(ctx context.Context, organization, project, pathPrefix string) ([]drs.DrsObject, error)
InspectProjectRecords returns the physical catalog rows associated with a project and optionally restricts them to a logical or configured S3 prefix.
func (*Service) InspectProjectStorage ¶ added in v0.4.2
func (s *Service) InspectProjectStorage(ctx context.Context, organization, project string, options InspectionOptions) (*internalapi.InternalInspectProjectBucketResponse, error)
InspectProjectStorage inventories the S3 target selected by the project's configured scope.
func (*Service) ProbeObject ¶ added in v0.4.2
func (s *Service) ProbeObject(ctx context.Context, request internalapi.InternalInspectObjectRequest) (*internalapi.InternalInspectObjectResponse, error)
func (*Service) ProbeObjects ¶ added in v0.4.2
func (s *Service) ProbeObjects(ctx context.Context, requests []internalapi.InternalInspectObjectRequest) []internalapi.InternalInspectObjectBulkItem
func (*Service) ValidateInventoryObjects ¶ added in v0.4.2
func (s *Service) ValidateInventoryObjects(ctx context.Context, requests []internalapi.InternalInspectObjectRequest) []internalapi.InternalInspectObjectBulkItem
ValidateInventoryObjects compares requested physical S3 locations with inventory evidence. Exact targets are deduplicated, dense sibling keys are coalesced at the historical threshold, and output is always restored to input order including duplicate requests.