api4datatug

package
v0.62.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 52 Imported by: 1 module, 0 packages

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

Documentation

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

View Source
const PersonalCloudLogConnectionsPath = "/v0/datatug/me/log-connections"
View Source
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

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 {
	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 AccessRecordReaderPort added in v0.60.11

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

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

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

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

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

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 CompleteGitHubOAuthResponse struct {
	Connected bool     `json:"connected"`
	ActorID   int64    `json:"actorID"`
	Login     string   `json:"login"`
	Scopes    []string `json:"scopes"`
}

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

type CreateProjectRequest struct {
	StoreID string `json:"-"`
	Title   string `json:"title"`
}

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 {
	SpaceID       string                                    `json:"spaceID"`
	CommandID     string                                    `json:"commandID"`
	Title         string                                    `json:"title"`
	BillingIntent facade4datatug.SharedProjectBillingIntent `json:"billingIntent,omitempty"`
}

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

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

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 GitHubBranchCapabilities struct {
	BranchList   bool `json:"branchList"`
	BranchCreate bool `json:"branchCreate"`
	BranchDiff   bool `json:"branchDiff"`
	BranchMerge  bool `json:"branchMerge"`
}

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 GitHubProjectBranch struct {
	Name string `json:"name"`
	Head string `json:"head"`
}

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 GitHubRepositoryOption struct {
	ID            int64  `json:"id"`
	Owner         string `json:"owner"`
	Name          string `json:"name"`
	DefaultBranch string `json:"defaultBranch"`
	Permission    string `json:"permission"`
}

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 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 QuickSearchRouteOptions added in v0.59.1

type QuickSearchRouteOptions struct{ Service *qs.Service }

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

type ResolveGitHubOAuthRepositoryResponse added in v0.59.1

type ResolveGitHubOAuthRepositoryResponse = GitHubRepositoryOption

type RouteOptions added in v0.10.0

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

func NewSessionContextRouteOptions added in v0.28.0

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 {
	Service SharedProjectAssetRouteService
}

type SharedProjectConnectionCatalogReader added in v0.60.6

type SharedProjectConnectionCatalogReader interface {
	ReadProjectConnectionCatalog(ctx context.Context, actorID, spaceID, projectID string) (facade4datatug.ProjectConnectionCatalog, error)
}

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 {
	Service SharedProjectMeaningRouteService
}

type SharedProjectMeaningRouteService added in v0.59.1

type SharedProjectMeaningRouteService interface {
	ReadProjectMeanings(context.Context, string, string, string) (datatug.ProjectMeaningsCatalog, error)
	ChangeProjectMeanings(context.Context, string, string, string, datatug.ProjectMeaningWrite) (datatug.ProjectMeaningAck, error)
}

type SharedProjectQueryRouteOptions added in v0.27.0

type SharedProjectQueryRouteOptions struct {
	Service SharedProjectQueryRouteService
}

type SharedProjectQueryRouteService added in v0.27.0

type SharedProjectQueryRouteService interface {
	ReadSharedProjectQuery(context.Context, string, string, string, string, string) (*facade4datatug.SharedProjectQueryReadResult, error)
	ListSharedProjectQueries(context.Context, string, string, string) ([]datatug.QueryDefWithFolderPath, error)
	SaveSharedProjectQuery(context.Context, string, string, dto.SaveQueryRequest) (*dto.SaveQueryResponse, error)
	SharedProjectQueryCapabilities(context.Context, string, string, string) (dto.ProjectCapabilities, error)
	ReadSharedProjectSummary(context.Context, string, string, string) (json.RawMessage, error)
}

type SharedProjectRouteOptions added in v0.10.0

type SharedProjectRouteOptions struct {
	Service SharedProjectRouteService
}

type SharedProjectRouteService added in v0.59.1

type SharedProjectRouteService interface {
	Create(context.Context, facade4datatug.SharedProjectCreateCommand) (models4datatug.SharedProjectRef, error)
	ReadSharedProjectAIEligibility(context.Context, string, string, string) (facade4datatug.ProjectAIEligibility, error)
}

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 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 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)
}

Source Files

Jump to

Keyboard shortcuts

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