Documentation
¶
Overview ¶
Copyright 2026 Sneat.co
Package api4datatug is the DataTug module's HTTP API layer. It translates HTTP into domain commands and back; the business logic lives in facade4datatug and the storage access in dal-go.
Copyright 2026 Sneat.co
Index ¶
- Constants
- func NewGitHubProjectVisibilityInventory(options GitHubProjectRouteOptions) facade4datatug.ProjectVisibilityInventory
- func NewQuickSearchAuthority(shared *facade4datatug.SharedProjectService, ...) (qs.Authority, error)
- func RegisterHttpRoutes(handle extension.HTTPHandleFunc, ids facade4datatug.IDGenerator)
- func RegisterHttpRoutesWithOptions(handle extension.HTTPHandleFunc, ids facade4datatug.IDGenerator, ...)
- func RegisterHttpRoutesWithPlan(handle extension.HTTPHandleFunc, ids facade4datatug.IDGenerator, ...)
- func RegisterPersonalCloudLogRoutes(handle extension.HTTPHandleFunc, options PersonalCloudLogRouteOptions)
- func RegisterQuickSearchRoutes(handle extension.HTTPHandleFunc, o QuickSearchRouteOptions)
- type AccessActorVerifier
- type AccessAgentBaselineResolverPort
- type AccessControlRouteOptions
- type AccessControlRouteService
- type AccessDecisionActivationService
- type AccessRecordReaderPort
- type AccessTableReaderPort
- type CloudProjectJoinEligibilityRequest
- type CloudProjectLifecycleRequest
- type CloudProjectLifecycleRouteOptions
- type CloudProjectLifecycleRouteService
- type CloudProjectRouteOptions
- type CloudProjectRouteService
- type CloudProjectSharingRouteOptions
- type CloudProjectSharingRouteService
- type CloudWatchRouteOptions
- type CompleteGitHubAuthorizationRequest
- type CompleteGitHubAuthorizationResponse
- type CompleteGitHubOAuthRequest
- type CompleteGitHubOAuthResponse
- type CreateCloudProjectInviteRequest
- type CreateCloudProjectRequest
- type CreateGitHubProjectRequest
- type CreateProjectRequest
- type CreateProjectResponse
- type CreateSharedProjectRequest
- type DetectiveRouteOptions
- type DetectiveRouteService
- type EnvironmentRouteOptions
- type EnvironmentRouteService
- type GitHubAuthorizationRouteOptions
- type GitHubAuthorizationService
- type GitHubBranchCapabilities
- type GitHubOAuthAuthorizationService
- type GitHubProjectBranch
- type GitHubProjectBranchesResponse
- type GitHubProjectRouteOptions
- type GitHubRepositoryOption
- type HTTPRunRouteOptions
- type HTTPRunService
- type JoinCloudProjectRequest
- type ListGitHubRepositoriesResponse
- type NativeSemanticRouteOptions
- type NativeSemanticRouteService
- type PersonalCloudLogRouteOptions
- type PersonalCloudLogVerifier
- type PlanRouteOptions
- type PostmortemRouteOptions
- type ProjectLifecycleRouteOptions
- type QueryActivityRouteOptions
- type QueryActivityRouteService
- type QuickSearchRouteOptions
- type RegisterGithubProjectRequest
- type RegisterGithubProjectResponse
- type ResolveGitHubOAuthRepositoryRequest
- type ResolveGitHubOAuthRepositoryResponse
- type RouteOptions
- type SaveGitHubQueryRequest
- type SaveProjectConnectionRequest
- type SessionContextCapabilities
- type SessionContextCatalog
- type SessionContextEnvironment
- type SessionContextProject
- type SessionContextQuerySource
- type SessionContextRouteOptions
- func NewSessionContextRouteOptions(mounted sessioncontext.MountedDatabase, ...) SessionContextRouteOptions
- func WithHostedSessionDetective(options SessionContextRouteOptions, mounted sessioncontext.MountedDatabase, ...) (SessionContextRouteOptions, error)
- func WithHostedShippingSessionContext(options SessionContextRouteOptions, mounted sessioncontext.MountedDatabase, ...) (SessionContextRouteOptions, error)
- type SessionContextSubject
- type SharedProjectAssetRouteOptions
- type SharedProjectAssetRouteService
- type SharedProjectConnectionCatalogReader
- type SharedProjectMeaningRouteOptions
- type SharedProjectMeaningRouteService
- type SharedProjectQueryRouteOptions
- type SharedProjectQueryRouteService
- type SharedProjectRouteOptions
- type SharedProjectRouteService
- type ShippingComponentRouteService
- type ShippingRouteOptions
- type ShippingRouteService
- type ShippingSourceRouteService
- type StartGitHubAuthorizationResponse
- type StartGitHubOAuthRequest
- type VerifiedPlanCaller
- type WorkMigrationRouteService
- type WorkRouteService
Constants ¶
const PersonalCloudLogConnectionsPath = "/v0/datatug/me/log-connections"
const PersonalCloudLogGrantPath = "/v0/datatug/me/google-log-grants"
Variables ¶
This section is empty.
Functions ¶
func NewGitHubProjectVisibilityInventory ¶ added in v0.61.1
func NewGitHubProjectVisibilityInventory(options GitHubProjectRouteOptions) facade4datatug.ProjectVisibilityInventory
func NewQuickSearchAuthority ¶ added in v0.59.1
func NewQuickSearchAuthority(shared *facade4datatug.SharedProjectService, detective *facade4datatug.DetectiveService, github GitHubProjectRouteOptions, public *qs.PublicGitHubVerifier) (qs.Authority, error)
NewQuickSearchAuthority composes current domain admission and fresh fixed-host GitHub visibility. It does not use the anonymous registry trust boundary.
func RegisterHttpRoutes ¶
func RegisterHttpRoutes(handle extension.HTTPHandleFunc, ids facade4datatug.IDGenerator)
RegisterHttpRoutes registers the DataTug module's HTTP routes.
ids is the host's adapter for the domain's IDGenerator port; the host supplies it at composition time (datatug-cloud, internal/datatug/adapters.go).
Route paths are literal: the host mounts them verbatim, with no module-id or /v0/ prefix added. These are the paths the datatug-apps client already calls.
func RegisterHttpRoutesWithOptions ¶ added in v0.10.0
func RegisterHttpRoutesWithOptions(handle extension.HTTPHandleFunc, ids facade4datatug.IDGenerator, options RouteOptions)
RegisterHttpRoutesWithOptions mounts the shared command as well as legacy routes. An unbound shared service returns 503 without authentication/storage effects. Binding this route requires independently reviewed host composition.
func RegisterHttpRoutesWithPlan ¶ added in v0.4.0
func RegisterHttpRoutesWithPlan(handle extension.HTTPHandleFunc, ids facade4datatug.IDGenerator, plan PlanRouteOptions)
RegisterHttpRoutesWithPlan adds the personal plan route with host-injected verification and reads. An unbound route fails closed with 503.
func RegisterPersonalCloudLogRoutes ¶ added in v0.59.1
func RegisterPersonalCloudLogRoutes(handle extension.HTTPHandleFunc, options PersonalCloudLogRouteOptions)
RegisterPersonalCloudLogRoutes is opt-in: the host must explicitly bind every security dependency. Existing registration APIs and OVDB are unchanged.
func RegisterQuickSearchRoutes ¶ added in v0.59.1
func RegisterQuickSearchRoutes(handle extension.HTTPHandleFunc, o QuickSearchRouteOptions)
Types ¶
type AccessActorVerifier ¶ added in v0.60.11
type AccessActorVerifier interface {
// decision requires fresh independent proof. For ordinary reads a host may
// return that proof when available, but a delegated credential never has it.
VerifyAccessActor(context.Context, string, bool) (facade4datatug.AccessActor, error)
}
type AccessAgentBaselineResolverPort ¶ added in v0.61.0
type AccessAgentBaselineResolverPort interface {
ResolveAccess(context.Context, facade4datatug.AccessActor, facade4datatug.AccessConnectionScope) (dataaccess.Resolution, error)
}
AccessAgentBaselineResolverPort returns only fresh, reduced Agent authority. The authenticated User actor is retained for control-plane membership checks.
type AccessControlRouteOptions ¶ added in v0.60.11
type AccessControlRouteOptions struct {
Activation AccessDecisionActivationService
Service AccessControlRouteService
Verifier AccessActorVerifier
RecordReader AccessRecordReaderPort
// Table ports are an independent opt-in profile; nil never falls back to a
// point reader, ordinary User authority or an ungoverned query route.
TableReader AccessTableReaderPort
// Agent ports are optional trusted composition. Missing ports remain dormant;
// they never fall back to the ordinary User service or reader.
AgentBaselineResolver AccessAgentBaselineResolverPort
AgentRecordReader AccessRecordReaderPort
AgentTableReader AccessTableReaderPort
}
type AccessControlRouteService ¶ added in v0.60.11
type AccessControlRouteService interface {
ReadAccessProtection(context.Context, facade4datatug.AccessActor, facade4datatug.AccessConnectionScope) (facade4datatug.AccessProtectionView, error)
SetAccessProtection(context.Context, facade4datatug.AccessActor, facade4datatug.AccessProtectionCommand) (facade4datatug.AccessProtectionView, error)
RequestAccess(context.Context, facade4datatug.AccessActor, facade4datatug.AccessRequestCommand) (facade4datatug.AccessGrantView, error)
ListAccessRequests(context.Context, facade4datatug.AccessActor, facade4datatug.AccessConnectionScope) (facade4datatug.AccessGrantList, error)
DecideAccess(context.Context, facade4datatug.AccessActor, facade4datatug.AccessDecisionCommand, dataaccess.GrantState) (facade4datatug.AccessGrantView, error)
ResolveAccess(context.Context, facade4datatug.AccessActor, facade4datatug.AccessConnectionScope) (dataaccess.Resolution, error)
}
type AccessDecisionActivationService ¶ added in v0.65.0
type AccessDecisionActivationService interface {
ReadAccessDecisionActivation(context.Context, facade4datatug.AccessActor, string) (facade4datatug.AccessDecisionActivationView, error)
SetAccessDecisionActivation(context.Context, facade4datatug.AccessActor, facade4datatug.AccessDecisionActivationCommand) (facade4datatug.AccessDecisionActivationView, error)
}
type AccessRecordReaderPort ¶ added in v0.60.11
type AccessRecordReaderPort interface {
ReadAccessRecord(context.Context, facade4datatug.AccessActor, facade4datatug.AccessRecordReadCommand, dataaccess.ResultRequest) (*dataaccess.Result, error)
}
AccessRecordReaderPort binds an actual source and applies Core authority before touching its data adapter. The HTTP layer never evaluates permissions.
type AccessTableReaderPort ¶ added in v0.61.3
type AccessTableReaderPort interface {
ReadAccessTable(context.Context, facade4datatug.AccessActor, facade4datatug.AccessTableReadCommand, dataaccess.ResultRequest) (*dataaccess.Result, error)
}
AccessTableReaderPort pins the actual native source and invokes Core's ReadTableResult. The host, not this HTTP layer, supplies source facts and applies fresh User authority or the fixed Agent baseline without human grants.
type CloudProjectJoinEligibilityRequest ¶ added in v0.60.6
type CloudProjectJoinEligibilityRequest struct {
JoinCloudProjectRequest
}
CloudProjectJoinEligibilityRequest is the join_eligibility body, the same as join_project's. Without a valid pin the response carries no title.
func (*CloudProjectJoinEligibilityRequest) Validate ¶ added in v0.60.6
func (r *CloudProjectJoinEligibilityRequest) Validate() error
type CloudProjectLifecycleRequest ¶ added in v0.60.3
type CloudProjectLifecycleRequest struct {
StoreID string `json:"-"`
SpaceID string `json:"spaceID,omitempty"`
Project string `json:"project"`
Branch string `json:"branch,omitempty"`
// Archived is required by archive_project (true archives, false restores), so
// a body that omits it can never silently restore a project.
Archived *bool `json:"archived,omitempty"`
// ConfirmTitle must equal the project title for a Space project's delete.
ConfirmTitle string `json:"confirmTitle,omitempty"`
}
CloudProjectLifecycleRequest names the DataTug project a lifecycle call acts on. The store travels as `?store=firestore`, as for create_project. A request with a spaceID acts on the Space-backed project spaces/{spaceID}/ext/datatug/projects/{project}; without one, on the personal project ext/datatug/projects/{project}.
func (CloudProjectLifecycleRequest) Validate ¶ added in v0.60.3
func (v CloudProjectLifecycleRequest) Validate() error
Validate validates the request.
type CloudProjectLifecycleRouteOptions ¶ added in v0.60.6
type CloudProjectLifecycleRouteOptions struct {
Service CloudProjectLifecycleRouteService
}
CloudProjectLifecycleRouteOptions bind the Space path of the lifecycle routes. Unbound, a request with a spaceID answers 503. Personal project deletion remains unavailable until its retained-reference inventory is verified.
type CloudProjectLifecycleRouteService ¶ added in v0.60.6
type CloudProjectLifecycleRouteService interface {
SetCloudProjectArchived(context.Context, string, facade4datatug.CloudProjectArchiveCommand) error
DeleteCloudProject(facade.ContextWithUser, facade4datatug.CloudProjectDeleteCommand) (facade4datatug.CloudProjectDeleteResult, error)
}
CloudProjectLifecycleRouteService serves the Space path of archive_project and delete_project (first-cloud-project-endpoints REQ space-project-delete-archive). *facade4datatug.SharedProjectService implements it.
type CloudProjectRouteOptions ¶ added in v0.60.6
type CloudProjectRouteOptions struct {
Service CloudProjectRouteService
}
CloudProjectRouteOptions bind the cloud project routes. An unbound service answers 503 without authentication or storage effects.
type CloudProjectRouteService ¶ added in v0.60.6
type CloudProjectRouteService interface {
CreateCloudProject(context.Context, facade4datatug.CloudProjectCreateCommand) (facade4datatug.CloudProjectRef, error)
SaveProjectConnection(context.Context, facade4datatug.ProjectConnectionSaveCommand) (models4datatug.ProjectConnectionSaveResult, error)
}
CloudProjectRouteService serves the first-cloud-project create and connection commands. *facade4datatug.SharedProjectService implements it once ConfigureCloudProjects bound the host's Space port.
type CloudProjectSharingRouteOptions ¶ added in v0.60.6
type CloudProjectSharingRouteOptions struct {
Service CloudProjectSharingRouteService
}
CloudProjectSharingRouteOptions binds the share-and-join routes. An unbound service answers 503 before authentication.
type CloudProjectSharingRouteService ¶ added in v0.60.6
type CloudProjectSharingRouteService interface {
CreateCloudProjectInvite(facade.ContextWithUser, facade4datatug.CloudProjectInviteCommand) (facade4datatug.CloudProjectInviteResult, error)
CloudProjectJoinEligibility(context.Context, string, facade4datatug.CloudProjectJoinCommand) (facade4datatug.CloudProjectJoinEligibility, error)
JoinCloudProject(facade.ContextWithUser, facade4datatug.CloudProjectJoinCommand) (facade4datatug.CloudProjectJoinResult, error)
ReadCloudProjectAccess(context.Context, string, string, string) (facade4datatug.CloudProjectAccess, error)
}
CloudProjectSharingRouteService serves first-cloud-project-endpoints REQ share-and-join. *facade4datatug.SharedProjectService implements it once the host calls EnableCloudProjectSharing.
type CloudWatchRouteOptions ¶ added in v0.59.1
type CloudWatchRouteOptions struct {
Service *facade4datatug.CloudWatchService
}
type CompleteGitHubAuthorizationRequest ¶ added in v0.13.0
type CompleteGitHubAuthorizationRequest struct {
Code string `json:"code"`
State string `json:"state"`
}
func (CompleteGitHubAuthorizationRequest) Validate ¶ added in v0.13.0
func (r CompleteGitHubAuthorizationRequest) Validate() error
type CompleteGitHubAuthorizationResponse ¶ added in v0.13.0
type CompleteGitHubAuthorizationResponse struct {
Connected bool `json:"connected"`
}
type CompleteGitHubOAuthRequest ¶ added in v0.59.1
type CompleteGitHubOAuthRequest struct {
OperationID string `json:"operationID"`
Code string `json:"code"`
State string `json:"state"`
}
func (CompleteGitHubOAuthRequest) Validate ¶ added in v0.59.1
func (r CompleteGitHubOAuthRequest) Validate() error
type CompleteGitHubOAuthResponse ¶ added in v0.59.1
type CreateCloudProjectInviteRequest ¶ added in v0.60.6
type CreateCloudProjectInviteRequest struct {
Storage string `json:"storage"`
SpaceID string `json:"spaceID"`
Project string `json:"project"`
OperationID string `json:"operationId"`
Role string `json:"role,omitempty"`
Channel string `json:"channel,omitempty"`
Email string `json:"email,omitempty"`
}
CreateCloudProjectInviteRequest is the create_invite body.
func (*CreateCloudProjectInviteRequest) Validate ¶ added in v0.60.6
func (r *CreateCloudProjectInviteRequest) Validate() error
type CreateCloudProjectRequest ¶ added in v0.60.6
type CreateCloudProjectRequest struct {
CommandID string `json:"commandID"`
Title string `json:"title"`
Source *models4datatug.GitHubProjectCloneSource `json:"source,omitempty"`
}
CreateCloudProjectRequest is create_cloud_project's body. It cannot name a Space or a Space type: the Space is always new and its type is DataTug's.
func (CreateCloudProjectRequest) Validate ¶ added in v0.60.6
func (r CreateCloudProjectRequest) Validate() error
type CreateGitHubProjectRequest ¶ added in v0.14.0
type CreateGitHubProjectRequest struct {
Source *models4datatug.GitHubProjectCloneSource `json:"source,omitempty"`
Title string `json:"title"`
SpaceID string `json:"spaceID"`
OperationID string `json:"operationID"`
BillingIntent facade4datatug.SharedProjectBillingIntent `json:"billingIntent,omitempty"`
CIEnabled *bool `json:"ciEnabled,omitempty"`
GitHub struct {
RepositoryID int64 `json:"repositoryID"`
Owner string `json:"owner"`
Name string `json:"name"`
Folder string `json:"folder"`
Branch string `json:"branch"`
ExpectedBranchHead string `json:"expectedBranchHead"`
} `json:"github"`
Template struct {
ID string `json:"id"`
Commit string `json:"commit"`
} `json:"template"`
}
func (*CreateGitHubProjectRequest) UnmarshalJSON ¶ added in v0.14.0
func (v *CreateGitHubProjectRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON refuses unknown fields recursively. The common mutation API must never silently discard richer client metadata before computing a request digest or writing to GitHub.
func (CreateGitHubProjectRequest) Validate ¶ added in v0.14.0
func (v CreateGitHubProjectRequest) Validate() error
type CreateProjectRequest ¶
CreateProjectRequest is the body of a create-project request. The store is taken from the `?store=` query parameter (the same shape the datatug CLI agent's create_project endpoint uses), so it is not part of the JSON body.
func (CreateProjectRequest) Validate ¶
func (v CreateProjectRequest) Validate() error
Validate validates the request.
type CreateProjectResponse ¶
type CreateProjectResponse struct {
ID string `json:"id"`
}
CreateProjectResponse is the response of a successful create-project call.
type CreateSharedProjectRequest ¶ added in v0.10.0
type CreateSharedProjectRequest struct {
}
func (CreateSharedProjectRequest) Validate ¶ added in v0.10.0
func (r CreateSharedProjectRequest) Validate() error
type DetectiveRouteOptions ¶ added in v0.29.1
type DetectiveRouteOptions struct {
Service DetectiveRouteService
AIProvider func(context.Context, *http.Request) (ai.LLMProvider, error)
}
type DetectiveRouteService ¶ added in v0.29.1
type DetectiveRouteService interface {
State(context.Context, string, string, string, string) (detective.State, error)
RunSavedQuery(context.Context, string, facade4datatug.HostedQueryRunRequest) (facade4datatug.HostedQueryRunResponse, error)
Action(context.Context, string, facade4datatug.HostedDetectiveAction) (facade4datatug.HostedDetectiveResponse, error)
CaseEvents(context.Context, string, string, string, string, int) (detective.CaseEventsPage, error)
KnowledgeProposals(context.Context, string, string, string, string) (facade4datatug.HostedKnowledgePage, error)
KnowledgeAction(context.Context, string, facade4datatug.HostedKnowledgeAction) (facade4datatug.HostedKnowledgeResponse, error)
LinkedIncidents(context.Context, string, string, string, string) (facade4datatug.HostedIncidentLinks, error)
ProjectIncidents(context.Context, string, string, string, string) (facade4datatug.HostedProjectIncidents, error)
ProjectIncident(context.Context, string, string, string, string, string) (facade4datatug.HostedProjectIncident, error)
IncidentEvents(context.Context, string, string, string, string, string, uint64, int) (facade4datatug.HostedIncidentEvents, error)
IncidentAction(context.Context, string, facade4datatug.HostedIncidentAction) (facade4datatug.HostedIncidentResponse, error)
CreateOrResumeDemo(context.Context, string, facade4datatug.DetectiveDemoProjectRequest) (models4datatug.SharedProjectRef, error)
AIProposals(context.Context, string, string, string, string) (facade4datatug.HostedAIPage, error)
AIGenerate(context.Context, string, facade4datatug.HostedAIGenerate, ai.LLMProvider) (detectiveai.Response, error)
AIReview(context.Context, string, facade4datatug.HostedAIReview) (detectiveai.Proposal, error)
AIConfirm(context.Context, string, facade4datatug.HostedAIConfirm) (detectiveai.Receipt, error)
}
type EnvironmentRouteOptions ¶ added in v0.59.1
type EnvironmentRouteOptions struct{ Service EnvironmentRouteService }
type EnvironmentRouteService ¶ added in v0.59.1
type EnvironmentRouteService interface {
ReadEnvironmentState(context.Context, string, dto.EnvironmentScope) (*dto.EnvironmentState, error)
CreateEnvironment(context.Context, string, dto.CreateEnvironmentRequest) (*dto.EnvironmentOperationResult, error)
SaveEnvironmentOrder(context.Context, string, dto.SaveEnvironmentOrderRequest) (*dto.EnvironmentOperationResult, error)
EnvironmentOperationStatus(context.Context, string, dto.EnvironmentOperationStatusRequest) (*dto.EnvironmentOperationResult, error)
}
EnvironmentRouteService is a project metadata authority, independent of the query save capability. Each operation rechecks current scoped permission.
func NewEnvironmentRouteService ¶ added in v0.59.1
func NewEnvironmentRouteService(hosted *facade4datatug.SharedProjectService, github GitHubProjectRouteOptions) EnvironmentRouteService
NewEnvironmentRouteService composes the existing authenticated hosted and provider boundaries without granting writes from query-save capabilities.
func RebindEnvironmentRouteService ¶ added in v0.60.0
func RebindEnvironmentRouteService(existing EnvironmentRouteService, expectedOldProject, newProject *facade4datatug.SharedProjectService, newGitHubOptions GitHubProjectRouteOptions) (EnvironmentRouteService, error)
RebindEnvironmentRouteService replaces only this package's known owning wrapper at startup. It never mutates a wrapper already serving requests and cannot infer ownership of an opaque custom implementation or override port.
type GitHubAuthorizationRouteOptions ¶ added in v0.13.0
type GitHubAuthorizationRouteOptions struct {
Provider GitHubAuthorizationService
OAuthAppProvider GitHubOAuthAuthorizationService
ProviderSet githubauth4datatug.ProviderSet
}
GitHubAuthorizationRouteOptions opts the host into actor-bound GitHub App OAuth routes. A nil provider keeps the routes fail-closed with 503.
type GitHubAuthorizationService ¶ added in v0.13.0
type GitHubAuthorizationService interface {
BeginAuthorization(context.Context, string) (string, error)
CompleteAuthorization(context.Context, string, string, string) error
ListRepositories(context.Context, string) ([]githubauth4datatug.GitHubRepository, error)
}
GitHubAuthorizationService is the API layer's narrow host-composition port.
type GitHubBranchCapabilities ¶ added in v0.14.0
type GitHubOAuthAuthorizationService ¶ added in v0.59.1
type GitHubOAuthAuthorizationService interface {
BeginProjectAuthorization(context.Context, string, string, []string) (string, error)
CompleteProjectAuthorization(context.Context, string, string, string, string) error
CurrentActorScopes(context.Context, string) (githubauth4datatug.GitHubActor, []string, error)
ResolveRepositoryByName(context.Context, string, string, string) (githubauth4datatug.GitHubRepository, error)
ListRepositories(context.Context, string) ([]githubauth4datatug.GitHubRepository, error)
}
type GitHubProjectBranch ¶ added in v0.14.0
type GitHubProjectBranchesResponse ¶ added in v0.14.0
type GitHubProjectBranchesResponse struct {
Branches []GitHubProjectBranch `json:"branches"`
DefaultBranch string `json:"defaultBranch"`
CurrentBranch string `json:"currentBranch,omitempty"`
Capabilities GitHubBranchCapabilities `json:"capabilities"`
}
type GitHubProjectRouteOptions ¶ added in v0.14.0
type GitHubProjectRouteOptions struct {
Service *facade4datatug.SharedProjectService
Provider *githubauth4datatug.Provider
ProviderSet githubauth4datatug.ProviderSet
AuthorizeRepository func(context.Context, string, int64, string, string) (facade4datatug.GitHubCreateRepository, error)
AuthorizeRepositoryWithScopes func(context.Context, string, int64, string, string, []string) (facade4datatug.GitHubCreateRepository, error)
AuthorizeStatusRepository func(context.Context, string, int64, string, string) (facade4datatug.GitHubCreateRepository, error)
// contains filtered or unexported fields
}
GitHubProjectRouteOptions are injected by the host after configuring the dedicated DataTug GitHub App and paid Space service. A missing port is 503. AuthorizeRepository must freshly bind the Firebase UID to the current GitHub user, selected installation, immutable repository and write grant.
type GitHubRepositoryOption ¶ added in v0.13.0
type HTTPRunRouteOptions ¶ added in v0.59.1
type HTTPRunRouteOptions struct {
Runner HTTPRunService
}
HTTPRunRouteOptions binds the HTTP run proxy. A nil Runner uses the production SSRF-guarded runner.
type HTTPRunService ¶ added in v0.59.1
type HTTPRunService interface {
Run(context.Context, facade4datatug.HTTPRunRequest) (*facade4datatug.HTTPRunResponse, error)
}
HTTPRunService executes one proxied HTTP request.
type JoinCloudProjectRequest ¶ added in v0.60.6
type JoinCloudProjectRequest struct {
Storage string `json:"storage"`
SpaceID string `json:"spaceID"`
Project string `json:"project"`
InviteID string `json:"inviteID"`
Pin string `json:"pin"`
}
JoinCloudProjectRequest is the join_project body.
func (*JoinCloudProjectRequest) Validate ¶ added in v0.60.6
func (r *JoinCloudProjectRequest) Validate() error
type ListGitHubRepositoriesResponse ¶ added in v0.13.0
type ListGitHubRepositoriesResponse struct {
Repositories []GitHubRepositoryOption `json:"repositories"`
}
type NativeSemanticRouteOptions ¶ added in v0.59.1
type NativeSemanticRouteOptions struct{ Service NativeSemanticRouteService }
NativeSemanticRouteOptions requires explicit host wiring. Source names grant nothing.
type NativeSemanticRouteService ¶ added in v0.59.1
type NativeSemanticRouteService interface {
ApplicableNativeSemantic(context.Context, string, models4datatug.NativeSemanticSelectionRequest) (models4datatug.NativeSemanticApplicable, error)
ReadNativeSemanticSchema(context.Context, string, string, string, string, string) (models4datatug.NativeSemanticSchema, error)
BrowseNativeSemantic(context.Context, string, models4datatug.NativeSemanticBrowseRequest) (models4datatug.NativeSemanticRows, error)
ResolveNativeSemantic(context.Context, string, models4datatug.NativeSemanticSelectionRequest) (models4datatug.NativeSemanticResolution, error)
RelatedNativeSemantic(context.Context, string, models4datatug.NativeSemanticSelectionRequest) (models4datatug.NativeSemanticRelated, error)
ReadNativeSemanticRelated(context.Context, string, models4datatug.NativeSemanticRelatedReadRequest) (models4datatug.NativeSemanticRows, error)
AddNativeSemanticMapping(context.Context, string, models4datatug.NativeSemanticMappingRequest) (dto.SaveEntityResponse, error)
}
type PersonalCloudLogRouteOptions ¶ added in v0.59.1
type PersonalCloudLogRouteOptions struct {
Service *logs.Service
Verifier PersonalCloudLogVerifier
// MutationAllowed enforces the exact allowed browser Origin, including start.
MutationAllowed func(*http.Request) bool
// Admit enforces finite per-UID rate/concurrency. Release must be idempotent.
Admit func(context.Context, string) (func(), error)
// FrontendURL is a deployment-configured HTTPS My connections URL, never input.
FrontendURL string
}
type PersonalCloudLogVerifier ¶ added in v0.59.1
type PersonalCloudLogVerifier interface {
VerifyPersonalCloudLogCaller(context.Context, *http.Request, bool) (logs.Identity, error)
}
PersonalCloudLogVerifier must verify Firebase identity for management, rejecting DataTug OAuth/CLI credentials there. Query permits the active DataTug read grant. No caller-supplied UID/header is an authentication source.
type PlanRouteOptions ¶ added in v0.4.0
type PlanRouteOptions struct {
Verifier VerifiedPlanCaller
Service facade4datatug.PersonalPlanService
}
type PostmortemRouteOptions ¶ added in v0.59.1
type PostmortemRouteOptions struct {
Service *facade4datatug.PostmortemService
AIProvider func(context.Context, *http.Request) (ai.LLMProvider, error)
}
type ProjectLifecycleRouteOptions ¶ added in v0.60.0
type ProjectLifecycleRouteOptions struct{ Service datatug.ProjectLifecycleStore }
Binding this optional port requires a provider that has proved complete retained usage and shared admission for every reference-bearing writer. Ordinary CRUD/Meanings services are not substitutes; unbound hosts fail closed.
type QueryActivityRouteOptions ¶ added in v0.20.0
type QueryActivityRouteOptions struct {
Service QueryActivityRouteService
}
type QueryActivityRouteService ¶ added in v0.20.0
type QueryActivityRouteService interface {
IssueContext(context.Context, string, string, string) (facade4datatug.QueryActivityContextResponse, error)
Report(context.Context, string, string, facade4datatug.QueryActivityReport) (facade4datatug.QueryActivityReportResult, error)
}
type QuickSearchRouteOptions ¶ added in v0.59.1
type RegisterGithubProjectRequest ¶ added in v0.2.0
type RegisterGithubProjectRequest struct {
Org string `json:"org"`
Repo string `json:"repo"`
Folder string `json:"folder"`
Title string `json:"title"`
}
RegisterGithubProjectRequest is the body of a register-github-project request: a project whose files the client has already committed to a GitHub repository, which the cloud only needs to record in the user's index.
func (RegisterGithubProjectRequest) Validate ¶ added in v0.2.0
func (v RegisterGithubProjectRequest) Validate() error
Validate validates the request.
type RegisterGithubProjectResponse ¶ added in v0.2.0
type RegisterGithubProjectResponse struct {
ID string `json:"id"`
}
RegisterGithubProjectResponse is the response of a successful call.
type ResolveGitHubOAuthRepositoryRequest ¶ added in v0.59.1
type ResolveGitHubOAuthRepositoryRequest struct {
Owner string `json:"owner"`
Repository string `json:"repository"`
}
func (ResolveGitHubOAuthRepositoryRequest) Validate ¶ added in v0.59.1
func (r ResolveGitHubOAuthRepositoryRequest) Validate() error
type ResolveGitHubOAuthRepositoryResponse ¶ added in v0.59.1
type ResolveGitHubOAuthRepositoryResponse = GitHubRepositoryOption
type RouteOptions ¶ added in v0.10.0
type RouteOptions struct {
AccessControl AccessControlRouteOptions
ProjectLifecycle ProjectLifecycleRouteOptions
Postmortems PostmortemRouteOptions
Watch CloudWatchRouteOptions
NativeSemantic NativeSemanticRouteOptions
Environments EnvironmentRouteOptions
QuickSearch QuickSearchRouteOptions
Shipping ShippingRouteOptions
Plan PlanRouteOptions
CloudProjects CloudProjectRouteOptions
Detective DetectiveRouteOptions
HTTPRun HTTPRunRouteOptions
QueryActivity QueryActivityRouteOptions
GitHubAuthorization GitHubAuthorizationRouteOptions
GitHubProjects GitHubProjectRouteOptions
SessionContext SessionContextRouteOptions
CloudProjectSharing CloudProjectSharingRouteOptions
CloudProjectLifecycle CloudProjectLifecycleRouteOptions
}
RouteOptions preserve the existing plan binding and explicitly opt a host into the new shared route. Old registration APIs retain their exact routes.
type SaveGitHubQueryRequest ¶ added in v0.14.0
type SaveGitHubQueryRequest struct{ dto.SaveQueryRequest }
func (*SaveGitHubQueryRequest) UnmarshalJSON ¶ added in v0.14.0
func (v *SaveGitHubQueryRequest) UnmarshalJSON(data []byte) error
func (SaveGitHubQueryRequest) Validate ¶ added in v0.14.0
func (v SaveGitHubQueryRequest) Validate() error
type SaveProjectConnectionRequest ¶ added in v0.60.6
type SaveProjectConnectionRequest struct {
Storage string `json:"storage"`
SpaceID string `json:"spaceID"`
Project string `json:"project"`
OperationID string `json:"operationId"`
IfMatch string `json:"ifMatch"`
DemoDB string `json:"demoDb"`
}
SaveProjectConnectionRequest is save_connection's body.
type SessionContextCapabilities ¶ added in v0.28.0
type SessionContextCapabilities struct {
OperationScope *facade4datatug.SessionOperationScope `json:"operationScope,omitempty"`
NativeDetective bool `json:"nativeDetective"`
ActorID string `json:"actorId"`
SchemaVersion int `json:"schemaVersion"`
DatabaseID string `json:"databaseId"`
ProjectID string `json:"projectId"`
Environments []SessionContextEnvironment `json:"environments"`
Actions []string `json:"actions"`
Subjects []SessionContextSubject `json:"subjects,omitempty"`
}
type SessionContextCatalog ¶ added in v0.28.0
type SessionContextCatalog func(context.Context, SessionContextProject) ([]SessionContextEnvironment, error)
Catalog must return verified environments for this admitted source. An empty catalog fails closed; clients cannot turn arbitrary environment names into grants.
type SessionContextEnvironment ¶ added in v0.28.0
type SessionContextEnvironment struct {
// NativeDetective overrides the legacy global capability for this exact scope.
NativeDetective *bool `json:"nativeDetective,omitempty"`
EnvironmentID string `json:"environmentId"`
IdentityDomain string `json:"identityDomain"`
Title string `json:"title,omitempty"`
Subjects []SessionContextSubject `json:"subjects,omitempty"`
QuerySources []SessionContextQuerySource `json:"querySources,omitempty"`
}
type SessionContextProject ¶ added in v0.28.0
type SessionContextProject struct {
Storage, Project, Branch, SpaceID, ProjectID string
}
SessionContextProject is an admitted source locator, not a storage parent.
type SessionContextQuerySource ¶ added in v0.30.0
type SessionContextQuerySource struct {
Kind string `json:"kind"`
ConnectionID string `json:"connectionId,omitempty"`
Origin string `json:"origin,omitempty"`
DatabaseID string `json:"databaseId"`
FixtureSHA256 string `json:"fixtureSha256"`
CatalogRevision string `json:"catalogRevision,omitempty"`
}
SessionContextQuerySource describes an admitted concrete source; it grants no access.
type SessionContextRouteOptions ¶ added in v0.28.0
type SessionContextRouteOptions struct {
ActiveSessions func(context.Context, datatug.ProjectLifecycleScope, facade4datatug.SessionOperationScope, []sessioncontext.Session) ([]sessioncontext.Session, error)
Work WorkRouteService
Native *facade4datatug.HostedSessionDetectiveService
Resolve func(context.Context, string, SessionContextProject) (*sessioncontext.Service, sessioncontext.Principal, SessionContextCapabilities, error)
// contains filtered or unexported fields
}
func NewSessionContextRouteOptions ¶ added in v0.28.0
func NewSessionContextRouteOptions(mounted sessioncontext.MountedDatabase, shared *facade4datatug.SharedProjectService, github GitHubProjectRouteOptions, catalog SessionContextCatalog) SessionContextRouteOptions
NewSessionContextRouteOptions keeps composition in the host narrow. The actual OVDB Firestore mount supplies database identity and transaction owner. Namespace selection is derived only after current project membership has been verified.
func WithHostedSessionDetective ¶ added in v0.30.0
func WithHostedSessionDetective(options SessionContextRouteOptions, mounted sessioncontext.MountedDatabase, detective *facade4datatug.DetectiveService, activeAccount func(context.Context, string) error, enabled bool) (SessionContextRouteOptions, error)
WithHostedSessionDetective is trusted wiring only. Configuring metadata/status does not enable native dispatch: enabled is an explicit proof-gated host flag.
func WithHostedShippingSessionContext ¶ added in v0.59.1
func WithHostedShippingSessionContext(options SessionContextRouteOptions, mounted sessioncontext.MountedDatabase, detective *facade4datatug.DetectiveService, activeAccount func(context.Context, string) error) (SessionContextRouteOptions, error)
WithHostedShippingSessionContext adds native authoring and evidence capture to an already authorized project catalog. The base must resolve successfully; failures are never converted into an empty, apparently available catalog. Explicit invoice/alternate Native dispatch ports are preserved unchanged.
type SessionContextSubject ¶ added in v0.28.0
type SessionContextSubject struct {
ID string `json:"id"`
Label string `json:"label"`
Subject sessioncontext.Subject `json:"subject"`
Type apicontract.ValueType `json:"type"`
Shape string `json:"shape"`
Scope sessioncontext.Scope `json:"scope"`
}
type SharedProjectAssetRouteOptions ¶ added in v0.59.1
type SharedProjectAssetRouteOptions struct {
}
type SharedProjectAssetRouteService ¶ added in v0.59.1
type SharedProjectAssetRouteService interface {
}
type SharedProjectConnectionCatalogReader ¶ added in v0.60.6
type SharedProjectConnectionCatalogReader interface {
}
SharedProjectConnectionCatalogReader is optionally implemented by the SharedProjectQueryRouteService. When present, connection_catalog serves a project's own connections; otherwise it keeps the pinned demo catalog.
type SharedProjectMeaningRouteOptions ¶ added in v0.59.1
type SharedProjectMeaningRouteOptions struct {
}
type SharedProjectMeaningRouteService ¶ added in v0.59.1
type SharedProjectMeaningRouteService interface {
}
type SharedProjectQueryRouteOptions ¶ added in v0.27.0
type SharedProjectQueryRouteOptions struct {
}
type SharedProjectQueryRouteService ¶ added in v0.27.0
type SharedProjectQueryRouteService interface {
}
type SharedProjectRouteOptions ¶ added in v0.10.0
type SharedProjectRouteOptions struct {
}
type SharedProjectRouteService ¶ added in v0.59.1
type SharedProjectRouteService interface {
}
SharedProjectRouteOptions are supplied only by RegisterHttpRoutesWithOptions; the legacy route registration leaves shared-project routes unmounted. A configured service proves current linked membership and sponsor status for AI eligibility, while project writes still require mutation-time paid checks.
type ShippingComponentRouteService ¶ added in v0.59.1
type ShippingComponentRouteService interface {
ReadShippingComponent(context.Context, string, string, string, string, string) (models4datatug.ShippingComponentState, error)
InstallShippingComponent(context.Context, string, models4datatug.ShippingComponentInstallRequest) (models4datatug.ShippingComponentInstallation, error)
}
type ShippingRouteOptions ¶ added in v0.59.1
type ShippingRouteOptions struct{ Service ShippingRouteService }
ShippingRouteOptions binds only trusted fixture mutations and metadata reads. It does not publish an SQL source or expose application byte downloads.
type ShippingRouteService ¶ added in v0.59.1
type ShippingRouteService interface {
ShippingAction(context.Context, string, models4datatug.ShippingAction) (models4datatug.ShippingActionResponse, error)
ReadShippingRevision(context.Context, string, string, string, string, *models4datatug.ShippingPointer) (models4datatug.ShippingRevision, []byte, error)
}
type ShippingSourceRouteService ¶ added in v0.59.1
type ShippingSourceRouteService interface {
PublishShippingSource(context.Context, string, models4datatug.ShippingPublicationRequest) (models4datatug.ShippingPublication, error)
}
type StartGitHubAuthorizationResponse ¶ added in v0.13.0
type StartGitHubAuthorizationResponse struct {
AuthorizationURL string `json:"authorizationURL"`
}
type StartGitHubOAuthRequest ¶ added in v0.59.1
type StartGitHubOAuthRequest struct {
OperationID string `json:"operationID"`
Owner string `json:"owner,omitempty"`
Repository string `json:"repository,omitempty"`
RequiredScopes []string `json:"requiredScopes"`
}
func (StartGitHubOAuthRequest) Validate ¶ added in v0.59.1
func (r StartGitHubOAuthRequest) Validate() error
type VerifiedPlanCaller ¶ added in v0.4.0
type VerifiedPlanCaller interface {
VerifyPlanCaller(context.Context, *http.Request) (string, error)
}
VerifiedPlanCaller is implemented by the host's credential verifier. It must check token signature, audience, scope and active grant as applicable; this route never regards the Authorization header itself as proof.
type WorkMigrationRouteService ¶ added in v0.59.1
type WorkMigrationRouteService interface {
PlanMigration(context.Context, string, string, string) (facade4datatug.WorkMigrationReport, error)
MigrateLegacy(context.Context, string, string, string, string) (facade4datatug.WorkMigrationReport, error)
}
type WorkRouteService ¶ added in v0.59.1
type WorkRouteService interface {
List(context.Context, string, string, string, facade4datatug.WorkFilter) (m.WorkPage, error)
Get(context.Context, string, string, string, string) (m.WorkDetail, error)
Context(context.Context, string, string, string, string) (sessioncontext.Snapshot, error)
Action(context.Context, string, m.WorkAction) (m.WorkDetail, error)
}
Source Files
¶
- environment_service.go
- favorite_target.go
- github_project_summary_visibility.go
- github_project_visibility.go
- http_access_activation.go
- http_access_control.go
- http_access_table.go
- http_cloud_project.go
- http_cloud_project_lifecycle.go
- http_cloud_project_sharing.go
- http_detective.go
- http_detective_incident_events.go
- http_environment_state.go
- http_favorites.go
- http_github_authorization.go
- http_github_project_assets.go
- http_github_project_branches.go
- http_github_project_capabilities.go
- http_github_project_clone.go
- http_github_project_create.go
- http_github_project_diagnostic.go
- http_github_project_meanings.go
- http_github_project_reads.go
- http_github_project_register.go
- http_github_query_save.go
- http_http_run.go
- http_native_semantic.go
- http_personal_cloud_logs.go
- http_plan.go
- http_postmortem.go
- http_project_create.go
- http_project_lifecycle.go
- http_project_server_discovery.go
- http_query_activity.go
- http_quick_search.go
- http_quick_search_cache.go
- http_quick_search_github.go
- http_quick_search_limits.go
- http_quick_search_preview.go
- http_quick_search_timing.go
- http_session_context.go
- http_session_context_detective.go
- http_shared_project_ai_eligibility.go
- http_shared_project_assets.go
- http_shared_project_create.go
- http_shared_project_meanings.go
- http_shared_project_queries.go
- http_shipping_component.go
- http_shipping_envelope.go
- http_shipping_evidence.go
- http_shipping_retained_reads.go
- http_shipping_session_context.go
- http_shipping_source.go
- http_shipping_source_operation.go
- http_shipping_working_copy.go
- http_space_access.go
- http_team_projects.go
- http_watch.go
- http_work.go
- http_work_migration.go
- import_pointers.go
- routes.go