Documentation
¶
Overview ¶
Copyright 2026 Sneat.co
Copyright 2026 Sneat.co ¶
Package host4datatug holds the host adapters DataTug's checkout and project routes share across hosts: the verified-caller authenticators, the verified first-sign-in bootstrap, the personal-account and owner ports, the project contact and usage-actor ports and the reviewed plan settings. They bind the DataTug domain's narrow ports to Sneat Core, so a library cannot import a service repository and every host imports the same implementation.
Copyright 2026 Sneat.co ¶
Copyright 2026 Sneat.co ¶
Copyright 2026 Sneat.co
Index ¶
- Constants
- func BearerValue(value string) (string, bool)
- func BusinessUsageActors() businessUsageActors
- func PersonalAccountForCheckout(ctx context.Context, db dal.DB, userID string, ...) (facade4datatug.PersonalAccount, error)
- func PersonalOwner() facade4datatug.PersonalPlanOwnerPort
- func PlanConfiguration() facade4datatug.PlanConfigReader
- func ProjectContacts() projectContacts
- func VerifiedPersonalBootstrap(ctx context.Context, actor string) (facade4auth.VerifiedPersonalBootstrap, error)
- func WithRemoteClient(next http.Handler) http.Handler
- type BusinessCheckoutCaller
- type PlanSettings
- type VerifiedCaller
Constants ¶
const PlanSettingsEnv = "DATATUG_PERSONAL_PLAN_SETTINGS_JSON"
The reviewed deployment configuration is versioned and must supply every allowance and model choice. An absent or malformed value closes plan reads and new paid effects; it never invents an allowance.
Variables ¶
This section is empty.
Functions ¶
func BearerValue ¶
BearerValue extracts the token of a well-formed "Bearer <token>" header value.
func BusinessUsageActors ¶
func BusinessUsageActors() businessUsageActors
BusinessUsageActors binds activity attribution to the verified request context preserved by DAL transaction callbacks.
func PersonalAccountForCheckout ¶
func PersonalAccountForCheckout(ctx context.Context, db dal.DB, userID string, bootstrap *facade4auth.VerifiedPersonalBootstrap) (facade4datatug.PersonalAccount, error)
PersonalAccountForCheckout uses only an auth-account already verified by Firebase Admin for the signed-in buyer. The core resolver performs its own fresh provider match before creating a missing user.
func PersonalOwner ¶
func PersonalOwner() facade4datatug.PersonalPlanOwnerPort
PersonalOwner verifies current ownership inside the caller's transaction.
func PlanConfiguration ¶
func PlanConfiguration() facade4datatug.PlanConfigReader
func ProjectContacts ¶
func ProjectContacts() projectContacts
ProjectContacts binds DataTug's project-contact ports to current Contactus records. The DataTug service owns the assignment and reciprocal writes.
func VerifiedPersonalBootstrap ¶
func VerifiedPersonalBootstrap(ctx context.Context, actor string) (facade4auth.VerifiedPersonalBootstrap, error)
VerifiedPersonalBootstrap admits only a single Firebase Admin verified provider account and the actual request-derived client information.
Types ¶
type BusinessCheckoutCaller ¶
type BusinessCheckoutCaller struct{}
BusinessCheckoutCaller verifies the same DataTug product, audience and current OAuth grant as the Pro caller, without requiring a project-write scope for a Space purchase.
func (BusinessCheckoutCaller) AuthenticateCheckout ¶
func (BusinessCheckoutCaller) AuthenticateCheckout(ctx context.Context, bearer string) (subscriptions.BuyerIdentity, error)
type PlanSettings ¶
type PlanSettings struct {
Version string `json:"version"`
ProjectGuestsKnown bool `json:"projectGuestsKnown"`
Config facade4datatug.PlanConfig `json:"config"`
}
func ReadPlanSettings ¶
func ReadPlanSettings() (PlanSettings, error)
type VerifiedCaller ¶
type VerifiedCaller struct{}
VerifiedCaller uses the host's Firebase signature and active OAuth-grant verification. The route-specific policy is bound before each verification; a caller-supplied site, body product or account never broadens it.
func (VerifiedCaller) AuthenticateCheckout ¶
func (VerifiedCaller) AuthenticateCheckout(ctx context.Context, bearer string) (subscriptions.BuyerIdentity, error)