quickstart

package module
v0.145.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: MIT Imports: 134 Imported by: 8

README

Quickstart Defaults

The quickstart package (module github.com/goliatone/go-admin/quickstart) bundles opt-in defaults for go-admin so hosts can get a working admin with minimal wiring while keeping override hooks.

Bootstrap helpers

Each helper is optional and composable.

Temporary bootstrap passwords

For first-instance provisioning, keep orchestration in go-users and enforcement in go-auth:

  1. Generate a one-time password and hash it with auth.HashPassword.
  2. Execute service.Commands().UserBootstrapPassword with the target user, hash, actor, and optional TTL. The default TTL is 24 hours.
  3. Wire login with auth.NewUserProvider(repoManager.Users()) or an equivalent provider that reads go-auth user metadata.
  4. Add auth.TemporaryPasswordClaimsDecorator() to the authenticator when the UI needs a compact password_change_required session/JWT hint.
  5. Add TemporaryPasswordGateForAdmin or TemporaryPasswordGate after auth middleware so temporary sessions can only reach password-change/reset routes.
  6. When the user sets a permanent password, run the normal UserPasswordReset/confirm path; temporary-password metadata is cleared when the repository supports it, and the reset token is claimed/finalized through the password-reset lifecycle repository so concurrent confirms cannot double-apply the password.

The metadata contract is migration-free: password_temporary, password_change_required, password_temporary_issued_at, and password_temporary_expires_at. Expired temporary passwords are rejected by local go-auth password verification.

The admin temporary password guide covers the full provisioning, auth wiring, password-change gate, and recovery flow.

Deployment identity

Set admin.Config.Deployment before calling quickstart.NewAdmin. Quickstart keeps the identity resolved by that Admin when it builds the Fiber developer error handler, so the error page and debug surfaces report the same process:

cfg := quickstart.NewAdminConfig("/admin", "Orders", "en")
cfg.Deployment = admin.DeploymentIdentityConfig{
    AppID:       "orders-admin",
    AppName:     "Orders Admin",
    Environment: "development",
    Persona: admin.DeploymentPersonaConfig{
        Enabled: true,
    },
}

adm, _, err := quickstart.NewAdmin(cfg, quickstart.AdapterHooks{})

The optional persona identifies the artifact; InstanceName and InstanceID still identify the answering process. Its seed precedence is typed seed, APP_DEPLOYMENT_SEED, then the full resolved commit. A missing stable seed omits the persona.

For deployed artifacts, inject APP_COMMIT_SHA, APP_VERSION, APP_BUILD_TIME, and APP_GIT_REF; use APP_INSTANCE_NAME and APP_INSTANCE_ID for orchestrator-owned runtime identity. Local processes get a generated readable name and UUID when those values are absent. See docs/GUIDE_DEBUG_MODULE.md for precedence, validation, and environment-color configuration, and docs/GUIDE_DEVELOPMENT.md for linker, GitHub Actions, and container examples.

Host lifecycle and readiness

Admin initialization registers admin routes; the host owns process startup, listener binding, readiness, and shutdown. Reuse the core module's github.com/goliatone/go-admin/pkg/go-lifecycle runner for phased startup and supervised workers. These helpers are opt-in:

  • RegisterLifecycleReadinessRoute(r, routePath, provider) mounts a readiness handler and returns the resolved path; the default is /readyz.
  • LifecycleReadinessHandler(provider) returns 503 until the provider's snapshot is ready, then 200. It does not infer readiness from an open socket.
  • LifecycleStatusPayload(snapshot) projects serving/ready flags and task state.
  • LifecycleDoctorCheck(provider) creates the quickstart.lifecycle diagnostic check; register it with the host's doctor configuration.

Register the readiness route while the backing router is collecting:

// runner is a *lifecycle.Runner, created from the host's lifecycle registry.
readyPath, err := quickstart.RegisterLifecycleReadinessRoute(
    host.InternalOps(), "", runner,
)
if err != nil {
    return err
}
_ = readyPath

Run pre-bind tasks before initializing/serving the backing router; after the listener accepts requests, explicitly mark serving and run post-bind/ready work. Consume background failures and finish lifecycle shutdown before closing shared resources. See the host lifecycle guide and runnable starter for ownership details.

Storage-backed uploads

  • NewStorageBundle(ctx context.Context, cfg StorageBundleConfig) (*StorageBundle, error) - Inputs: shared go-uploader provider config, optional validator/logger/startup validation toggle. Outputs: configured storage provider plus uploader manager for host apps.

  • StorageBundleConfig reuses go-uploader provider config so host apps can select fs, s3, or multi without embedding backend-specific construction logic into app modules.

  • NewAdminConfig(basePath, title, defaultLocale string, opts ...AdminConfigOption) admin.Config - Inputs: base path/title/locale plus option setters. Outputs: admin.Config with quickstart defaults and overrides applied.

  • DefaultMinimalFeatures() map[string]bool - Outputs: minimal Stage 1 feature set (dashboard + cms) intended for WithFeatureSet(...) or custom feature-gate construction.

  • WithDebugConfig(cfg admin.DebugConfig) AdminConfigOption - Inputs: debug config; outputs: option that applies debug config (used to derive debug gate defaults).

  • WithDebugOptions(opt DebugOption) AdminConfigOption - Inputs: explicit debug option overrides; outputs: option that applies targeted debug fields.

  • WithErrorConfig(cfg admin.ErrorConfig) AdminConfigOption - Inputs: error config; outputs: option that applies error presentation defaults.

  • WithErrorOptions(opt ErrorOption) AdminConfigOption - Inputs: explicit error option overrides; outputs: option that applies targeted error fields.

  • WithTheme(name, variant string) AdminConfigOption - Inputs: default admin selector values; outputs: option that sets the configured theme and named variant.

  • WithThemeTokens(tokens map[string]string) AdminConfigOption - Inputs: portable/package semantic or compatible legacy tokens; outputs: option that merges config tokens and final token overrides.

  • WithThemeAssetURLs(assets map[string]string) AdminConfigOption - Inputs: resolved asset URLs/paths keyed by theme asset name; outputs: option that overlays final admin theme assets such as logo, icon, and favicon.

  • WithLoginLogoPlacement(placement admin.LoginLogoPlacement) AdminConfigOption - Inputs: outside-card or inside-card; outputs: normalized login identity-mark placement while preserving theme asset selection.

  • WithThemeAssetPrefix(prefix string) AdminConfigOption - Inputs: final config-level asset prefix; outputs: option applied after provider selection.

  • WithRoutingConfig(cfg routing.Config) AdminConfigOption - Inputs: routing roots/module mount overrides; outputs: option that applies explicit routing policy overrides during quickstart config assembly.

  • WithScopeConfig(scope ScopeConfig) AdminConfigOption - Inputs: scope config; outputs: option that applies single/multi-tenant defaults.

  • WithScopeMode(mode ScopeMode) AdminConfigOption - Inputs: scope mode (single or multi); outputs: option that sets the mode.

  • WithDefaultScope(tenantID, orgID string) AdminConfigOption - Inputs: default tenant/org IDs; outputs: option that sets defaults for single-tenant mode.

  • NewAdmin(cfg admin.Config, hooks AdapterHooks, opts ...AdminOption) (*admin.Admin, AdapterResult, error) - Inputs: config, adapter hooks, optional context/dependencies. Outputs: admin instance, adapter result summary, error.

  • WithAdapterFlags(flags AdapterFlags) AdminOption - Inputs: adapter flags; outputs: option that applies explicit adapter toggles.

  • WithFeatureDefaults(defaults map[string]bool) AdminOption - Inputs: feature override map; outputs: compatibility option that merges overrides into DefaultAdminFeatures().

  • WithFeatureOverrides(defaults map[string]bool) AdminOption - Inputs: feature override map; outputs: explicit merge-style option for quickstart feature defaults.

  • WithFeatureSet(defaults map[string]bool) AdminOption - Inputs: full feature default map; outputs: option that replaces DefaultAdminFeatures() as the base set used by NewAdmin.

  • WithMinimalFeatures() AdminOption - Outputs: option that replaces the default quickstart feature set with DefaultMinimalFeatures().

  • WithStartupPolicy(policy StartupPolicy) AdminOption - Inputs: startup policy (enforce or warn); outputs: option controlling module startup validation handling.

  • WithCommandExecutionPolicy(policy admin.CommandExecutionPolicy) AdminOption - Inputs: command execution policy (global default + per-command overrides); outputs: option that injects command routing policy into bootstrap.

  • WithCommandQueueRouting(cfg CommandQueueRoutingConfig) AdminOption - Inputs: queue routing config (enabled, enqueuer, optional command registry + dedupe store); outputs: option that attaches the queued dispatcher executor.

  • WithRPCTransport(cfg RPCTransportConfig) AdminOption - Inputs: RPC transport config (enabled, optional invoke_path, require_auth, explicit allow_unauthenticated opt-out, discovery_enabled, optional command rules/policy hook); outputs: option that mounts Fiber RPC invoke routes and wires admin RPC command policy defaults.

  • TranslationExchangeCommandIDs() []string - Outputs: canonical translation-exchange command ids for policy configuration.

  • TranslationQueueCommandIDs() []string - Outputs: canonical translation-queue command ids for policy configuration.

  • WithTranslationProfile(profile TranslationProfile) AdminOption - Inputs: profile (none, core, core+exchange, core+queue, full); outputs: option that applies productized translation defaults.

  • WithTranslationProductConfig(cfg TranslationProductConfig) AdminOption - Inputs: product config (SchemaVersion, Profile, optional module overrides); outputs: option that resolves effective translation module wiring with deterministic precedence.

  • TranslationCapabilities(adm *admin.Admin) map[string]any - Inputs: admin instance; outputs: resolved translation capability metadata (profile, schema_version, module enablement, feature flags, routes, resolver keys, panels, warnings).

  • WithTranslationPolicyConfig(cfg TranslationPolicyConfig) AdminOption - Inputs: workflow transition requirements by policy entity/content type; outputs: option that wires the default translation policy and reports missing suitable checker services.

  • WithTranslationPolicyServices(services TranslationPolicyServices) AdminOption - Inputs: page/content services implementing CheckTranslations; outputs: explicit checker overrides for hosts whose CMS container is not discoverable.

  • ValidateTranslationPolicyCoverage(cfg TranslationPolicyConfig, contentTypes []string) (TranslationPolicyValidationResult, error) - Inputs: policy config plus content types included in family readiness; outputs: validation warnings/error for missing policy coverage.

  • WithTranslationExchangeConfig(cfg TranslationExchangeConfig) AdminOption - Inputs: exchange config (disabled by default); outputs: option that enables exchange feature + command wiring when configured.

  • WithTranslationQueueConfig(cfg TranslationQueueConfig) AdminOption - Inputs: queue config (disabled by default); outputs: option that enables queue feature + panel/command wiring when configured.

  • EnablePreferences() AdminOption - Inputs: none; outputs: option to enable FeaturePreferences.

  • EnableFeature(feature admin.FeatureKey) AdminOption - Inputs: feature key; outputs: option to enable a single feature gate key.

  • RegisterTranslationExchangeWiring(adm *admin.Admin, cfg TranslationExchangeConfig) error - Inputs: admin + exchange config; outputs: error (registers exchange commands and optional permission entries).

  • RegisterTranslationQueueWiring(adm *admin.Admin, cfg TranslationQueueConfig, policyCfg TranslationPolicyConfig, hasPolicyCfg bool) error - Inputs: admin + queue config + policy context; outputs: error (registers queue panel, tabs, commands, and optional permission entries).

  • WithGoUsersPreferencesRepository(repo types.PreferenceRepository) AdminOption - Inputs: go-users preferences repo; outputs: option that wires a PreferencesStore via the adapter when one is not already set.

  • WithGoUsersPreferencesRepositoryFactory(factory func() (types.PreferenceRepository, error)) AdminOption - Inputs: repo builder; outputs: option to lazily construct a preferences repo (used when dependencies do not already supply a PreferencesStore).

  • WithGoUsersUserManagement(cfg GoUsersUserManagementConfig) AdminOption - Inputs: go-users auth/inventory/role repositories (plus optional profile repo and scope resolver); outputs: option that wires user/role/profile dependencies.

  • RegisterUserRoleBulkRoutes(r admin.AdminRouter, cfg admin.Config, adm *admin.Admin) error - Inputs: admin router, config, and admin instance; outputs: error. This is an explicit migration bridge for deprecated static role routes; new hosts should use panel bulk actions.

  • NewUsersModule(opts ...admin.UserManagementModuleOption) *admin.UserManagementModule - Inputs: user module options; outputs: configured built-in users module.

  • NewExportBundle(opts ...ExportBundleOption) *ExportBundle - Inputs: go-export options (store/guard/actor/base path overrides). Outputs: runner/service plus go-admin registry/registrar/metadata adapters.

  • PreferencesPermissions() []PermissionDefinition - Outputs: default preferences permission definitions.

  • RegisterPreferencesPermissions(register PermissionRegisterFunc) error - Inputs: register func; outputs: error (registers default preferences permissions).

  • TranslationExchangePermissions() []PermissionDefinition - Outputs: default translation exchange permission definitions.

  • RegisterTranslationExchangePermissions(register PermissionRegisterFunc) error - Inputs: register func; outputs: error (registers translation exchange permissions).

  • TranslationQueuePermissions() []PermissionDefinition - Outputs: default translation queue permission definitions.

  • RegisterTranslationQueuePermissions(register PermissionRegisterFunc) error - Inputs: register func; outputs: error (registers translation queue permissions).

  • NewPreferencesModule(cfg admin.Config, menuParent string, opts ...PreferencesModuleOption) admin.Module - Inputs: admin config, optional menu parent, preferences module options. Outputs: configured Preferences module.

  • WithPreferencesSchemaPath(path string) PreferencesModuleOption - Inputs: schema path (file or directory); outputs: option that overrides the Preferences form schema.

  • WithPreferencesJSONEditorStrict(strict bool) PreferencesModuleOption - Inputs: strict toggle; outputs: option that enforces client-side JSON validation for raw_ui.

  • NewFiberErrorHandler(adm *admin.Admin, cfg admin.Config, isDev bool, opts ...FiberErrorHandlerOption) fiber.ErrorHandler - Inputs: admin, config, dev flag + options. Outputs: Fiber error handler.

  • WithFiberErrorMappers(mappers ...goerrors.ErrorMapper) FiberErrorHandlerOption - Inputs: extra mappers; outputs: error handler option (appended to defaults).

  • NewViewEngine(baseFS fs.FS, opts ...ViewEngineOption) (fiber.Views, error) - Inputs: base FS and view options. Outputs: Fiber views engine and error.

  • RenderTemplateView(c router.Context, template string, viewCtx router.ViewContext) error - Inputs: active router context, template name, and view context. Outputs: rendered response or error after propagating request CSRF helpers and normalizing whole-number JSON values.

  • WithViewAdmin(adm *admin.Admin) ViewEngineOption - Inputs: Admin instance; outputs: binds Admin's structural-partial lookup to the exact normalized first-wins view stack during NewViewEngine construction.

  • DefaultTemplateFuncs(opts ...TemplateFuncOption) map[string]any - Outputs: default template helpers (JSON, dict, singularize/pluralize, adminURL, widget titles, etc.).

  • MergeTemplateFuncs(overrides map[string]any, opts ...TemplateFuncOption) map[string]any - Inputs: overrides + optional template options. Outputs: merged map for WithViewTemplateFuncs.

  • WithTemplateURLResolver(urls urlkit.Resolver) TemplateFuncOption - Inputs: URLKit resolver; outputs: option that configures adminURL to resolve via URLKit.

  • WithViewURLResolver(urls urlkit.Resolver) ViewEngineOption - Inputs: URLKit resolver; outputs: option that configures adminURL to resolve via URLKit.

  • WithThemeContext(ctx router.ViewContext, adm *admin.Admin, req router.Context) router.ViewContext - Inputs: view context, admin, request. Outputs: context enriched with theme tokens/selection, the serialized lowercase admin_partials template map, bounded structural diagnostics, and query/header theme preview overrides.

  • admin.EnrichLayoutViewContextWithChrome(adm *admin.Admin, req router.Context, ctx router.ViewContext, chrome admin.AdminPageChrome) router.ViewContext - Inputs: Admin, request, base view context, and typed page presentation. Outputs: a cloned context where non-zero typed title/pretitle/subtitle/breadcrumb/navigation/body values win over legacy keys before request-scoped shell enrichment; trusted action markup remains template-owned.

  • WithNav(ctx router.ViewContext, adm *admin.Admin, cfg admin.Config, active string, reqCtx context.Context) router.ViewContext - Inputs: base view context + admin/config/request state. Outputs: context enriched with feature flags (activity_enabled, activity_feature_enabled, translation_capabilities, body_classes), session user payload, nav items, theme payload, and path helpers.

  • WithNavPlacements(ctx router.ViewContext, adm *admin.Admin, cfg admin.Config, placements PlacementConfig, placement MenuPlacementKey, active string, reqCtx context.Context) router.ViewContext - Inputs: same as WithNav, plus placement mapping. Outputs: placement-aware nav context for non-sidebar menus while preserving the same feature/session/theme enrichment.

  • ResolveDashboardArea(placements PlacementConfig, placement placement.DashboardPlacementKey, fallback string) string - Inputs: placement config, shared dashboard placement key, fallback area code. Outputs: resolved dashboard area code for quickstart-owned widget wiring.

  • BuildPanelExportConfig(cfg admin.Config, opts PanelViewCapabilityOptions) map[string]any - Inputs: admin config and panel capability options. Outputs: normalized export_config payload (endpoint, definition, optional validated variant); explicit capabilities fail closed when export is false or no resolved export is supplied.

  • BuildPanelDataGridConfig(opts PanelDataGridConfigOptions) map[string]any - Inputs: datagrid options. Outputs: normalized datagrid_config payload (table_id, api_endpoint, action_base, optional capabilities, optional preferences_endpoint, column_storage_key, optional translation/grouped-mode keys, state_store, and url_state).

  • BuildPanelViewCapabilities(cfg admin.Config, opts PanelViewCapabilityOptions) router.ViewContext - Inputs: admin config and panel capability options. Outputs: template capability context including list_capabilities, capability-gated export_config, and datagrid_config. Omit Capabilities only for legacy caller behavior; quickstart-owned panel lists pass an explicit normalized projection.

  • PathViewContext(cfg admin.Config, pathCfg PathViewContextConfig) router.ViewContext - Inputs: config + path resolver hints. Outputs: normalized base_path, api_base_path, asset_base_path, preferences_api_path.

  • WithPathViewContext(ctx router.ViewContext, cfg admin.Config, pathCfg PathViewContextConfig) router.ViewContext - Inputs: existing context + path resolver hints. Outputs: merged context with canonical path keys.

  • WithThemeSelector(selector theme.ThemeSelector, manifest *theme.Manifest) AdminOption - Inputs: admin go-theme selector + manifest; outputs: option that wires admin theme selection + manifest into NewAdmin (including Preferences variant options).

  • NewFiberServer(viewEngine fiber.Views, cfg admin.Config, adm *admin.Admin, isDev bool, opts ...FiberServerOption) (router.Server[*fiber.App], router.Router[*fiber.App]) - Inputs: views, config, admin, dev flag, server options. Outputs: go-router server adapter and router.

  • NewThemeSelector(name, variant string, tokenOverrides map[string]string, opts ...ThemeOption) (theme.Selector, *theme.Manifest, error) - Inputs: theme name/variant, token overrides, theme options. Outputs: selector, manifest, error.

  • WithThemeRegistry(registry theme.Registry) ThemeOption - Inputs: reusable theme registry; outputs: selector option that reuses or registers against it.

  • WithThemeManifest(manifest *theme.Manifest) ThemeOption - Inputs: complete manifest; outputs: selector option that replaces the generated compatibility manifest.

  • WithThemeAssets(prefix string, files map[string]string) ThemeOption - Inputs: manifest-relative asset files and optional prefix; outputs: selector option that fills missing manifest asset metadata.

  • WithThemeVariants(variants map[string]theme.Variant) ThemeOption - Inputs: named variant definitions; outputs: selector option that fills missing manifest variants.

  • NewStaticAssets(r router.Router[T], cfg admin.Config, assetsFS fs.FS, opts ...StaticAssetsOption) - Inputs: router, config, host assets FS, asset options. Outputs: none (registers static routes).

  • ResolveDashboardShellAssetsPrefix(cfg admin.Config, opts ...StaticAssetsOption) string - Inputs: admin config and the same static asset options passed to NewStaticAssets. Outputs: resolved go-dashboard shell asset prefix for content-builder UI route registration.

  • WithContentTypeBuilderUIStaticAssetOptions(cfg admin.Config, opts ...StaticAssetsOption) ContentTypeBuilderUIOption - Inputs: admin config and the same static asset options passed to NewStaticAssets. Outputs: content-builder UI option that keeps rendered shell asset URLs aligned with the mounted shell prefix.

  • ResolveDiskAssetsDir(marker string, candidates ...string) string - Inputs: marker file + candidate directories. Outputs: first matching directory.

  • RegisterAdminUIRoutes(r router.Router[T], cfg admin.Config, adm *admin.Admin, auth admin.HandlerAuthenticator, opts ...UIRouteOption) error - Inputs: router/config/admin/auth wrapper + options. Outputs: error (registers dashboard + notifications UI routes, and injects feature-aware view context such as activity_enabled + body_classes).

  • WithContentEntryDataGridStateStore(cfg PanelDataGridStateStoreOptions) ContentEntryUIOption - Inputs: DataGrid state-store config for content-entry list templates. Outputs: content-entry route option (default mode remains localStorage when unset).

  • WithContentEntryDataGridURLState(cfg PanelDataGridURLStateOptions) ContentEntryUIOption - Inputs: URL sync limits/token config for content-entry list templates. Outputs: content-entry route option.

  • WithContentEntryUpdateIntentPolicy(policy ContentEntryUpdateIntentPolicy) ContentEntryUIOption - Inputs: nested-array update-intent policy. Outputs: content-entry route option that patches configured array paths before persistence.

  • Nested object-array patch/preserve behavior for CMS content-entry forms is an explicit opt-in contract, not the default. Use schema/UI schema/capability metadata or WithContentEntryUpdateIntentPolicy(...); custom renderers must submit the same row and array markers as generated go-formgen repeatable arrays.

  • RegisterAuthUIRoutes(r router.Router[T], cfg admin.Config, routeAuth *auth.RouteAuthenticator, opts ...AuthUIOption) error - Inputs: router/config/go-auth route authenticator + options. Outputs: error (registers login/reset UI routes plus POST /logout; GET /logout is registered only when WithAuthUILogoutGET(true) is passed).

  • RegisterRegistrationUIRoutes(r router.Router[T], cfg admin.Config, opts ...RegistrationUIOption) error - Inputs: router/config + options. Outputs: error (registers signup UI route).

  • NewAuthUIBrowserProtection(cfg admin.Config, opts ...AuthUIBrowserProtectionOption) (*AuthUIBrowserProtection, error) - Inputs: admin config plus optional stable key, cookie, trusted secure-request resolver, and origin policy. Outputs: a reusable browser-bound CSRF contract for Auth UI pages and onboarding mutations.

  • AuthUIViewContext(cfg admin.Config, state AuthUIState, paths AuthUIPaths) router.ViewContext - Inputs: config/state/paths; outputs: view context with auth flags + paths (base_path, api_base_path, asset_base_path, preferences_api_path).

  • Browser/admin routes rendered through quickstart now carry CSRF helpers automatically. Generated forms should include the hidden _token field, and same-origin JavaScript writes should send X-CSRF-Token from meta[name="csrf-token"].

  • For cookie-backed browser pages, prefer the package-managed browser protection path instead of a custom CSRF wrapper so origin checks, CSRF header emission, and session-key resolution stay aligned with go-auth.

  • Login, registration, and password-reset forms use a browser-bound pre-auth cookie plus stateless CSRF signatures and same-origin checks. Create one AuthUIBrowserProtection and pass it through WithAuthUIBrowserProtection, WithRegistrationUIBrowserProtection, and WithOnboardingBrowserProtection so every page/mutation pair shares the same key and cookie contract.

  • Multi-instance deployments must use a shared cfg.PreviewSecret or WithAuthUIBrowserProtectionSecureKey(...). Use WithAuthUIBrowserProtectionSecureRequestResolver(...) when TLS terminates at a trusted proxy so the pre-auth cookie is marked Secure.

  • On trusted HTTPS requests, the default cookie uses the __Host- prefix, Path=/, no Domain, HttpOnly, and SameSite=Lax; plain HTTP keeps a development-compatible host-only name.

  • When an authenticated admin shell renders logout, use a POST form with the page's ambient csrf_field, and pass WithAuthUILogoutAuthenticator(authn) or WithAuthUILogoutMiddleware(mw) so /logout validates with the same browser auth/CSRF contract that produced the token. Login and password reset remain on the standalone Auth UI CSRF path.

  • WithAuthUILogoutGET(true) remains an opt-in compatibility route. If a logout authenticator or middleware is configured, the GET route is wrapped by the same middleware; new shells should keep POST logout canonical. Without that option, GET /admin/logout is a route miss.

  • WithProtectedAppAuth(routeAuth *auth.RouteAuthenticator, cfg auth.Config, opts ...admin.GoAuthAuthenticatorOption) *admin.GoAuthAuthenticator - Inputs: shared go-auth route authenticator plus canonical admin config with protected-app roots. Outputs: a protected-app browser/API authenticator that reuses the same actor/session and CSRF model as admin routes.

  • AttachDebugMiddleware(r router.Router[T], cfg admin.Config, adm *admin.Admin) - Inputs: router/config/admin; outputs: none (registers debug request capture middleware).

  • AttachDebugLogHandler(cfg admin.Config, adm *admin.Admin) - Inputs: config/admin; outputs: none (wires slog debug handler).

  • ConfigureExportRenderers(bundle *ExportBundle, templatesFS fs.FS, opts ...ExportTemplateOption) error - Inputs: export bundle + templates FS + options. Outputs: error (registers template/PDF renderers).

  • NewModuleRegistrar(adm *admin.Admin, cfg admin.Config, modules []admin.Module, isDev bool, opts ...ModuleRegistrarOption) error - Inputs: admin, config, module list, dev flag, options. Outputs: error.

  • WithModuleFeatureGates(gates gate.FeatureGate) ModuleRegistrarOption - Inputs: feature gate; outputs: option to filter modules/menu items.

  • WithModuleFeatureDisabledHandler(handler func(feature, moduleID string) error) ModuleRegistrarOption - Inputs: handler; outputs: option for disabled modules.

  • WithTranslationCapabilityMenuMode(mode TranslationCapabilityMenuMode) ModuleRegistrarOption - Inputs: translation menu seeding mode (tools default, none opt-out); outputs: option controlling whether translation dashboard/queue/exchange links are added to server-seeded navigation.

  • BuildMenuSeedPlan(opts MenuSeedPlanOptions) (MenuSeedPlan, error) - Inputs: menu code/locale, module contributors, optional parent replacement, module/target parent overrides, base item transforms, module item transforms, and extra base items. Outputs: deterministic expected generated menu rows used by quickstart seeding and reconciliation.

  • WithMenuSeedPlanOptions(mutator func(*MenuSeedPlanOptions)) ModuleRegistrarOption - Inputs: mutator for the expected menu seed plan. Outputs: option for advanced host layout control before generated rows are reconciled.

  • WithMenuSeedParents(parents ...admin.MenuItem) ModuleRegistrarOption - Inputs: host-defined parent/group rows. Outputs: option that replaces default quickstart parent groups for the primary menu while retaining module and translation capability collection.

  • WithMenuSeedTargetParentOverride(targetKey, parentID string) ModuleRegistrarOption - Inputs: stable menu target key and parent ID. Outputs: option that moves matching generated rows without copying quickstart seed internals.

  • WithMenuSeedModuleParentOverride(moduleID, parentID string) ModuleRegistrarOption - Inputs: module ID and parent ID. Outputs: option that moves all menu rows contributed by that module under the given parent.

  • WithMenuSeedBaseItemTransform(transforms ...MenuSeedBaseItemTransform) ModuleRegistrarOption - Inputs: transforms for quickstart base/capability rows such as translation dashboard, queue, assignments, and exchange links. Outputs: option for host label, target, permission, parent, or sparse sort-weight tweaks before generated rows are reconciled.

  • WithMenuSeedItemTransform(transforms ...MenuSeedItemTransform) ModuleRegistrarOption - Inputs: transforms for module-contributed menu rows. Outputs: option for host label, permission, parent, or sparse sort-weight tweaks before generated rows are reconciled.

  • ReconcileGeneratedNavigation(ctx context.Context, opts NavigationReconcileOptions) (NavigationReconcileReport, error) - Inputs: menu service, expected items, locale, menu code, apply/dry-run mode, raw-inventory scope, and optional destructive cleanup. Outputs: creates, updates, preserved user rows, duplicate identities, destructive candidates, stale target cleanup, route failures, capability omissions, permission-filtered rows, preserved generated fields, parent-prune diagnostics, raw-inventory availability, raw-present-but-not-rendered rows, and coordination support diagnostics.

  • DefaultContentParentPermissions() []string - Outputs: canonical permission set used by the default sidebar Content parent (media, content_types, block_definitions).

  • WithGoAuth(adm *admin.Admin, routeAuth *auth.RouteAuthenticator, cfg auth.Config, authz admin.GoAuthAuthorizerConfig, authCfg *admin.AuthConfig, opts ...admin.GoAuthAuthenticatorOption) (*admin.GoAuthAuthenticator, *admin.GoAuthAuthorizer) - Inputs: admin, route auth, auth config, authz config, admin auth config, options. Outputs: adapters.

  • WithDefaultDashboardRenderer(adm *admin.Admin, viewEngine fiber.Views, cfg admin.Config, opts ...DashboardRendererOption) error - Inputs: admin, view engine, config, renderer options. Outputs: error.

  • WithDashboardTemplatesFS(fsys fs.FS) DashboardRendererOption - Inputs: template FS; outputs: renderer option for overrides.

  • WithDashboardEmbeddedTemplates(enabled bool) DashboardRendererOption - Inputs: boolean; outputs: renderer option to enable/disable embedded templates.

  • NewCompositeActivitySink(primary admin.ActivitySink, hooks dashboardactivity.Hooks, cfg dashboardactivity.Config) admin.ActivitySink - Inputs: primary sink, dashboard hooks/config. Outputs: activity sink bridge.

  • NewGoAuthActivitySink(sink admin.ActivitySink, opts ...GoAuthActivitySinkOption) auth.ActivitySink - Inputs: admin sink + options. Outputs: go-auth activity adapter.

  • NewSharedActivitySinks(primary admin.ActivitySink, hooks dashboardactivity.Hooks, cfg dashboardactivity.Config, opts ...GoAuthActivitySinkOption) SharedActivitySinks - Inputs: primary sink + dashboard hooks/config. Outputs: shared admin/go-auth sinks.

  • NewFormGenerator(openapiFS fs.FS, templatesFS fs.FS, opts ...FormGeneratorOption) (*formgenorchestrator.Orchestrator, error) - Inputs: OpenAPI FS, templates FS, optional configuration. Outputs: form generator orchestrator and error.

  • WithComponentRegistry(reg *components.Registry) FormGeneratorOption - Inputs: custom registry; outputs: option that replaces default components (clean replace).

  • WithComponentRegistryMergeDefaults(reg *components.Registry) FormGeneratorOption - Inputs: custom registry; outputs: option that merges into defaults, overriding matching names.

  • WithVanillaOption(opt formgenvanilla.Option) FormGeneratorOption - Inputs: vanilla renderer option; outputs: option applied last so it can override templates/styles/registry.

  • The form generation guide covers the end-to-end form generation pipeline, UI schema overlays, component registration, submission parsing, and nested-array update-intent contract.

  • DefaultSecureLinkConfig(basePath string) SecureLinkConfig - Inputs: base path; outputs: securelink defaults.

  • DefaultSecureLinkRoutes(basePath string) map[string]string - Inputs: base path; outputs: securelink routes map.

  • NewSecureLinkManager(cfg SecureLinkConfig) (types.SecureLinkManager, error) - Inputs: securelink config; outputs: go-users securelink manager.

  • NewNotificationsSecureLinkManager(cfg SecureLinkConfig) (links.SecureLinkManager, error) - Inputs: securelink config; outputs: go-notifications securelink manager (delegates to go-notifications/adapters/securelink.NewManager).

  • ApplySecureLinkManager(cfg *userssvc.Config, manager types.SecureLinkManager, opts ...SecureLinkUsersOption) - Inputs: go-users config + manager; outputs: config mutated with securelink routes/manager.

  • NewSecureLinkNotificationBuilder(manager links.SecureLinkManager, opts ...linksecure.Option) links.LinkBuilder - Inputs: notification manager + options; outputs: notification link builder.

  • RegisterOnboardingRoutes(r router.Router[T], cfg admin.Config, handlers OnboardingHandlers, opts ...OnboardingRouteOption) error - Inputs: router/config/handlers; outputs: error (registers onboarding API routes; public registration and password-reset mutations require the browser-bound CSRF token/cookie/origin contract).

  • RegisterUserMigrations(client *persistence.Client, opts ...UserMigrationsOption) error - Inputs: persistence client + options; outputs: error (registers go-auth/go-users/go-notifications migrations using canonical profiles + source labels).

Routing policy overrides

Quickstart exposes the admin/routing policy directly. Host roots and per-module mount overrides remain explicit, and startup logs plus doctor output now include effective roots, resolved module mounts, and conflicts.

Release policy for quickstart matches core:

  • mounted modules must expose RouteContract() routing.ModuleContract
  • routing validation is strict fail-fast in every environment
  • public API exposure is opt-in through PublicAPIRoutes
  • the supported diagnostics surfaces are adm.RoutingReport(), adm.RoutingPlanner().Manifest(), startup logs, and the quickstart.routing doctor check

The routing guide covers the published external-module contract, manifest-diff workflow, and PR review guidance.

cfg := quickstart.NewAdminConfig(
	"/admin",
	"Admin",
	"en",
	quickstart.WithRoutingConfig(routing.Config{
		Roots: routing.RootsConfig{
			AdminRoot:     "/control",
			APIRoot:       "/ops/admin/api",
			PublicAPIRoot: "/api/v2",
		},
		Modules: map[string]routing.ModuleConfig{
			"preferences": {
				Mount: routing.ModuleMountOverride{
					UIBase: "/control/workbench/preferences",
				},
			},
			"partner_tools": {
				Mount: routing.ModuleMountOverride{
					UIBase:  "/control/workbench/partner-tools",
					APIBase: "/ops/admin/api/modules/partner-tools",
				},
			},
		},
	}),
)

External-style modules keep declaring relative contracts and let the host compute absolute paths:

type PartnerToolsModule struct{}

func (*PartnerToolsModule) Manifest() admin.ModuleManifest {
	return admin.ModuleManifest{ID: "partner.tools"}
}

func (*PartnerToolsModule) RouteContract() routing.ModuleContract {
	return routing.ModuleContract{
		Slug: "partner_tools",
		UIRoutes: map[string]string{
			"partner_tools.index": "/",
		},
		APIRoutes: map[string]string{
			"partner_tools.ping": "/ping",
		},
	}
}

func (*PartnerToolsModule) Register(ctx admin.ModuleContext) error {
	ctx.Router.Get(ctx.Routing.RoutePath(routing.SurfaceUI, "partner_tools.index"), handler)
	ctx.ProtectedRouter.Get(ctx.Routing.RoutePath(routing.SurfaceAPI, "partner_tools.ping"), apiHandler)
	return nil
}

Fiber runtime route options can relax adapter behavior for path matching, but they do not disable admin/routing startup validation. Route ownership and path conflicts still fail before router mutation.

Protected app quickstart

Protected-app support extends the existing host-router surface model instead of introducing a second application container.

  • Enable it explicitly with cfg.Routing.ProtectedAppEnabled = true.
  • Omit roots to use the canonical defaults /app and /app/api.
  • Root overrides are only active when ProtectedAppEnabled is true; stale /app values do not reserve the surface by themselves.
  • Map host runtime config such as protected_app.enabled, protected_app.root, and protected_app.api_root into cfg.Routing; quickstart does not read app.json directly.
  • Use host.ProtectedAppUI() and host.ProtectedAppAPI() for explicit route ownership.
  • Use WithProtectedAppAuth(...) for browser/API auth semantics on /app and /app/api.
  • Use quickstart/protectedapp helpers for shell registration, bundle mounting, reserved-prefix derivation, and SPA history fallback.

Example:

cfg := quickstart.NewAdminConfig("/admin", "Admin", "en")
cfg.Routing.ProtectedAppEnabled = true

host := quickstart.NewHostRouter(server.Router(), cfg)

host.ProtectedAppAPI().Get("/app/api/me", apiHandler)

appAuth := quickstart.WithProtectedAppAuth(routeAuth, authCfg)
host.ProtectedAppUI().Get("/app/settings", appAuth.WrapHandler(settingsPage))

if err := protectedapp.RegisterShell(host.ProtectedAppUI(), cfg, appAuth.WrapHandler(appShell)); err != nil {
	panic(err)
}
if err := protectedapp.MountBundle(host.Static(), cfg, "/app/assets", "./dist"); err != nil {
	panic(err)
}
if err := protectedapp.RegisterHistoryFallback(
	host.ProtectedAppUI(),
	cfg,
	appAuth.WrapHandler(appShell),
	"/app/assets",
	"/admin",
	"/api",
	"/static",
	"/.well-known",
); err != nil {
	panic(err)
}

Notes:

  • Existing hosts that do not enable protected-app routing keep their current /app behavior unchanged.
  • admin.WithProtectedSurfaceRoots(...) inherits canonical roots for the side you do not override, so partial overrides keep browser/API split semantics intact.
  • protectedapp.RegisterHistoryFallback(...) is intended for Fiber-backed quickstart hosts. On httprouter-backed hosts, use explicit app routes instead of the SPA history-fallback helper.
  • quickstart.BuildSessionUser(...) reads the authenticated actor/claims from the same protected-app request context, so app handlers can project session metadata without a second auth adapter.

Split deployment:

  • The same primitives work if you split surfaces later. A public-site deployment only mounts PublicSite() plus site fallback. A protected-app deployment mounts ProtectedAppUI(), ProtectedAppAPI(), and WithProtectedAppAuth(...). An admin deployment mounts AdminUI(), AdminAPI(), and the existing admin auth wiring.
  • Keep the configured roots aligned across deployments. The public site should still reserve the protected-app and admin prefixes, while the protected-app deployment should own its own /app and /app/api surfaces directly instead of reintroducing a different routing model.

Command routing

Quickstart defaults to inline command execution. To opt into queued execution, configure policy and queue wiring explicitly.

RPC transport hardening defaults

  • RPC transport is opt-in (WithRPCTransport).
  • When enabled, quickstart requires an authenticator by default and fails startup when RPC routes are mounted if missing.
  • Unauthenticated RPC transport must be opted into explicitly with allow_unauthenticated=true.
  • Discovery route mounting is disabled by default (discovery_enabled=false).
  • Admin command RPC dispatch is deny-by-default until command rules are configured (command_rules / commands.rpc.commands).
  • Command RPC permission checks use resource-role authorization by default. Set permission_mode=exact on the transport or individual command rules when commands require explicit grants such as operational permissions.

The RPC guide covers the full transport, command dispatch, and workflow RPC contract.

Dev inline (default)
adm, _, err := quickstart.NewAdmin(
	cfg,
	quickstart.AdapterHooks{},
	quickstart.WithCommandExecutionPolicy(admin.CommandExecutionPolicy{
		DefaultMode: command.ExecutionModeInline,
	}),
)
Dev local queue (same process API + worker)
queueRegistry := queuecommand.NewRegistry()
_ = commandregistry.AddResolver("queue", queuecommand.QueueResolver(queueRegistry))

queueStorage := queuepostgres.NewStorage(db)
queueAdapter := queuepostgres.NewAdapter(queueStorage)

adm, _, err := quickstart.NewAdmin(
	cfg,
	quickstart.AdapterHooks{},
	quickstart.WithCommandExecutionPolicy(admin.CommandExecutionPolicy{
		PerCommand: map[string]command.ExecutionMode{
			"documents.pdf.remediate": command.ExecutionModeQueued,
		},
	}),
	quickstart.WithCommandQueueRouting(quickstart.CommandQueueRoutingConfig{
		Enabled:  true,
		Enqueuer: queueAdapter,
		Registry: queueRegistry,
	}),
)
if err != nil {
	return err
}
if err := commandregistry.Start(context.Background()); err != nil {
	return err
}
worker, err := queuecommand.StartLocalWorker(context.Background(), queueAdapter, queueRegistry, queuecommand.LocalWorkerConfig{})
if err != nil {
	return err
}
defer worker.Stop(context.Background())
Prod remote worker (API process only)
queueRegistry := queuecommand.NewRegistry()
_ = commandregistry.AddResolver("queue", queuecommand.QueueResolver(queueRegistry))

queueStorage := queuepostgres.NewStorage(db)
queueAdapter := queuepostgres.NewAdapter(queueStorage)

adm, _, err := quickstart.NewAdmin(
	cfg,
	quickstart.AdapterHooks{},
	quickstart.WithCommandExecutionPolicy(admin.CommandExecutionPolicy{
		PerCommand: map[string]command.ExecutionMode{
			"documents.pdf.remediate": command.ExecutionModeQueued,
		},
	}),
	quickstart.WithCommandQueueRouting(quickstart.CommandQueueRoutingConfig{
		Enabled:  true,
		Enqueuer: queueAdapter,
		Registry: queueRegistry,
	}),
)
if err != nil {
	return err
}
if err := commandregistry.Start(context.Background()); err != nil {
	return err
}

Run workers in a separate process with the same queue adapter + command registry wiring (queuecommand.RegisterAll/StartLocalWorker).

Translation quickstart modules keep their existing async options and can now reuse command policy primitives:

  • TranslationExchangeConfig.CommandExecutionMode
  • TranslationQueueConfig.CommandExecutionMode
Command routing observability

When using queued routing (for example documents.pdf.remediate), quickstart emits structured dispatch logs with canonical routing fields:

  • command_id
  • execution_mode
  • dispatch_id
  • correlation_id
  • accepted

Host applications should expose command and domain counters from their own observability package and keep raw secrets and idempotency material out of metric labels.

User management

Quickstart can wire go-users repositories and expose the built-in users module. The users feature flag is enabled by default in DefaultAdminFeatures(); if you disable it, the users module is skipped and user/role endpoints return FeatureDisabledError.

Use WithGoUsersUserManagement to provide the required repositories (AuthRepo, InventoryRepo, RoleRegistry) and optional ProfileRepo + ScopeResolver. This wires UserRepository, RoleRepository, and (when provided) ProfileStore. When ScopeResolver is omitted, quickstart uses ScopeBuilder(cfg) so single-tenant defaults apply to the standard go-users user, role, and profile adapters. Explicit resolvers still win.

Bulk role operations should use panel bulk routes (/panels/:panel/bulk/:action, e.g. /admin/api/panels/users/bulk/assign-role). Legacy static routes are not part of bootstrap. If a migration window still requires them, register the compatibility routes explicitly before the router seals:

if err := quickstart.RegisterUserRoleBulkRoutes(host.Admin(), cfg, adm); err != nil {
	return err
}

Quickstart Fiber defaults use prefer_static path conflict resolution, so absolute static routes (for example /users/bulk/assign-role) can coexist with wildcard siblings (for example /users/bulk/:action) deterministically. Override path conflict behavior with WithFiberAdapterConfig(...). Quickstart also defaults Fiber request-header ReadBufferSize to 16KB; override with WithFiberConfig(...) when your deployment needs a different limit.

cfg := quickstart.NewAdminConfig("/admin", "Admin", "en")

adm, _, err := quickstart.NewAdmin(
\tcfg,
\tquickstart.AdapterHooks{},
\tquickstart.WithGoUsersUserManagement(quickstart.GoUsersUserManagementConfig{
\t\tAuthRepo:      authRepo,
\t\tInventoryRepo: inventoryRepo,
\t\tRoleRegistry:  roleRegistry,
\t\tProfileRepo:   profileRepo,   // optional
\t\tScopeResolver: scopeResolver, // optional; omitted uses quickstart.ScopeBuilder(cfg)
\t}),
)
if err != nil {
\treturn err
}

_ = adm.RegisterModule(quickstart.NewUsersModule(
\tadmin.WithUserMenuParent("main"),
\tadmin.WithUserProfilesPanel(), // opt-in managed profiles panel
\tadmin.WithUserPanelTabs(admin.PanelTab{
\t\tID:     "activity",
\t\tLabel:  "Activity",
\t\tScope:  admin.PanelTabScopeDetail,
\t\tTarget: admin.PanelTabTarget{Type: "path", Path: "/admin/users/:id/activity"},
\t}),
))

The managed profiles panel and activity tab are opt-in; omit WithUserProfilesPanel or WithUserPanelTabs to keep the default users panel.

All user management URLs should resolve via URLKit (admin namespace). Defaults:

  • adm.URLs().Resolve("admin.users") -> /admin/users
  • adm.URLs().Resolve("admin.roles") -> /admin/roles
  • Panel API collection endpoints are canonical under /admin/api/panels/<panel> (for example /admin/api/panels/users, /admin/api/panels/roles).
  • Panel API detail endpoints are canonical under /admin/api/panels/<panel>/<id>.
  • adm.URLs().Resolve("admin.user_profiles") -> /admin/user-profiles (when the profiles panel is enabled)

Panel entry behavior:

  • Canonical panel UI routes (registered by RegisterContentEntryUIRoutes) now honor PanelBuilder.WithEntryMode(...).
  • RegisterContentEntryUIRoutes must register concrete canonical routes before the generic /content/:name/* handlers. Reordering them can cause paths like /admin/content/documents/new to be captured by the generic matcher and skip the intended browser handler.
  • profile defaults to admin.PanelEntryModeDetailCurrentUser, so GET /admin/profile resolves to the current user detail view instead of the profile datagrid/list.
  • Successful profile create-as-update and update submissions return to the canonical route with saved=1, preserving channel and requested locale. WithContentEntryPostCreatePolicy still runs once after create and may add query state, but cannot replace the singleton destination or reserved state.
  • Panels without explicit entry mode use admin.PanelEntryModeList.

To opt a panel into a different canonical entry point:

usersModule := quickstart.NewUsersModule(
	admin.WithUsersPanelConfigurer(func(builder *admin.PanelBuilder) *admin.PanelBuilder {
		if builder == nil {
			return nil
		}
		return builder.WithEntryMode(admin.PanelEntryModeDetailCurrentUser)
	}),
)
_ = usersModule

Bulk role routes are auto-registered by quickstart when users is enabled:

  • adm.URLs().Resolve("admin.api.users.bulk.assign_role") -> /admin/api/users/bulk/assign-role
  • adm.URLs().Resolve("admin.api.users.bulk.unassign_role") -> /admin/api/users/bulk/unassign-role

Translation exchange (opt-in)

Translation exchange is disabled by default in quickstart. Enable it explicitly with WithTranslationExchangeConfig(...).

Translation product profiles

Quickstart supports one product-level translation entry point:

quickstart.WithTranslationProductConfig(quickstart.TranslationProductConfig{
	SchemaVersion: 1, // defaults to 1
	Profile:       quickstart.TranslationProfileCore, // default for cms-enabled apps
	Exchange:      nil, // optional module override
	Queue:         nil, // optional module override
})

Supported profiles:

  • none
  • core
  • core+exchange
  • core+queue
  • full

Deterministic precedence order:

  1. Profile baseline (core default when cms is enabled, otherwise none).
  2. Product module overrides (TranslationProductConfig.Exchange / Queue).
  3. Legacy options (WithTranslationExchangeConfig, WithTranslationQueueConfig) as final compatibility overrides.

When exchange is enabled through profiles, quickstart still validates that required exchange handlers are configured. If cms is disabled, any effective profile/module enablement other than none fails startup with a typed translation product config error. Quickstart publishes resolved translation metadata to both:

  • quickstart.TranslationCapabilities(adm) for backend/example wiring.
  • translation_capabilities in UI route view context and quickstart.WithNav(...) context for template/frontend gating.
  • Startup diagnostics log event: translation.capabilities.startup (INFO) with profile, schema_version, module enablement, feature flags, routes, panels, resolver keys, and warnings.
  • Validation failures log translation.capabilities.startup (ERROR) with deterministic fields: error_code, error_message, hint, failed_checks.
  • SchemaVersion=0 is treated as a supported legacy input and normalized to schema version 1 with warning translation.productization.schema.upconverted.
  • Explicit translation module feature overrides in WithFeatureDefaults are honored (translations.exchange, translations.queue) before dependency validation.
  • dashboard=false only suppresses dashboard exposure; it does not disable translation policy enforcement or queue/exchange wiring by itself.
Migration and compatibility contract

Product wiring and legacy manual wiring can coexist during migration.

  • Conflict handling is deterministic: legacy module options are applied after profile + product module overrides.
  • Mixed product+legacy usage emits warning translation.productization.legacy_override.
  • Switching to product config changes runtime wiring source only and must not mutate persisted translation records, exchange artifacts, or queue assignments.
  • Legacy manual wiring options remain supported for at least two minor releases after product API GA.

The CMS guide contains the detailed translation productization contract and rollout rules.

Minimal in-process wiring:

adm, _, err := quickstart.NewAdmin(
	cfg,
	quickstart.AdapterHooks{},
	quickstart.WithTranslationExchangeConfig(quickstart.TranslationExchangeConfig{
		Enabled: true,
		Store:   translationExchangeStore, // implements admin.TranslationExchangeStore
	}),
)
if err != nil {
	return err
}

Optional permission registration:

err := quickstart.RegisterTranslationExchangePermissions(func(def quickstart.PermissionDefinition) error {
	// host permission catalog integration
	return permissionRegistry.Register(def.Key, def.Description)
})

Permission ownership:

  • Quickstart defines and can register translation permission keys into a host permission catalog.
  • Quickstart does not create roles or assign permissions to users.
  • The host application must seed/assign permissions for every role that should access exchange/queue routes.
  • Exchange endpoints require:
    • admin.translations.export -> POST /admin/api/translations/exchange/export
    • admin.translations.import.view -> GET /admin/api/translations/exchange/template
    • admin.translations.import.validate -> POST /admin/api/translations/exchange/import/validate
    • admin.translations.import.apply -> POST /admin/api/translations/exchange/import/apply

Optional async apply integration for production workers:

quickstart.WithTranslationExchangeConfig(quickstart.TranslationExchangeConfig{
	Enabled: true,
	Store:   translationExchangeStore,
	AsyncApply: func(ctx context.Context, input admin.TranslationImportApplyInput) (admin.TranslationExchangeResult, error) {
		// enqueue job in external worker and return queued contract
		return admin.TranslationExchangeResult{
			Summary: admin.TranslationExchangeSummary{
				Processed: len(input.Rows),
			},
			Metadata: map[string]any{"queued": true},
		}, nil
	},
})
Exchange contract and trigger reuse

Exchange adapters should preserve one command contract across HTTP, CLI, and jobs.

HTTP routes:

  • POST /admin/api/translations/exchange/export
  • GET /admin/api/translations/exchange/template
  • POST /admin/api/translations/exchange/import/validate
  • POST /admin/api/translations/exchange/import/apply

Row linkage fields (rows[*]):

  • resource
  • entity_id
  • family_id
  • target_locale
  • field_path

Safety semantics:

  • Run validate before apply.
  • apply never auto-publishes imported rows.
  • Missing locale variants require explicit create intent (create_translation).
  • source_hash mismatch is a typed row conflict unless explicitly overridden.
  • Duplicate linkage rows in one payload produce deterministic row conflicts and do not write duplicate changes.

Trigger command names:

  • admin.translations.exchange.import.run (typed run command)
  • jobs.translations.exchange.import.run (cron/manual trigger)

Job wrapper:

  • examples/web/jobs.NewTranslationImportRunJob(...) builds a cron trigger command that dispatches the same typed run message contract.
Grouped translation-family lists

Quickstart grouped translation UX expects sibling locale rows to exist as real list records.

Behavior:

  • locale=en stays locale-scoped.
  • locale=all requests wildcard list reads for translation-enabled panels.
  • group_by=family_id groups already-expanded sibling rows into one family row with locale children.
  • family_id=<id> without an explicit locale returns all siblings for that family.

This contract applies to both structured content panels and page-backed panels when their repositories/read adapters use the CMS translation-family expansion path.

Translation queue (opt-in)

Translation queue is disabled by default in quickstart. Enable it with WithTranslationQueueConfig(...).

Minimal wiring:

policyCfg := quickstart.TranslationPolicyConfig{
	Required: map[string]quickstart.TranslationPolicyEntityConfig{
		"catalog_items": {
			"publish": {Locales: []string{"en", "es"}},
		},
	},
}

adm, _, err := quickstart.NewAdmin(
	cfg,
	quickstart.AdapterHooks{},
	quickstart.WithTranslationPolicyConfig(policyCfg),
	quickstart.WithTranslationQueueConfig(quickstart.TranslationQueueConfig{
		Enabled: true,
		// Optional: provide repository/service overrides.
		// Repository: admin.NewInMemoryTranslationAssignmentRepository(),
	}),
)
if err != nil {
	return err
}

Locale alignment rule:

  • If supported_locales is omitted, quickstart derives queue locales from active translation policy requirements.
  • If supported_locales is explicitly set and policy locales are available, sets must match exactly or startup fails with ErrTranslationQueueConfig.

Optional permission registration:

err := quickstart.RegisterTranslationQueuePermissions(func(def quickstart.PermissionDefinition) error {
	return permissionRegistry.Register(def.Key, def.Description)
})

Queue permission map:

  • admin.translations.view -> queue list/detail read access.
  • admin.translations.assign -> queue create/new and assign/release actions.
  • admin.translations.edit -> submit-review/update flows.
  • admin.translations.approve -> approve/reject review actions.
  • admin.translations.manage -> archive/manage/bulk lifecycle actions.
  • admin.translations.claim -> claim open-pool assignments.

Auth note:

  • Non-CRUD permissions (for example admin.translations.export and admin.translations.assign) are checked as explicit permission strings.
  • After changing role permissions, reload the page so permission checks and diagnostics reflect current role assignments.

URL configuration

Quickstart defaults still mount admin under /admin and the public API under /api/v1, but the canonical URL surface now lives in cfg.URLs.

Example:

cfg := quickstart.NewAdminConfig("/admin", "Admin", "en")
cfg.URLs.Admin.BasePath = "/control"
cfg.URLs.Admin.APIPrefix = "api"
cfg.URLs.Public.APIVersion = "v2"

If you need full control, set cfg.URLs.URLKit to a custom URLKit config and use adm.URLs() for template helpers and route registration.

For panel-backed navigation targets, prefer canonical panel URL helpers instead of hardcoded paths:

  • quickstart.ResolveAdminPanelURL(adm.URLs(), cfg.BasePath, "<panel>")

The helper resolves the canonical panel entry URL. When a panel opts into PanelEntryModeDetailCurrentUser, that same URL opens detail for the current authenticated user.

Scope defaults (single vs multi-tenant)

Quickstart can enforce a single-tenant default scope or require explicit tenant/org claims for multi-tenant projects.

Modes:

  • single (default): injects default tenant/org IDs when claims are missing.
  • multi: never injects defaults; scope must come from auth claims/metadata.

The standard WithGoUsersUserManagement path uses these rules automatically when ScopeResolver is omitted. Custom repositories, handlers, or direct go-users registry calls must use quickstart.ScopeBuilder(cfg) or an equivalent config-aware resolver themselves.

The authentication and permissions guide covers the broader role, scope, debug console, doctor, and permissions-panel workflow.

go-admin request and service paths should resolve trusted tenant/org scope through Admin.EffectiveScope(...) or Admin.EffectiveScopeFromRequest(...). These helpers preserve explicit trusted scope, apply configured defaults only in single-tenant mode, and ignore browser query tenant_id / org_id values for authenticated actor scope. Repository code should receive the resolved scope and apply explicit predicates; do not add global persistence hooks that inject scope into every query.

Defaults:

  • tenant: 11111111-1111-1111-1111-111111111111
  • org: 22222222-2222-2222-2222-222222222222

Explicit config:

cfg := quickstart.NewAdminConfig("/admin", "Admin", "en",
	quickstart.WithScopeConfig(quickstart.ScopeConfig{
		Mode:            quickstart.ScopeModeSingle,
		DefaultTenantID: "11111111-1111-1111-1111-111111111111",
		DefaultOrgID:    "22222222-2222-2222-2222-222222222222",
	}),
)

Quickstart registers a quickstart.scope_drift doctor check for single-tenant translation data. Hosts can wire it with:

adm, _, err := quickstart.NewAdmin(
	cfg,
	hooks,
	quickstart.WithScopeDriftInspector(quickstart.NewBunScopeDriftInspector(db)),
)

The check inspects the allowlisted translation tables content_families, locale_variants, family_blockers, and translation_assignments for blank tenant/org rows. It reports counts and default scope metadata, skips multi-tenant mode, reports unavailable/missing tables as informational findings, and never mutates data.

When the same Bun inspector is wired, quickstart also registers the explicit command quickstart.scope_drift.repair. Dispatch without apply to dry-run the allowlisted tables; dispatch with apply: true to backfill blank tenant/org values to the configured single-tenant defaults. Apply mode rejects multi-tenant configurations and never updates tables outside the allowlist.

Explicit Fiber v3 host and presentation

NewFiberV3ViewEngine, DefaultFiberV3TemplateFuncs and WithViewFiberV3TemplateFuncs use the go-router Fiber v3 contracts and are available without build tags. Existing NewViewEngine and v2 host defaults remain unchanged. NewFiberV3ErrorHandler shares the v2 HTML/API presentation policy and accepts the same FiberErrorHandlerOption values, including custom error mappers. WithDefaultFiberV3DashboardRenderer installs typed dashboard SSR on the shared v3 views while preserving an existing renderer.

views, err := quickstart.NewFiberV3ViewEngine(
    client.Templates(),
    quickstart.WithViewBasePath("/admin"),
    quickstart.WithViewFeatureGate(featureGate),
    quickstart.WithViewTranslator(translator),
    quickstart.WithViewReload(false),
)
if err != nil { return err }
// The explicit host installs the shared HTML/API error policy by default.
server, routes := quickstart.NewFiberV3Server(views, cfg, adm, isDev)
// Install the renderer before Admin initialization when the host needs dashboard SSR.
err = quickstart.WithDefaultFiberV3DashboardRenderer(adm, views, cfg)

WithFiberV3ErrorHandler and native WithFiberV3Config overrides remain authoritative. Register authentication, admin routes and assets before initialization, then start with server.Serve(address). WithFiberV3AdapterConfig forwards native ListenConfig through Serve; callers starting server.WrappedRouter() directly must supply their native listener/TLS/hook settings themselves.

Hosts own long-lived sessions. Cancel the contexts assigned to dashboard WebSocket and SSE requests, wait for their handlers/subscriptions to finish, then call server.Shutdown(ctx) with the caller's bounded context. The admin-shell shutdown coordinator drains the native server before lifecycle hooks and shared-resource release; wrap its server shutdown operation with stream cleanup. If the deadline expires, retain shared resources and retry cleanup after remaining requests finish. Native server shutdown alone does not establish WebSocket cleanup.

The maintained TestFiberCandidateHostIntegration, TestFiberCandidateHostLifecycle and TestFiberCandidateHostStartupFailure tests under examples/admin-shell/internal/core exercise both native hosts on real local listeners. They verify candidate package composition; publication and application adoption remain separate steps.

The same filesystem, overlay, asset, admin-lookup, translation and ordinary helper options work on both constructors. The v3 engine registers tojson locally and retains its JSON/null fallback and escaping behavior across reloads. Feature and CSRF helpers retain their names and policies through native v7 helper signatures. Request context stays in render-local helper closures rather than becoming an object exposed to templates; configured context keys, scope, cancellation and snapshots remain available to the helpers.

Synthetic route-miss diagnostics require an explicit terminal fallback. For a standalone native app, register app.Use(quickstart.NewFiberV3RouteMissHandler(cfg)) last, after all application routes and middleware (v2 uses NewFiberRouteMissHandler). With a go-router adapter, call server.Init() first so deferred routes and assets are registered, then append the native fallback. NewFiberServer and NewFiberV3Server do this automatically during initialization; configure native middleware through their options before Init, WrappedRouter or Serve.

The fallback marks only owned admin misses reached at the end of routing and retains native method-not-allowed behavior. Error presentation preserves direct and wrapped middleware errors. Without the terminal fallback, a standalone app still presents native 404s with their original diagnostics; sentinel identity and message text alone never establish a synthetic miss.

Keep WithViewTemplateFuncs(shared) for the shared/v2 map. Add WithViewFiberV3TemplateFuncs(v7Overrides) for application helpers using v7 Value or execution-context types under the same template names. Overrides do not modify the shared map or affect v2. Arbitrary v6 tags and boxed values are not translated; port their Go implementations explicitly. Additional v7 filters and tags can register on the returned router.FiberV3ViewExtensions interface.

Use the repository workspace and the published dependencies declared in go.mod. From quickstart:

go test -race . -run '^TestFiberPresentation|^TestFiberV3|^TestDashboard' -count=1
go run ./examples/fiber-v3-presentation -addr 127.0.0.1:3001

Open /admin for the standalone preview; ?state=empty, /admin/denied, /admin/failure, /admin/api/denied and /admin/redirect exercise presentation states. The example embeds its page overlay and stylesheet and serves packaged admin assets through NewStaticAssets. It supplies the T00 presentation ports without using the quickstart server constructor. It is a local presentation sample, not an authenticated production host or evidence of final host acceptance. Existing v2 examples are retained.

The parity tests compare the real login, users, translations, activity, feature-flags, media and dashboard templates against v2. Native HTTP checks cover HTML/API status, correlation, cookies, explicit redirects, theme/partial overlays, failed-render fallback, safe locals, CSRF helpers and concurrent request isolation. Asset tests verify matching helper output, GET/HEAD bytes, fallback precedence and missing files; the example has a real HTTP listener smoke test. Final host defaults, authenticated integration, lifecycle validation and publication remain separate.

Template functions

NewViewEngine wires DefaultTemplateFuncs() when no template functions are supplied. Prefer WithViewURLResolver(adm.URLs()) (or WithTemplateURLResolver(adm.URLs())) so adminURL resolves via URLKit; WithViewBasePath(cfg.BasePath) remains as a fallback for legacy setups. WithViewTemplateFuncs is a strict override; use MergeTemplateFuncs if you want to keep defaults and add/override a subset. The go-router Pongo2 engine treats these helpers as functions (globals), not filters, so call them like {{ singularize(resource_label|default:resource)|title }} instead of {{ resource_label|singularize }}.

adminURL is available by default. Use it for admin-relative links and admin-hosted assets such as {{ adminURL("login") }} or {{ adminURL("assets/dist/dashboard/index.js") }}. When a template intentionally supports a separate asset host or CDN, prefer asset_base_path instead of adminURL.

Template function options let you override widget title labels without touching the core map:

  • WithWidgetTitleOverrides(overrides map[string]string) TemplateFuncOption - merges label overrides into defaults.
  • WithWidgetTitleMap(titles map[string]string) TemplateFuncOption - replaces the default map entirely.
  • WithWidgetTitleFunc(fn func(string) string) TemplateFuncOption - provides a custom resolver.
  • Widget definition constants are available via constants such as admin.WidgetUserProfileOverview.
  • WithTemplateBasePath(basePath string) TemplateFuncOption - sets the fallback base path used by the adminURL helper.
  • WithTemplateURLResolver(urls urlkit.Resolver) TemplateFuncOption - configures the URLKit resolver used by adminURL.
  • WithTemplateFeatureGate(gate fggate.FeatureGate, opts ...fgtemplates.HelperOption) TemplateFuncOption - registers feature gate template helpers (featureEnabled, featureDisabled, etc.) from go-featuregate.
  • WithTemplateIconRenderer(renderFunc func(ref string, variant string) string) TemplateFuncOption - injects a custom icon renderer for renderIcon and renderIconVariant helpers; if not provided, templates use the built-in legacy icon rendering.
funcs := quickstart.MergeTemplateFuncs(
	map[string]any{
		"titleize": strings.ToUpper,
	},
	quickstart.WithTemplateURLResolver(adm.URLs()),
	quickstart.WithTemplateBasePath(cfg.BasePath),
	quickstart.WithWidgetTitleOverrides(map[string]string{
		admin.WidgetUserProfileOverview: "Profile Overview",
	}),
)

views, err := quickstart.NewViewEngine(
	os.DirFS("./web"),
	quickstart.WithViewTemplateFuncs(funcs),
)
if err != nil {
	return err
}

UI routes

Quickstart includes opt-in helpers for common UI routes (admin shell, notifications, login/logout, password reset).

if err := quickstart.RegisterAdminUIRoutes(router, cfg, adm, authn); err != nil {
	return err
}

if err := quickstart.RegisterAuthUIRoutes(
	router,
	cfg,
	routeAuth,
	quickstart.WithAuthUILogoutAuthenticator(authn),
	quickstart.WithAuthUITitles("Login", "Password Reset"),
); err != nil {
	return err
}

if err := quickstart.RegisterRegistrationUIRoutes(
	router,
	cfg,
	quickstart.WithRegistrationUITitle("Register"),
); err != nil {
	return err
}

if err := quickstart.RegisterContentEntryUIRoutes(
	router,
	cfg,
	adm,
	authn,
	quickstart.WithContentEntryDataGridStateStore(quickstart.PanelDataGridStateStoreOptions{
		Mode: "preferences", // optional; default is local storage when unset
	}),
	quickstart.WithContentEntryDataGridURLState(quickstart.PanelDataGridURLStateOptions{
		MaxURLLength:     1800,
		MaxFiltersLength: 600,
	}),
); err != nil {
	return err
}

When canonical panel UI routes are active (PanelUIRouteModeCanonical), the base panel route (/admin/<panel>) uses the panel entry mode. For example, detail_current_user renders detail for the authenticated user; default mode remains list/datagrid.

Panel list template contract

For list templates rendered from quickstart panel/content-entry routes, use datagrid_config as the canonical contract for DataGrid wiring:

  • datagrid_config.table_id
  • datagrid_config.api_endpoint
  • datagrid_config.action_base
  • datagrid_config.preferences_endpoint (optional; resolved panel preferences API path)
  • datagrid_config.column_storage_key
  • datagrid_config.translation_ux_enabled (optional)
  • datagrid_config.enable_grouped_mode, default_view_mode, group_by_field (optional)
  • datagrid_config.state_store (optional: {mode, resource, sync_debounce_ms, hydrate_timeout_ms, max_share_entries})
  • datagrid_config.url_state (optional: {max_url_length, max_filters_length, enable_state_token})
  • datagrid_config.export_config

State persistence behavior:

  • default mode is localStorage (state_store omitted or mode=local).
  • optional preferences mode (mode=preferences) hydrates/syncs user state through /api/panels/preferences, with local cache fallback.
  • URL sync writes compact query state; when limits are exceeded, DataGrid can fallback to state=<token> instead of writing large query payloads.

Compatibility keys (datatable_id, list_api, action_base, export_config) are still present for legacy templates, but new/updated templates should read from datagrid_config first.

The CRUD guide covers the full CRUD/DataGrid/action wiring contract. The search guide covers admin global search, public site search, go-search adapter wiring, application-defined variants, typed evidence and named counts, validated page-size policy, bounded filter-only execution, and panel DataGrid search distinctions. Optional search policy blocks are validated by site.RegisterSiteRoutes; nil blocks preserve legacy behavior.

Password reset UI defaults to two pages:

  • Request: /admin/password-reset (template password_reset)
  • Confirm: /admin/password-reset/confirm (template password_reset_confirm)

Override the confirm route or template with WithAuthUIPasswordResetConfirmPath and WithAuthUIPasswordResetConfirmTemplate.

Auth UI SSO provider context

The default login template reads optional sso_providers from auth UI view context. Integrations such as go-auth/adapters/goadmin can inject it with WithAuthUIViewContextBuilder(...); go-admin does not discover providers, configure OIDC, handle callbacks, or receive secrets.

Each provider entry is a display-safe map:

  • key: stable non-secret provider identifier.
  • label: required user-facing provider name.
  • login_url: required begin-login URL for enabled providers.
  • icon_class: optional CSS/icon class metadata.
  • icon_url: optional image/icon asset URL.
  • disabled_reason: optional non-secret reason for unavailable providers.

Entries without a usable label are ignored. Entries with label, login_url, and no disabled_reason render as sign-in links. Entries with a disabled_reason render disabled without href. A usable login_url is a non-empty relative URL or http/https URL without control characters; blank URLs and unsafe schemes never produce active links. Missing, empty, or fully malformed provider lists omit the SSO divider and provider section.

quickstart.WithAuthUIViewContextBuilder(func(ctx router.ViewContext, c router.Context) router.ViewContext {
	ctx["sso_providers"] = []map[string]any{
		{
			"key":       "acme",
			"label":     "Acme ID",
			"login_url": "/admin/auth/sso/acme",
		},
	}
	return ctx
})
Theme assets for auth UI

Auth and registration UI routes support theme assets (logo, icon, favicon) via dedicated options. Assets are exposed in templates as theme.assets.logo, theme.assets.icon, theme.assets.favicon, etc. Relative filenames are joined with the provided prefix; already resolved absolute URLs/paths are preserved.

Reserved branding semantics:

  • logo: expanded sidebar / horizontal lockup
  • icon: compact sidebar mark and auth-card icon
  • favicon: browser/app icon
authThemeAssets := map[string]string{
	"icon":    "icon.svg",
	"logo":    "logo.svg",
	"favicon": "favicon.svg",
}
authThemeAssetPrefix := path.Join(cfg.BasePath, "assets")

if err := quickstart.RegisterAuthUIRoutes(
	router,
	cfg,
	routeAuth,
	quickstart.WithAuthUILogoutAuthenticator(authn),
	quickstart.WithAuthUITitles("Login", "Password Reset"),
	quickstart.WithAuthUIThemeAssets(authThemeAssetPrefix, authThemeAssets),
); err != nil {
	return err
}

if err := quickstart.RegisterRegistrationUIRoutes(
	router,
	cfg,
	quickstart.WithRegistrationUITitle("Register"),
	quickstart.WithRegistrationUIThemeAssets(authThemeAssetPrefix, authThemeAssets),
); err != nil {
	return err
}

For manual route handlers, use WithAuthUIViewThemeAssets to merge theme assets into the view context:

viewCtx := router.ViewContext{
	"title":     cfg.Title,
}
viewCtx = quickstart.WithPathViewContext(viewCtx, cfg, quickstart.PathViewContextConfig{
	BasePath: cfg.BasePath,
})
viewCtx = quickstart.WithAuthUIViewThemeAssets(viewCtx, authThemeAssets, authThemeAssetPrefix)
return c.Render("register", viewCtx)

Auth templates prefer theme.assets.icon when it exists and fall back to theme.assets.logo.

For non-auth/public handlers, prefer the same path helper before rendering templates that link JS/CSS assets:

viewCtx := quickstart.WithPathViewContext(nil, cfg, quickstart.PathViewContextConfig{
	BasePath:    cfg.BasePath,
	APIBasePath: "/api/v1/public",
})

Templates use a conditional fallback pattern:

{% if theme and theme.assets and theme.assets.logo %}
<img src="{{ theme.assets.logo }}" alt="Logo" class="w-10 h-10" />
{% else %}
<!-- inline SVG fallback -->
{% endif %}

CMS workflow defaults

Quickstart wires CMS workflows through the shared go-admin workflow system. This section covers startup helpers; the workflow guide covers the full workflow/state-machine contract.

To start from defaults and override only a subset, register defaults before your overrides or opt in to default registration on a custom engine:

workflow := admin.NewFSMWorkflowEngine()
admin.RegisterDefaultCMSWorkflows(workflow)
workflow.RegisterWorkflow("content", admin.WorkflowDefinition{
    EntityType:   "content",
    InitialState: "draft",
    Transitions: []admin.WorkflowTransition{
        {Name: "submit_for_approval", From: "draft", To: "approval"},
        {Name: "publish", From: "approval", To: "published"},
    },
})

adm, _, err := quickstart.NewAdmin(
    cfg,
    hooks,
    quickstart.WithAdminDependencies(admin.Dependencies{
        Workflow: workflow,
    }),
)
if err != nil {
    return err
}
adm.WithCMSWorkflowDefaults()

Workflow capability precedence for dynamic content panels:

  1. workflow_id (aliases: workflowId, workflow-id)
  2. legacy workflow
  3. persisted workflow runtime binding (content_type, then trait, then global)
  4. no workflow

Content type capability examples:

{
  "panel_traits": ["editorial"],
  "workflow_id": "editorial.news"
}
{
  "panel_traits": ["editorial"],
  "workflow": "editorial.default"
}

Migration guidance:

  1. Keep legacy workflow keys initially.
  2. Add runtime bindings for shared defaults.
  3. Add explicit workflow_id for content types that must override defaults.
  4. Remove legacy workflow after validation.

External workflow config (YAML/JSON) can be loaded at startup:

schema_version: 1
workflows:
  editorial.default:
    initial_state: draft
    transitions:
      - name: submit_for_approval
        from: draft
        to: approval
      - name: publish
        from: approval
        to: published
  editorial.news:
    initial_state: draft
    transitions:
      - name: submit_for_approval
        from: draft
        to: approval
      - name: publish
        from: approval
        to: published
bindings:
  - scope_type: trait
    scope_ref: editorial
    workflow_id: editorial.default
    priority: 100
    status: active
adm, _, err := quickstart.NewAdmin(
    cfg,
    hooks,
    quickstart.WithWorkflowConfigFile("workflow_config.yaml"),
)

Definitions are registered into the configured workflow engine during startup. Bindings are seeded when WithWorkflowRuntime(...) is also provided.

Validation fails fast with actionable field errors for:

  • unsupported schema versions
  • invalid workflow definitions (missing initial_state, transition fields, duplicate transition names)
  • bindings referencing unknown workflow IDs

Persisted workflow runtime can be wired for dynamic workflow and binding management:

runtime := admin.NewWorkflowRuntimeService(
    admin.NewInMemoryWorkflowDefinitionRepository(),
    admin.NewInMemoryWorkflowBindingRepository(),
)

adm, _, err := quickstart.NewAdmin(
    cfg,
    hooks,
    quickstart.WithAdminDependencies(admin.Dependencies{
        Workflow: admin.NewFSMWorkflowEngine(),
    }),
    quickstart.WithWorkflowRuntime(runtime),
)

Runtime binding resolution order is:

  1. content type binding
  2. trait binding
  3. global binding

Capability precedence is unchanged: explicit workflow_id/workflow on the content type still wins over persisted bindings.

Workflow management API endpoints:

  • GET /admin/api/workflows
  • POST /admin/api/workflows
  • PUT /admin/api/workflows/:id (expected_version required for updates; rollback_to_version enables rollback)
  • GET /admin/api/workflows/bindings
  • POST /admin/api/workflows/bindings
  • PUT /admin/api/workflows/bindings/:id (expected_version required)
  • DELETE /admin/api/workflows/bindings/:id

The workflow guide covers operational migration, rollback, and persistence details.

CMS demo panels default to the submit_for_approval and publish actions. Override them with:

adm.WithCMSWorkflowActions(
    admin.Action{Name: "submit_for_approval", Label: "Submit for approval"},
    admin.Action{Name: "publish", Label: "Publish"},
)

Translation policy (workflow enforcement)

Quickstart can enforce translation completeness during workflow transitions (publish/promote). Provide a TranslationPolicyConfig via WithTranslationPolicyConfig; quickstart wires the default policy when the config is present (or when deny_by_default/required are set).

Config example (YAML/JSON):

translation_policy:
  deny_by_default: false
  required_fields_strategy: "error" # error|warn|ignore
  page_entities: ["landing_pages"] # optional: additional entities that use page checker
  entity_aliases:
    article: news
  required:
    landing_pages:
      publish:
        locales: ["en", "es"]
      promote:
        environments:
          staging:
            locales: ["en"]
          prod:
            locales: ["en", "es", "fr"]
    articles:
      publish:
        locales: ["en"]
        required_fields:
          en: ["title", "path"]

Behavior notes:

  • required keys map to policy entities (panel slug or content type slug). If a payload includes policy_entity/policyEntity, it overrides the entity lookup.
  • pages is the go-cms Pages service policy entity and uses the page checker by default; page is the backing content type slug used when page records are bridged through generic content APIs. Other entities use the content checker unless listed in page_entities; quickstart does not use a page checker as fallback for content entities or a content checker as fallback for page entities.
  • Entity lookup is singular/plural tolerant (for example item vs items) using inflection-based matching against configured required keys.
  • Use entity_aliases for irregular/legacy names that need explicit mapping.
  • Transition names are the workflow transition names (publish, promote, etc.).
  • If an environment match is present, it overrides transition-level locales/required_fields for that transition.
  • required_fields is a map of locale → required field keys. If locales is empty but required_fields is set, locales are derived from the map keys.
  • required_fields_strategy controls how unknown field keys are handled during validation (error, warn, ignore).
  • deny_by_default=true blocks transitions when no requirements are configured for a transition.
  • Every content type included in translation family readiness needs effective publish requirements. Use ValidateTranslationPolicyCoverage when hosts know the family content types at startup; an entity key without publish locales or required fields is not enough.
  • The default policy needs page/content services that implement CheckTranslations. Quickstart discovers them from go-cms wiring when possible; use WithTranslationPolicyServices when the CMS container is not discoverable or when custom entity routing needs explicit page/content services.
  • Family readiness is persisted by sync. After policy, checker-service, or CMS fixture changes, rerun family sync so content_families, locale_variants, and family_blockers match the current policy.
  • policy_denied with details.reason=policy_unavailable means policy configuration or checker wiring is missing; it is not a missing-translation task for editors.
  • The CMS guide covers the operational contract and troubleshooting workflow.

Wiring example:

policyCfg := quickstart.TranslationPolicyConfig{
	Required: map[string]quickstart.TranslationPolicyEntityConfig{
		"articles": {
			"publish": {Locales: []string{"en", "es"}},
		},
	},
}

if _, err := quickstart.ValidateTranslationPolicyCoverage(policyCfg, []string{"articles"}); err != nil {
	return err
}

adm, _, err := quickstart.NewAdmin(
	cfg,
	hooks,
	quickstart.WithTranslationPolicyConfig(policyCfg),
	// Use explicit services when go-cms checkers are not auto-discoverable.
	quickstart.WithTranslationPolicyServices(quickstart.TranslationPolicyServices{
		Pages:   pageService,
		Content: contentService,
	}),
)
if err != nil {
	return err
}
Theme selector + manifest

When using go-theme, pass the selector + manifest into quickstart so the Preferences UI can list available variants. The theme guide covers the full theme contract, resolution order, and payload shape.

selector, manifest, err := quickstart.NewThemeSelector(
	cfg.Theme,
	cfg.ThemeVariant,
	cfg.ThemeTokens,
	quickstart.WithThemeAssets(path.Join(cfg.BasePath, "assets"), map[string]string{
		"logo":    "logo.light.svg",
		"icon":    "icon.light.svg",
		"favicon": "favicon.svg",
	}),
)
if err != nil {
	return err
}

adm, _, err := quickstart.NewAdmin(
	cfg,
	hooks,
	quickstart.WithThemeSelector(selector, manifest),
)
if err != nil {
	return err
}
_ = adm

If you build the admin manually, call adm.WithAdminTheme(selector) and adm.WithThemeManifest(manifest) after initialization. Public-site theme selection is separate; attach it with quicksite.WithSiteTheme(selector) or SiteConfig.ThemeProvider.

The default quickstart manifest also exposes these sidebar brand aliases:

  • sidebar-brand-max-height → admin.sidebar.brand-max-height
  • sidebar-brand-max-width → admin.sidebar.brand-max-width
  • sidebar-brand-collapsed-size → admin.sidebar.brand-collapsed-size
  • sidebar-brand-align → admin.sidebar.brand-align

New manifests should prefer the canonical dotted keys. The aliases remain for compatibility and lose when the matching canonical key is present.

Use WithThemeAssets(...) for manifest-relative theme assets and WithThemeAssetURLs(...) / admin.Config.ThemeAssets for final resolved URL overrides supplied by host config.

If you have local CSS that forces the sidebar logo to width: 100%, remove that override and configure branding through logo, icon, and the sidebar brand tokens instead.

WithThemeManifest(...), WithThemeAssets(...), and WithThemeVariants(...) above are ThemeOption values passed to NewThemeSelector; WithThemeSelector(...) is the separate AdminOption passed to NewAdmin. Existing registered or explicit manifests win. Asset/variant options fill missing manifest fields and do not overwrite populated ones.

For explicit variants:

selector, manifest, err := quickstart.NewThemeSelector(
	cfg.Theme,
	cfg.ThemeVariant,
	cfg.ThemeTokens,
	quickstart.WithThemeVariants(map[string]theme.Variant{
		"light": {},
		"dark": {
			Tokens: map[string]string{
				"color.surface.canvas":     "#09090b",
				"color.surface.default":    "#18181b",
				"color.text.primary":       "#fafafa",
				"color.border.default":     "#3f3f46",
				"color.action.primary":     "#38bdf8",
				"admin.sidebar.background": "#09090b",
			},
		},
	}),
)

A base-only theme should provide a manifest with no named variants and a selector/provider that resolves an empty variant. The attached manifest is the Preferences option authority, so stale stored or preview variants are cleared to the base.

Quickstart propagates the same request-scoped query/header selection to admin views, DataGrid, dashboard pages/charts, panel and settings forms, and CMS content forms. Content-entry and roles rendering pass adm.FormTheme(ctx) to go-formgen, so portable and form.* semantic tokens cover container width, focus, invalid, disabled, readonly, loading, label/help/error, and responsive states. No semantic tokens preserve the existing renderer output.

Navigation may reference asset:<role> or theme:<role> and resolves the theme asset icon-<role>. Normal icon names also try icon-<normalized-name> before falling back to Iconoir/library/emoji rendering. Host sidebar overrides should preserve renderThemeMenuIcon(item.icon, theme.assets).

Shell-specific presentation options live on admin.Config:

  • SidebarHideSearch removes the shared sidebar search slot.
  • ExternalAssets overrides the Iconoir, simple-datatables, and ECharts document URLs while empty fields retain their published defaults.

NewStaticAssets separately mounts admin assets, go-formgen runtime/renderer assets, and go-dashboard ECharts/shell assets. Manifest paths are metadata; a prefix still needs a mounted route. See docs/GUIDE_THEME.md, docs/GUIDE_FORMGEN.md, and docs/GUIDE_DASHBOARD_WIDGETS.md for the complete semantic API and diagnostics contract.

Public-site theme precedence

For quickstart/site, the packaged theme should be the primary public-site HTML source and host-local wrappers should stay limited to compatibility glue. The supported diagnostics surfaces are:

  • site_theme.manifest_partials plus site_theme.partials in request/view context
  • site_theme.baseline for selected-versus-approved variant checks
  • site.ResolveSiteThemeTemplateDiagnostics(...) for concrete template winner and shadowed-source reporting

When mounting template filesystems, label them so precedence diagnostics stay readable:

siteCfg.Views.TemplateFS = []fs.FS{
	site.LabelTemplateFS(themeFS, "garchen-archive-site", site.TemplateSourcePackagedTheme),
	site.LabelTemplateFS(hostOverlayFS, "host-overlay", site.TemplateSourceHostOverlay),
}

Use site.home.page when the public root route needs a dedicated homepage. If the host leaves SiteThemeConfig.Variant empty, the selector resolves the theme package defaultVariant; use SiteThemeConfig.BaselineVariant to warn when a downstream app forces a non-approved public baseline.

Public-site error rendering policy

quickstart/site supports ordered concrete and theme-backed HTML error templates while preserving the legacy ErrorTemplate, ErrorTemplatesByStatus, and ErrorTemplatesByCode fields. Explicit policy references run before the matching legacy candidates; selection remains code-specific, then status-specific, then generic fallback.

siteCfg.Views.ErrorPolicy = site.SiteErrorTemplatePolicy{
	ByStatus: map[int][]site.SiteTemplateRef{
		http.StatusNotFound: {
			{
				ThemeKey:        "site.error.404_page",
				DefaultTemplate: "site/error/404",
			},
		},
	},
	Fallback: []site.SiteTemplateRef{
		{Template: "site/error"},
	},
}

Theme keys resolve after request theme context is available through site_theme.manifest_partials and the existing aliases. A stable default is used only when the key is absent; unsafe or invalid resolved targets advance to the next reference. Every template attempt is rendered into an isolated router response capture, so missing templates and nested include failures cannot leak partial bytes into the selected fallback.

  • site.RenderSiteErrorHTML is the HTML-only host API. Keep application-specific JSON negotiation and payloads in the host, then call the shared renderer for HTML.
  • site.SiteErrorContextProvider lets registered site modules add safe localized fields after normal request context has run. Normal SiteModule.ViewContext methods are not rerun.
  • Mutable map, slice, and array view data is recursively isolated between the request, providers, and render candidates. Opaque pointer/service values are passed through as read-only capabilities.
  • Host-owned calls inherit the complete middleware request state; explicit State and ViewContext values overlay prepared theme, preview, locale, channel, and path context instead of replacing it wholesale.
  • The base site_error model contains only normalized code, status, and locale/base-path-aware home_href. Providers own any visitor copy or compatibility projections.
  • site.SiteErrorRenderObserver receives sanitized attempt/selection provenance without view data, rendered bytes, tokens, or stack traces. Observer panics cannot change the visitor response.
  • site.ResolveSitePublicPath converts a canonical path into the configured locale/base-path public path and avoids duplicate locale prefixes.
  • Locale-like single-segment canonical slugs are preserved when they belong to a different locale, so /bo remains a valid default-locale path while multi-segment localized inputs still normalize predictably.
  • HEAD preserves the requested status and headers without a body. If every candidate fails, the response contains only the requested status.

Legacy configuration remains valid. Use ErrorPolicy when candidate ordering needs theme keys or multiple fallbacks; existing single-template fields do not require migration.

Public-site render cache

quickstart/site.NewRenderCacheRuntime(...) plus WithRenderCacheRuntime(...) is the canonical setup for anonymous rendered HTML caching on public CMS delivery routes. quickstart/site owns backend construction for the built-in memory and Valkey modes, policy, keying, eligibility, generation fencing, response replay, and unsafe-header filtering; host apps own rollout, host-specific policy inputs, and application-specific invalidation wiring.

  • Use site.NewRenderCacheRuntime(ctx, cfg, policy) and carry the returned runtime through WithRenderCacheRuntime. This keeps the store, generation fence, policy, diagnostics, and request observers together. WithRenderCache(store, policy) remains available for compatible legacy integrations, but it cannot provide the complete generation-fence contract.
  • site.RenderCacheConfig controls backend setup (memory or valkey), debug flags, fail-open/fail-closed startup behavior, tag-index requirements, capture limits, render version, and sanitized diagnostic config. site.RenderCachePolicy remains the public-site eligibility and keying policy.
  • When runtime config and policy overlap, the runtime config is authoritative in the returned RenderCacheRuntime.Policy; use the incoming policy for host-specific eligibility inputs such as namespaces not represented in config, allowlists, auth cookie names, bypass predicates, template renderers, and stale revalidators.
  • Valkey setup supports URL parsing, address fallback, username/password, DB selection, TLS, TLS skip verify, single-client mode, and disabled client-side cache. Startup diagnostics redact URL userinfo and credential-bearing query values.
  • site.RegisterRenderCacheDebugPanel(runtime) registers the built-in site-render-cache debug panel backend. The debug console and toolbar include the matching built-in client renderer, so enabled hosts get the purpose-built panel instead of generic JSON.
  • The runtime snapshot is process-local by design. It reports configured/active state, backend, status, scope, startup errors, sanitized config, capabilities, counters, latest cached metadata, observed key metadata, recent operations/errors, and the last clear command.
  • Clear commands use the existing debug clear-panel transport and record results in the follow-up snapshot. Shared invalidation targets are exported as site.RenderCacheAllSiteTag and site.RenderCacheKeyPrefix; app-specific CMS invalidation should use the same values as the debug clear path.
  • Standard go-router Fiber and HTTPRouter site contexts use router-backed response capture by default, so hosts do not need to provide RenderCachePolicy.TemplateRenderer for the common path.
  • RenderCachePolicy.TemplateRenderer remains an optional override for tests, custom render stacks, and router contexts that cannot use non-committing template capture. Unsupported contexts bypass storage with an observable reason unless an override is configured.
  • RenderCachePolicy.MaxCaptureBodySize defaults to router.DefaultMaxCapturedBodySize; oversized captures bypass storage and then use the normal template response path without committing a partial response.
  • Cache hits replay stored site.RenderedSiteResponse values through the site-owned replay path. quickstart/site does not store or replay raw router.CapturedResponse values, so safe-header filtering, HEAD handling, debug headers, and freshness metadata stay under site-cache policy.
  • RenderCachePolicy.StaleTTL enables stale-while-revalidate. Entries are stored for FreshTTL + StaleTTL; hits before FreshUntil report hit, hits through StaleUntil report stale and replay the stale response, and entries past StaleUntil are deleted and refreshed as misses. Use RenderCachePolicy.StaleRevalidator to schedule host-owned background regeneration without reusing a live router context. Stale revalidation is keyed per process so duplicate stale hits do not stampede one runtime, and callback panics are recovered.
  • RenderCachePolicy.ExpirationMode and RenderCacheConfig.ExpirationMode accept site.RenderCacheExpirationFixed or site.RenderCacheExpirationSliding. Empty mode is fixed, preserving existing hit-time behavior with no renewal writes. Invalid values fail NewRenderCacheRuntime validation and are also rejected when a direct policy is passed to RegisterSiteRoutes.
  • Sliding mode renews only fresh hits. It preserves the original CreatedAt, moves FreshUntil and StaleUntil using the effective policy, and resets the backend TTL to FreshTTL + StaleTTL. GET and HEAD hits renew the shared representation; stale hits keep their original deadlines and continue through stale-while-revalidate without renewal.
  • Sliding renewal adds one backend write per fresh hit and can keep frequently accessed entries fresh indefinitely. Use it only with active mutation invalidation through tags, prefixes, render versions, or handler generation fences; fixed mode remains preferable when write amplification or natural expiry matters more.
  • Built-in memory and Valkey runtimes support sliding renewal. A direct custom store must implement site.RenderCacheSetIfPresentStore; fail-open policy bypasses an unsupported store, while fail-closed policy returns the configured service-unavailable response. Renewal failures are reported separately from ordinary cache writes.
  • Use RenderCachePolicy.AuthCookieNames for host-specific auth cookies and RenderCachePolicy.BypassPredicates for application-specific auth, session, tenant, cart, A/B, or personalization signals. Built-in checks already cover Authorization, admin authenticated request context, go-auth claims/actor context, and common session/JWT cookie names such as session_id and jwt.
  • quickstart/render_cache_gocache_compat_test.go compiles and exercises a real github.com/goliatone/go-cache/stores/memory store as a site.RenderCacheStore, including local tag API compatibility. The higher-level runtime API imports go-cache so hosts do not need to duplicate memory/Valkey construction.
  • Use RenderCachePolicy.RequireTagIndex: true only with a shared non-memory backend for production tag invalidation. With this guard enabled, memory backends bypass caching, stores must implement site.RenderCacheBackendDescriber with a non-memory backend kind, stores without site.RenderCacheTagInvalidator bypass caching, and tag attachment failures remove the just-written entry before it can be served.
  • Every runtime includes a generation store. Generic public delivery automatically keys against site.RenderCacheSharedFenceScope, which covers shared navigation, theme, widget, and locale dependencies. Arbitrary handlers can combine that shared scope with bounded surface-specific RenderCacheHandlerDecision.FenceScopes. The generations are read before lookup and immediately before storage, preventing an in-flight pre-mutation render from becoming a current entry.
  • An enabled memory runtime is rejected unless RenderCacheConfig.AllowProcessLocalFence is explicitly true. Use that escape hatch only for a single serving process in development or tests; the decision-level AllowProcessLocalFence cannot override runtime authorization. Multi-instance staging and production must use a shared backend such as Valkey.
  • Concurrent cold GET misses for the same representation are coalesced within one process. Followers re-run cache eligibility, generation reads, and key construction after the leader completes. The coordinator is bounded and is not a distributed lock; cross-instance correctness comes from the shared generation fence.
  • Request snapshots aggregate bounded counters by host surface. Surface labels are normalized and bounded; request paths, queries, entity IDs, bodies, and raw keys are not added to observations.
  • Single-process development defaults: memory backend, explicit AllowProcessLocalFence: true, FreshTTL around 30s-60s, DebugHeaders: true, and DebugKeys only where key exposure is safe.
  • Production defaults: shared backend or shared render-version source, FreshTTL around 5m-10m, active invalidation through render-version bumps or tag/prefix-capable stores before broad rollout.
  • Static asset caching is separate from rendered HTML caching and should stay on the asset/CDN path.

Example:

policy := quicksite.RenderCachePolicy{
	Enabled:              true,
	ApplicationNamespace: "archive-admin",
	EnvironmentNamespace: "staging",
	SiteNamespace:        "public-site",
	FreshTTL:             30 * time.Second,
	DebugHeaders:         true,
	AuthCookieNames:      []string{"admin_session", "debug_session"},
}

runtime, err := quicksite.NewRenderCacheRuntime(ctx, quicksite.RenderCacheConfig{
	Enabled:         true,
	Backend:         quicksite.RenderCacheBackendValkey,
	ExpirationMode:  quicksite.RenderCacheExpirationSliding,
	DebugHeaders:    true,
	RequireTagIndex: true,
	Valkey: quicksite.RenderCacheValkeyConfig{
		Address:   "127.0.0.1:6379",
		Namespace: "archive:staging:site-render-cache",
	},
}, policy)
if err != nil {
	return err
}
if err := quicksite.RegisterRenderCacheDebugPanel(runtime); err != nil {
	return err
}
quicksite.RegisterSiteRoutes(router, siteCfg, quicksite.WithRenderCacheRuntime(runtime))

For a process-local built-in runtime, select memory and keep fixed mode or opt into sliding explicitly:

runtime, err := quicksite.NewRenderCacheRuntime(ctx, quicksite.RenderCacheConfig{
	Enabled:                  true,
	Backend:                  quicksite.RenderCacheBackendMemory,
	AllowProcessLocalFence:   true, // single-process development/tests only
	FreshTTL:                 5 * time.Minute,
	StaleTTL:                 time.Minute,
	ExpirationMode:           quicksite.RenderCacheExpirationFixed,
}, quicksite.RenderCachePolicy{})

Host-owned deterministic HTML handlers use the same runtime and may combine the shared fence with a domain fence. Search remains bypassed by generic site delivery; only an explicit wrapper with normalized query material opts it in.

eventHandler := quicksite.WrapRenderCacheHandler(runtime, func(c router.Context) error {
	event, err := loadPublishedEvent(quicksite.RequestContext(c), c.Params("slug"))
	if err != nil {
		return err
	}
	quicksite.SetRenderCacheHandlerTags(c, "site:archive", "site:event:"+event.ID)
	return c.Render("event", event)
}, quicksite.RenderCacheHandlerOptions{
	ObservationSurface: func(router.Context) string { return "archive_event" },
	Decide: func(c router.Context) (quicksite.RenderCacheHandlerDecision, error) {
		return quicksite.RenderCacheHandlerDecision{
			Cacheable:     true,
			Surface:       "archive_event",
			CanonicalPath: canonicalEventPath(c.Params("slug")),
			FenceScopes: []string{
				quicksite.RenderCacheSharedFenceScope,
				"site:archive",
			},
			RequireFence: true,
		}, nil
	},
})
router.Get("/events/:slug", eventHandler)

CanonicalPath and CanonicalQuery are hashed before entering the backend key, but hosts must still normalize them deterministically and reject unknown or unsafe query state. A GET miss is captured once; a hit skips the handler. GET and HEAD share a representation, while a HEAD-first miss is never stored. After an authoritative mutation commits, advance each affected generation before returning success, then invalidate tags to reclaim old entries:

if _, err := quicksite.AdvanceRenderCacheGeneration(ctx, runtime, "site:archive"); err != nil {
	return err
}
invalidator, ok := runtime.Store.(quicksite.RenderCacheTagInvalidator)
if !ok {
	return errors.New("site render cache does not support tag invalidation")
}
if err := invalidator.InvalidateTags(ctx, []string{
	"site:archive",
	"site:event:" + eventID,
}); err != nil {
	return err
}

Runtime store wrappers preserve supported invalidation capabilities, so the type assertion above works for the built-in Valkey runtime. Advance every affected generation before invalidating tags. The generation change prevents a concurrent pre-mutation render from becoming current; tag invalidation then reclaims entries from older generations.

A custom store used directly with sliding mode must satisfy both local contracts:

var store interface {
	quicksite.RenderCacheStore
	quicksite.RenderCacheSetIfPresentStore
} = customStore

option := quicksite.WithRenderCache(store, quicksite.RenderCachePolicy{
	Enabled:        true,
	FreshTTL:       5 * time.Minute,
	StaleTTL:       time.Minute,
	ExpirationMode: quicksite.RenderCacheExpirationSliding,
})

Routing migration notes

When migrating a host from the old shared-root quickstart/site setup to the explicit ownership model:

  • register system, internal-ops, admin UI, admin API, public API, public site, and static routes through quickstart.NewHostRouter(...); do not rely on calling RegisterSiteRoutes(...) before or after admin wiring to make ownership work
  • replace callback matchers or magic fallback mode strings with quicksite.SiteFallbackPolicy plus the exported mode constants (SiteFallbackModeDisabled, SiteFallbackModePublicContentOnly, SiteFallbackModeExplicitPathsOnly)
  • remove handler-level prefix guards for /admin, /api, /.well-known, /assets, and /static; reserved-prefix enforcement now belongs in the grouped router surfaces and the declarative fallback policy
  • migrate old shared theme wiring from adm.WithGoTheme(...) to adm.WithAdminTheme(...), and attach the public-site selector separately with quicksite.WithSiteTheme(...) or SiteConfig.ThemeProvider
  • keep /healthz and /status on the internal-ops surface when enabled so those endpoints never resolve through site fallback

Recommended QA after migration:

  • GET /search renders with the site theme surface
  • an allowed unknown public content path resolves through site fallback
  • GET /admin/missing returns the admin 404 behavior rather than a site page
  • GET /.well-known/... bypasses site templates entirely
  • enabled /healthz and /status endpoints return host-owned diagnostics payloads

The search guide covers route ownership and request/response contracts.

Quickstart wires onboarding routes and securelink helpers so hosts can opt in with minimal setup.

Feature gate keys (system scope) used by onboarding flows:

  • users.invite
  • users.password_reset
  • users.signup

Enable these via gate defaults (for example WithFeatureDefaults) or runtime overrides. Alias policy: users.self_registration is not supported; use users.signup.

Securelink config defaults:

  • quickstart.DefaultSecureLinkConfig(basePath) returns:
  • SigningKey="" (manager disabled until a key is provided)
  • BaseURL="http://localhost:8080"
  • QueryKey="token"
  • AsQuery=true
  • Expiration=72h

Route helpers:

  • RegisterOnboardingRoutes (API endpoints under /admin/api/onboarding by default)
  • RegisterAuthUIRoutes + RegisterRegistrationUIRoutes (UI pages)

See docs/GUIDE_ONBOARDING.md for token lifecycle details, error response shape, and override hook examples.

User migrations

Quickstart registers the combined profile by default (go-auth -> go-users -> go-notifications):

if err := quickstart.RegisterUserMigrations(client); err != nil {
	return err
}

Canonical profiles:

  • quickstart.UserMigrationsProfileAuthOnly -> go-auth -> go-notifications
  • quickstart.UserMigrationsProfileCombined -> go-auth -> go-users -> go-notifications
  • quickstart.UserMigrationsProfileUsersStandalone -> go-users-auth -> go-users-auth-extras -> go-users -> go-notifications

Canonical source labels:

  • quickstart.UserMigrationsSourceLabelAuth
  • quickstart.UserMigrationsSourceLabelUsersCore
  • quickstart.UserMigrationsSourceLabelUsersAuthBootstrap
  • quickstart.UserMigrationsSourceLabelUsersAuthExtras
  • quickstart.UserMigrationsSourceLabelNotifications

The wrapper uses source-stable ordered migration identity. Source keys and order values are durable migration ABI:

  • go-auth: key go-auth, order 10
  • go-users-auth: key go-users-auth, order 20
  • go-users-auth-extras: key go-users-auth-extras, order 30, depends on go-users-auth when present
  • go-users: key go-users, order 40, depends on go-auth in combined mode or go-users-auth-extras in standalone mode
  • go-notifications: key go-notifications, order 50, depends on the nearest enabled built-in source

When optional sources are disabled, dependency edges are pruned to the selected source graph. Existing databases with positional ord_* markers must run the go-persistence-bun stable-marker backfill before deploying wrapper behavior that generates ordsrc_* names.

Disable notifications explicitly only when that runtime is not used:

quickstart.WithUserMigrationsNotificationsEnabled(false)

For a fresh persistent runtime, migrate before constructing or bootstrapping the admin:

if err := quickstart.RegisterUserMigrations(client); err != nil {
	return err
}
if err := client.Migrate(ctx); err != nil {
	return err
}
notificationRuntime, err := admin.NewBunNotificationRuntime(ctx, client.DB())
if err != nil {
	return err
}
deps.NotificationRuntime = notificationRuntime

The manual retention endpoint is global and requires affirmative trusted system authority in addition to its permission. In trusted host middleware, wrap the authenticated request context with admin.WithNotificationSystemAuthority(ctx), or set the boolean admin.NotificationSystemAuthorityMetadataKey in authenticated actor metadata. Never derive this marker from request payload or query data. It intentionally overrides quickstart's injected single-tenant default only for the trusted system operator; ordinary tenant actors remain denied.

For an existing persisted graph that already ends at order 50 or later, do not insert notifications at its default order. Take a database backup, choose a permanent order after the last persisted source, depend on that source with WithUserMigrationsNotificationPlacement or WithServiceMigrationsNotificationPlacement, then run notifications.AdoptAdditiveOrderedMigrationGraph before migrating. Adoption is suffix-only and is not a drift-repair tool. Rollback for applied forward-only or destructive migrations is restore from the pre-adoption backup.

Example: register users standalone mode (no go-auth migrations):

if err := quickstart.RegisterUserMigrations(
	client,
	quickstart.WithUserMigrationsProfile(quickstart.UserMigrationsProfileUsersStandalone),
); err != nil {
	return err
}

Services module migration registration uses services-stack (go-auth -> go-users -> go-services -> go-notifications -> app-local) by default via modules/services.RegisterServiceMigrations; app-local sources remain at order 100+ and depend on notifications in fresh graphs.

Static assets (opt-in disk fallback)

diskAssetsDir := quickstart.ResolveDiskAssetsDir(
	"output.css",
	"path/to/pkg/client/assets",
	"assets",
)
host := quickstart.NewHostRouter(r, cfg)
quickstart.NewStaticAssets(host.Static(), cfg, client.Assets(), quickstart.WithDiskAssetsDir(diskAssetsDir))
quickstart.RegisterContentTypeBuilderUIRoutes(
	host.AdminUI(),
	cfg,
	adm,
	authn,
	quickstart.WithContentTypeBuilderUIStaticAssetOptions(cfg, quickstart.WithDiskAssetsDir(diskAssetsDir)),
)

Durable authenticated exports

NewDurableExportHost composes the normal export bundle with go-export's SQL replay/tracker, filesystem artifacts, atomic completion publication, receipt webhooks and go-job's SQL queue, native worker and recurring ledger. The workspace selects sibling go-job and go-export sources while module release pins remain unchanged.

Supply DurableExportHostConfig with the host Bun database, artifact directory, current guard/actor provider, trusted namespace, authorized transaction and record policy. AcceptBackground must explicitly authorize and persist bounded delegation in the supplied transaction. ResolveBackground receives only work kind and export/schedule IDs: recover current authority, safe correlation and scope from trusted durable state. Overwrite message actor hints; never copy browser cookies, bearer tokens or role claims into background authority. Recheck account, membership, exact grant, delegation expiry/revocation, parent delegation and destination policy in guards/transactions. A valid independent delegation can survive browser logout/expiry; account, permission or delegation revocation must stop effects. Child grants must not widen parent lifetime or capabilities.

  1. Apply the host-owned native export_records migration, including request_payload; call host.Migrate(ctx) for additive replay/queue/ownership/recurrence and optional webhook schemas. Startup readiness fails closed on missing tables.
  2. Register definitions/row sources/renderers on host.Bundle.Runner (or supply WithExportRunner). Sources must reuse the authorized transaction. Pass Bundle.Registry, Bundle.Registrar and Bundle.Metadata through the existing admin dependencies and authenticated route wrapper. Durable creation requires CSRF-protected POST and async delivery; sync/GET creation is rejected. History applies trusted ownership/namespace predicates in SQL, with a 200-record limit.
  3. Run host.Run(applicationContext) under the host lifecycle. It owns a dedicated native task registry and one queue retry policy; cancel and await it before closing the database. Reserve this queue for the registered export tasks. For shared/fleet consumers, use separate queue storage/tables and the same identity policy. ExecuteMessage leaves receipt ACK/NACK to its caller.
  4. Install immutable native schedule definitions through trusted operator configuration with an ExportRequest JSON payload and explicit bounded schedule delegation. TickSchedule atomically admits occurrence/export/delegation/plan/job/cursor and emits ordinary activity after commit. Optional RecurringNamespaces enables bounded polling; OnPollError is mandatory and must report failed scopes. Pausing retains backlog and does not cancel already accepted exports.

Optional Webhooks requires a receipt sender, immutable destination selector, current destination authorizer and safe download-link policy. External delivery remains at least once; matching transactional receiver inbox receipts prevent duplicate effects for that receiver. Ordinary activity is postcommit and is not a durable outbox. Tracker migration, delegation provisioning/renewal, credentials, legacy-data backfill, coordinated retention/backup/restore and deployment remain application/operator responsibilities. This opt-in composition does not automatically change the legacy demo host.

Reviewed legacy export adoption

Enable LegacyAdoption only for a controlled cutover. Its Authorize callback must verify current operator identity, authoritative legacy ownership, the versioned profile and a maintenance fence before record reads. Its Select callback resolves an immutable reviewed endpoint/credential profile inside the supplied transaction. Both callbacks must reuse that transaction without network I/O, nested transactions or commits. Provision profile versions through host policy; commands carry only a profile reference and digests. Existing native Webhooks.AuthorizeTarget must reject revoked destinations and credential versions at acceptance and sending. Keep Webhooks.Link stable, as required by native delivery.

Apply native tracker migrations and host.Migrate(ctx) before adoption. Fence old admission, pollers and workers for the reviewed records. Preview a queued record with retained executable request_payload, or a completed record whose checksummed durable envelope and tracker metadata still match. Arbitrary raw artifact formats and unknown schemas need a separate migration.

func adoptLegacy(ctx context.Context, host *quickstart.DurableExportHost, operator export.Actor) error {
    review, err := host.PreviewLegacyExport(ctx, operator, "legacy-export-id", "approved-profile-v2")
    if err != nil { return err }
    // Review both digests before applying; persist this request for response-loss retry.
    request := quickstart.LegacyExportAdoptionRequest{
        ExportID: review.ExportID, ProfileRef: review.ProfileRef,
        RecordSHA256: review.RecordSHA256, PlanSHA256: review.PlanSHA256,
    }
    handler := quickstart.AdoptLegacyExportHandler{Service: host}
    _, err = handler.Run(ctx, quickstart.AdoptLegacyExport{Actor: operator, Request: request})
    return err
}

The typed command ID is admin.export.legacy.adopt.v1. Register its handler on an operator-owned command bus if needed; no public HTTP/RPC factory is installed. Bind operator identity from current authentication, never a decoded actor claim. Preview exposes no endpoints or credential bytes. Review hashes bind exact retained request bytes and the profile version/plan; changed records, profiles or credentials require a new review before first adoption. Queued request numbers must also survive native tracker/job JSON decoding without changing value. Preview, inventory and apply reject lossy values in query, selection and template data; equivalent decimal/exponent spellings and exact typed integers remain valid. Such records need an explicit lossless input mapping or native decoder support before cutover.

For read-only cutover preparation, optionally provide LegacyAdoption.Inventory. It must authorize the current operator, profile and maintenance fence before enumerating IDs from authoritative application ownership, using only the supplied transaction. Return at most the supplied limit, with unique IDs in increasing UTF-8 byte order after the cursor; the host asks for page size plus one (at most 101). Do not derive authority from stored legacy actor hints or perform writes/network calls in the callback. Without this policy inventory is disabled.

host.InventoryLegacyExports(ctx, operator, LegacyExportInventoryQuery{ProfileRef: "approved-profile-v2", Limit: 50}) returns at most 100 entries, safe review digests and blockers (already_adopted, notification_intent, unsupported_state). Follow NextAfter only when HasMore is true. Current per-record policy also authorizes the lookahead ID; only actual page records are read/reviewed. Failures discard the entire page. Completed artifacts and queued generation guards are checked before a review is returned. Inventory does not create owners, delegations, receipts, queue work or profiles. The operator-only typed command is admin.export.legacy.inventory.v1; its handler delegates to the service and keeps Actor out of JSON. No public factory/route is installed.

Each page is a current read, not a frozen inventory attestation. Keep the real old-writer fence across cutover, explicitly review ready entries, and pass their digests to the existing adoption command. Apply rechecks records, plans and current policy; published credentials/receiver identities remain immutable. RecoveryGate admission/drain covers the whole inventory page.

First adoption commits private namespace ownership, explicit bounded delegation, native completion/delivery intent, queue acceptance and an admin_export_legacy_adoptions receipt together. Queued records retain their export identity; completed records retain artifact bytes and never query the source again. Adoption adds one recoverable generation message; retained old at-least-once messages may also arrive through the new worker. Native generation serializes by export ID and reuses completion, rather than regenerating or repeating publication. Resume only through workers that reconstruct current background authority. Existing notification plans or target receipts are rejected, not rebound to new credentials.

Retry the original reviewed request after a lost response. Replays reauthorize current policy without renewing delegation or adding generation work. Keep versioned profile content stable and retain the receipt with owner/delegation, complete host SQL, native queue, plans, sender/receiver receipts and artifacts through every allowed retry/restore horizon. Missing retained plans/receipts deny. Replay of a still-queued adoption also requires the original reviewed record. Retained plan ownership, namespace and digest must match; a queued record cannot have a publication marker. Once a queued adoption completes, its marker, artifact, native operation and full target set must remain intact before replay can acknowledge it. Replay does not reconstruct pruned publication state. INT13 evidence covers its frozen earlier graph; deployments adopting this additive table must include it in coordinated backup/restore checks. SQLite regressions restore the full SQL snapshot/artifacts; PostgreSQL regressions reopen the same isolated durable state.

This is an opt-in code path verified with synthetic records. Live profile provisioning/cutover, rotation or rebinding of already-published identities, receiver endpoint changes, operational fences and deployment signoff remain consuming-host work. No startup scan or automatic adoption occurs.

Recovery of adopted exports

Retain admin_export_legacy_adoptions with the entire host SQL, durable artifact tree, native completion/sender receipts and transactional receiver inbox/effects. Restore them as one quiescent, catalog-anchored set and compare every canonical table and artifact before enabling workers. CheckReady checks schema availability; the consuming application must enforce the recovery gate, stop all writers and reconcile post-snapshot revocations before replay.

durable_export_recovery_test.go provides the current-host reference gate and SQLite/PostgreSQL full-restore checks for pending adoption, generated exports and uncertain receiver responses. It verifies adoption receipt/owner/delegation/plan closure before capture and rejects pruned or mixed recovery state. This is controlled recovery verification; production distributed fences, catalog custody and deployment RPO/RTO remain application responsibilities.

Runtime maintenance and recovery interlock

Set DurableExportHostConfig.RecoveryGate to a new NewDurableExportRecoveryGate for opt-in sealed startup. Supply trusted Authorize, VerifyCatalog and Reconcile policies. ExportRecoveryCheckpoint contains reviewed set/catalog/policy references; callbacks must verify the complete restored set against independent catalog custody and reconcile authoritative post-snapshot revocations. A successful callback cannot be replaced by a caller-supplied approval flag. Every process restart needs a new sealed gate and a new successful resume.

Construct and migrate the host while sealed, then call gate.Resume(ctx, currentOperator, checkpoint) and start host.Run under the application lifecycle. Before backup, call gate.Seal(ctx, currentOperator); only a nil result means admitted facade work, native worker shutdown and outstanding queue operations have drained. Timeout/cancellation leaves admission sealed and unfinished work counted. Resume the gate and explicitly restart host.Run after maintenance. Operator adapters may register the typed admin.export.recovery.seal.v1 and admin.export.recovery.resume.v1 handlers; no public route/message factory is installed, and actor claims are omitted from command JSON.

Use the host facade for export services, history, legacy adoption, schedules and native Run/ExecuteMessage. Share one gate across all host instances in this process. Migrations require an idle sealed gate; CheckReady remains a schema probe. Raw queue, scheduler, tracker, runner, worker and webhook handles are trusted integration ports and require separate maintenance discipline. The gate does not fence another process, an external receiver, another database client or work escaping trusted callback lifetimes. Fence authentication/session and other application writers separately as well. Stop those writers independently before capturing a recovery set; deployment-wide fencing, catalog custody, revocation-feed availability and recovery objectives remain consuming-host policy.

Usage example

cfg := quickstart.NewAdminConfig("/admin", "Admin", "en")
exportBundle := quickstart.NewExportBundle()
adm, adapters, err := quickstart.NewAdmin(cfg, quickstart.AdapterHooks{
	PersistentCMS: func(ctx context.Context, defaultLocale string) (admin.CMSOptions, string, error) {
		return admin.CMSOptions{}, "in-memory CMS", nil
	},
}, quickstart.WithAdminDependencies(admin.Dependencies{
	ExportRegistry:  exportBundle.Registry,
	ExportRegistrar: exportBundle.Registrar,
	ExportMetadata:  exportBundle.Metadata,
}))
if err != nil {
	return err
}

// Register definitions and row sources on exportBundle.Runner.
// exportBundle.Runner.Definitions.Register(...)
// exportBundle.Runner.RowSources.Register(...)

// List export is advertised only after Initialize successfully registers the
// export routes and the requested panel definition exists in this registry.

views, err := quickstart.NewViewEngine(os.DirFS("./web"))
if err != nil {
	return err
}

srv, r := quickstart.NewFiberServer(views, cfg, adm, true)
host := quickstart.NewHostRouter(r, cfg)
quickstart.NewStaticAssets(host.Static(), cfg, os.DirFS("./web"))
_ = quickstart.NewModuleRegistrar(adm, cfg, []admin.Module{}, true)
if err := adm.Initialize(host.Admin()); err != nil {
	return err
}

_ = adapters
_ = srv
cfg := quickstart.NewAdminConfig(
	"/admin",
	"Admin",
	"en",
)
flags := config.Admin.AdapterFlags
adm, adapters, err := quickstart.NewAdmin(
	cfg,
	hooks,
	quickstart.WithAdapterFlags(flags),
	quickstart.WithMinimalFeatures(),
)
if err != nil {
	return err
}
_ = adapters
_ = adm
err = quickstart.NewModuleRegistrar(
	adm,
	cfg,
	modules,
	isDev,
)
if err != nil {
	return err
}
authn, authz := quickstart.WithGoAuth(
	adm,
	routeAuth,
	authConfig,
	admin.GoAuthAuthorizerConfig{DefaultResource: "admin"},
	&admin.AuthConfig{
		LoginPath:    "/admin/login",
		LogoutPath:   "/admin/logout",
		RedirectPath: "/admin",
	},
)
_ = authn
_ = authz
if err := quickstart.WithDefaultDashboardRenderer(adm, views, cfg); err != nil {
	return err
}
formgen, err := quickstart.NewFormGenerator(os.DirFS("./openapi"), os.DirFS("./forms"))
if err != nil {
	return err
}
_ = formgen
registry := components.New()
registry.MustRegister("permission-matrix", components.Descriptor{
	Renderer: permissionMatrixRenderer,
})

formgen, err := quickstart.NewFormGenerator(
	os.DirFS("./openapi"),
	os.DirFS("./forms"),
	quickstart.WithComponentRegistryMergeDefaults(registry),
	quickstart.WithVanillaOption(formgenvanilla.WithStylesheet("/admin/assets/forms.css")),
)
if err != nil {
	return err
}
_ = formgen

WithVanillaOption(...) is applied last, so it can override templates/styles/registry. Use WithComponentRegistry(...) instead of the merge option to replace defaults entirely.

The formgen guide covers full customization guidance.

Debug quickstart

Debug is opt-in and requires module registration plus middleware/log wiring. Configure panels before constructing the admin; attach middleware/log helpers after the debug module is registered so the collector is available.

Use explicit option structs:

  • quickstart.WithDebugOptions(quickstart.DebugOption{...}) for debug fields.
  • quickstart.WithErrorOptions(quickstart.ErrorOption{...}) for error presentation fields.
cfg := quickstart.NewAdminConfig(
	"/admin",
	"Admin",
	"en",
	quickstart.WithDebugOptions(quickstart.DebugOption{
		Enabled:     admin.BoolPtr(true),
		LayoutMode:  "admin",
		ReplEnabled: admin.BoolPtr(true),
	}),
	quickstart.WithErrorOptions(quickstart.ErrorOption{
		DevMode:               admin.BoolPtr(true),
		IncludeStackTrace:     admin.BoolPtr(true),
		ExposeInternalMessage: admin.BoolPtr(true),
	}),
)

quickstart.ConfigureDebugPanels(&cfg, quickstart.DebugPanelDeps{}, quickstart.DefaultDebugPanelCatalog())

adm, _, err := quickstart.NewAdmin(cfg, hooks, quickstart.WithAdminDependencies(deps))
if err != nil {
	return err
}

modules := []admin.Module{
	// core modules...
}
if cfg.Debug.Enabled {
	modules = append(modules, admin.NewDebugModule(cfg.Debug))
}

if err := quickstart.NewModuleRegistrar(
	adm,
	cfg,
	modules,
	isDev,
); err != nil {
	return err
}

if cfg.Debug.Enabled {
	quickstart.AttachDebugMiddleware(r, cfg, adm)
	quickstart.AttachDebugLogHandler(cfg, adm)
}

repoOptions := adm.DebugQueryHookOptions()
repo := repository.MustNewRepositoryWithOptions[*MyModel](db, handlers, repoOptions...)
Go-only rich debug panels

Go applications can register operator-friendly debug panels without shipping app-side JavaScript by adding a declarative debug.PanelUI schema to debug.PanelConfig.

_ = debug.RegisterPanel("queue", debug.PanelConfig{
	Label:           "Queue",
	SnapshotKey:     "queue",
	SupportsToolbar: admin.BoolPtr(true),
	UI: debug.NewPanelUI(
		debug.TableView("jobs"),
		debug.MetricsView("summary"),
	),
	Snapshot: func(ctx context.Context) any {
		return map[string]any{
			"summary": map[string]any{"pending": 3},
			"jobs": []map[string]any{
				{"id": "job-1", "status": "pending"},
			},
		}
	},
})

Supported schema renderers are metrics, key_value, table, status_list, timeline, json, and stack. count, filters, and events configure badges, console filtering, and live-event update behavior. actions render buttons that post to /admin/debug/api/panels/:panel/actions/:action and must be backed by debug.PanelActionHandler entries in the same registration.

The panel ID must still be present in DebugConfig.Panels; toolbar rendering also requires supports_toolbar plus the toolbar panel configuration. Panels without a schema, malformed schema, or unsupported renderer names fall back to escaped JSON rendering. Use a TypeScript panelRegistry.register(...) renderer when a panel needs bespoke browser interaction beyond the declarative catalog.

Scope debug (optional)

Scope debug captures the raw/resolved tenant/org scope for requests, adds an X-Admin-Resolved-Scope header, and exposes a JSON snapshot endpoint. When enabled through ConfigureDebugPanels, it also registers a Go-only rich debug panel using the declarative schema described above.

Scope debug is explicit:

  • choose whether scope capture is enabled in your host config
  • set a ring buffer size (default 200)
scopeDebugEnabled := true
var scopeDebugBuffer *quickstart.ScopeDebugBuffer
if scopeDebugEnabled {
	scopeDebugBuffer = quickstart.NewScopeDebugBuffer(200)
}

quickstart.ConfigureDebugPanels(
	&cfg,
	quickstart.DebugPanelDeps{ScopeBuffer: scopeDebugBuffer},
	quickstart.DefaultDebugPanelCatalog(),
)

wrapAuthed := authn.WrapHandler
if scopeDebugEnabled {
	wrapAuthed = quickstart.ScopeDebugWrap(authn, &cfg, scopeDebugBuffer)
}

r.Get(path.Join(cfg.BasePath, "api", "debug", "scope"), wrapAuthed(quickstart.ScopeDebugHandler(scopeDebugBuffer)))

Preferences quickstart

  • FeaturePreferences remains opt-in: pass EnablePreferences() or supply WithFeatureOverrides(map[string]bool{"preferences": true}) when building the admin gate.
  • A 403 on /admin/api/panels/preferences usually means the default permissions are missing (admin.preferences.view, admin.preferences.edit).
  • Read query params: levels, keys, include_traces, include_versions, tenant_id, org_id.
  • Clear/delete semantics: send clear_raw_keys or clear: true (for all raw keys), plus empty values for known keys to delete user-level overrides.
  • Non-user writes (tenant/org/system) require admin.preferences.manage_tenant, admin.preferences.manage_org, admin.preferences.manage_system.
  • Dashboard preferences endpoints default to preferences permissions; override with cfg.DashboardPreferencesPermission / cfg.DashboardPreferencesUpdatePermission if needed.
  • The preferences guide covers module behavior, traces, and clear semantics.
  • If you want quickstart to build the repo (for example, to enable caching), pass WithGoUsersPreferencesRepositoryFactory to NewAdmin.
  • Use NewPreferencesModule with WithPreferencesSchemaPath to override the form schema (file path or a directory containing schema.json).
  • Use WithPreferencesJSONEditorStrict(true) to enforce client-side JSON validation of raw_ui (default is lenient; server-side validation still applies).
prefsStore, err := quickstart.NewGoUsersPreferencesStore(preferenceRepo)
if err != nil {
	return err
}

adm, err := admin.New(cfg, admin.Dependencies{
	PreferencesStore: prefsStore,
})
if err != nil {
	return err
}
_ = adm
adm, _, err := quickstart.NewAdmin(
	cfg,
	adapterHooks,
	quickstart.WithGoUsersPreferencesRepositoryFactory(func() (types.PreferenceRepository, error) {
		return preferences.NewRepository(
			preferences.RepositoryConfig{DB: client.DB()},
			preferences.WithCache(true),
		)
	}),
	quickstart.EnablePreferences(),
)
if err != nil {
	return err
}
_ = adm
err := quickstart.RegisterPreferencesPermissions(func(def quickstart.PermissionDefinition) error {
	return permissions.Register(def.Key, def.Description)
})
if err != nil {
	return err
}
modules := []admin.Module{
	quickstart.NewPreferencesModule(
		cfg,
		"",
		quickstart.WithPreferencesSchemaPath("./configs/preferences"),
		quickstart.WithPreferencesJSONEditorStrict(true),
	),
}
if err := quickstart.NewModuleRegistrar(adm, cfg, modules, isDev); err != nil {
	return err
}

Stage 1 minimal flow

  • Build config with NewAdminConfig(...) and pass WithMinimalFeatures() or WithFeatureSet(DefaultMinimalFeatures()) to NewAdmin.
  • Resolve adapter flags from config and pass via WithAdapterFlags(...).
  • Register modules with NewModuleRegistrar (uses adm.FeatureGate() by default).
  • Wire auth with WithGoAuth(...) (include *admin.AuthConfig when needed).
  • Enable dashboard SSR with WithDefaultDashboardRenderer(...) (override templates as needed).

Translation Profile Operational Runbook

Config-based Configuration

Configure translation profiles via WithTranslationProductConfig(...):

Field Values Default Description
Profile none, core, core+exchange, core+queue, full Empty (resolves to core when CMS enabled) Sets the baseline translation capability profile
Exchange.Enabled true, false Profile default Overrides exchange module enablement
Queue.Enabled true, false Profile default Overrides queue module enablement

Profile capability matrix:

Profile Exchange Queue Use Case
none - - Translation disabled
core - - Basic translation readiness only
core+exchange Yes - Import/export workflows
core+queue - Yes Assignment management
full Yes Yes Complete translation operations
Verification Checklist
  1. Start the host app with the intended profile and overrides.
  2. Validate the startup capability event and module flags.
  3. Validate module route exposure for enabled modules.
  4. Validate disabled modules are not exposed.

Example startup:

adm, _, err := quickstart.NewAdmin(
	cfg,
	hooks,
	quickstart.WithTranslationProductConfig(quickstart.TranslationProductConfig{
		SchemaVersion: quickstart.TranslationProductSchemaVersionCurrent,
		Profile:       quickstart.TranslationProfileFull,
		Exchange:      &quickstart.TranslationExchangeConfig{Enabled: true},
		Queue:         &quickstart.TranslationQueueConfig{Enabled: true},
	}),
)
if err != nil {
	return err
}

Check startup logs for translation.capabilities.startup and verify:

  • profile is the expected resolved value.
  • modules.exchange.enabled and modules.queue.enabled match the final intended state.
  • routes includes enabled module routes only.
  • resolver_keys include route keys expected by UI entrypoints.
Route/Capability Expectations

Expected runtime routes when modules are enabled:

  • Exchange UI route: /admin/translations/exchange
  • Queue UI route: /admin/translations/queue
  • Queue compatibility alias: /admin/content/translations
  • Exchange API routes: /admin/api/translations/exchange/export, /admin/api/translations/exchange/import/validate, /admin/api/translations/exchange/import/apply
  • Queue API routes: /admin/api/translations/queue, /admin/api/translations/my-work
  • Queue panel API route: /admin/api/panels/translations

When a module is disabled:

  • Exchange UI route is not registered.
  • Exchange API endpoints are not registered.
  • Queue panel/API routes are not registered.
  • Capability metadata (TranslationCapabilities(adm)) reports the module as disabled.
Troubleshooting
Symptom Likely Cause Resolution
translation product config invalid at startup Missing CMS feature for non-none profile Enable cms feature or use profile none
Exchange routes not registered Exchange module not enabled Set TranslationProductConfig.Exchange.Enabled=true or use core+exchange/full profile
exchange.handlers_missing error Exchange store not configured Provide TranslationExchangeConfig.Store implementation
queue.locales_invalid error Queue enabled without supported locales Set TranslationQueueConfig.SupportedLocales or configure translation policy
quickstart.translation_policy.services_missing warning/error Policy has explicit requirements but no page/content checker service was resolved Expose go-cms services through CMSOptions.GoCMSConfig or pass WithTranslationPolicyServices
Family row shows Policy unavailable Family sync could not resolve policy/checker wiring for that content type Cover the content type in TranslationPolicyConfig, provide checker services, then rerun family sync
Translation UI not visible Feature gate disabled Check FeatureTranslationExchange in feature gate
Runtime Validation

After admin initialization, call quickstart.TranslationCapabilities(adm) to get resolved capabilities:

caps := quickstart.TranslationCapabilities(adm)
log.Printf("Translation profile: %s", caps["profile"])
log.Printf("Exchange enabled: %v", caps["modules"].(map[string]any)["exchange"].(map[string]any)["enabled"])
log.Printf("Registered routes: %v", caps["routes"])

Compatibility note

If you previously imported quickstart as part of the root module, keep the same import path but add a direct require on github.com/goliatone/go-admin/quickstart in your go.mod (or use a local replace/go.work entry during dev). The APIs are unchanged; only the module boundary moved.

What’s included

  • Navigation: slug-derived menu IDs/lookup, parent scaffolder for grouped/collapsible defaults, canonical content-parent permission helper (DefaultContentParentPermissions), idempotent seeding (SeedNavigation), deterministic ordering, permission filtering, collapsible state, and view helpers (WithNav, BuildNavItems).
  • Sidebar: embedded templates/partials and assets (CSS/JS) with pre-paint desktop collapse restoration, collapse + submenu persistence, and a separate narrow drawer; stock layouts need no configuration. Apps can override by adding their own template/assets FS ahead of the defaults.
  • Error handling: Fiber error handler that returns JSON for API paths and renders the branded error page (with nav/theme/session) for HTML routes.
  • Adapters: explicit AdapterFlags wiring for persistent CMS, go-options settings, and go-users activity sink with safe in-memory fallbacks.
  • Auth debug: GoAuthAuthorizer supports explicit config debug mode for structured decision logging (logger injectable).

Adapter and runtime toggles

  • Set adapter switches with quickstart.WithAdapterFlags(quickstart.AdapterFlags{...}).
  • For navigation reset/debug behavior, pass explicit host runtime config to your setup layer (for example examples/web/setup.ConfigureRuntime(...)).
  • For authz diagnostics, set admin.GoAuthAuthorizerConfig.Debug explicitly when constructing the authorizer.

Overrides

  • Templates/Assets: WithViewTemplatesFS values are first-wins overlays in call order, followed by the host base and quickstart fallbacks. Pass WithViewAdmin(adm) so theme-selected admin.shell.sidebar, admin.page.breadcrumbs, and admin.shell.footer identifiers are checked against that exact stack; absent lookup, unsafe paths, and unavailable files use packaged defaults. WithSidebarAssetsFS is a partial first-wins override, so omitted files continue to fall back to packaged sidebar assets. Full layout.html overrides must keep the render-blocking assets/sidebar-state.js tag from asset_base_path before shell stylesheets, place sidebar.js immediately after the sidebar markup and before main content, and continue serving both assets. Do not defer the state script; if asset_base_path uses a CDN, allow its origin in script-src.
  • Navigation seed: pass custom items to SeedNavigation; module menu contributions flow through BuildMenuSeedPlan and generated-menu reconciliation.
  • Module gating: WithModuleFeatureGates(customGate) with optional WithModuleFeatureDisabledHandler.
  • Translation nav seeding: WithTranslationCapabilityMenuMode(TranslationCapabilityMenuModeTools) adds dashboard/queue/exchange links into a dedicated Translations menu group in server-seeded navigation.
  • Dashboard SSR: DashboardTemplatesFS() is the canonical client template set. Provide WithDashboardTemplatesFS for first-wins overlays; disabling packaged templates via WithDashboardEmbeddedTemplates(false) requires a complete compatible shell and fails explicitly for incomplete stacks.
  • Dashboard widget contract: handlers should return typed admin.WidgetPayload models consumed by both SSR and client hydration; avoid render-mode payload branching and disallow chart_html/full-document/script blobs in payload data.
  • Typed authenticated pages: build admin.AdminPageChrome and call admin.EnrichLayoutViewContextWithChrome; keep arbitrary actions in page_header_actions. Import shared browser presentation from @goliatone/go-admin-client/components.css, then mount product CSS with WithExtraAssetsFS and link it from head_extra.
  • Error handler: swap quickstart.NewFiberErrorHandler with your own if needed.

Generated navigation reconciliation

NewModuleRegistrar computes the expected primary and utility menu rows with BuildMenuSeedPlan, then calls SeedNavigation in reconciliation mode. This keeps quickstart-owned menu rows current without replacing host-authored rows.

Generated rows are normalized before persistence:

  • target._generated_by is set to quickstart.
  • target._generated_id stores the stable generated identity.
  • request-scoped target state such as enabled, disabled, disabled_reason, and missing_permission is removed before comparison.

Use seed-plan options when a host owns the sidebar layout but still wants quickstart to collect module and translation menu contributions:

quickstart.NewModuleRegistrar(
    adm, cfg, modules, isDev,
    quickstart.WithMenuSeedParents(admin.MenuItem{
        ID:          "host.nav",
        Type:        admin.MenuItemTypeGroup,
        GroupTitle:  "Host Navigation",
        Collapsible: true,
    }),
    quickstart.WithMenuSeedTargetParentOverride("translation_queue", "host.nav"),
    quickstart.WithMenuSeedBaseItemTransform(func(item *admin.MenuItem) {
        if item == nil || item.Target == nil || item.Target["key"] != "translation_dashboard" {
            return
        }
        item.Label = "Translations"
        item.LabelKey = "menu.translations.overview"
        item.Target["name"] = "admin.translations.overview"
        item.Target["breadcrumb_label"] = "Translation Center"
    }),
    quickstart.WithMenuSeedModuleParentOverride("reports", "host.nav"),
    quickstart.WithMenuSeedItemTransform(func(moduleID string, item *admin.MenuItem) {
        if moduleID == "reports" && item != nil {
            item.Label = "Analytics"
        }
    }),
)

Use WithMenuSeedBaseItemTransform for quickstart-owned base/capability rows, including translation capability links. Use WithMenuSeedItemTransform for rows returned by module MenuItems(locale) contributors. Hosts that pin github.com/goliatone/go-admin and github.com/goliatone/go-admin/quickstart separately should upgrade both modules together when adopting base-item transforms so the seed-plan API and generated navigation reconciliation stay in sync.

Use ReconcileGeneratedNavigation directly when you need a dry-run report before applying changes:

report, err := quickstart.ReconcileGeneratedNavigation(ctx, quickstart.NavigationReconcileOptions{
    MenuSvc:  adm.MenuService(),
    MenuCode: cfg.NavMenuCode,
    Locale:   cfg.DefaultLocale,
    Items:    expectedItems,
    Apply:    false,
    RawInventory: admin.NavigationRawInventoryOptions{
        MenuCode:          cfg.NavMenuCode,
        Environment:       cfg.NavEnvironment,
        EnvironmentSource: "config.nav_environment",
    },
})

Generated navigation treats admin.MenuItem.Position as a sparse sort weight. This lets independent modules reserve ordering bands without knowing current sibling counts. Before writing to CMS-backed menu storage, quickstart sorts siblings by sparse weight and stable identity, then writes compact per-parent 0..n-1 positions because CMS/menu-builder APIs treat position as an insertion index. Generated leaf targets keep the original sparse weight in _generated_sort_order for diagnostics.

The report separates normal updates from operational diagnostics:

  • Creates and Updates are generated rows that would be inserted or updated.
  • PreservedUserRows are non-generated rows that are intentionally left alone.
  • DuplicateIdentities reports duplicate or ambiguous generated identities; in apply mode ambiguous legacy matches are skipped.
  • DestructiveCandidates reports stale generated rows whose identity no longer appears in the expected plan. They are not deleted unless the caller opts into destructive behavior.
  • StaleTargetStateCleanup reports generated rows that carried transient request/permission state and will be cleaned by an update.
  • CapabilityOmissions, PermissionFilteredItems, ParentPrunedItems, and RouteResolutionFailures are diagnostics for missing capabilities, permission-filtered rows, empty generated parents, or unresolved route data.
  • RawInventoryUnavailable records scoped raw inventory failures. In dry-run mode this is a diagnostic; in apply mode a raw-inventory error returns before any create, update, delete, or managed-exclusion mutation.
  • RawPresentButNotRendered reports generated rows present in raw storage but absent from the rendered menu, usually because render filtering or malformed target data hid a row that still affects convergence.
  • CoordinationBackend, CoordinationScope, CoordinationSupported, and CoordinationWarning describe whether the menu backend coordinated convergence beyond this process. Treat unsupported coordination as an operational warning for multi-process or blue-green startup.

Set Apply: true to converge rows. Keep AllowDestructive off unless the host has explicitly reviewed the destructive candidates; generated rows are update-safe by default, but deleting or replacing rows can affect host-specific navigation customizations.

Durable activity ingestion

Use ConfigureActivityIngestion(ctx, adm, options) before adm.Initialize, then RegisterActivityIngestionRoutes(ctx, rootRouter, adm) outside browser auth groups. The bundle reuses NewAdminConfig scope options and URLKit activity.ingest; adm.ActivityIngestionURL() reports the sole mounted producer URL. Explicitly migrate go-users activity/scopes and admin.EnsureActivityIngestionSchema first. Provide producer/current-policy ports, browser authenticator, reader authorizer and access policy. The widget and full feed share durable authorized reads. See the canonical setup and contract, including its dependency and persistence contracts. Disabled hosts retain legacy behavior; the helper performs no DDL and registers no implicit route alias.

Documentation

Index

Constants

View Source
const (
	AuthUIBrowserCSRFCookieName       = "go_admin_pre_auth_csrf"
	AuthUIBrowserCSRFSecureCookieName = "__Host-" + AuthUIBrowserCSRFCookieName

	AuthUIBrowserCSRFInvalidCode = "AUTH_UI_CSRF_INVALID"
)
View Source
const (
	ExportBackgroundGenerate = "generate"
	ExportBackgroundWebhook  = "webhook"
	ExportBackgroundSchedule = "schedule"
)
View Source
const (
	DefaultInternalOpsHealthzPath = "/healthz"
	DefaultInternalOpsStatusPath  = "/status"
)
View Source
const (
	// DefaultLifecycleReadyPath is the default route for lifecycle readiness.
	DefaultLifecycleReadyPath = "/readyz"
	// LifecycleDoctorCheckID is the built-in doctor check ID for lifecycle state.
	LifecycleDoctorCheckID = "quickstart.lifecycle"
)
View Source
const (
	// SidebarPlacementPrimary is the placement key used for the main sidebar tree.
	SidebarPlacementPrimary MenuPlacementKey = "sidebar"
	// SidebarPlacementUtility is the placement key used for fixed utility links above the user pod.
	SidebarPlacementUtility MenuPlacementKey = "sidebar_utility"
	// FooterPlacement is the placement key used for footer navigation.
	FooterPlacement MenuPlacementKey = "footer"

	// NavigationGroupMainID is the canonical main navigation group parent ID.
	NavigationGroupMainID = "nav-group-main"
	// NavigationSectionContentID is the canonical content section parent ID.
	NavigationSectionContentID = NavigationGroupMainID + ".content"
	// NavigationGroupToolsID is the canonical Tools group parent ID.
	NavigationGroupToolsID = "nav-group-others"
	// NavigationGroupOthersID is retained as an alias for backward compatibility.
	NavigationGroupOthersID = NavigationGroupToolsID
	// NavigationGroupTranslationsID is the canonical Translations group parent ID.
	NavigationGroupTranslationsID = "nav-group-translations"

	// DefaultSidebarUtilityMenuCode is the default menu code used for sidebar utility links.
	DefaultSidebarUtilityMenuCode = "admin.utility"
)
View Source
const (
	MenuTargetGeneratedByKey        = "_generated_by"
	MenuTargetGeneratedIDKey        = "_generated_id"
	MenuTargetGeneratedSortOrderKey = "_generated_sort_order"
	MenuTargetPlacementSlotKey      = navcontract.TargetPlacementSlotKey
	MenuTargetGeneratedOwner        = "quickstart"
	MenuTargetGeneratedSource       = "quickstart.menu_seed_plan"
)
View Source
const (
	ScopeDebugPanelID = "scope"
	ScopeDebugHeader  = "X-Admin-Resolved-Scope"
)
View Source
const (
	ViewKeyBreadcrumbs        = "breadcrumbs"
	ViewKeyBreadcrumbAppend   = "breadcrumb_append"
	ViewKeyBreadcrumbOverride = "breadcrumb_override"
	ViewKeyBreadcrumbActive   = "breadcrumb_active"
	ViewKeyBreadcrumbSpec     = "breadcrumb_spec"
)
View Source
const (
	UserMigrationsSourceLabelAuth               = "go-auth"
	UserMigrationsSourceLabelUsersCore          = "go-users"
	UserMigrationsSourceLabelUsersAuthBootstrap = "go-users-auth"
	UserMigrationsSourceLabelUsersAuthExtras    = "go-users-auth-extras"
	UserMigrationsSourceLabelNotifications      = notifications.MigrationSourceName
)

User migration source labels for dialect-aware registration.

View Source
const (
	UserRoleBulkAssignRouteKey   = "users.bulk.assign_role"
	UserRoleBulkUnassignRouteKey = "users.bulk.unassign_role"
)
View Source
const AdoptLegacyExportCommand = "admin.export.legacy.adopt.v1"
View Source
const DefaultNavMenuCode = "admin_main"

DefaultNavMenuCode is the quickstart default menu identifier.

View Source
const InventoryLegacyExportsCommand = "admin.export.legacy.inventory.v1"
View Source
const MaxLegacyExportInventoryPage = 100
View Source
const ResumeDurableExportsCommand = "admin.export.recovery.resume.v1"
View Source
const ScopeDriftRepairCommandName = "quickstart.scope_drift.repair"

ScopeDriftRepairCommandName is the quickstart command name for the explicit blank-scope repair operation.

View Source
const SealDurableExportsCommand = "admin.export.recovery.seal.v1"
View Source
const TranslationPolicyServicesMissingCode = "quickstart.translation_policy.services_missing"

TranslationPolicyServicesMissingCode identifies an explicit policy that cannot be evaluated.

View Source
const TranslationProductSchemaVersionCurrent = 1

TranslationProductSchemaVersionCurrent is the supported quickstart product schema version.

View Source
const TranslationProductSchemaVersionMinimumSupported = 0

TranslationProductSchemaVersionMinimumSupported is the minimum schema version accepted for deterministic up-conversion into the current version.

View Source
const WorkflowConfigSchemaVersionCurrent = 1

WorkflowConfigSchemaVersionCurrent is the current schema version for external workflow config.

View Source
const WorkflowConfigSchemaVersionMinimumSupported = 0

WorkflowConfigSchemaVersionMinimumSupported is the oldest accepted schema version.

Variables

View Source
var (
	// ErrBinaryObjectContextRequired signals a missing response context.
	ErrBinaryObjectContextRequired = errors.New("quickstart: response context required")
	// ErrBinaryObjectStoreRequired signals a missing object store.
	ErrBinaryObjectStoreRequired = errors.New("quickstart: object store is not configured")
	// ErrBinaryObjectKeyRequired signals a missing object key.
	ErrBinaryObjectKeyRequired = errors.New("quickstart: object key is required")
	// ErrBinaryObjectUnavailable signals a missing/empty object payload.
	ErrBinaryObjectUnavailable = errors.New("quickstart: object payload is unavailable")
)
View Source
var ErrCommandQueueRoutingConfig = errors.New("command queue routing config invalid")

ErrCommandQueueRoutingConfig indicates invalid quickstart command queue routing wiring.

View Source
var ErrGoUsersUserManagementConfig = errors.New("go-users user management config invalid")
View Source
var ErrPersistentCMSSetupFailed = errors.New("quickstart: persistent CMS setup failed")
View Source
var ErrTranslationExchangeConfig = errors.New("translation exchange config invalid")

ErrTranslationExchangeConfig indicates invalid quickstart exchange wiring.

View Source
var ErrTranslationPolicyServicesUnavailable = errors.New("quickstart: translation policy checker services unavailable")

ErrTranslationPolicyServicesUnavailable marks configured policy requirements that cannot be evaluated because no translation checker services are wired.

View Source
var ErrTranslationProductConfig = errors.New("translation product config invalid")

ErrTranslationProductConfig indicates invalid translation product profile wiring.

View Source
var ErrTranslationQueueConfig = errors.New("translation queue config invalid")

ErrTranslationQueueConfig indicates invalid quickstart queue wiring.

View Source
var ErrWorkflowConfig = errors.New("workflow config invalid")

ErrWorkflowConfig indicates workflow config parsing/normalization issues.

Functions

func AddDebugPanels added in v0.24.0

func AddDebugPanels(cfg *admin.Config, panels ...string)

AddDebugPanels appends panels to the debug config, preserving defaults.

func ApplyAdapterIntegrations

func ApplyAdapterIntegrations(adm *admin.Admin, result *AdapterResult, hooks AdapterHooks)

ApplyAdapterIntegrations wires optional adapters post-admin initialization.

func ApplyPanelBreadcrumbs added in v0.27.0

func ApplyPanelBreadcrumbs(ctx router.ViewContext, panel *admin.Panel, basePath, fallbackListLabel, listHref string, kind BreadcrumbRouteKind, record map[string]any) router.ViewContext

ApplyPanelBreadcrumbs resolves a panel-backed breadcrumb trail without relying on menu nesting.

func ApplyScopeConfig added in v0.24.0

func ApplyScopeConfig(cfg *admin.Config, scope ScopeConfig)

ApplyScopeConfig writes scope defaults back into admin.Config.

func ApplyScopeDefaultsToMetadata added in v0.24.0

func ApplyScopeDefaultsToMetadata(metadata map[string]any, cfg admin.Config) map[string]any

ApplyScopeDefaultsToMetadata injects default tenant/org metadata when enabled.

func ApplySecureLinkManager added in v0.19.0

func ApplySecureLinkManager(cfg *userssvc.Config, manager userstypes.SecureLinkManager, opts ...SecureLinkUsersOption)

ApplySecureLinkManager wires securelink settings into go-users config.

func ApplySecureLinkManagerToAuth added in v0.19.0

func ApplySecureLinkManagerToAuth(target SecureLinkManagerSetter, manager userstypes.SecureLinkManager)

ApplySecureLinkManagerToAuth wires the securelink manager into go-auth style handlers.

func AttachDebugLogHandler added in v0.15.0

func AttachDebugLogHandler(cfg admin.Config, adm *admin.Admin)

AttachDebugLogHandler wires slog to the debug collector when CaptureLogs is enabled.

func AttachDebugMiddleware added in v0.15.0

func AttachDebugMiddleware[T any](r router.Router[T], cfg admin.Config, adm *admin.Admin)

AttachDebugMiddleware registers the debug request capture middleware on the router.

func AttachGoAuthActivitySink added in v0.19.0

func AttachGoAuthActivitySink(auther *auth.Auther, sink admin.ActivitySink, opts ...GoAuthActivitySinkOption)

AttachGoAuthActivitySink wires the go-auth activity adapter into the auther.

func AuthUIViewContext added in v0.19.0

func AuthUIViewContext(cfg admin.Config, state AuthUIState, paths AuthUIPaths) router.ViewContext

AuthUIViewContext builds a view context with auth flags + paths.

func BuildNavItems

func BuildNavItems(adm *admin.Admin, cfg admin.Config, ctx context.Context, active string) []map[string]any

BuildNavItems builds navigation menu items from the admin menu service.

func BuildNavItemsForPlacement

func BuildNavItemsForPlacement(adm *admin.Admin, cfg admin.Config, placements PlacementConfig, placement MenuPlacementKey, ctx context.Context, active string) []map[string]any

BuildNavItemsForPlacement resolves a menu for a placement and returns render-ready entries.

func BuildPanelDataGridConfig added in v0.25.0

func BuildPanelDataGridConfig(opts PanelDataGridConfigOptions) map[string]any

BuildPanelDataGridConfig resolves datagrid_config for datatable templates.

func BuildPanelExportConfig added in v0.25.0

func BuildPanelExportConfig(cfg admin.Config, opts PanelViewCapabilityOptions) map[string]any

BuildPanelExportConfig resolves export_config for datatable templates.

func BuildPanelViewCapabilities added in v0.25.0

func BuildPanelViewCapabilities(cfg admin.Config, opts PanelViewCapabilityOptions) router.ViewContext

BuildPanelViewCapabilities returns standard capability keys for panel templates.

Current keys: - list_capabilities - export_config - datagrid_config

func CloseCommandRunUpdates added in v0.121.3

func CloseCommandRunUpdates(ctx context.Context, adm *admin.Admin) error

CloseCommandRunUpdates closes go-admin subscriptions and observers before a host closes any injected messaging drivers or routers.

func ConfigureActivityIngestion added in v0.142.2

func ConfigureActivityIngestion(ctx context.Context, adm *admin.Admin, opts admin.ActivityIngestionOptions) (*admin.ActivityIngestionRuntime, error)

ConfigureActivityIngestion composes durable ingestion and both Activity readers before admin.Initialize. Build the Admin with NewAdminConfig and the existing WithScopeMode/WithDefaultScope/WithScopeConfig options; the bundle consumes that same normalized scope policy. Migrate go-users activity/scopes first, then call admin.EnsureActivityIngestionSchema explicitly. No startup DDL is performed. Required host inputs include producer verification/current policy, DB, an admin authorizer and ActivityPermission. Disabled options preserve legacy behavior.

func ConfigureDebugPanels added in v0.24.0

func ConfigureDebugPanels(cfg *admin.Config, deps DebugPanelDeps, catalog DebugPanelCatalog)

ConfigureDebugPanels ensures debug panels are enabled in config and registered in the catalog.

func ConfigureExportRenderers added in v0.13.0

func ConfigureExportRenderers(bundle *ExportBundle, templatesFS fs.FS, opts ...ExportTemplateOption) error

ConfigureExportRenderers registers template + PDF renderers using the provided templates FS.

func DashboardTemplatesFS

func DashboardTemplatesFS() fs.FS

DashboardTemplatesFS returns the canonical packaged admin template set. The legacy compact quickstart dashboard document is no longer a fallback.

func DebugWSAuthMiddleware added in v0.24.0

func DebugWSAuthMiddleware(auther *auth.Auther, cfg admin.DebugConfig, config ...router.WSAuthConfig) router.WebSocketMiddleware

DebugWSAuthMiddleware returns a go-auth backed WebSocket auth middleware with defaults aligned to debug remote settings.

func DefaultAdminFeatures

func DefaultAdminFeatures() map[string]bool

DefaultAdminFeatures returns the baseline feature defaults for quickstart.

func DefaultContentParentPermissions added in v0.25.0

func DefaultContentParentPermissions() []string

DefaultContentParentPermissions returns the canonical permission set used for the sidebar "Content" parent node.

func DefaultContentTypePreviewFallback added in v0.24.0

func DefaultContentTypePreviewFallback() admin.SchemaPreviewFallback

DefaultContentTypePreviewFallback returns the standard preview error HTML.

func DefaultFiberV3TemplateFuncs added in v0.142.0

func DefaultFiberV3TemplateFuncs(opts ...TemplateFuncOption) map[string]any

DefaultFiberV3TemplateFuncs preserves the default template helper names and behavior while accepting v7 execution contexts for feature and CSRF helpers.

func DefaultLoopbackTrustedProxyCIDRs added in v0.27.0

func DefaultLoopbackTrustedProxyCIDRs() []string

DefaultLoopbackTrustedProxyCIDRs returns loopback-only trusted proxy ranges.

func DefaultMenuParents

func DefaultMenuParents(menuCode string) []admin.MenuItem

DefaultMenuParents returns the baseline parents/groups used by quickstart modules.

func DefaultMinimalFeatures

func DefaultMinimalFeatures() map[string]bool

DefaultMinimalFeatures returns a Stage 1 friendly feature default set.

func DefaultScopeFilter added in v0.24.0

func DefaultScopeFilter(cfg admin.Config) userstypes.ScopeFilter

DefaultScopeFilter returns the default scope for single-tenant mode.

func DefaultSecureLinkRoutes added in v0.19.0

func DefaultSecureLinkRoutes(basePath string) map[string]string

DefaultSecureLinkRoutes builds the route map used by securelink managers.

func DefaultTemplateFuncs

func DefaultTemplateFuncs(opts ...TemplateFuncOption) map[string]any

DefaultTemplateFuncs returns shared template functions for view rendering.

func DefaultThemeTokens

func DefaultThemeTokens() map[string]string

DefaultThemeTokens returns the baseline theme tokens used by quickstart.

func EnsureDefaultMenuParents

func EnsureDefaultMenuParents(ctx context.Context, menuSvc admin.CMSMenuService, menuCode, locale string) error

EnsureDefaultMenuParents scaffolds the default parents so module menus can nest without seeds.

func IconRendererFunc added in v0.25.0

func IconRendererFunc(renderer TemplateIconRenderer) func(ref string, variant string) string

IconRendererFunc creates a template-compatible render function from a TemplateIconRenderer. Template-driven values are treated as untrusted by default.

func InsecureAnyTrustedProxyCIDRs added in v0.27.0

func InsecureAnyTrustedProxyCIDRs() []string

InsecureAnyTrustedProxyCIDRs returns a trust-all proxy CIDR list. Use only for backward compatibility and local testing.

func InternalOpsReservedPrefixes added in v0.36.0

func InternalOpsReservedPrefixes(cfg InternalOpsConfig) []string

func IsLocalRequest added in v0.27.0

func IsLocalRequest(c RequestMetaContext, policy RequestTrustPolicy) bool

IsLocalRequest reports whether request host resolves to localhost/loopback.

func IsLoopbackPeer added in v0.27.0

func IsLoopbackPeer(c RequestMetaContext) bool

IsLoopbackPeer reports whether the direct peer address is a loopback IP.

func IsSecureRequest added in v0.27.0

func IsSecureRequest(c RequestMetaContext, policy RequestTrustPolicy) bool

IsSecureRequest reports whether a request should be treated as TLS-protected.

func LifecycleDoctorCheck added in v0.91.0

func LifecycleDoctorCheck(provider LifecycleSnapshotProvider) admin.DoctorCheck

LifecycleDoctorCheck builds a doctor check for lifecycle diagnostics.

func LifecycleReadinessHandler added in v0.91.0

func LifecycleReadinessHandler(provider LifecycleSnapshotProvider) router.HandlerFunc

LifecycleReadinessHandler returns a handler that reports full lifecycle readiness. It is separate from liveness endpoints such as /health.

func LifecycleStatusPayload added in v0.91.0

func LifecycleStatusPayload(snapshot lifecycle.Snapshot) map[string]any

LifecycleStatusPayload converts a lifecycle snapshot into JSON-safe diagnostics suitable for readiness endpoints, debug panels, or logs.

func MergeComponentDescriptors

func MergeComponentDescriptors(base, override components.Descriptor) components.Descriptor

MergeComponentDescriptors combines a default descriptor with an override. Renderer uses the override when provided; assets are appended.

func MergeTemplateFuncs

func MergeTemplateFuncs(overrides map[string]any, opts ...TemplateFuncOption) map[string]any

MergeTemplateFuncs combines default functions with caller overrides.

func NewActivityModule added in v0.25.0

func NewActivityModule(opts ...ActivityModuleOption) *admin.ActivityModule

NewActivityModule returns the built-in activity module under the quickstart Tools group.

func NewAdminConfig

func NewAdminConfig(basePath, title, defaultLocale string, opts ...AdminConfigOption) admin.Config

NewAdminConfig builds a baseline admin config with quickstart defaults.

func NewCompositeActivitySink

func NewCompositeActivitySink(primary admin.ActivitySink, hooks dashboardactivity.Hooks, cfg dashboardactivity.Config) admin.ActivitySink

NewCompositeActivitySink forwards admin activity entries to the primary sink and dashboard hooks.

func NewContentTypeBuilderModule added in v0.24.0

func NewContentTypeBuilderModule(cfg admin.Config, menuParent string, opts ...admin.ContentTypeBuilderOption) admin.Module

NewContentTypeBuilderModule builds a content type builder module with quickstart defaults.

func NewDashboardTemplateRenderer added in v0.25.0

func NewDashboardTemplateRenderer(opts ...DashboardRendererOption) (admin.DashboardRenderer, error)

NewDashboardTemplateRenderer builds the default dashboard SSR renderer.

func NewDebugModule added in v0.25.0

func NewDebugModule(cfg admin.DebugConfig, opts ...DebugModuleOption) *admin.DebugModule

NewDebugModule returns the built-in debug module under the quickstart Tools group.

func NewFeatureFlagsModule added in v0.25.0

func NewFeatureFlagsModule(opts ...FeatureFlagsModuleOption) *admin.FeatureFlagsModule

NewFeatureFlagsModule returns the built-in feature flags module under the quickstart Tools group.

func NewFiberErrorHandler

func NewFiberErrorHandler(adm *admin.Admin, cfg admin.Config, isDev bool, opts ...FiberErrorHandlerOption) fiber.ErrorHandler

NewFiberErrorHandler returns a default error handler that renders JSON for API paths and an HTML error page (with nav + theme) for non-API paths.

func NewFiberRouteMissHandler added in v0.142.0

func NewFiberRouteMissHandler(cfg admin.Config) fiber.Handler

NewFiberRouteMissHandler marks owned terminal routing misses for presentation. Register it with app.Use last, after all application routes and middleware. Returned middleware/handler errors remain untouched. Standalone apps without this fallback still present native errors, without synthetic-miss diagnostics.

func NewFiberServer

func NewFiberServer(viewEngine fiber.Views, cfg admin.Config, adm *admin.Admin, isDev bool, opts ...FiberServerOption) (router.Server[*fiber.App], router.Router[*fiber.App])

NewFiberServer constructs a Fiber-backed router adapter with quickstart defaults.

func NewFiberV3ErrorHandler added in v0.142.0

func NewFiberV3ErrorHandler(adm *admin.Admin, cfg admin.Config, isDev bool, opts ...FiberErrorHandlerOption) fiber3.ErrorHandler

NewFiberV3ErrorHandler renders the same API envelopes and HTML templates as NewFiberErrorHandler through a native v3 context. Options and error causes are shared; hosts opt in by supplying this handler in fiber3.Config.

func NewFiberV3RouteMissHandler added in v0.142.0

func NewFiberV3RouteMissHandler(cfg admin.Config) fiber.Handler

NewFiberV3RouteMissHandler is the native v3 terminal fallback. Register it with app.Use last, after all application routes and middleware, or use NewFiberV3Server which installs it during finalization. It preserves explicit middleware errors and native non-404 outcomes, including method-not-allowed responses.

func NewFiberV3Server added in v0.142.0

func NewFiberV3Server(viewEngine fiber.Views, cfg admin.Config, adm *admin.Admin, isDev bool, opts ...FiberV3ServerOption) (router.Server[*fiber.App], router.Router[*fiber.App])

NewFiberV3Server constructs an explicit Fiber v3 host with quickstart HTML/API error presentation. Supplied views and native error-handler options remain authoritative, matching the existing v2 composition contract. Serve forwards AdapterConfig.ListenConfig. Callers starting WrappedRouter themselves must initialize the adapter and pass native listen settings.

func NewFiberV3ViewEngine added in v0.142.0

func NewFiberV3ViewEngine(baseFS fs.FS, opts ...ViewEngineOption) (fiber3.Views, error)

NewFiberV3ViewEngine builds explicit v3 views with the same template and asset stack as NewViewEngine. The unqualified constructor continues using v2.

func NewFormGenerator

func NewFormGenerator(openapiFS fs.FS, templatesFS fs.FS, opts ...FormGeneratorOption) (*formgenorchestrator.Orchestrator, error)

NewFormGenerator creates a form generator from OpenAPI and template filesystems.

func NewGoAuthActivitySink added in v0.19.0

func NewGoAuthActivitySink(sink admin.ActivitySink, opts ...GoAuthActivitySinkOption) auth.ActivitySink

NewGoAuthActivitySink adapts go-auth activity events into the admin activity sink.

func NewModuleRegistrar

func NewModuleRegistrar(adm *admin.Admin, cfg admin.Config, modules []admin.Module, isDev bool, opts ...ModuleRegistrarOption) error

NewModuleRegistrar seeds navigation and registers modules deterministically.

func NewNotificationsSecureLinkManager added in v0.19.0

func NewNotificationsSecureLinkManager(cfg SecureLinkConfig) (links.SecureLinkManager, error)

NewNotificationsSecureLinkManager builds a go-notifications compatible securelink manager.

func NewPreferencesModule added in v0.24.0

func NewPreferencesModule(cfg admin.Config, menuParent string, opts ...PreferencesModuleOption) admin.Module

NewPreferencesModule builds a Preferences module with quickstart defaults.

func NewSecureLinkManager added in v0.19.0

func NewSecureLinkManager(cfg SecureLinkConfig) (userstypes.SecureLinkManager, error)

NewSecureLinkManager builds a go-users compatible securelink manager.

func NewSecureLinkNotificationBuilder added in v0.19.0

func NewSecureLinkNotificationBuilder(manager links.SecureLinkManager, opts ...linknotifications.Option) links.LinkBuilder

NewSecureLinkNotificationBuilder builds a securelink link builder for go-notifications.

func NewStaticAssets

func NewStaticAssets[T any](r router.Router[T], cfg admin.Config, assetsFS fs.FS, opts ...StaticAssetsOption)

NewStaticAssets registers static asset routes with quickstart defaults.

func NewThemeSelector

func NewThemeSelector(name, variant string, tokenOverrides map[string]string, opts ...ThemeOption) (theme.Selector, *theme.Manifest, error)

NewThemeSelector registers a default theme manifest and returns a selector.

func NewTranslationPolicy added in v0.24.0

NewTranslationPolicy builds a quickstart translation policy from config + services.

func NewTranslationQueueAutoCreateHook added in v0.25.0

func NewTranslationQueueAutoCreateHook(cfg TranslationQueueConfig) admin.TranslationQueueAutoCreateHook

NewTranslationQueueAutoCreateHook builds an auto-create hook for queue assignments. When enabled, workflow transitions blocked by missing translations will automatically create/reuse queue assignments for the missing locales.

func NewUploadHandler added in v0.25.0

func NewUploadHandler(cfg UploadHandlerConfig) router.HandlerFunc

NewUploadHandler returns a generic multipart upload handler.

func NewUsersModule added in v0.24.0

NewUsersModule returns the built-in user management module with options applied.

func NewViewEngine

func NewViewEngine(baseFS fs.FS, opts ...ViewEngineOption) (fiber.Views, error)

NewViewEngine builds a view engine with quickstart sidebar fallbacks.

func NormalizeDashboardTemplateData added in v0.27.0

func NormalizeDashboardTemplateData(data any) (map[string]any, error)

NormalizeDashboardTemplateData converts a typed go-dashboard page or typed admin host wrapper into the serialized template context used by the default dashboard renderer.

func OAuthNeedsReauthorization added in v0.25.0

func OAuthNeedsReauthorization(isExpired, isExpiringSoon, canAutoRefresh bool) bool

OAuthNeedsReauthorization returns true only when manual action is required.

func PathViewContext added in v0.25.0

func PathViewContext(cfg admin.Config, pathCfg PathViewContextConfig) router.ViewContext

PathViewContext returns canonical template path keys: - base_path - api_base_path - asset_base_path - preferences_api_path

func RecommendedContentEntryDefaultRenderers added in v0.25.0

func RecommendedContentEntryDefaultRenderers() map[string]string

RecommendedContentEntryDefaultRenderers returns a copy of the recommended default renderer map used by WithContentEntryRecommendedDefaults.

func RegisterActivityIngestionRoutes added in v0.142.2

func RegisterActivityIngestionRoutes[T any](ctx context.Context, r router.Router[T], adm *admin.Admin) error

RegisterActivityIngestionRoutes mounts the configured producer endpoint on the root router outside browser-cookie groups. URLKit activity.ingest controls the actual URL, including absolute overrides and API roots/version. A disabled or unconfigured runtime adds no endpoint; enabled configuration fails earlier if migrations or authority/read dependencies are missing.

func RegisterAdminPageRoutes added in v0.24.0

func RegisterAdminPageRoutes[T any](
	r router.Router[T],
	cfg admin.Config,
	adm *admin.Admin,
	auth admin.HandlerAuthenticator,
	specs ...AdminPageSpec,
) error

RegisterAdminPageRoutes registers simple admin HTML page routes with URLKit resolution.

func RegisterAdminUIRoutes added in v0.13.0

func RegisterAdminUIRoutes[T any](r router.Router[T], cfg admin.Config, adm *admin.Admin, auth admin.HandlerAuthenticator, opts ...UIRouteOption) error

RegisterAdminUIRoutes registers default UI routes (dashboard + notifications).

func RegisterAuthUIRoutes added in v0.13.0

func RegisterAuthUIRoutes[T any](r router.Router[T], cfg admin.Config, routeAuth *auth.RouteAuthenticator, opts ...AuthUIOption) error

RegisterAuthUIRoutes registers login, logout, and password reset UI routes.

func RegisterContentEntryAliasRoutes added in v0.24.0

func RegisterContentEntryAliasRoutes[T any](
	r router.Router[T],
	cfg admin.Config,
	adm *admin.Admin,
	auth admin.HandlerAuthenticator,
	opts ...ContentAliasRouteOption,
) error

RegisterContentEntryAliasRoutes registers content entry alias routes for content panels.

func RegisterContentEntryUIRoutes added in v0.24.0

func RegisterContentEntryUIRoutes[T any](
	r router.Router[T],
	cfg admin.Config,
	adm *admin.Admin,
	auth admin.HandlerAuthenticator,
	opts ...ContentEntryUIOption,
) error

RegisterContentEntryUIRoutes registers HTML routes for content entries.

func RegisterContentTypeBuilderAPIRoutes added in v0.24.0

func RegisterContentTypeBuilderAPIRoutes[T any](
	r router.Router[T],
	cfg admin.Config,
	adm *admin.Admin,
	auth admin.HandlerAuthenticator,
	opts ...ContentTypeBuilderAPIOption,
) error

RegisterContentTypeBuilderAPIRoutes registers API helper routes for content types and block definitions.

func RegisterContentTypeBuilderUIRoutes added in v0.24.0

func RegisterContentTypeBuilderUIRoutes[T any](
	r router.Router[T],
	cfg admin.Config,
	adm *admin.Admin,
	auth admin.HandlerAuthenticator,
	opts ...ContentTypeBuilderUIOption,
) error

RegisterContentTypeBuilderUIRoutes registers HTML routes for the content type builder.

func RegisterDebugPanelCatalog added in v0.24.0

func RegisterDebugPanelCatalog(cfg *admin.Config, deps DebugPanelDeps, catalog DebugPanelCatalog)

RegisterDebugPanelCatalog registers panels defined in the provided catalog.

func RegisterLifecycleReadinessRoute added in v0.91.0

func RegisterLifecycleReadinessRoute[T any](r router.Router[T], routePath string, provider LifecycleSnapshotProvider) (string, error)

RegisterLifecycleReadinessRoute registers a readiness endpoint on the given router and returns the normalized path.

func RegisterOnboardingRoutes added in v0.19.0

func RegisterOnboardingRoutes[T any](r router.Router[T], cfg admin.Config, handlers OnboardingHandlers, opts ...OnboardingRouteOption) error

RegisterOnboardingRoutes registers onboarding API endpoints.

func RegisterPreferencesPermissions

func RegisterPreferencesPermissions(register PermissionRegisterFunc) error

RegisterPreferencesPermissions registers the default preferences permissions.

func RegisterRegistrationUIRoutes added in v0.19.0

func RegisterRegistrationUIRoutes[T any](r router.Router[T], cfg admin.Config, opts ...RegistrationUIOption) error

RegisterRegistrationUIRoutes registers the registration UI route.

func RegisterRolesUIRoutes added in v0.22.0

func RegisterRolesUIRoutes[T any](r router.Router[T], cfg admin.Config, adm *admin.Admin, opts ...RolesUIOption) error

RegisterRolesUIRoutes registers HTML routes for role management.

func RegisterScopeDebugPanel added in v0.24.0

func RegisterScopeDebugPanel(buffer *ScopeDebugBuffer)

RegisterScopeDebugPanel registers the scope debug panel with the registry.

func RegisterSettingsUIRoutes added in v0.24.0

func RegisterSettingsUIRoutes[T any](
	r router.Router[T],
	cfg admin.Config,
	adm *admin.Admin,
	auth admin.HandlerAuthenticator,
	opts ...SettingsUIOption,
) error

RegisterSettingsUIRoutes registers a read-only settings page rendered from templates.

func RegisterSyncClientAssets added in v0.84.0

func RegisterSyncClientAssets[T any](r router.Router[T], cfg admin.Config, fsys fs.FS)

RegisterSyncClientAssets mounts the supplied sync-core runtime filesystem at the admin-scoped sync-client route advertised to browser editors.

func RegisterTranslationExchangePermissions added in v0.25.0

func RegisterTranslationExchangePermissions(register PermissionRegisterFunc) error

RegisterTranslationExchangePermissions registers translation exchange permissions.

func RegisterTranslationExchangeWiring added in v0.25.0

func RegisterTranslationExchangeWiring(adm *admin.Admin, cfg TranslationExchangeConfig) error

RegisterTranslationExchangeWiring wires commands and optional permission registration.

func RegisterTranslationQueuePermissions added in v0.25.0

func RegisterTranslationQueuePermissions(register PermissionRegisterFunc) error

RegisterTranslationQueuePermissions registers translation queue permissions.

func RegisterTranslationQueueWiring added in v0.25.0

func RegisterTranslationQueueWiring(adm *admin.Admin, cfg TranslationQueueConfig, policyCfg TranslationPolicyConfig, hasPolicyCfg bool) error

RegisterTranslationQueueWiring wires queue panels, commands, and optional permissions.

func RegisterUserMigrations added in v0.19.0

func RegisterUserMigrations(client *persistence.Client, opts ...UserMigrationsOption) error

RegisterUserMigrations registers go-auth, go-users, and notification migrations with sensible defaults. The default graph is auth -> users -> notifications.

func RegisterUserRoleBulkRoutes added in v0.22.0

func RegisterUserRoleBulkRoutes(r admin.AdminRouter, cfg admin.Config, adm *admin.Admin) error

RegisterUserRoleBulkRoutes registers bulk assign/unassign endpoints.

func RenderTemplateView added in v0.126.10

func RenderTemplateView(c router.Context, template string, viewCtx router.ViewContext) error

RenderTemplateView renders a template using the active router view engine. It propagates request CSRF helpers and normalizes whole-number JSON values before rendering. A nil router context returns an error.

func ResolveAdminAPIBasePath added in v0.24.0

func ResolveAdminAPIBasePath(urls urlkit.Resolver, cfg admin.Config, fallbackBase string) string

ResolveAdminAPIBasePath returns the base admin API path using URLKit when available.

func ResolveAdminAPIGroupName added in v0.24.0

func ResolveAdminAPIGroupName(cfg admin.Config) string

ResolveAdminAPIGroupName returns the URLKit group name for admin API routes.

func ResolveAdminBasePath added in v0.24.0

func ResolveAdminBasePath(urls urlkit.Resolver, fallback string) string

ResolveAdminBasePath returns the admin base path using URLKit when available.

func ResolveAdminBaseURL added in v0.24.0

func ResolveAdminBaseURL(urls urlkit.Resolver, fallback string) string

ResolveAdminBaseURL returns the admin base URL using URLKit when available.

func ResolveAdminPanelAPICollectionPath added in v0.25.0

func ResolveAdminPanelAPICollectionPath(urls urlkit.Resolver, cfg admin.Config, fallbackBase, panel string) string

ResolveAdminPanelAPICollectionPath returns the canonical admin API collection path for a panel.

func ResolveAdminPanelAPIDetailPath added in v0.25.0

func ResolveAdminPanelAPIDetailPath(urls urlkit.Resolver, cfg admin.Config, fallbackBase, panel, id string) string

ResolveAdminPanelAPIDetailPath returns the canonical admin API detail path for a panel record.

func ResolveAdminPanelDetailURL added in v0.25.0

func ResolveAdminPanelDetailURL(urls urlkit.Resolver, fallback, panel, id string) string

ResolveAdminPanelDetailURL returns the canonical admin UI detail path for a panel record.

func ResolveAdminPanelEditURL added in v0.25.0

func ResolveAdminPanelEditURL(urls urlkit.Resolver, fallback, panel, id string) string

ResolveAdminPanelEditURL returns the canonical admin UI edit path for a panel record.

func ResolveAdminPanelPreviewURL added in v0.25.0

func ResolveAdminPanelPreviewURL(urls urlkit.Resolver, fallback, panel, id string) string

ResolveAdminPanelPreviewURL returns the canonical admin UI preview path for a panel record.

func ResolveAdminPanelURL added in v0.25.0

func ResolveAdminPanelURL(urls urlkit.Resolver, fallback, panel string) string

ResolveAdminPanelURL returns the canonical admin UI path for a panel.

func ResolveAdminRoutePath added in v0.24.0

func ResolveAdminRoutePath(urls urlkit.Resolver, fallback, route string) string

ResolveAdminRoutePath returns a resolved admin route path using URLKit when available.

func ResolveAdminURL added in v0.24.0

func ResolveAdminURL(urls urlkit.Resolver, fallback, path string) string

ResolveAdminURL prefixes the admin base URL to the provided path.

func ResolveDashboardArea added in v0.27.0

func ResolveDashboardArea(placements PlacementConfig, placement uiplacement.DashboardPlacementKey, fallback string) string

ResolveDashboardArea resolves a quickstart dashboard placement to a concrete area code.

func ResolveDashboardShellAssetsPrefix added in v0.110.0

func ResolveDashboardShellAssetsPrefix(cfg admin.Config, opts ...StaticAssetsOption) string

ResolveDashboardShellAssetsPrefix returns the go-dashboard shell asset prefix after applying the same static asset options used by NewStaticAssets.

func ResolveDiskAssetsDir added in v0.13.0

func ResolveDiskAssetsDir(marker string, candidates ...string) string

ResolveDiskAssetsDir returns the first candidate directory that contains the marker file.

func ResolveInternalOpsHealthzPath added in v0.36.0

func ResolveInternalOpsHealthzPath(cfg InternalOpsConfig) string

func ResolveInternalOpsStatusPath added in v0.36.0

func ResolveInternalOpsStatusPath(cfg InternalOpsConfig) string

func ResolveRequestIP added in v0.26.0

func ResolveRequestIP(c RequestIPContext, opts RequestIPOptions) string

ResolveRequestIP resolves the best-effort client IP for a request context. By default it returns the direct peer IP and ignores forwarded headers unless both forwarded trust and trusted proxy CIDRs are configured.

func ResolveRequestIPWithPolicy added in v0.27.0

func ResolveRequestIPWithPolicy(c RequestIPContext, policy RequestTrustPolicy) string

ResolveRequestIPWithPolicy resolves client IP using a request trust policy.

func ResolveRequestOrigin added in v0.27.0

func ResolveRequestOrigin(c RequestMetaContext, policy RequestTrustPolicy) string

ResolveRequestOrigin builds a request origin string (<scheme>://<host>) when possible.

func ResolveSiteFallbackReservedPrefixes added in v0.48.0

func ResolveSiteFallbackReservedPrefixes(cfg admin.Config, opts ...StaticAssetsOption) []string

ResolveSiteFallbackReservedPrefixes returns the site fallback reserved prefixes that correspond to the current admin config and static asset mount options. Hosts that override static asset route prefixes should use this helper when configuring site fallback reservations.

func ResolveStaticAssetPrefixes added in v0.36.0

func ResolveStaticAssetPrefixes(cfg admin.Config, opts ...StaticAssetsOption) []string

ResolveStaticAssetPrefixes returns static URL prefixes owned by quickstart asset helpers for the given config and options.

func ResolveSyncClientAssetsPrefix added in v0.84.0

func ResolveSyncClientAssetsPrefix(cfg admin.Config) string

ResolveSyncClientAssetsPrefix returns the admin-scoped sync-core runtime asset prefix used by translation and other editor runtime configuration.

func ScopeBuilder added in v0.24.0

func ScopeBuilder(cfg admin.Config) func(context.Context) userstypes.ScopeFilter

ScopeBuilder returns a scope resolver that applies defaults for single-tenant mode.

func ScopeDebugHandler added in v0.24.0

func ScopeDebugHandler(buffer *ScopeDebugBuffer) router.HandlerFunc

ScopeDebugHandler returns a handler that serves scope debug snapshots.

func ScopeDebugWrap added in v0.24.0

func ScopeDebugWrap(authn *admin.GoAuthAuthenticator, cfg *admin.Config, buffer *ScopeDebugBuffer) func(router.HandlerFunc) router.HandlerFunc

ScopeDebugWrap captures scope debug info for authenticated requests.

func ScopeFromContext added in v0.24.0

func ScopeFromContext(ctx context.Context) userstypes.ScopeFilter

ScopeFromContext extracts scope from go-auth actor/claims metadata.

func SeedLocalizedNavigation added in v0.26.0

func SeedLocalizedNavigation(ctx context.Context, opts SeedLocalizedNavigationOptions) error

SeedLocalizedNavigation seeds canonical menu IDs and applies locale-specific translations.

This is the preferred package-level API for localized site menus. It prevents locale-specific IDs such as "about.es" by keeping identity stable and attaching locale variants as translations.

func SeedNavigation

func SeedNavigation(ctx context.Context, opts SeedNavigationOptions) error

SeedNavigation seeds a menu using the public admin CMS menu contract.

func SeedWorkflowRuntimeFromConfig added in v0.26.0

func SeedWorkflowRuntimeFromConfig(ctx context.Context, runtime admin.WorkflowRuntime, cfg WorkflowConfig) error

SeedWorkflowRuntimeFromConfig upserts canonical workflow definitions + bindings into a runtime service.

func ServeBinaryObject added in v0.25.0

func ServeBinaryObject(c router.Context, cfg BinaryObjectResponseConfig) error

ServeBinaryObject resolves an object from storage and writes it as an HTTP response body.

func SessionRequiresPasswordChange added in v0.55.0

func SessionRequiresPasswordChange(session *auth.SessionObject) bool

SessionRequiresPasswordChange reports whether a go-auth session carries temporary-password metadata that should force a password update.

func SidebarAssetsFS

func SidebarAssetsFS() fs.FS

SidebarAssetsFS returns the embedded sidebar assets (sidebar-state.js, sidebar.js, and sidebar.css).

func SidebarTemplatesFS

func SidebarTemplatesFS() fs.FS

SidebarTemplatesFS returns the packaged canonical admin templates. It remains as a quickstart fallback so hosts with an isolated template filesystem still receive the complete authenticated shell without maintaining a second copy.

func TemporaryPasswordGate added in v0.55.0

func TemporaryPasswordGate(cfg TemporaryPasswordGateConfig) router.MiddlewareFunc

TemporaryPasswordGate blocks authenticated sessions whose claims require a password change. It expects go-auth metadata to be present in the session.

func TemporaryPasswordGateForAdmin added in v0.55.0

func TemporaryPasswordGateForAdmin(cfg admin.Config, sessionContextKey string) router.MiddlewareFunc

TemporaryPasswordGateForAdmin returns a gate with quickstart admin defaults.

func TranslationCapabilities added in v0.25.0

func TranslationCapabilities(adm *admin.Admin) map[string]any

TranslationCapabilities returns a stable translation capability snapshot for the admin instance.

func TranslationCapabilitiesForContext added in v0.25.0

func TranslationCapabilitiesForContext(adm *admin.Admin, reqCtx context.Context) map[string]any

TranslationCapabilitiesForContext returns a translation capability snapshot merged with request-scoped permission and action states.

func TranslationExchangeCommandIDs added in v0.27.0

func TranslationExchangeCommandIDs() []string

TranslationExchangeCommandIDs returns command ids registered by exchange quickstart wiring.

func TranslationQueueCommandIDs added in v0.27.0

func TranslationQueueCommandIDs() []string

TranslationQueueCommandIDs returns command ids registered by translation queue quickstart wiring.

func ValidateWorkflowConfig added in v0.25.0

func ValidateWorkflowConfig(cfg WorkflowConfig) error

ValidateWorkflowConfig validates external workflow config structure and constraints.

func WithAdminUIViewContext added in v0.24.0

func WithAdminUIViewContext(ctx router.ViewContext, adm *admin.Admin, cfg admin.Config, active string, c router.Context) router.ViewContext

WithAdminUIViewContext applies the default admin UI view-context builder.

func WithAuthUIViewContext added in v0.19.0

func WithAuthUIViewContext(ctx router.ViewContext, cfg admin.Config, state AuthUIState, paths AuthUIPaths) router.ViewContext

WithAuthUIViewContext merges auth flags + paths into an existing view context.

func WithAuthUIViewThemeAssets added in v0.19.0

func WithAuthUIViewThemeAssets(ctx router.ViewContext, assets map[string]string, assetPrefix string) router.ViewContext

WithAuthUIViewThemeAssets merges theme assets into an existing view context. It creates or extends the "theme" map with an "assets" sub-map containing the provided asset paths. If assetPrefix is provided, each relative asset filename is resolved to a full path by joining with the prefix. Already resolved absolute URLs/paths are preserved unchanged.

This function does not add query-string theme/variant handling; it only provides static asset paths for auth UI templates.

func WithBreadcrumbAnchor added in v0.27.0

func WithBreadcrumbAnchor(ctx router.ViewContext, active string) router.ViewContext

WithBreadcrumbAnchor overrides the active nav key used for breadcrumb derivation.

func WithBreadcrumbAppend added in v0.27.0

func WithBreadcrumbAppend(ctx router.ViewContext, items ...BreadcrumbItem) router.ViewContext

WithBreadcrumbAppend appends terminal breadcrumbs to the derived trail.

func WithBreadcrumbOverride added in v0.27.0

func WithBreadcrumbOverride(ctx router.ViewContext, items ...BreadcrumbItem) router.ViewContext

WithBreadcrumbOverride fully replaces the derived trail.

func WithBreadcrumbSpec added in v0.27.0

func WithBreadcrumbSpec(ctx router.ViewContext, spec BreadcrumbSpec) router.ViewContext

WithBreadcrumbSpec sets an explicit breadcrumb contract for the current view.

func WithDefaultDashboardRenderer

func WithDefaultDashboardRenderer(adm *admin.Admin, viewEngine fiber.Views, _ admin.Config, opts ...DashboardRendererOption) error

WithDefaultDashboardRenderer registers dashboard SSR against the shared host view engine when one is supplied. The standalone renderer remains the compatibility fallback for hosts without a shared view engine. The config argument is retained for source compatibility; request-scoped shell state is composed by Admin and carried by AdminDashboardPage.

func WithDefaultFiberV3DashboardRenderer added in v0.142.0

func WithDefaultFiberV3DashboardRenderer(adm *admin.Admin, views fiber3.Views, cfg admin.Config, opts ...DashboardRendererOption) error

WithDefaultFiberV3DashboardRenderer registers typed dashboard SSR using the shared native v3 views. Both view interfaces are structurally identical, so the shared renderer preserves overlays, shell context and existing renderers. With nil views it retains the standalone template-renderer fallback.

func WithFallbackFS

func WithFallbackFS(primary fs.FS, fallbacks ...fs.FS) fs.FS

WithFallbackFS builds a MultiFS preferring the primary FS first.

func WithFeatureTemplateContext added in v0.20.0

func WithFeatureTemplateContext(ctx router.ViewContext, reqCtx context.Context, scope any, snapshot any) router.ViewContext

WithFeatureTemplateContext injects feature helper keys into a view context when missing.

func WithGoAuth

WithGoAuth wires go-auth adapters into the admin instance.

func WithNav

func WithNav(ctx router.ViewContext, adm *admin.Admin, cfg admin.Config, active string, reqCtx context.Context) router.ViewContext

WithNav adds session, theme, and navigation payload to the view context.

func WithNavPlacements

func WithNavPlacements(ctx router.ViewContext, adm *admin.Admin, cfg admin.Config, placements PlacementConfig, placement MenuPlacementKey, active string, reqCtx context.Context) router.ViewContext

WithNavPlacements is like WithNav but allows selecting a placement-specific menu.

func WithPathViewContext added in v0.25.0

func WithPathViewContext(ctx router.ViewContext, cfg admin.Config, pathCfg PathViewContextConfig) router.ViewContext

WithPathViewContext merges canonical template path keys into an existing context.

func WithProtectedAppAuth added in v0.58.0

func WithProtectedAppAuth(routeAuth *auth.RouteAuthenticator, cfg auth.Config, opts ...admin.GoAuthAuthenticatorOption) *admin.GoAuthAuthenticator

WithProtectedAppAuth builds a protected-app authenticator using the shared protected-surface auth adapter.

func WithThemeContext added in v0.13.0

func WithThemeContext(ctx router.ViewContext, adm *admin.Admin, req router.Context) router.ViewContext

WithThemeContext resolves the active theme (with optional query/header overrides) and adds it to the view context.

func WorkflowBindingsFromConfig added in v0.26.0

func WorkflowBindingsFromConfig(cfg WorkflowConfig) []admin.WorkflowBinding

WorkflowBindingsFromConfig converts runtime binding config into canonical admin workflow bindings.

func WorkflowDefinitionsFromConfig added in v0.25.0

func WorkflowDefinitionsFromConfig(cfg WorkflowConfig) map[string]admin.WorkflowDefinition

WorkflowDefinitionsFromConfig converts workflow config into admin workflow definitions.

func WorkflowTraitDefaultsFromConfig added in v0.25.0

func WorkflowTraitDefaultsFromConfig(cfg WorkflowConfig) map[string]string

WorkflowTraitDefaultsFromConfig returns a cloned trait->workflow default map.

Types

type ActivityModuleOption added in v0.25.0

type ActivityModuleOption func(*admin.ActivityModule)

ActivityModuleOption customizes quickstart activity module defaults.

type AdapterFlags

type AdapterFlags struct {
	UsePersistentCMS   bool `json:"use_persistent_cms"`
	UseGoOptions       bool `json:"use_go_options"`
	UseGoUsersActivity bool `json:"use_go_users_activity"`
}

AdapterFlags captures adapter switches (config or env).

type AdapterHooks

type AdapterHooks struct {
	// PersistentCMS should build CMSOptions when persistent storage is desired.
	// Return backend label (for logging) alongside options.
	PersistentCMS func(ctx context.Context, defaultLocale string) (admin.CMSOptions, string, error) `json:"persistent_cms"`
	// GoOptions should swap settings to go-options backend.
	GoOptions func(adm *admin.Admin) (string, error) `json:"go_options"`
	// GoUsersActivity should build an activity sink backed by go-users (or nil).
	GoUsersActivity func() admin.ActivitySink `json:"go_users_activity"`
}

AdapterHooks supplies host-specific builders for optional adapters.

type AdapterResult

type AdapterResult struct {
	Flags              AdapterFlags       `json:"flags"`
	CMSBackend         string             `json:"cms_backend"`
	SettingsBackend    string             `json:"settings_backend"`
	ActivityBackend    string             `json:"activity_backend"`
	ActivitySink       admin.ActivitySink `json:"activity_sink"`
	PersistentCMSSet   bool               `json:"persistent_cms_set"`
	PersistentCMSError error              `json:"persistent_cms_error"`
	Config             admin.Config       `json:"config"`
}

AdapterResult describes applied adapters/backends.

func ConfigureAdapters

func ConfigureAdapters(ctx context.Context, cfg admin.Config, hooks AdapterHooks) (admin.Config, AdapterResult)

ConfigureAdapters mutates the admin config (CMS) using explicit defaults and available hooks.

func ConfigureAdaptersWithFlags

func ConfigureAdaptersWithFlags(ctx context.Context, cfg admin.Config, hooks AdapterHooks, flags AdapterFlags) (admin.Config, AdapterResult)

ConfigureAdaptersWithFlags mutates the admin config (CMS) based on supplied flags.

func NewAdmin

func NewAdmin(cfg admin.Config, hooks AdapterHooks, opts ...AdminOption) (*admin.Admin, AdapterResult, error)

NewAdmin constructs an admin instance with adapter wiring applied.

type AdminConfigOption

type AdminConfigOption func(*admin.Config)

AdminConfigOption mutates the base admin config.

func WithDebugConfig added in v0.15.0

func WithDebugConfig(debugCfg admin.DebugConfig) AdminConfigOption

WithDebugConfig merges a debug config into the admin config.

func WithDebugOptions added in v0.26.0

func WithDebugOptions(opt DebugOption) AdminConfigOption

WithDebugOptions applies explicit debug options into admin config.

func WithDefaultScope added in v0.24.0

func WithDefaultScope(tenantID, orgID string) AdminConfigOption

WithDefaultScope sets the default tenant/org identifiers for single-tenant mode.

func WithErrorConfig added in v0.24.0

func WithErrorConfig(errorCfg admin.ErrorConfig) AdminConfigOption

WithErrorConfig merges an error config into the admin config.

func WithErrorOptions added in v0.26.0

func WithErrorOptions(opt ErrorOption) AdminConfigOption

WithErrorOptions applies explicit error options to the admin config.

func WithFeatureCatalogPath added in v0.22.0

func WithFeatureCatalogPath(path string) AdminConfigOption

WithFeatureCatalogPath sets the feature catalog config file path.

func WithLoginLogoPlacement added in v0.128.5

func WithLoginLogoPlacement(placement admin.LoginLogoPlacement) AdminConfigOption

WithLoginLogoPlacement controls whether the login identity mark renders above the card or inside it. Unknown values preserve the outside-card default.

func WithNavDebug added in v0.26.0

func WithNavDebug(enabled bool) AdminConfigOption

WithNavDebug enables/disables navigation debug payloads in view context.

func WithNavDebugLog added in v0.26.0

func WithNavDebugLog(enabled bool) AdminConfigOption

WithNavDebugLog enables/disables navigation debug logging.

func WithNavMenuCode

func WithNavMenuCode(code string) AdminConfigOption

WithNavMenuCode overrides the default navigation menu code.

func WithNavPermissionDeniedMode added in v0.82.0

func WithNavPermissionDeniedMode(mode admin.NavigationPermissionDeniedMode) AdminConfigOption

WithNavPermissionDeniedMode sets how denied navigation entries are resolved.

func WithRequestTrustPolicy added in v0.27.0

func WithRequestTrustPolicy(policy RequestTrustPolicy) AdminConfigOption

WithRequestTrustPolicy applies request trust settings to admin debug secure checks.

func WithRoutingConfig added in v0.27.0

func WithRoutingConfig(routingCfg routing.Config) AdminConfigOption

WithRoutingConfig applies routing roots and per-module mount policy overrides.

func WithScopeConfig added in v0.24.0

func WithScopeConfig(scope ScopeConfig) AdminConfigOption

WithScopeConfig applies scope defaults for single/multi tenant behavior.

func WithScopeMode added in v0.24.0

func WithScopeMode(mode ScopeMode) AdminConfigOption

WithScopeMode sets the scope mode (single or multi).

func WithTheme

func WithTheme(name, variant string) AdminConfigOption

WithTheme overrides the base theme name/variant.

func WithThemeAssetPrefix

func WithThemeAssetPrefix(prefix string) AdminConfigOption

WithThemeAssetPrefix sets a default asset prefix used by themes.

func WithThemeAssetURLs added in v0.52.0

func WithThemeAssetURLs(assets map[string]string) AdminConfigOption

WithThemeAssetURLs merges resolved theme asset URLs/paths into admin config overrides. Values should be final URLs or absolute/served paths, not manifest-relative filenames.

func WithThemeTokens

func WithThemeTokens(tokens map[string]string) AdminConfigOption

WithThemeTokens merges custom theme tokens.

type AdminOption

type AdminOption func(*adminOptions)

AdminOption customizes NewAdmin behavior.

func EnableFeature

func EnableFeature(feature admin.FeatureKey) AdminOption

EnableFeature enables a single admin feature key for quickstart.NewAdmin.

func EnablePreferences

func EnablePreferences() AdminOption

EnablePreferences enables the preferences feature gate.

func WithAdapterFlags

func WithAdapterFlags(flags AdapterFlags) AdminOption

WithAdapterFlags overrides env-driven adapter flag resolution.

func WithAdminContext

func WithAdminContext(ctx context.Context) AdminOption

WithAdminContext sets the context used when resolving adapter hooks.

func WithAdminDependencies

func WithAdminDependencies(deps admin.Dependencies) AdminOption

WithAdminDependencies sets the admin dependencies passed to admin.New.

func WithCommandExecutionPolicy added in v0.27.0

func WithCommandExecutionPolicy(policy admin.CommandExecutionPolicy) AdminOption

WithCommandExecutionPolicy overrides command execution policy used by quickstart NewAdmin bootstrap.

func WithCommandQueueRouting added in v0.27.0

func WithCommandQueueRouting(cfg CommandQueueRoutingConfig) AdminOption

WithCommandQueueRouting configures queued command dispatch wiring for quickstart NewAdmin bootstrap.

func WithDoctorChecks added in v0.25.0

func WithDoctorChecks(checks ...admin.DoctorCheck) AdminOption

WithDoctorChecks registers app-specific doctor diagnostics checks.

func WithFeatureDefaults added in v0.20.0

func WithFeatureDefaults(defaults map[string]bool) AdminOption

WithFeatureDefaults applies compatibility feature overrides used to build the gate. It preserves legacy merge semantics against DefaultAdminFeatures.

func WithFeatureOverrides added in v0.27.0

func WithFeatureOverrides(defaults map[string]bool) AdminOption

WithFeatureOverrides merges feature overrides into the base defaults used to build the gate.

func WithFeatureSet added in v0.27.0

func WithFeatureSet(defaults map[string]bool) AdminOption

WithFeatureSet replaces the base feature defaults used to build the quickstart feature gate.

func WithGoUsersPreferencesRepository added in v0.24.0

func WithGoUsersPreferencesRepository(repo types.PreferenceRepository) AdminOption

WithGoUsersPreferencesRepository sets a go-users preference repository to be wrapped into an admin PreferencesStore when preferences dependencies are not already provided.

func WithGoUsersPreferencesRepositoryFactory added in v0.24.0

func WithGoUsersPreferencesRepositoryFactory(factory func() (types.PreferenceRepository, error)) AdminOption

WithGoUsersPreferencesRepositoryFactory sets a lazy go-users preference repository builder.

func WithGoUsersUserManagement added in v0.24.0

func WithGoUsersUserManagement(cfg GoUsersUserManagementConfig) AdminOption

WithGoUsersUserManagement wires go-users repositories into admin dependencies.

func WithMinimalFeatures added in v0.27.0

func WithMinimalFeatures() AdminOption

WithMinimalFeatures replaces the quickstart feature defaults with DefaultMinimalFeatures.

func WithRPCTransport added in v0.27.0

func WithRPCTransport(cfg RPCTransportConfig) AdminOption

WithRPCTransport mounts go-router RPC transport routes for the admin RPC server.

func WithScopeDriftInspector added in v0.83.0

func WithScopeDriftInspector(inspector ScopeDriftInspector) AdminOption

WithScopeDriftInspector wires the quickstart doctor check data source used to detect blank tenant/org rows in scoped translation tables.

func WithScopeDriftRepairer added in v0.83.0

func WithScopeDriftRepairer(repairer ScopeDriftRepairer) AdminOption

WithScopeDriftRepairer wires the opt-in repair command used to backfill blank tenant/org rows in allowlisted scoped translation tables.

func WithStartupPolicy added in v0.25.0

func WithStartupPolicy(policy StartupPolicy) AdminOption

WithStartupPolicy configures module startup validation handling policy.

func WithThemeSelector added in v0.24.0

func WithThemeSelector(selector theme.ThemeSelector, manifest *theme.Manifest) AdminOption

WithThemeSelector wires an admin go-theme selector + manifest into quickstart admin bootstrap.

func WithTraitWorkflowDefaults added in v0.25.0

func WithTraitWorkflowDefaults(defaults map[string]string) AdminOption

WithTraitWorkflowDefaults sets trait->workflow defaults applied to the admin instance.

func WithTranslationExchangeConfig added in v0.25.0

func WithTranslationExchangeConfig(cfg TranslationExchangeConfig) AdminOption

WithTranslationExchangeConfig configures opt-in translation exchange command/permission wiring.

func WithTranslationLocaleLabels added in v0.25.0

func WithTranslationLocaleLabels(labels map[string]string) AdminOption

WithTranslationLocaleLabels overrides locale labels used by create_translation action payload options.

func WithTranslationPolicyConfig added in v0.24.0

func WithTranslationPolicyConfig(cfg TranslationPolicyConfig) AdminOption

WithTranslationPolicyConfig sets the translation policy config for quickstart defaults.

func WithTranslationPolicyServices added in v0.24.0

func WithTranslationPolicyServices(services TranslationPolicyServices) AdminOption

WithTranslationPolicyServices overrides the translation check services used by the default policy.

func WithTranslationProductConfig added in v0.25.0

func WithTranslationProductConfig(cfg TranslationProductConfig) AdminOption

WithTranslationProductConfig applies productized translation module configuration.

func WithTranslationProfile added in v0.25.0

func WithTranslationProfile(profile TranslationProfile) AdminOption

WithTranslationProfile applies a productized translation profile.

func WithTranslationQueueConfig added in v0.25.0

func WithTranslationQueueConfig(cfg TranslationQueueConfig) AdminOption

WithTranslationQueueConfig configures opt-in translation queue feature and command/panel wiring.

func WithWorkflowConfig added in v0.25.0

func WithWorkflowConfig(cfg WorkflowConfig) AdminOption

WithWorkflowConfig sets external workflow definitions + trait defaults.

func WithWorkflowConfigFile added in v0.25.0

func WithWorkflowConfigFile(path string) AdminOption

WithWorkflowConfigFile loads external workflow definitions + trait defaults from file.

func WithWorkflowRuntime added in v0.25.0

func WithWorkflowRuntime(runtime admin.WorkflowRuntime) AdminOption

WithWorkflowRuntime wires persisted workflow runtime management into admin bootstrap.

type AdminPageSpec added in v0.24.0

type AdminPageSpec struct {
	Route              string                                           `json:"route"`
	Path               string                                           `json:"path"`
	Template           string                                           `json:"template"`
	Title              string                                           `json:"title"`
	Active             string                                           `json:"active"`
	Chrome             admin.AdminPageChrome                            `json:"chrome"`
	Feature            string                                           `json:"feature"`
	Permission         string                                           `json:"permission"`
	ViewContextBuilder UIViewContextBuilder                             `json:"view_context_builder"`
	BuildContext       func(router.Context) (router.ViewContext, error) `json:"build_context"`
	Guard              func(router.Context) error                       `json:"guard"`
}

AdminPageSpec configures a simple admin HTML page route.

type AdoptLegacyExport added in v0.141.1

type AdoptLegacyExport struct {
	Actor   export.Actor                `json:"-"`
	Request LegacyExportAdoptionRequest `json:"request"`
}

AdoptLegacyExport contains reviewed references, never endpoint credentials. The operator adapter must supply Actor from trusted current authentication. It is deliberately not installed in public HTTP/RPC message factories.

func (AdoptLegacyExport) Type added in v0.141.1

func (AdoptLegacyExport) Type() string

func (AdoptLegacyExport) Validate added in v0.141.1

func (m AdoptLegacyExport) Validate() error

type AdoptLegacyExportHandler added in v0.141.1

type AdoptLegacyExportHandler struct{ Service LegacyExportAdoptionService }

func (*AdoptLegacyExportHandler) Execute added in v0.141.1

func (*AdoptLegacyExportHandler) Run added in v0.141.1

type AsyncRequesterFactory

type AsyncRequesterFactory func(service export.Service, logger export.Logger) exportapi.AsyncRequester

AsyncRequesterFactory builds an async requester after the export service is initialized.

type AuthUIBrowserProtection added in v0.131.6

type AuthUIBrowserProtection struct {
	// contains filtered or unexported fields
}

AuthUIBrowserProtection binds public Auth UI CSRF tokens to an opaque pre-authentication browser cookie and enforces same-origin unsafe requests. Reuse one instance across Auth UI, registration UI, and onboarding routes.

func NewAuthUIBrowserProtection added in v0.131.6

func NewAuthUIBrowserProtection(cfg admin.Config, options ...AuthUIBrowserProtectionOption) (*AuthUIBrowserProtection, error)

NewAuthUIBrowserProtection constructs a browser-bound, stateless CSRF boundary suitable for public login, registration, and password-reset flows.

func (*AuthUIBrowserProtection) APIMiddleware added in v0.131.6

func (p *AuthUIBrowserProtection) APIMiddleware() router.MiddlewareFunc

APIMiddleware returns browser CSRF middleware whose failures flow through the host API error presenter as structured, controlled errors.

func (*AuthUIBrowserProtection) HTMLMiddleware added in v0.131.6

func (p *AuthUIBrowserProtection) HTMLMiddleware(errorHandler router.ErrorHandler) router.MiddlewareFunc

HTMLMiddleware returns browser CSRF middleware with caller-owned recovery behavior for token failures and a controlled forbidden origin response.

func (*AuthUIBrowserProtection) WrapAPI added in v0.131.6

WrapAPI applies the public browser CSRF API boundary directly to a handler.

type AuthUIBrowserProtectionOption added in v0.131.6

type AuthUIBrowserProtectionOption func(*authUIBrowserProtectionOptions)

AuthUIBrowserProtectionOption customizes the reusable public Auth UI browser protection boundary.

func WithAuthUIBrowserProtectionCookie added in v0.131.6

func WithAuthUIBrowserProtectionCookie(cookie router.Cookie) AuthUIBrowserProtectionOption

WithAuthUIBrowserProtectionCookie overrides the pre-auth browser cookie. The cookie remains host-only and HTTP-only; Domain values are rejected.

func WithAuthUIBrowserProtectionOriginConfig added in v0.131.6

func WithAuthUIBrowserProtectionOriginConfig(config router.OriginProtectionConfig) AuthUIBrowserProtectionOption

WithAuthUIBrowserProtectionOriginConfig overrides same-origin enforcement.

func WithAuthUIBrowserProtectionSecureKey added in v0.131.6

func WithAuthUIBrowserProtectionSecureKey(key []byte) AuthUIBrowserProtectionOption

WithAuthUIBrowserProtectionSecureKey sets a stable signing key. Multi-instance deployments must share this key (or cfg.PreviewSecret) across instances.

func WithAuthUIBrowserProtectionSecureRequestResolver added in v0.131.6

func WithAuthUIBrowserProtectionSecureRequestResolver(resolver func(router.Context) bool) AuthUIBrowserProtectionOption

WithAuthUIBrowserProtectionSecureRequestResolver controls whether the pre-auth cookie is marked Secure for the current request.

type AuthUIOption added in v0.13.0

type AuthUIOption func(*authUIOptions)

AuthUIOption customizes the auth UI routes.

func WithAuthUIAdminTheme added in v0.50.0

func WithAuthUIAdminTheme(adm *admin.Admin) AuthUIOption

WithAuthUIAdminTheme injects the full admin theme payload into auth templates.

func WithAuthUIBasePath added in v0.13.0

func WithAuthUIBasePath(basePath string) AuthUIOption

WithAuthUIBasePath overrides the base path used by auth UI routes.

func WithAuthUIBrowserProtection added in v0.131.6

func WithAuthUIBrowserProtection(protection *AuthUIBrowserProtection) AuthUIOption

WithAuthUIBrowserProtection reuses one browser-bound CSRF contract across Auth UI, registration UI, and onboarding routes.

func WithAuthUICSRFSecureKey added in v0.28.0

func WithAuthUICSRFSecureKey(key []byte) AuthUIOption

WithAuthUICSRFSecureKey overrides the stateless CSRF secure key for auth UI forms.

func WithAuthUICookie added in v0.13.0

func WithAuthUICookie(cookie router.Cookie) AuthUIOption

WithAuthUICookie overrides the auth cookie defaults.

func WithAuthUIFeatureGate added in v0.20.0

func WithAuthUIFeatureGate(gate fggate.FeatureGate) AuthUIOption

WithAuthUIFeatureGate sets the feature gate used for default guards.

func WithAuthUILoginPath added in v0.13.0

func WithAuthUILoginPath(route string) AuthUIOption

WithAuthUILoginPath overrides the login route path.

func WithAuthUILoginRedirect added in v0.13.0

func WithAuthUILoginRedirect(route string) AuthUIOption

WithAuthUILoginRedirect overrides the redirect path after login.

func WithAuthUILoginRedirectResolver added in v0.32.0

func WithAuthUILoginRedirectResolver(resolver func(c router.Context, fallback string) string) AuthUIOption

WithAuthUILoginRedirectResolver overrides the login redirect target using the current request context and a static fallback.

func WithAuthUILoginRedirectStatus added in v0.50.0

func WithAuthUILoginRedirectStatus(status int) AuthUIOption

WithAuthUILoginRedirectStatus overrides the redirect status code after login.

func WithAuthUILogoutAuthenticator added in v0.76.0

func WithAuthUILogoutAuthenticator(authn admin.HandlerAuthenticator) AuthUIOption

WithAuthUILogoutAuthenticator protects logout routes with the provided handler authenticator. This lets authenticated admin shells validate logout POSTs with the same browser auth and CSRF contract that rendered the form.

func WithAuthUILogoutGET added in v0.50.0

func WithAuthUILogoutGET(enabled bool) AuthUIOption

WithAuthUILogoutGET enables a compatibility GET logout route in addition to POST.

func WithAuthUILogoutMiddleware added in v0.76.0

func WithAuthUILogoutMiddleware(mw router.MiddlewareFunc) AuthUIOption

WithAuthUILogoutMiddleware overrides the middleware used to protect logout routes. Use this when logout forms are rendered inside another protected shell whose CSRF token must be validated by the same middleware.

func WithAuthUILogoutPath added in v0.13.0

func WithAuthUILogoutPath(route string) AuthUIOption

WithAuthUILogoutPath overrides the logout route path.

func WithAuthUILogoutRedirect added in v0.13.0

func WithAuthUILogoutRedirect(route string) AuthUIOption

WithAuthUILogoutRedirect overrides the redirect path after logout.

func WithAuthUILogoutRedirectStatus added in v0.50.0

func WithAuthUILogoutRedirectStatus(status int) AuthUIOption

WithAuthUILogoutRedirectStatus overrides the redirect status code after logout.

func WithAuthUIPasswordResetConfirmPath added in v0.19.0

func WithAuthUIPasswordResetConfirmPath(route string) AuthUIOption

WithAuthUIPasswordResetConfirmPath overrides the password reset confirm route path.

func WithAuthUIPasswordResetConfirmTemplate added in v0.19.0

func WithAuthUIPasswordResetConfirmTemplate(name string) AuthUIOption

WithAuthUIPasswordResetConfirmTemplate overrides the password reset confirm template name.

func WithAuthUIPasswordResetConfirmTitle added in v0.19.0

func WithAuthUIPasswordResetConfirmTitle(title string) AuthUIOption

WithAuthUIPasswordResetConfirmTitle overrides the view title for the confirm reset page.

func WithAuthUIPasswordResetEnabled added in v0.13.0

func WithAuthUIPasswordResetEnabled(fn func(admin.Config) bool) AuthUIOption

WithAuthUIPasswordResetEnabled overrides the password reset feature guard.

func WithAuthUIPasswordResetPath added in v0.13.0

func WithAuthUIPasswordResetPath(route string) AuthUIOption

WithAuthUIPasswordResetPath overrides the password reset route path.

func WithAuthUIRegisterPath added in v0.19.0

func WithAuthUIRegisterPath(route string) AuthUIOption

WithAuthUIRegisterPath overrides the self-registration route path.

func WithAuthUISelfRegistrationEnabled added in v0.19.0

func WithAuthUISelfRegistrationEnabled(fn func(admin.Config) bool) AuthUIOption

WithAuthUISelfRegistrationEnabled overrides the self-registration feature guard.

func WithAuthUITemplates added in v0.13.0

func WithAuthUITemplates(loginTemplate, passwordResetTemplate string) AuthUIOption

WithAuthUITemplates overrides the login and password reset templates.

func WithAuthUIThemeAssets added in v0.19.0

func WithAuthUIThemeAssets(prefix string, assets map[string]string) AuthUIOption

WithAuthUIThemeAssets sets theme assets (logo, icon, favicon, etc.) for auth UI templates. The prefix is prepended to each relative asset filename to form the full URL path. Already resolved URLs/paths are preserved unchanged. Assets are exposed in templates as theme.assets.logo, theme.assets.icon, theme.assets.favicon, etc.

func WithAuthUITitles added in v0.13.0

func WithAuthUITitles(loginTitle, passwordResetTitle string) AuthUIOption

WithAuthUITitles overrides the view titles for login and password reset.

func WithAuthUIViewContextBuilder added in v0.13.0

func WithAuthUIViewContextBuilder(builder AuthUIViewContextBuilder) AuthUIOption

WithAuthUIViewContextBuilder overrides the default view context builder.

type AuthUIPaths added in v0.19.0

type AuthUIPaths struct {
	BasePath                 string `json:"base_path"`
	PasswordResetPath        string `json:"password_reset_path"`
	PasswordResetConfirmPath string `json:"password_reset_confirm_path"`
	RegisterPath             string `json:"register_path"`
}

AuthUIPaths captures common auth-related route paths for templates.

type AuthUIState added in v0.19.0

type AuthUIState struct {
	PasswordResetEnabled    bool `json:"password_reset_enabled"`
	SelfRegistrationEnabled bool `json:"self_registration_enabled"`
}

AuthUIState captures feature-guarded flags used by auth templates.

func AuthUIStateFromGate added in v0.20.0

func AuthUIStateFromGate(ctx context.Context, gate fggate.FeatureGate, scope fggate.ScopeChain) AuthUIState

AuthUIStateFromGate derives auth UI flags from the feature gate.

type AuthUIViewContextBuilder added in v0.13.0

type AuthUIViewContextBuilder func(ctx router.ViewContext, c router.Context) router.ViewContext

AuthUIViewContextBuilder mutates the view context for auth UI routes.

type BinaryObjectResponseConfig added in v0.25.0

type BinaryObjectResponseConfig struct {
	Store        BinaryObjectStore `json:"store"`
	ObjectKey    string            `json:"object_key"`
	ContentType  string            `json:"content_type"`
	Filename     string            `json:"filename"`
	Disposition  string            `json:"disposition"`
	CacheControl string            `json:"cache_control"`
	Pragma       string            `json:"pragma"`
	StatusCode   int               `json:"status_code"`
	Headers      map[string]string `json:"headers"`
}

BinaryObjectResponseConfig configures object-backed binary responses.

type BinaryObjectStore added in v0.25.0

type BinaryObjectStore interface {
	GetFile(ctx context.Context, path string) ([]byte, error)
}

BinaryObjectStore resolves raw object bytes by key.

type BreadcrumbItem struct {
	Label   string `json:"label"`
	Href    string `json:"href,omitempty"`
	Current bool   `json:"current,omitempty"`
}

BreadcrumbItem represents a single rendered breadcrumb.

func Breadcrumb(label, href string) BreadcrumbItem

Breadcrumb builds a linked breadcrumb.

func CurrentBreadcrumb added in v0.27.0

func CurrentBreadcrumb(label string) BreadcrumbItem

CurrentBreadcrumb builds a terminal breadcrumb.

func DeriveBreadcrumbsFromNavEntries added in v0.27.0

func DeriveBreadcrumbsFromNavEntries(entries []map[string]any, active string) []BreadcrumbItem

DeriveBreadcrumbsFromNavEntries builds breadcrumbs from the active nav trail.

type BreadcrumbRouteKind string

BreadcrumbRouteKind identifies the route surface being rendered.

const (
	BreadcrumbRouteList   BreadcrumbRouteKind = "list"
	BreadcrumbRouteDetail BreadcrumbRouteKind = "detail"
)
type BreadcrumbSpec struct {
	Override     []BreadcrumbItem `json:"override"`
	RootLabel    string           `json:"root_label"`
	RootHref     string           `json:"root_href"`
	Trail        []BreadcrumbItem `json:"trail"`
	CurrentLabel string           `json:"current_label"`
}

BreadcrumbSpec describes a breadcrumb trail without relying on nav structure.

type BunScopeDriftInspector added in v0.83.0

type BunScopeDriftInspector struct {
	// contains filtered or unexported fields
}

BunScopeDriftInspector checks allowlisted scoped tables through Bun.

func NewBunScopeDriftInspector added in v0.83.0

func NewBunScopeDriftInspector(db *bun.DB) *BunScopeDriftInspector

NewBunScopeDriftInspector returns a Bun-backed scope drift inspector.

func (*BunScopeDriftInspector) CheckBlankScopeRows added in v0.83.0

func (i *BunScopeDriftInspector) CheckBlankScopeRows(ctx context.Context, table string) (ScopeDriftTableCheck, error)

func (*BunScopeDriftInspector) RepairBlankScopeRows added in v0.83.0

func (i *BunScopeDriftInspector) RepairBlankScopeRows(ctx context.Context, table string, scope ScopeDriftRepairScope) (int, error)

type CommandQueueRoutingConfig added in v0.27.0

type CommandQueueRoutingConfig struct {
	Enabled bool `json:"enabled,omitempty"`

	Enqueuer jobqueue.Enqueuer      `json:"-"`
	Registry *queuecommand.Registry `json:"-"`

	// IdempotencyStore enables durable deduplication for drop|merge|replace policies.
	IdempotencyStore qidempotency.Store `json:"-"`
	// IdempotencyTTL controls dedup record expiration when IdempotencyStore is configured.
	IdempotencyTTL time.Duration `json:"idempotency_ttl,omitempty"`
}

CommandQueueRoutingConfig configures optional quickstart queued command dispatch wiring.

type ContentAliasRouteOption added in v0.24.0

type ContentAliasRouteOption func(*contentAliasRouteOptions)

ContentAliasRouteOption customizes the content entry alias route registration.

func WithContentAliasBasePath added in v0.24.0

func WithContentAliasBasePath(basePath string) ContentAliasRouteOption

WithContentAliasBasePath overrides the base path used to build alias routes.

func WithContentAliasContext added in v0.32.0

func WithContentAliasContext(ctx context.Context) ContentAliasRouteOption

WithContentAliasContext overrides the context used to discover content aliases during route registration.

func WithContentAliasRoutes added in v0.24.0

func WithContentAliasRoutes(aliases ...string) ContentAliasRouteOption

WithContentAliasRoutes overrides the aliases that should be registered.

type ContentEntryEditGuard added in v0.27.0

type ContentEntryEditGuard func(c router.Context, panelName string, record map[string]any) (bool, error)

type ContentEntryPostCreateContext added in v0.126.12

type ContentEntryPostCreateContext struct {
	PanelName string
	CreatedID string
	Channel   string
}

type ContentEntryPostCreateDecision added in v0.126.12

type ContentEntryPostCreateDecision struct {
	Destination ContentEntryPostCreateDestination
	Query       map[string]string
}

type ContentEntryPostCreateDestination added in v0.126.12

type ContentEntryPostCreateDestination string
const (
	ContentEntryPostCreateEdit   ContentEntryPostCreateDestination = "edit"
	ContentEntryPostCreateDetail ContentEntryPostCreateDestination = "detail"
	ContentEntryPostCreateIndex  ContentEntryPostCreateDestination = "index"
)

type ContentEntryPostCreatePolicy added in v0.126.12

type ContentEntryPostCreatePolicy func(ContentEntryPostCreateContext) ContentEntryPostCreateDecision

type ContentEntryUIOption added in v0.24.0

type ContentEntryUIOption func(*contentEntryUIOptions)

ContentEntryUIOption customizes content entry UI routes.

func WithContentEntryDataGridStateStore added in v0.25.0

func WithContentEntryDataGridStateStore(cfg PanelDataGridStateStoreOptions) ContentEntryUIOption

WithContentEntryDataGridStateStore configures DataGrid persisted-state storage for content list templates.

func WithContentEntryDataGridURLState added in v0.25.0

func WithContentEntryDataGridURLState(cfg PanelDataGridURLStateOptions) ContentEntryUIOption

WithContentEntryDataGridURLState configures DataGrid URL-state limits for content list templates.

func WithContentEntryDefaultRenderers added in v0.25.0

func WithContentEntryDefaultRenderers(renderers map[string]string) ContentEntryUIOption

WithContentEntryDefaultRenderers replaces the configured default renderer map. Values are used when ui_schema does not specify a renderer.

func WithContentEntryFormRenderer added in v0.24.0

func WithContentEntryFormRenderer(renderer *admin.FormgenSchemaValidator) ContentEntryUIOption

WithContentEntryFormRenderer overrides the form renderer used for content entry forms.

func WithContentEntryMergeDefaultRenderers added in v0.25.0

func WithContentEntryMergeDefaultRenderers(renderers map[string]string) ContentEntryUIOption

WithContentEntryMergeDefaultRenderers merges renderer defaults into the existing map. Keys in renderers override existing configured values.

func WithContentEntryPostCreatePolicy added in v0.126.12

func WithContentEntryPostCreatePolicy(policy ContentEntryPostCreatePolicy) ContentEntryUIOption

WithContentEntryPostCreatePolicy controls the destination and query values used after a content entry is created. The default destination is the edit page. For canonical current-user detail panels, the canonical destination is authoritative while non-reserved policy query values are preserved.

func WithContentEntryRecommendedDefaults added in v0.25.0

func WithContentEntryRecommendedDefaults() ContentEntryUIOption

WithContentEntryRecommendedDefaults merges recommended content-entry defaults.

func WithContentEntryTranslationUX added in v0.25.0

func WithContentEntryTranslationUX(enabled bool) ContentEntryUIOption

WithContentEntryTranslationUX enables translation list UX enhancements (grouped/matrix view mode wiring and grouped URL sync) for translation-enabled panels.

func WithContentEntryUIAuthResource added in v0.24.0

func WithContentEntryUIAuthResource(resource string) ContentEntryUIOption

WithContentEntryUIAuthResource overrides the go-auth resource used for checks.

func WithContentEntryUIBasePath added in v0.24.0

func WithContentEntryUIBasePath(basePath string) ContentEntryUIOption

WithContentEntryUIBasePath overrides the base path used to build content entry routes.

func WithContentEntryUIEditGuard added in v0.27.0

func WithContentEntryUIEditGuard(guard ContentEntryEditGuard) ContentEntryUIOption

WithContentEntryUIEditGuard configures a pre-render guard for edit routes. Returning handled=true stops normal edit rendering.

func WithContentEntryUIPermission added in v0.24.0

func WithContentEntryUIPermission(permission string) ContentEntryUIOption

WithContentEntryUIPermission sets the permission used for authz checks.

func WithContentEntryUITemplateExists added in v0.25.0

func WithContentEntryUITemplateExists(checker func(name string) bool) ContentEntryUIOption

WithContentEntryUITemplateExists sets a template existence checker used to resolve panel template fallbacks.

func WithContentEntryUITemplateFS added in v0.25.0

func WithContentEntryUITemplateFS(fsys ...fs.FS) ContentEntryUIOption

WithContentEntryUITemplateFS configures deterministic template fallback resolution from filesystem sources.

func WithContentEntryUITemplates added in v0.24.0

func WithContentEntryUITemplates(listTemplate, formTemplate, detailTemplate string) ContentEntryUIOption

WithContentEntryUITemplates overrides template names for content entry routes.

func WithContentEntryUIViewContext added in v0.24.0

func WithContentEntryUIViewContext(builder UIViewContextBuilder) ContentEntryUIOption

WithContentEntryUIViewContext overrides the view context builder for content entry routes.

func WithContentEntryUpdateIntentPolicy added in v0.108.0

func WithContentEntryUpdateIntentPolicy(policy ContentEntryUpdateIntentPolicy) ContentEntryUIOption

WithContentEntryUpdateIntentPolicy adds programmatic nested-array update intent policy for content entry updates. Schema and content type metadata can also define policy; this option overrides matching array paths.

type ContentEntryUpdateIntentAmbiguity added in v0.108.0

type ContentEntryUpdateIntentAmbiguity string
const (
	ContentEntryUpdateIntentReject   ContentEntryUpdateIntentAmbiguity = "reject"
	ContentEntryUpdateIntentPreserve ContentEntryUpdateIntentAmbiguity = "preserve"
	ContentEntryUpdateIntentReplace  ContentEntryUpdateIntentAmbiguity = "replace"
)

type ContentEntryUpdateIntentArrayPolicy added in v0.108.0

type ContentEntryUpdateIntentArrayPolicy struct {
	Mode               string                            `json:"mode"`
	Identity           []string                          `json:"identity"`
	ReferenceFields    []string                          `json:"reference_fields"`
	DeleteField        string                            `json:"delete_field"`
	Ambiguous          ContentEntryUpdateIntentAmbiguity `json:"ambiguous"`
	AllowIndexFallback bool                              `json:"allow_index_fallback"`
}

type ContentEntryUpdateIntentPolicy added in v0.108.0

type ContentEntryUpdateIntentPolicy struct {
	Arrays map[string]ContentEntryUpdateIntentArrayPolicy `json:"arrays"`
}

type ContentTypeBuilderAPIOption added in v0.24.0

type ContentTypeBuilderAPIOption func(*contentTypeBuilderAPIOptions)

ContentTypeBuilderAPIOption customizes content type builder API routes.

func WithContentTypeBuilderAPIAuthResource added in v0.24.0

func WithContentTypeBuilderAPIAuthResource(resource string) ContentTypeBuilderAPIOption

WithContentTypeBuilderAPIAuthResource overrides the go-auth resource used for checks.

func WithContentTypeBuilderAPIBasePath added in v0.24.0

func WithContentTypeBuilderAPIBasePath(basePath string) ContentTypeBuilderAPIOption

WithContentTypeBuilderAPIBasePath overrides the base path used to build API routes.

func WithContentTypeBuilderAPIPermission added in v0.24.0

func WithContentTypeBuilderAPIPermission(permission string) ContentTypeBuilderAPIOption

WithContentTypeBuilderAPIPermission sets the permission used for authz checks.

type ContentTypeBuilderUIOption added in v0.24.0

type ContentTypeBuilderUIOption func(*contentTypeBuilderUIOptions)

ContentTypeBuilderUIOption customizes content type builder UI routes.

func WithContentTypeBuilderUIAuthResource added in v0.24.0

func WithContentTypeBuilderUIAuthResource(resource string) ContentTypeBuilderUIOption

WithContentTypeBuilderUIAuthResource overrides the go-auth resource used for checks.

func WithContentTypeBuilderUIBasePath added in v0.24.0

func WithContentTypeBuilderUIBasePath(basePath string) ContentTypeBuilderUIOption

WithContentTypeBuilderUIBasePath overrides the base path used to build UI routes.

func WithContentTypeBuilderUIPermission added in v0.24.0

func WithContentTypeBuilderUIPermission(permission string) ContentTypeBuilderUIOption

WithContentTypeBuilderUIPermission sets the permission used for authz checks.

func WithContentTypeBuilderUIShellAssetsPrefix added in v0.110.0

func WithContentTypeBuilderUIShellAssetsPrefix(prefix string) ContentTypeBuilderUIOption

WithContentTypeBuilderUIShellAssetsPrefix sets the go-dashboard shell asset prefix rendered by Content Types and Block Library pages. Keep it aligned with NewStaticAssets(..., WithDashboardShellPrefix(...)).

func WithContentTypeBuilderUIStaticAssetOptions added in v0.110.0

func WithContentTypeBuilderUIStaticAssetOptions(cfg admin.Config, opts ...StaticAssetsOption) ContentTypeBuilderUIOption

WithContentTypeBuilderUIStaticAssetOptions derives the rendered shell asset prefix from the same static asset options passed to NewStaticAssets.

func WithContentTypeBuilderUITemplates added in v0.24.0

func WithContentTypeBuilderUITemplates(contentTypes, blockDefinitions string) ContentTypeBuilderUIOption

WithContentTypeBuilderUITemplates overrides template names for UI routes.

func WithContentTypeBuilderUIViewContext added in v0.24.0

func WithContentTypeBuilderUIViewContext(builder UIViewContextBuilder) ContentTypeBuilderUIOption

WithContentTypeBuilderUIViewContext overrides the view context builder for UI routes.

type DashboardPlacementSpec added in v0.27.0

type DashboardPlacementSpec struct {
	AreaCode string         `json:"area_code"`
	Extra    map[string]any `json:"extra"`
}

DashboardPlacementSpec describes dashboard routing for a placement.

type DashboardRendererOption

type DashboardRendererOption func(*dashboardRendererOptions)

DashboardRendererOption customizes the default dashboard renderer setup.

func WithDashboardEmbeddedTemplates

func WithDashboardEmbeddedTemplates(enabled bool) DashboardRendererOption

WithDashboardEmbeddedTemplates toggles the embedded dashboard templates.

func WithDashboardTemplateFuncOptions added in v0.25.0

func WithDashboardTemplateFuncOptions(options ...TemplateFuncOption) DashboardRendererOption

WithDashboardTemplateFuncOptions configures quickstart.DefaultTemplateFuncs when no explicit template function map is provided.

func WithDashboardTemplateFuncs added in v0.25.0

func WithDashboardTemplateFuncs(funcs map[string]any) DashboardRendererOption

WithDashboardTemplateFuncs overrides template functions used by the dashboard renderer.

func WithDashboardTemplatesFS

func WithDashboardTemplatesFS(fsys fs.FS) DashboardRendererOption

WithDashboardTemplatesFS appends a template filesystem to the renderer.

type DebugModuleOption added in v0.25.0

type DebugModuleOption func(*admin.DebugModule)

DebugModuleOption customizes quickstart debug module defaults.

type DebugOption added in v0.26.0

type DebugOption struct {
	Enabled                    *bool          `json:"enabled"`
	AllowedIPs                 []string       `json:"allowed_i_ps"`
	AllowedOrigins             []string       `json:"allowed_origins"`
	AppID                      string         `json:"app_id"`
	AppName                    string         `json:"app_name"`
	Environment                string         `json:"environment"`
	RemoteEnabled              *bool          `json:"remote_enabled"`
	TokenTTL                   *time.Duration `json:"token_ttl"`
	SessionTracking            *bool          `json:"session_tracking"`
	SessionIncludeGlobalPanels *bool          `json:"session_include_global_panels"`
	SessionCookieName          string         `json:"session_cookie_name"`
	SessionInactivityExpiry    *time.Duration `json:"session_inactivity_expiry"`
	SnapshotTimeout            *time.Duration `json:"snapshot_timeout"`
	CaptureSQL                 *bool          `json:"capture_sql"`
	CaptureLogs                *bool          `json:"capture_logs"`
	CaptureJSErrors            *bool          `json:"capture_js_errors"`
	CaptureRequestBody         *bool          `json:"capture_request_body"`
	ToolbarMode                *bool          `json:"toolbar_mode"`
	ToolbarPanels              []string       `json:"toolbar_panels"`
	LayoutMode                 string         `json:"layout_mode"`
	ReplEnabled                *bool          `json:"repl_enabled"`
	ReplReadOnly               *bool          `json:"repl_read_only"`
}

DebugOption applies explicit debug configuration overrides.

type DebugPanelCatalog added in v0.24.0

type DebugPanelCatalog map[string]DebugPanelRegistrar

DebugPanelCatalog maps panel IDs to registration callbacks.

func DefaultDebugPanelCatalog added in v0.24.0

func DefaultDebugPanelCatalog() DebugPanelCatalog

DefaultDebugPanelCatalog returns the built-in quickstart debug panel catalog.

type DebugPanelDeps added in v0.24.0

type DebugPanelDeps struct {
	ScopeBuffer   *ScopeDebugBuffer `json:"scope_buffer"`
	IsDevelopment *bool             `json:"is_development"`
	DoctorEnabled *bool             `json:"doctor_enabled"`
}

DebugPanelDeps provides optional dependencies for debug panel registration.

type DebugPanelRegistrar added in v0.24.0

type DebugPanelRegistrar func(cfg *admin.Config, deps DebugPanelDeps)

DebugPanelRegistrar registers a debug panel definition.

type DurableExportHost added in v0.141.0

type DurableExportHost struct {
	export.Service
	Bundle    *ExportBundle
	Queue     *postgres.Storage
	Recurring *postgres.RecurringScheduler
	Worker    *worker.Worker
	Webhooks  *deliverybun.Service
	Tracker   *trackerbun.Tracker
	// contains filtered or unexported fields
}

DurableExportHost is a normal export bundle backed by the native durable services. Register Bundle's dependencies through the existing admin bootstrap. Call Migrate after the host's native export tracker migration, then Run under the application's lifecycle context. The host retains database ownership.

func NewDurableExportHost added in v0.141.0

func NewDurableExportHost(cfg DurableExportHostConfig, opts ...ExportBundleOption) (*DurableExportHost, error)

func (*DurableExportHost) AdoptLegacyExport added in v0.141.1

AdoptLegacyExport applies the reviewed pair atomically. Existing plans and delivery identities are never rebound to another profile or credential set.

func (*DurableExportHost) CheckReady added in v0.141.0

func (h *DurableExportHost) CheckReady(ctx context.Context) error

CheckReady validates the durable tables before routes or workers start.

func (*DurableExportHost) ExecuteMessage added in v0.141.0

func (h *DurableExportHost) ExecuteMessage(ctx context.Context, m *job.ExecutionMessage) error

ExecuteMessage uses the same trusted task dispatch as the native worker. It does not acknowledge a queue receipt; the queue consumer owns ACK/NACK/leases.

func (*DurableExportHost) History added in v0.141.0

History authorizes before metadata reads and applies trusted namespace/owner predicates in SQL before a bounded native tracker lookup. Group namespaces do not have to be encoded as tenant/workspace identifiers.

func (*DurableExportHost) InventoryLegacyExports added in v0.142.0

InventoryLegacyExports prepares one authorized page without adopting records. Inventory policy owns authoritative discovery; stored actor hints are not authority.

func (*DurableExportHost) Migrate added in v0.141.0

func (h *DurableExportHost) Migrate(ctx context.Context) error

Migrate adds native durable schemas and private namespace ownership. The tracker schema (including request_payload) remains a host migration contract. It is checked before any durable schema is changed or traffic is accepted.

func (*DurableExportHost) Poll added in v0.141.0

func (h *DurableExportHost) Poll(ctx context.Context) error

Poll admits bounded due work from a trusted namespace catalog. Failed scopes are reported after other scopes are processed; they retain their due cursor.

func (*DurableExportHost) PreviewLegacyExport added in v0.141.1

func (h *DurableExportHost) PreviewLegacyExport(ctx context.Context, a export.Actor, id, profile string) (LegacyExportReview, error)

PreviewLegacyExport exposes only digests/references, never credential bytes. The operator must fence old workers and review the returned record/plan pair.

func (*DurableExportHost) Run added in v0.141.0

func (h *DurableExportHost) Run(ctx context.Context) (err error)

Run owns worker and poller lifetime. Poll failures are reported to the required observer without advancing failed scopes or preventing other scopes' work. Cancellation stops active work; its unacknowledged leases recover normally.

func (*DurableExportHost) TickSchedule added in v0.141.0

func (h *DurableExportHost) TickSchedule(ctx context.Context, namespace, id string, through time.Time, limit int) ([]postgres.Occurrence, error)

TickSchedule admits a bounded chronological catch-up batch. The host resolves current schedule delegation before entering its authorized SQL transaction. Occurrence/owner/delegation/record/plan/queue/cursor share one commit. Operators install immutable native definitions with an ExportRequest JSON payload.

type DurableExportHostConfig added in v0.141.0

type DurableExportHostConfig struct {
	// RecoveryGate optionally enforces process-local sealed startup and drain.
	// Construct a new gate on each start; raw handles require separate fencing.
	RecoveryGate               *DurableExportRecoveryGate
	LegacyAdoption             *LegacyExportAdoptionConfig
	DB                         *bun.DB
	ArtifactRoot               string
	Guard                      export.Guard
	ActorProvider              export.ActorProvider
	Namespace                  func(context.Context, export.Actor) (string, error)
	WithTransaction            func(context.Context, export.Actor, func(context.Context, bun.Tx) error) error
	AuthorizeRecordTransaction func(context.Context, bun.Tx, export.Actor, string) error
	AcceptBackground           func(context.Context, bun.Tx, export.Actor, export.ExportRecord) error
	ResolveBackground          func(context.Context, ExportBackgroundWork) (context.Context, export.Actor, error)
	Webhooks                   *DurableExportWebhookConfig
	// RecurringNamespaces is a trusted operator catalog. A nil catalog disables
	// automatic polling; explicit TickSchedule remains available.
	RecurringNamespaces func(context.Context) ([]string, error)
	OnPollError         func(error)
	PollInterval        time.Duration
	ScheduleBatch       int
	OccurrenceBatch     int
	WorkerConcurrency   int
	RetryPolicy         worker.RetryPolicy
	Now                 func() time.Time
}

DurableExportHostConfig supplies application-owned authorization. Transaction callbacks must use the supplied transaction for all guards and row sources. ResolveBackground authenticates a current durable delegation independently of browser credentials. AcceptBackground explicitly authorizes/persists that delegation with each new export; errors roll back all acceptance writes.

type DurableExportRecoveryGate added in v0.141.1

type DurableExportRecoveryGate struct {
	// contains filtered or unexported fields
}

DurableExportRecoveryGate drains work admitted through the host facade and native Run lifecycle in this process. All host instances in the same process must share the gate. Raw persistence/runner/webhook/worker handles, external receivers and other processes require separate consuming-host fences. A zero value is invalid; construct a new sealed gate for every process start.

func NewDurableExportRecoveryGate added in v0.141.1

func NewDurableExportRecoveryGate(policy ExportRecoveryPolicy) (*DurableExportRecoveryGate, error)

func (*DurableExportRecoveryGate) Resume added in v0.141.1

Resume authorizes the current operator, verifies catalog-anchored restoration and reconciles current policy while admission is closed. Concurrent Seal or cancellation invalidates the attempt, even if callbacks subsequently succeed.

func (*DurableExportRecoveryGate) Seal added in v0.141.1

Seal rejects new work, stops native Run lifecycles and waits for all admitted calls, migration/reconciliation and worker shutdown to finish. Timeout leaves admission sealed; it never declares outstanding work quiescent.

func (*DurableExportRecoveryGate) State added in v0.141.1

type DurableExportWebhookConfig added in v0.141.0

type DurableExportWebhookConfig struct {
	Sender          delivery.ReceiptWebhookSender
	Select          func(context.Context, export.Actor, export.ExportRecord) (deliverybun.ScheduleRequest, error)
	AuthorizeTarget func(context.Context, export.Actor, string, deliverybun.Target) error
	Link            func(export.ExportRecord) (string, error)
}

DurableExportWebhookConfig enables immutable completion plans and receipts. Target policy and links must be current host policy, not request-supplied URLs.

type ErrorOption added in v0.26.0

type ErrorOption struct {
	DevMode               *bool `json:"dev_mode"`
	IncludeStackTrace     *bool `json:"include_stack_trace"`
	ExposeInternalMessage *bool `json:"expose_internal_message"`
}

ErrorOption applies explicit error configuration overrides.

type ExportBackgroundWork added in v0.141.0

type ExportBackgroundWork struct {
	Kind       string
	ExportID   string
	Namespace  string
	ScheduleID string
}

ExportBackgroundWork contains identifiers to resolve through current host policy. Message actor/role/session fields are deliberately absent.

type ExportBundle

type ExportBundle struct {
	Runner    *export.Runner               `json:"runner"`
	Service   export.Service               `json:"service"`
	Registry  admin.ExportRegistry         `json:"registry"`
	Registrar admin.ExportHTTPRegistrar    `json:"registrar"`
	Metadata  admin.ExportMetadataProvider `json:"metadata"`
}

ExportBundle wires go-export integrations for go-admin.

func NewExportBundle

func NewExportBundle(opts ...ExportBundleOption) *ExportBundle

NewExportBundle constructs default go-export wiring for go-admin.

type ExportBundleOption

type ExportBundleOption func(*exportBundleOptions)

ExportBundleOption customizes NewExportBundle behavior.

func WithExportActorProvider

func WithExportActorProvider(provider export.ActorProvider) ExportBundleOption

WithExportActorProvider sets the actor provider for export requests.

func WithExportAsyncInProcess

func WithExportAsyncInProcess(timeout time.Duration) ExportBundleOption

WithExportAsyncInProcess enables in-process async exports using a background goroutine. This is suitable for demos; production should use a job runner/queue.

func WithExportAsyncRequester

func WithExportAsyncRequester(factory AsyncRequesterFactory) ExportBundleOption

WithExportAsyncRequester configures async export requests (for 202 + status/download URLs).

func WithExportBasePath

func WithExportBasePath(path string) ExportBundleOption

WithExportBasePath overrides the default export base path. Provide a full path ("/admin/exports") or a suffix ("exports").

func WithExportDeliveryPolicy

func WithExportDeliveryPolicy(policy export.DeliveryPolicy) ExportBundleOption

WithExportDeliveryPolicy overrides the delivery policy defaults.

func WithExportGuard

func WithExportGuard(guard export.Guard) ExportBundleOption

WithExportGuard sets the go-export guard.

func WithExportHistoryPath

func WithExportHistoryPath(path string) ExportBundleOption

WithExportHistoryPath overrides the history endpoint path.

func WithExportLogger

func WithExportLogger(logger export.Logger) ExportBundleOption

WithExportLogger sets the go-export logger.

func WithExportMaxBufferBytes

func WithExportMaxBufferBytes(maxBytes int64) ExportBundleOption

WithExportMaxBufferBytes sets the max buffer size for sync downloads.

func WithExportPathSuffix

func WithExportPathSuffix(suffix string) ExportBundleOption

WithExportPathSuffix overrides the default base path suffix when no base path is set.

func WithExportQueryRequestDecoder

func WithExportQueryRequestDecoder(decoder exportapi.RequestDecoder) ExportBundleOption

WithExportQueryRequestDecoder overrides the querystring request decoder.

func WithExportRequestDecoder

func WithExportRequestDecoder(decoder exportapi.RequestDecoder) ExportBundleOption

WithExportRequestDecoder overrides the JSON request decoder.

func WithExportRunner added in v0.141.0

func WithExportRunner(runner *export.Runner) ExportBundleOption

WithExportRunner reuses configured definitions, sources, renderers and activity emitters. Bundle store/tracker/guard options still own their runtime bindings. Configure the runner before serving traffic; it must have one lifecycle owner.

func WithExportStore

func WithExportStore(store export.ArtifactStore) ExportBundleOption

WithExportStore sets the artifact store used by go-export.

func WithExportTracker

func WithExportTracker(tracker export.ProgressTracker) ExportBundleOption

WithExportTracker sets the progress tracker used by go-export.

type ExportPDFConfig added in v0.26.0

type ExportPDFConfig struct {
	Engine            string        `json:"engine"`
	WKHTMLToPDFPath   string        `json:"wkhtml_to_pdf_path"`
	BrowserPath       string        `json:"browser_path"`
	Timeout           time.Duration `json:"timeout"`
	PageSize          string        `json:"page_size"`
	PrintBackground   bool          `json:"print_background"`
	PreferCSSPageSize bool          `json:"prefer_css_page_size"`
	Headless          bool          `json:"headless"`
	Args              []string      `json:"args"`
}

ExportPDFConfig controls default PDF renderer behavior.

func DefaultExportPDFConfig added in v0.26.0

func DefaultExportPDFConfig() ExportPDFConfig

DefaultExportPDFConfig returns baseline PDF settings.

type ExportRecoveryCheckpoint added in v0.141.1

type ExportRecoveryCheckpoint struct {
	SetID          string `json:"set_id"`
	CatalogSHA256  string `json:"catalog_sha256"`
	PolicyRevision string `json:"policy_revision"`
}

ExportRecoveryCheckpoint contains reviewed references, not proof of recovery. Trusted callbacks must verify the complete restored set and authoritative current policy revision. Approval is process-local and never survives restart.

func (ExportRecoveryCheckpoint) Validate added in v0.141.1

func (c ExportRecoveryCheckpoint) Validate() error

type ExportRecoveryGateState added in v0.141.1

type ExportRecoveryGateState struct {
	Sealed   bool `json:"sealed"`
	Active   int  `json:"active"`
	Resuming bool `json:"resuming"`
}

type ExportRecoveryPolicy added in v0.141.1

type ExportRecoveryPolicy struct {
	Authorize     func(context.Context, export.Actor, string) error
	VerifyCatalog func(context.Context, ExportRecoveryCheckpoint) error
	Reconcile     func(context.Context, ExportRecoveryCheckpoint) error
}

ExportRecoveryPolicy is trusted consuming-host code. Authorize is read-only current operator policy for "seal" or "resume". VerifyCatalog must verify the complete restored set against independently trusted catalog custody; Reconcile must apply/check authoritative post-snapshot revocations before returning. Callbacks must honor cancellation and must not call gate control operations.

type ExportTemplateOption added in v0.13.0

type ExportTemplateOption func(*exportTemplateOptions)

ExportTemplateOption customizes the default export template renderers.

func WithExportPDFConfig added in v0.26.0

func WithExportPDFConfig(cfg ExportPDFConfig) ExportTemplateOption

WithExportPDFConfig overrides default PDF renderer settings.

func WithExportPDFRenderer added in v0.13.0

func WithExportPDFRenderer(builder func(exporttemplate.Renderer) (exportpdf.Renderer, error)) ExportTemplateOption

WithExportPDFRenderer overrides the default PDF renderer builder.

func WithExportTemplateFuncs added in v0.13.0

func WithExportTemplateFuncs(funcs map[string]any) ExportTemplateOption

WithExportTemplateFuncs sets the template helpers used by the export renderer.

func WithExportTemplateMaxRows added in v0.13.0

func WithExportTemplateMaxRows(rows int) ExportTemplateOption

WithExportTemplateMaxRows overrides the buffered template row limit.

func WithExportTemplateName added in v0.13.0

func WithExportTemplateName(name string) ExportTemplateOption

WithExportTemplateName overrides the default template name ("export").

type FeatureFlagsModuleOption added in v0.25.0

type FeatureFlagsModuleOption func(*admin.FeatureFlagsModule)

FeatureFlagsModuleOption customizes quickstart feature flags module defaults.

type FiberErrorHandlerOption added in v0.19.0

type FiberErrorHandlerOption func(*fiberErrorHandlerOptions)

FiberErrorHandlerOption customizes the quickstart Fiber error handler.

func WithFiberErrorMappers added in v0.19.0

func WithFiberErrorMappers(mappers ...goerrors.ErrorMapper) FiberErrorHandlerOption

WithFiberErrorMappers appends custom error mappers to the defaults.

type FiberRuntimeConfig added in v0.26.0

type FiberRuntimeConfig struct {
	StrictRoutes        *bool  `json:"strict_routes"`
	RouteConflictPolicy string `json:"route_conflict_policy"`
	PathConflictMode    string `json:"path_conflict_mode"`
	ReadBufferSize      int    `json:"read_buffer_size"`
}

FiberRuntimeConfig captures typed runtime overrides for Fiber and router adapter behavior.

type FiberServerOption

type FiberServerOption func(*fiberServerOptions)

FiberServerOption customizes the Fiber server defaults.

func WithFiberAdapterConfig added in v0.24.0

func WithFiberAdapterConfig(mutator func(*router.FiberAdapterConfig)) FiberServerOption

WithFiberAdapterConfig overrides the go-router adapter configuration.

func WithFiberConfig

func WithFiberConfig(mutator func(*fiber.Config)) FiberServerOption

WithFiberConfig overrides the default Fiber config.

func WithFiberErrorHandler

func WithFiberErrorHandler(handler fiber.ErrorHandler) FiberServerOption

WithFiberErrorHandler overrides the default error handler.

func WithFiberLogger

func WithFiberLogger(enabled bool) FiberServerOption

WithFiberLogger toggles the default logger middleware.

func WithFiberMiddleware

func WithFiberMiddleware(handlers ...fiber.Handler) FiberServerOption

WithFiberMiddleware appends middleware to the default stack.

func WithFiberRuntimeConfig added in v0.26.0

func WithFiberRuntimeConfig(runtime FiberRuntimeConfig) FiberServerOption

WithFiberRuntimeConfig applies typed runtime overrides for Fiber defaults.

type FiberV3ServerConfig added in v0.142.0

type FiberV3ServerConfig struct {
	Config        fiber3.Config
	AdapterConfig router.FiberV3AdapterConfig
	Middleware    []fiber3.Handler
	EnableLogger  bool
}

FiberV3ServerConfig holds the native inputs shared by v3 host composition and presentation. Its zero value supplies no quickstart defaults. Config owns Views and ErrorHandler; AdapterConfig owns the listener settings used by Serve. Callers starting WrappedRouter directly must pass ListenConfig themselves. This contract does not construct or start a host.

type FiberV3ServerOption added in v0.142.0

type FiberV3ServerOption func(*FiberV3ServerConfig)

FiberV3ServerOption configures explicit v3 inputs. Apply options in order; scalar overrides use the last value and middleware options append in order.

func WithFiberV3AdapterConfig added in v0.142.0

func WithFiberV3AdapterConfig(mutator func(*router.FiberV3AdapterConfig)) FiberV3ServerOption

WithFiberV3AdapterConfig changes shared routing and native listen settings.

func WithFiberV3Config added in v0.142.0

func WithFiberV3Config(mutator func(*fiber3.Config)) FiberV3ServerOption

WithFiberV3Config changes native app configuration, including presentation ports.

func WithFiberV3ErrorHandler added in v0.142.0

func WithFiberV3ErrorHandler(handler fiber3.ErrorHandler) FiberV3ServerOption

WithFiberV3ErrorHandler supplies native v3 error presentation.

func WithFiberV3Logger added in v0.142.0

func WithFiberV3Logger(enabled bool) FiberV3ServerOption

WithFiberV3Logger selects whether host composition installs its default logger.

func WithFiberV3Middleware added in v0.142.0

func WithFiberV3Middleware(handlers ...fiber3.Handler) FiberV3ServerOption

WithFiberV3Middleware appends native middleware. It snapshots the supplied slice so later caller changes do not alter this option. Nil handlers are ignored.

func WithFiberV3Views added in v0.142.0

func WithFiberV3Views(views fiber3.Views) FiberV3ServerOption

WithFiberV3Views supplies a native v3 view engine without building defaults.

type FormGeneratorOption

type FormGeneratorOption func(*formGeneratorConfig)

FormGeneratorOption configures the form generator.

func WithComponentRegistry

func WithComponentRegistry(reg *components.Registry) FormGeneratorOption

WithComponentRegistry replaces the default component registry.

func WithComponentRegistryMergeDefaults

func WithComponentRegistryMergeDefaults(reg *components.Registry) FormGeneratorOption

WithComponentRegistryMergeDefaults merges a custom registry into defaults. Custom components override built-ins with the same name.

func WithVanillaOption

func WithVanillaOption(opt formgenvanilla.Option) FormGeneratorOption

WithVanillaOption appends a vanilla renderer option. These are applied last to allow overrides.

type GoAuthActivitySinkOption added in v0.19.0

type GoAuthActivitySinkOption func(*goAuthActivitySinkOptions)

GoAuthActivitySinkOption customizes how go-auth activity events are mapped.

func WithGoAuthActivityChannel added in v0.19.0

func WithGoAuthActivityChannel(channel string) GoAuthActivitySinkOption

WithGoAuthActivityChannel overrides the channel used for go-auth events.

func WithGoAuthActivityObjectType added in v0.19.0

func WithGoAuthActivityObjectType(objectType string) GoAuthActivitySinkOption

WithGoAuthActivityObjectType overrides the object type used for go-auth events.

type GoUsersPreferencesStore

type GoUsersPreferencesStore struct {
	// contains filtered or unexported fields
}

GoUsersPreferencesStore bridges go-users preferences into the admin preferences contract.

func NewGoUsersPreferencesStore

func NewGoUsersPreferencesStore(repo types.PreferenceRepository) (*GoUsersPreferencesStore, error)

NewGoUsersPreferencesStore builds a preferences store backed by go-users.

func (*GoUsersPreferencesStore) Delete

func (*GoUsersPreferencesStore) Resolve

func (*GoUsersPreferencesStore) Upsert

type GoUsersUserManagementConfig added in v0.24.0

type GoUsersUserManagementConfig struct {
	AuthRepo      userstypes.AuthRepository                    `json:"auth_repo"`
	InventoryRepo userstypes.UserInventoryRepository           `json:"inventory_repo"`
	RoleRegistry  userstypes.RoleRegistry                      `json:"role_registry"`
	ProfileRepo   userstypes.ProfileRepository                 `json:"profile_repo"`
	ScopeResolver func(context.Context) userstypes.ScopeFilter `json:"scope_resolver"`
}

GoUsersUserManagementConfig captures go-users adapters used by quickstart user management.

type GoUsersUserManagementConfigError added in v0.24.0

type GoUsersUserManagementConfigError struct {
	Missing []string `json:"missing"`
}

func (GoUsersUserManagementConfigError) Error added in v0.24.0

func (GoUsersUserManagementConfigError) Unwrap added in v0.24.0

type HostRouter added in v0.36.0

type HostRouter[T any] interface {
	System() router.Router[T]
	InternalOps() router.Router[T]
	AdminUI() router.Router[T]
	AdminAPI() router.Router[T]
	ProtectedAppUI() router.Router[T]
	ProtectedAppAPI() router.Router[T]
	PublicAPI() router.Router[T]
	PublicSite() router.Router[T]
	Static() router.Router[T]
	Admin() coreadmin.AdminRouter
}

HostRouter exposes explicit route-registration surfaces for host-owned, admin-owned, public API, site, and static routes.

func NewHostRouter added in v0.36.0

func NewHostRouter[T any](r router.Router[T], cfg coreadmin.Config) HostRouter[T]

NewHostRouter returns explicit route-registration surfaces backed by the provided router.

type InternalOpsConfig added in v0.36.0

type InternalOpsConfig struct {
	EnableHealthz bool   `json:"enable_healthz"`
	EnableStatus  bool   `json:"enable_status"`
	HealthzPath   string `json:"healthz_path"`
	StatusPath    string `json:"status_path"`
}

type InternalOpsOption added in v0.36.0

type InternalOpsOption func(*internalOpsRouteOptions)

func WithInternalOpsHealthzHandler added in v0.36.0

func WithInternalOpsHealthzHandler(handler router.HandlerFunc) InternalOpsOption

func WithInternalOpsStatusHandler added in v0.36.0

func WithInternalOpsStatusHandler(handler router.HandlerFunc) InternalOpsOption

type InventoryLegacyExports added in v0.142.0

type InventoryLegacyExports struct {
	Actor export.Actor               `json:"-"`
	Query LegacyExportInventoryQuery `json:"query"`
}

func (InventoryLegacyExports) Type added in v0.142.0

func (InventoryLegacyExports) Validate added in v0.142.0

func (m InventoryLegacyExports) Validate() error

type InventoryLegacyExportsHandler added in v0.142.0

type InventoryLegacyExportsHandler struct{ Service LegacyExportInventoryService }

func (*InventoryLegacyExportsHandler) Execute added in v0.142.0

func (*InventoryLegacyExportsHandler) Run added in v0.142.0

type LegacyExportAdoptionConfig added in v0.141.1

type LegacyExportAdoptionConfig struct {
	Authorize func(context.Context, bun.Tx, export.Actor, string, string) error
	Select    func(context.Context, bun.Tx, export.Actor, export.ExportRecord, string) (deliverybun.ScheduleRequest, error)
	// Inventory authorizes current operator/profile/fence before listing trusted ownership IDs.
	// Return at most limit IDs, strictly increasing after the cursor, using tx only.
	Inventory func(ctx context.Context, tx bun.Tx, actor export.Actor, profile, after string, limit int) ([]string, error)
}

LegacyExportAdoptionConfig is trusted operator policy, disabled by default. Authorize must check current identity, legacy ownership, the versioned profile and a maintenance fence excluding old writers before any record is read. Select resolves reviewed endpoint/credential versions without network I/O. Neither callback may commit, open a nested transaction or change authorization.

type LegacyExportAdoptionRequest added in v0.141.1

type LegacyExportAdoptionRequest struct {
	ExportID     string `json:"export_id"`
	ProfileRef   string `json:"profile_ref"`
	RecordSHA256 string `json:"record_sha256"`
	PlanSHA256   string `json:"plan_sha256"`
}

func (LegacyExportAdoptionRequest) Validate added in v0.141.1

func (r LegacyExportAdoptionRequest) Validate() error

type LegacyExportAdoptionResult added in v0.141.1

type LegacyExportAdoptionResult struct {
	ExportID   string             `json:"export_id"`
	ProfileRef string             `json:"profile_ref"`
	State      export.ExportState `json:"adopted_state"`
	Replayed   bool               `json:"replayed"`
}

type LegacyExportAdoptionService added in v0.141.1

type LegacyExportAdoptionService interface {
	AdoptLegacyExport(context.Context, export.Actor, LegacyExportAdoptionRequest) (LegacyExportAdoptionResult, error)
}

type LegacyExportInventoryEntry added in v0.142.0

type LegacyExportInventoryEntry struct {
	ExportID string              `json:"export_id"`
	State    export.ExportState  `json:"state"`
	Blocker  string              `json:"blocker,omitempty"`
	Review   *LegacyExportReview `json:"review,omitempty"`
}

type LegacyExportInventoryQuery added in v0.142.0

type LegacyExportInventoryQuery struct {
	ProfileRef string `json:"profile_ref"`
	After      string `json:"after,omitempty"`
	Limit      int    `json:"limit"`
}

func (LegacyExportInventoryQuery) Validate added in v0.142.0

func (q LegacyExportInventoryQuery) Validate() error

type LegacyExportInventoryResult added in v0.142.0

type LegacyExportInventoryResult struct {
	Entries   []LegacyExportInventoryEntry `json:"entries"`
	HasMore   bool                         `json:"has_more"`
	NextAfter string                       `json:"next_after,omitempty"`
}

type LegacyExportInventoryService added in v0.142.0

type LegacyExportInventoryService interface {
	InventoryLegacyExports(context.Context, export.Actor, LegacyExportInventoryQuery) (LegacyExportInventoryResult, error)
}

type LegacyExportReview added in v0.141.1

type LegacyExportReview struct {
	ExportID     string             `json:"export_id"`
	ProfileRef   string             `json:"profile_ref"`
	State        export.ExportState `json:"state"`
	RecordSHA256 string             `json:"record_sha256"`
	PlanSHA256   string             `json:"plan_sha256"`
}

type LegacyLocalizedMenuMigrationOptions added in v0.26.0

type LegacyLocalizedMenuMigrationOptions struct {
	MenuSvc  admin.CMSMenuService `json:"menu_svc"`
	MenuCode string               `json:"menu_code"`
	Locales  []string             `json:"locales"`
}

LegacyLocalizedMenuMigrationOptions configures migration from locale-suffixed menu IDs.

type LegacyLocalizedMenuMigrationReport added in v0.26.0

type LegacyLocalizedMenuMigrationReport struct {
	MigratedTranslations int      `json:"migrated_translations"`
	DeletedLegacyItems   int      `json:"deleted_legacy_items"`
	SkippedLegacyItems   int      `json:"skipped_legacy_items"`
	LegacyItemIDs        []string `json:"legacy_item_i_ds"`
}

LegacyLocalizedMenuMigrationReport summarizes migration effects.

func MigrateLegacyLocalizedMenuItems added in v0.26.0

MigrateLegacyLocalizedMenuItems folds legacy locale-suffixed item IDs (for example "site_main.about.es") into canonical base IDs by transferring localized translations and then removing the suffix nodes.

type LifecycleSnapshotProvider added in v0.91.0

type LifecycleSnapshotProvider interface {
	Snapshot() lifecycle.Snapshot
}

LifecycleSnapshotProvider exposes a lifecycle status snapshot.

type LocalizedMenuItemTranslation added in v0.26.0

type LocalizedMenuItemTranslation struct {
	Locale        string `json:"locale"`
	Label         string `json:"label"`
	LabelKey      string `json:"label_key"`
	GroupTitle    string `json:"group_title"`
	GroupTitleKey string `json:"group_title_key"`
	URLOverride   string `json:"url_override"`
}

LocalizedMenuItemTranslation captures per-locale display and URL override values.

type LocalizedSeedMenuItem added in v0.26.0

type LocalizedSeedMenuItem struct {
	Item         admin.MenuItem                 `json:"item"`
	Translations []LocalizedMenuItemTranslation `json:"translations"`
}

LocalizedSeedMenuItem represents one canonical menu item and its localized variants.

type MenuPlacementKey string

MenuPlacementKey identifies a logical navigation placement.

type MenuPlacementSpec struct {
	MenuCode string         `json:"menu_code"`
	Extra    map[string]any `json:"extra"`
}

MenuPlacementSpec describes menu routing for a placement.

type MenuSeedBaseItemTransform func(item *admin.MenuItem)

MenuSeedBaseItemTransform can adjust quickstart base/capability menu rows before they are normalized.

type MenuSeedItemTransform func(moduleID string, item *admin.MenuItem)

MenuSeedItemTransform can adjust module-contributed menu rows before they are normalized.

type MenuSeedPlan struct {
	MenuCode string           `json:"menu_code"`
	Locale   string           `json:"locale"`
	Items    []admin.MenuItem `json:"items"`
}

MenuSeedPlan is the canonical expected quickstart-generated menu tree before persistence.

func BuildMenuSeedPlan added in v0.83.0

func BuildMenuSeedPlan(opts MenuSeedPlanOptions) (MenuSeedPlan, error)

BuildMenuSeedPlan computes the expected generated quickstart menu rows.

type MenuSeedPlanOptions struct {
	MenuCode string
	Locale   string

	Modules   []admin.Module
	BaseItems []admin.MenuItem

	ParentItems           []admin.MenuItem
	ReplaceDefaultParents bool

	ModuleParentOverrides map[string]string
	TargetParentOverrides map[string]string
	SlotParentOverrides   map[string]string
	BaseItemTransforms    []MenuSeedBaseItemTransform
	ItemTransforms        []MenuSeedItemTransform
}

MenuSeedPlanOptions describes how quickstart computes expected generated menu rows.

type ModuleRegistrarOption

type ModuleRegistrarOption func(*moduleRegistrarOptions)

ModuleRegistrarOption customizes module registration behavior.

func WithDefaultSidebarUtilityItemKeys added in v0.122.0

func WithDefaultSidebarUtilityItemKeys(keys ...SidebarUtilityItemKey) ModuleRegistrarOption

WithDefaultSidebarUtilityItemKeys selects quickstart-owned standard utility items without requiring hosts to duplicate their descriptors.

func WithDefaultSidebarUtilityItems added in v0.25.0

func WithDefaultSidebarUtilityItems(enabled bool) ModuleRegistrarOption

WithDefaultSidebarUtilityItems toggles quickstart-provided utility links.

func WithMenuSeedBaseItemTransform added in v0.110.1

func WithMenuSeedBaseItemTransform(transforms ...MenuSeedBaseItemTransform) ModuleRegistrarOption

WithMenuSeedBaseItemTransform appends transforms applied to quickstart base/capability menu rows.

func WithMenuSeedItemTransform added in v0.83.0

func WithMenuSeedItemTransform(transforms ...MenuSeedItemTransform) ModuleRegistrarOption

WithMenuSeedItemTransform appends transforms applied to module-contributed menu rows.

func WithMenuSeedModuleParentOverride added in v0.83.0

func WithMenuSeedModuleParentOverride(moduleID, parentID string) ModuleRegistrarOption

WithMenuSeedModuleParentOverride places menu rows contributed by moduleID under parentID.

func WithMenuSeedParents added in v0.83.0

func WithMenuSeedParents(parents ...admin.MenuItem) ModuleRegistrarOption

WithMenuSeedParents replaces quickstart's default parent groups for the primary menu.

func WithMenuSeedPlanOptions added in v0.83.0

func WithMenuSeedPlanOptions(mutator func(*MenuSeedPlanOptions)) ModuleRegistrarOption

WithMenuSeedPlanOptions mutates the expected menu seed plan before seeding/reconciliation.

func WithMenuSeedTargetParentOverride added in v0.83.0

func WithMenuSeedTargetParentOverride(targetKey, parentID string) ModuleRegistrarOption

WithMenuSeedTargetParentOverride places items with a matching target key under parentID.

func WithModuleFeatureDisabledHandler

func WithModuleFeatureDisabledHandler(handler func(feature, moduleID string) error) ModuleRegistrarOption

WithModuleFeatureDisabledHandler configures how feature-disabled modules are handled.

func WithModuleFeatureGates

func WithModuleFeatureGates(gates fggate.FeatureGate) ModuleRegistrarOption

WithModuleFeatureGates enables feature-gated module filtering.

func WithModuleMenuItems

func WithModuleMenuItems(items ...admin.MenuItem) ModuleRegistrarOption

WithModuleMenuItems appends base menu items before seeding.

func WithModuleRegistrarContext

func WithModuleRegistrarContext(ctx context.Context) ModuleRegistrarOption

WithModuleRegistrarContext sets the context used for navigation seeding.

func WithSeedNavigation

func WithSeedNavigation(enabled bool) ModuleRegistrarOption

WithSeedNavigation toggles navigation seeding.

func WithSeedNavigationOptions

func WithSeedNavigationOptions(mutator func(*SeedNavigationOptions)) ModuleRegistrarOption

WithSeedNavigationOptions mutates the seed options before execution.

func WithSidebarUtilityMenuCode added in v0.25.0

func WithSidebarUtilityMenuCode(menuCode string) ModuleRegistrarOption

WithSidebarUtilityMenuCode overrides the menu code used for utility links.

func WithSidebarUtilityMenuItems added in v0.25.0

func WithSidebarUtilityMenuItems(items ...admin.MenuItem) ModuleRegistrarOption

WithSidebarUtilityMenuItems appends utility links for the fixed sidebar utility zone.

func WithToolsMenuItems added in v0.25.0

func WithToolsMenuItems(items ...admin.MenuItem) ModuleRegistrarOption

WithToolsMenuItems appends menu items to the quickstart Tools group.

func WithTranslationCapabilityMenuMode added in v0.25.0

func WithTranslationCapabilityMenuMode(mode TranslationCapabilityMenuMode) ModuleRegistrarOption

WithTranslationCapabilityMenuMode controls how translation capability links are seeded into server-side navigation menus.

type MultiFS

type MultiFS []fs.FS

MultiFS tries each filesystem in order until one succeeds.

func (MultiFS) Open

func (m MultiFS) Open(name string) (fs.File, error)

Open implements fs.FS to provide fallback resolution.

func (MultiFS) Stat

func (m MultiFS) Stat(name string) (fs.FileInfo, error)

Stat implements fs.StatFS so callers can validate roots without requiring Open(".") to exist.

type NavigationManagedExclusion struct {
	ID          string
	GeneratedID string
	TargetKey   string
	Reason      string
}
type NavigationReconcileOptions struct {
	MenuSvc  admin.CMSMenuService
	MenuCode string
	Locale   string
	Items    []admin.MenuItem
	Apply    bool
	Logf     func(format string, args ...any)

	RawInventory            admin.NavigationRawInventoryOptions
	CapabilityOmissions     []string
	PermissionFilteredItems []string
	AllowDestructive        bool
	RetireManagedExclusions bool
	ManagedExclusions       []NavigationManagedExclusion
}

NavigationReconcileOptions controls quickstart generated-menu reconciliation.

type NavigationReconcileReport struct {
	MenuCode       string `json:"menu_code"`
	Locale         string `json:"locale"`
	Applied        bool   `json:"applied"`
	EngineIdentity string `json:"engine_identity,omitempty"`
	EngineVersion  string `json:"engine_version,omitempty"`

	ExpectedGeneratedCount int `json:"expected_generated_count"`
	ActualGeneratedCount   int `json:"actual_generated_count"`

	Creates                  []string `json:"creates,omitempty"`
	Updates                  []string `json:"updates,omitempty"`
	PreservedUserRows        []string `json:"preserved_user_rows,omitempty"`
	DuplicateIdentities      []string `json:"duplicate_identities,omitempty"`
	DestructiveCandidates    []string `json:"destructive_candidates,omitempty"`
	StaleTargetStateCleanup  []string `json:"stale_target_state_cleanup,omitempty"`
	RouteResolutionFailures  []string `json:"route_resolution_failures,omitempty"`
	CapabilityOmissions      []string `json:"capability_omissions,omitempty"`
	PermissionFilteredItems  []string `json:"permission_filtered_items,omitempty"`
	ParentPrunedItems        []string `json:"parent_pruned_items,omitempty"`
	PreservedGeneratedFields []string `json:"preserved_generated_fields,omitempty"`
	PersistedPresent         []string `json:"persisted_present,omitempty"`
	PersistedMissing         []string `json:"persisted_missing,omitempty"`
	RawPresentButNotRendered []string `json:"raw_present_but_not_rendered,omitempty"`
	RawInventoryUnavailable  []string `json:"raw_inventory_unavailable,omitempty"`
	RetiredManagedItems      []string `json:"retired_managed_items,omitempty"`

	CoordinationBackend   string `json:"coordination_backend,omitempty"`
	CoordinationScope     string `json:"coordination_scope,omitempty"`
	CoordinationSupported bool   `json:"coordination_supported"`
	CoordinationWarning   string `json:"coordination_warning,omitempty"`
}

NavigationReconcileReport describes a dry-run or applied generated-menu reconciliation.

func ReconcileGeneratedNavigation added in v0.83.0

func ReconcileGeneratedNavigation(ctx context.Context, opts NavigationReconcileOptions) (NavigationReconcileReport, error)

ReconcileGeneratedNavigation converges persisted CMS menu rows to the expected generated plan.

type OAuthTokenPolicyInput added in v0.25.0

type OAuthTokenPolicyInput struct {
	IsExpired      bool `json:"is_expired"`
	IsExpiringSoon bool `json:"is_expiring_soon"`
	CanAutoRefresh bool `json:"can_auto_refresh"`
}

OAuthTokenPolicyInput captures provider token status flags used by UI warnings.

type OAuthTokenPolicyState added in v0.25.0

type OAuthTokenPolicyState struct {
	IsExpired            bool `json:"is_expired"`
	IsExpiringSoon       bool `json:"is_expiring_soon"`
	CanAutoRefresh       bool `json:"can_auto_refresh"`
	NeedsReauthorization bool `json:"needs_reauthorization"`
}

OAuthTokenPolicyState contains derived UI policy for token warnings.

func ResolveOAuthTokenPolicy added in v0.25.0

func ResolveOAuthTokenPolicy(input OAuthTokenPolicyInput) OAuthTokenPolicyState

ResolveOAuthTokenPolicy derives UI flags from backend token state.

type OnboardingHandlers added in v0.19.0

type OnboardingHandlers struct {
	Invite               router.HandlerFunc `json:"invite"`
	VerifyInvite         router.HandlerFunc `json:"verify_invite"`
	AcceptInvite         router.HandlerFunc `json:"accept_invite"`
	SelfRegister         router.HandlerFunc `json:"self_register"`
	ConfirmRegistration  router.HandlerFunc `json:"confirm_registration"`
	RequestPasswordReset router.HandlerFunc `json:"request_password_reset"`
	ConfirmPasswordReset router.HandlerFunc `json:"confirm_password_reset"`
	TokenMetadata        router.HandlerFunc `json:"token_metadata"`
}

OnboardingHandlers provides handlers for onboarding routes.

type OnboardingRouteKey added in v0.19.0

type OnboardingRouteKey string

OnboardingRouteKey identifies a specific onboarding endpoint.

const (
	OnboardingRouteInvite               OnboardingRouteKey = "invite"
	OnboardingRouteInviteVerify         OnboardingRouteKey = "invite.verify"
	OnboardingRouteInviteAccept         OnboardingRouteKey = "invite.accept"
	OnboardingRouteRegister             OnboardingRouteKey = "register"
	OnboardingRouteRegisterConfirm      OnboardingRouteKey = "register.confirm"
	OnboardingRoutePasswordResetRequest OnboardingRouteKey = "password.reset.request"
	OnboardingRoutePasswordResetConfirm OnboardingRouteKey = "password.reset.confirm"
	OnboardingRouteTokenMetadata        OnboardingRouteKey = "token.metadata"
)

type OnboardingRouteOption added in v0.19.0

type OnboardingRouteOption func(*onboardingRouteOptions)

OnboardingRouteOption customizes onboarding route registration.

func WithOnboardingAuth added in v0.19.0

func WithOnboardingAuth(auth admin.HandlerAuthenticator) OnboardingRouteOption

WithOnboardingAuth configures the handler authenticator for protected routes.

func WithOnboardingBasePath added in v0.19.0

func WithOnboardingBasePath(basePath string) OnboardingRouteOption

WithOnboardingBasePath overrides the onboarding API base path.

func WithOnboardingBrowserProtection added in v0.131.6

func WithOnboardingBrowserProtection(protection *AuthUIBrowserProtection) OnboardingRouteOption

WithOnboardingBrowserProtection reuses the public Auth UI browser CSRF contract that issued tokens to registration and password-reset pages.

func WithOnboardingProtectedRoutes added in v0.19.0

func WithOnboardingProtectedRoutes(keys ...OnboardingRouteKey) OnboardingRouteOption

WithOnboardingProtectedRoutes overrides which routes should be auth-wrapped.

func WithOnboardingRoutePaths added in v0.19.0

func WithOnboardingRoutePaths(paths OnboardingRoutePaths) OnboardingRouteOption

WithOnboardingRoutePaths overrides specific onboarding route paths.

type OnboardingRoutePaths added in v0.19.0

type OnboardingRoutePaths struct {
	Invite               string `json:"invite"`
	InviteVerify         string `json:"invite_verify"`
	InviteAccept         string `json:"invite_accept"`
	Register             string `json:"register"`
	RegisterConfirm      string `json:"register_confirm"`
	PasswordResetRequest string `json:"password_reset_request"`
	PasswordResetConfirm string `json:"password_reset_confirm"`
	TokenMetadata        string `json:"token_metadata"`
}

OnboardingRoutePaths captures full route paths for onboarding endpoints.

func DefaultOnboardingRoutePaths added in v0.19.0

func DefaultOnboardingRoutePaths(basePath string) OnboardingRoutePaths

DefaultOnboardingRoutePaths builds onboarding API paths from the base path.

type PanelDataGridConfigOptions added in v0.25.0

type PanelDataGridConfigOptions struct {
	TableID             string                         `json:"table_id"`
	APIEndpoint         string                         `json:"api_endpoint"`
	ActionBase          string                         `json:"action_base"`
	PaginationMode      string                         `json:"pagination_mode"`
	PreferencesEndpoint string                         `json:"preferences_endpoint"`
	PreferencesWritable bool                           `json:"preferences_writable"`
	ColumnStorageKey    string                         `json:"column_storage_key"`
	EnableGroupedMode   bool                           `json:"enable_grouped_mode"`
	DefaultViewMode     string                         `json:"default_view_mode"`
	GroupByField        string                         `json:"group_by_field"`
	TranslationUX       bool                           `json:"translation_ux"`
	StateStore          PanelDataGridStateStoreOptions `json:"state_store"`
	URLState            PanelDataGridURLStateOptions   `json:"url_state"`
	Capabilities        *admin.PanelListCapabilities   `json:"capabilities"`
}

PanelDataGridConfigOptions configures datagrid wiring for panel templates.

type PanelDataGridStateStoreOptions added in v0.25.0

type PanelDataGridStateStoreOptions struct {
	Mode             string `json:"mode"`
	Resource         string `json:"resource"`
	SyncDebounceMS   int    `json:"sync_debounce_ms"`
	HydrateTimeoutMS int    `json:"hydrate_timeout_ms"`
	MaxShareEntries  int    `json:"max_share_entries"`
}

PanelDataGridStateStoreOptions configures datagrid state store wiring for templates.

type PanelDataGridURLStateOptions added in v0.25.0

type PanelDataGridURLStateOptions struct {
	MaxURLLength     int   `json:"max_url_length"`
	MaxFiltersLength int   `json:"max_filters_length"`
	EnableStateToken *bool `json:"enable_state_token"`
}

PanelDataGridURLStateOptions configures datagrid URL sync limits.

type PanelViewCapabilityOptions added in v0.25.0

type PanelViewCapabilityOptions struct {
	BasePath       string                       `json:"base_path"`
	URLResolver    urlkit.Resolver              `json:"url_resolver"`
	Definition     string                       `json:"definition"`
	Variant        string                       `json:"variant"`
	ExportEndpoint string                       `json:"export_endpoint"`
	ResolvedExport *admin.ExportConfig          `json:"resolved_export"`
	Capabilities   *admin.PanelListCapabilities `json:"capabilities"`
	DataGrid       PanelDataGridConfigOptions   `json:"data_grid"`
}

PanelViewCapabilityOptions configures capability context derived for panel templates.

type PathViewContextConfig added in v0.25.0

type PathViewContextConfig struct {
	BasePath      string          `json:"base_path"`
	APIBasePath   string          `json:"api_base_path"`
	AssetBasePath string          `json:"asset_base_path"`
	URLResolver   urlkit.Resolver `json:"url_resolver"`
}

PathViewContextConfig describes how base/api/asset paths should be injected into a view context.

type PermissionDefinition

type PermissionDefinition struct {
	Key         string `json:"key"`
	Description string `json:"description"`
}

PermissionDefinition describes a permission entry for registration.

func PreferencesPermissions

func PreferencesPermissions() []PermissionDefinition

PreferencesPermissions returns the default permissions for preferences.

func TranslationExchangePermissions added in v0.25.0

func TranslationExchangePermissions() []PermissionDefinition

TranslationExchangePermissions returns default permissions for translation exchange flows.

func TranslationQueuePermissions added in v0.25.0

func TranslationQueuePermissions() []PermissionDefinition

TranslationQueuePermissions returns default permissions for translation queue flows.

type PermissionRegisterFunc

type PermissionRegisterFunc func(def PermissionDefinition) error

PermissionRegisterFunc registers a permission definition with a host registry.

type PlacementConfig

type PlacementConfig struct {
	Menus      map[MenuPlacementKey]MenuPlacementSpec                       `json:"menus"`
	Dashboards map[uiplacement.DashboardPlacementKey]DashboardPlacementSpec `json:"dashboards"`
}

PlacementConfig maps menu and dashboard placements independently.

func DefaultPlacements

func DefaultPlacements(cfg admin.Config) PlacementConfig

DefaultPlacements builds a placement map seeded with defaults.

func (PlacementConfig) DashboardAreaFor

func (p PlacementConfig) DashboardAreaFor(placement uiplacement.DashboardPlacementKey, fallback string) string

DashboardAreaFor returns the dashboard area for a placement, with fallback support.

func (PlacementConfig) DashboardPlacementFor added in v0.27.0

func (p PlacementConfig) DashboardPlacementFor(placement uiplacement.DashboardPlacementKey) (DashboardPlacementSpec, bool)

DashboardPlacementFor returns the dashboard placement spec for a logical placement, if present.

func (PlacementConfig) MenuCodeFor

func (p PlacementConfig) MenuCodeFor(placement MenuPlacementKey, fallback string) string

MenuCodeFor returns the menu code for a placement, falling back to the provided default.

func (PlacementConfig) MenuPlacementFor added in v0.27.0

func (p PlacementConfig) MenuPlacementFor(placement MenuPlacementKey) (MenuPlacementSpec, bool)

MenuPlacementFor returns the menu placement spec for a logical placement, if present.

type PreferencesModuleOption added in v0.24.0

type PreferencesModuleOption func(*admin.PreferencesModule)

PreferencesModuleOption customizes the Preferences module wiring in quickstart.

func WithPreferencesJSONEditorStrict added in v0.24.0

func WithPreferencesJSONEditorStrict(strict bool) PreferencesModuleOption

WithPreferencesJSONEditorStrict toggles client-side JSON editor strictness.

func WithPreferencesSchemaPath added in v0.24.0

func WithPreferencesSchemaPath(path string) PreferencesModuleOption

WithPreferencesSchemaPath overrides the preferences form schema path.

type RPCTransportConfig added in v0.27.0

type RPCTransportConfig struct {
	Enabled bool `json:"enabled,omitempty"`

	// StrictStartup rejects invalid or unverifiable exposure at router finalization.
	StrictStartup bool `json:"strict_startup,omitempty"`

	InvokePath string `json:"invoke_path,omitempty"`

	RequireAuth          bool                           `json:"require_auth,omitempty"`
	AllowUnauthenticated bool                           `json:"allow_unauthenticated,omitempty"`
	DiscoveryEnabled     bool                           `json:"discovery_enabled,omitempty"`
	PermissionMode       admin.RPCCommandPermissionMode `json:"permission_mode,omitempty"`

	CommandRules map[string]admin.RPCCommandRule `json:"command_rules,omitempty"`
	Authorize    admin.RPCCommandPolicyHook      `json:"-"`

	// ErrorMapper opts into structured invocation errors. Use
	// admin.DefaultRPCErrorMapper for safe admin domain classification.
	// Nil retains legacy RPC codes; raw diagnostic causes are always omitted.
	ErrorMapper cmdrpc.ErrorMapper `json:"-"`

	MetaExtractor rpcfiber.MetaExtractor    `json:"-"`
	BeforeInvoke  rpcfiber.BeforeInvokeHook `json:"-"`
	AfterInvoke   rpcfiber.AfterInvokeHook  `json:"-"`
}

RPCTransportConfig configures optional RPC transport endpoint mounting.

type RegistrationUIOption added in v0.19.0

type RegistrationUIOption func(*registrationUIOptions)

RegistrationUIOption customizes the registration UI route.

func WithRegistrationUIAdminTheme added in v0.50.0

func WithRegistrationUIAdminTheme(adm *admin.Admin) RegistrationUIOption

WithRegistrationUIAdminTheme injects the full admin theme payload into registration templates.

func WithRegistrationUIBasePath added in v0.19.0

func WithRegistrationUIBasePath(basePath string) RegistrationUIOption

WithRegistrationUIBasePath overrides the base path used by registration UI routes.

func WithRegistrationUIBrowserProtection added in v0.131.6

func WithRegistrationUIBrowserProtection(protection *AuthUIBrowserProtection) RegistrationUIOption

WithRegistrationUIBrowserProtection reuses the public Auth UI browser CSRF contract used by the matching onboarding POST endpoints.

func WithRegistrationUIEnabled added in v0.19.0

func WithRegistrationUIEnabled(fn func(admin.Config) bool) RegistrationUIOption

WithRegistrationUIEnabled overrides the self-registration feature guard.

func WithRegistrationUIFeatureGate added in v0.20.0

func WithRegistrationUIFeatureGate(gate fggate.FeatureGate) RegistrationUIOption

WithRegistrationUIFeatureGate sets the feature gate used for default guards.

func WithRegistrationUIMode added in v0.19.0

func WithRegistrationUIMode(fn func(admin.Config) string) RegistrationUIOption

WithRegistrationUIMode overrides the registration mode label in the view context.

func WithRegistrationUIPasswordResetPath added in v0.19.0

func WithRegistrationUIPasswordResetPath(route string) RegistrationUIOption

WithRegistrationUIPasswordResetPath overrides the password reset route path.

func WithRegistrationUIRegisterPath added in v0.19.0

func WithRegistrationUIRegisterPath(route string) RegistrationUIOption

WithRegistrationUIRegisterPath overrides the registration route path.

func WithRegistrationUITemplate added in v0.19.0

func WithRegistrationUITemplate(name string) RegistrationUIOption

WithRegistrationUITemplate overrides the registration template name.

func WithRegistrationUIThemeAssets added in v0.19.0

func WithRegistrationUIThemeAssets(prefix string, assets map[string]string) RegistrationUIOption

WithRegistrationUIThemeAssets sets theme assets (logo, icon, favicon, etc.) for registration UI templates. The prefix is prepended to each relative asset filename to form the full URL path. Already resolved URLs/paths are preserved unchanged. Assets are exposed in templates as theme.assets.logo, theme.assets.icon, theme.assets.favicon, etc.

func WithRegistrationUITitle added in v0.19.0

func WithRegistrationUITitle(title string) RegistrationUIOption

WithRegistrationUITitle overrides the registration view title.

func WithRegistrationUIViewContextBuilder added in v0.19.0

func WithRegistrationUIViewContextBuilder(builder RegistrationUIViewContextBuilder) RegistrationUIOption

WithRegistrationUIViewContextBuilder overrides the default view context builder.

type RegistrationUIViewContextBuilder added in v0.19.0

type RegistrationUIViewContextBuilder func(ctx router.ViewContext, c router.Context) router.ViewContext

RegistrationUIViewContextBuilder mutates the view context for registration routes.

type RequestIPContext added in v0.26.0

type RequestIPContext interface {
	Header(name string) string
	IP() string
}

RequestIPContext captures the request methods needed to resolve client IP.

type RequestIPOptions added in v0.26.0

type RequestIPOptions struct {
	// TrustForwardedHeaders enables X-Forwarded-For, Forwarded, and X-Real-IP resolution.
	// Keep disabled unless your runtime sits behind a trusted proxy that sanitizes these headers.
	TrustForwardedHeaders bool `json:"trust_forwarded_headers"`
	// TrustedProxyCIDRs constrains which peer IP ranges can influence forwarded headers.
	// Empty disables forwarded-header trust even when TrustForwardedHeaders is true.
	TrustedProxyCIDRs []string `json:"trusted_proxy_cid_rs"`
}

RequestIPOptions controls request IP extraction behavior.

type RequestMeta added in v0.27.0

type RequestMeta struct {
	PeerIP           string `json:"peer_ip"`
	ClientIP         string `json:"client_ip"`
	Host             string `json:"host"`
	Scheme           string `json:"scheme"`
	Secure           bool   `json:"secure"`
	ForwardedTrusted bool   `json:"forwarded_trusted"`
}

RequestMeta captures normalized request transport details.

func ResolveRequestMeta added in v0.27.0

func ResolveRequestMeta(c RequestMetaContext, policy RequestTrustPolicy) RequestMeta

ResolveRequestMeta resolves request transport metadata with trusted proxy checks.

type RequestMetaContext added in v0.27.0

type RequestMetaContext interface {
	RequestIPContext
}

RequestMetaContext captures request methods required for trust resolution.

type RequestTrustPolicy added in v0.27.0

type RequestTrustPolicy struct {
	// TrustForwardedHeaders enables X-Forwarded-* and Forwarded header handling.
	TrustForwardedHeaders bool `json:"trust_forwarded_headers"`
	// TrustedProxyCIDRs lists reverse-proxy source CIDRs allowed to influence
	// forwarded header resolution. Empty disables forwarded-header trust.
	TrustedProxyCIDRs []string `json:"trusted_proxy_cid_rs"`
}

RequestTrustPolicy controls whether forwarded headers are trusted and from where.

type ResolvedInternalOpsConfig added in v0.36.0

type ResolvedInternalOpsConfig struct {
	EnableHealthz bool   `json:"enable_healthz"`
	EnableStatus  bool   `json:"enable_status"`
	HealthzPath   string `json:"healthz_path"`
	StatusPath    string `json:"status_path"`
}

func RegisterInternalOpsRoutes added in v0.36.0

func RegisterInternalOpsRoutes[T any](r router.Router[T], cfg InternalOpsConfig, opts ...InternalOpsOption) (ResolvedInternalOpsConfig, error)

func ResolveInternalOpsConfig added in v0.36.0

func ResolveInternalOpsConfig(cfg InternalOpsConfig) ResolvedInternalOpsConfig

type ResumeDurableExports added in v0.141.1

type ResumeDurableExports struct {
	Actor      export.Actor             `json:"-"`
	Checkpoint ExportRecoveryCheckpoint `json:"checkpoint"`
}

func (ResumeDurableExports) Type added in v0.141.1

func (ResumeDurableExports) Validate added in v0.141.1

func (m ResumeDurableExports) Validate() error

type ResumeDurableExportsHandler added in v0.141.1

type ResumeDurableExportsHandler struct{ Gate *DurableExportRecoveryGate }

func (*ResumeDurableExportsHandler) Execute added in v0.141.1

func (*ResumeDurableExportsHandler) Run added in v0.141.1

type RolesUIOption added in v0.22.0

type RolesUIOption func(*rolesUIOptions)

func WithRolesBasePath added in v0.22.0

func WithRolesBasePath(basePath string) RolesUIOption

WithRolesBasePath overrides the base path used to build role routes.

func WithRolesFormGenerator added in v0.22.0

func WithRolesFormGenerator(formGen *formgenorchestrator.Orchestrator) RolesUIOption

WithRolesFormGenerator uses a custom form generator.

func WithRolesTemplates added in v0.22.0

func WithRolesTemplates(list, form, detail string) RolesUIOption

WithRolesTemplates overrides the template names for roles UI.

func WithRolesUIViewContext added in v0.22.0

func WithRolesUIViewContext(builder UIViewContextBuilder) RolesUIOption

WithRolesUIViewContext overrides the view context builder for roles routes.

type ScopeConfig added in v0.24.0

type ScopeConfig struct {
	Mode            ScopeMode `json:"mode"`
	DefaultTenantID string    `json:"default_tenant_id"`
	DefaultOrgID    string    `json:"default_org_id"`
}

ScopeConfig captures the quickstart scope behavior.

func DefaultScopeConfig added in v0.24.0

func DefaultScopeConfig() ScopeConfig

DefaultScopeConfig returns single-tenant defaults aligned with demo seeds.

func NormalizeScopeConfig added in v0.24.0

func NormalizeScopeConfig(cfg ScopeConfig) ScopeConfig

NormalizeScopeConfig ensures mode/defaults are set consistently.

func ScopeConfigFromAdmin added in v0.24.0

func ScopeConfigFromAdmin(cfg admin.Config) ScopeConfig

ScopeConfigFromAdmin maps admin.Config into a normalized ScopeConfig.

type ScopeDebugActor added in v0.24.0

type ScopeDebugActor struct {
	ID             string            `json:"id,omitempty"`
	Subject        string            `json:"subject,omitempty"`
	Role           string            `json:"role,omitempty"`
	TenantID       string            `json:"tenant_id,omitempty"`
	OrganizationID string            `json:"organization_id,omitempty"`
	Metadata       map[string]any    `json:"metadata,omitempty"`
	ImpersonatorID string            `json:"impersonator_id,omitempty"`
	IsImpersonated bool              `json:"is_impersonated,omitempty"`
	ResourceRoles  map[string]string `json:"resource_roles,omitempty"`
}

ScopeDebugActor captures actor context for a scope entry.

type ScopeDebugBuffer added in v0.24.0

type ScopeDebugBuffer struct {
	// contains filtered or unexported fields
}

ScopeDebugBuffer stores recent scope debug entries.

func NewScopeDebugBuffer added in v0.24.0

func NewScopeDebugBuffer(limit int) *ScopeDebugBuffer

NewScopeDebugBuffer allocates a buffer for scope debug entries.

func (*ScopeDebugBuffer) Add added in v0.24.0

func (b *ScopeDebugBuffer) Add(entry ScopeDebugEntry)

Add appends a scope debug entry to the buffer.

func (*ScopeDebugBuffer) Clear added in v0.24.0

func (b *ScopeDebugBuffer) Clear() error

Clear removes all buffered scope debug entries.

func (*ScopeDebugBuffer) Snapshot added in v0.24.0

func (b *ScopeDebugBuffer) Snapshot() ScopeDebugSnapshot

Snapshot returns a copy of the buffered scope debug entries.

type ScopeDebugClaims added in v0.24.0

type ScopeDebugClaims struct {
	Subject  string         `json:"subject,omitempty"`
	UserID   string         `json:"user_id,omitempty"`
	Role     string         `json:"role,omitempty"`
	Metadata map[string]any `json:"metadata,omitempty"`
}

ScopeDebugClaims captures JWT claims context for a scope entry.

type ScopeDebugDefaults added in v0.24.0

type ScopeDebugDefaults struct {
	TenantID bool `json:"tenant_id,omitempty"`
	OrgID    bool `json:"org_id,omitempty"`
}

ScopeDebugDefaults records which defaults were applied.

type ScopeDebugEntry added in v0.24.0

type ScopeDebugEntry struct {
	Timestamp       time.Time          `json:"timestamp"`
	Method          string             `json:"method,omitempty"`
	Path            string             `json:"path,omitempty"`
	ScopeMode       string             `json:"scope_mode,omitempty"`
	Actor           ScopeDebugActor    `json:"actor"`
	Claims          ScopeDebugClaims   `json:"claims"`
	RawScope        ScopeDebugScope    `json:"raw_scope"`
	ResolvedScope   ScopeDebugScope    `json:"resolved_scope"`
	DefaultScope    ScopeDebugScope    `json:"default_scope"`
	DefaultsApplied ScopeDebugDefaults `json:"defaults_applied"`
	Metadata        map[string]any     `json:"metadata,omitempty"`
	Headers         map[string]string  `json:"headers,omitempty"`
	Query           map[string]string  `json:"query,omitempty"`
	RouteParams     map[string]string  `json:"route_params,omitempty"`
	RequestID       string             `json:"request_id,omitempty"`
	Extra           map[string]any     `json:"extra,omitempty"`
}

ScopeDebugEntry captures a request scope resolution snapshot.

type ScopeDebugScope added in v0.24.0

type ScopeDebugScope struct {
	TenantID string `json:"tenant_id,omitempty"`
	OrgID    string `json:"org_id,omitempty"`
}

ScopeDebugScope represents tenant/org values in scope debug.

type ScopeDebugSnapshot added in v0.24.0

type ScopeDebugSnapshot struct {
	UpdatedAt time.Time         `json:"updated_at"`
	Count     int               `json:"count"`
	Limit     int               `json:"limit"`
	Entries   []ScopeDebugEntry `json:"entries"`
}

ScopeDebugSnapshot holds scope debug entries for the debug API.

type ScopeDriftInspector added in v0.83.0

type ScopeDriftInspector interface {
	CheckBlankScopeRows(ctx context.Context, table string) (ScopeDriftTableCheck, error)
}

ScopeDriftInspector is the small database inspection contract used by quickstart diagnostics to find blank tenant/org rows in scoped tables.

type ScopeDriftRepairCommand added in v0.83.0

type ScopeDriftRepairCommand struct {
	Config    admin.Config        `json:"config"`
	Inspector ScopeDriftInspector `json:"-"`
	Repairer  ScopeDriftRepairer  `json:"-"`
}

ScopeDriftRepairCommand dispatches the explicit quickstart scope repair.

func (*ScopeDriftRepairCommand) Execute added in v0.83.0

type ScopeDriftRepairInput added in v0.83.0

type ScopeDriftRepairInput struct {
	Apply  bool                    `json:"apply"`
	Tables []string                `json:"tables,omitempty"`
	Result *ScopeDriftRepairReport `json:"-"`
}

ScopeDriftRepairInput controls the explicit scope drift repair command.

func (ScopeDriftRepairInput) Type added in v0.83.0

func (ScopeDriftRepairInput) Validate added in v0.83.0

func (ScopeDriftRepairInput) Validate() error

type ScopeDriftRepairReport added in v0.83.0

type ScopeDriftRepairReport struct {
	DryRun             bool                    `json:"dry_run"`
	Applied            bool                    `json:"applied"`
	ScopeMode          ScopeMode               `json:"scope_mode"`
	DefaultTenantID    string                  `json:"default_tenant_id"`
	DefaultOrgID       string                  `json:"default_org_id"`
	Tables             []ScopeDriftTableRepair `json:"tables"`
	TotalBeforeCount   int                     `json:"total_before_count"`
	TotalAfterCount    int                     `json:"total_after_count"`
	TotalRepairedCount int                     `json:"total_repaired_count"`
}

ScopeDriftRepairReport summarizes a dry-run or apply repair operation.

func RepairScopeDrift added in v0.83.0

RepairScopeDrift runs the explicit single-tenant scope repair. When Apply is false it reports affected rows without mutating data.

type ScopeDriftRepairScope added in v0.83.0

type ScopeDriftRepairScope struct {
	TenantID string `json:"tenant_id"`
	OrgID    string `json:"org_id"`
}

ScopeDriftRepairScope captures the configured single-tenant defaults used by scope drift repair.

type ScopeDriftRepairer added in v0.83.0

type ScopeDriftRepairer interface {
	RepairBlankScopeRows(ctx context.Context, table string, scope ScopeDriftRepairScope) (int, error)
}

ScopeDriftRepairer is the mutation contract used by the explicit repair command. It must only update allowlisted rows whose tenant/org scope is blank.

type ScopeDriftTableCheck added in v0.83.0

type ScopeDriftTableCheck struct {
	Table     string
	Count     int
	Available bool
	Error     string
}

ScopeDriftTableCheck captures one table's blank scope diagnostic result.

type ScopeDriftTableRepair added in v0.83.0

type ScopeDriftTableRepair struct {
	Table         string `json:"table"`
	BeforeCount   int    `json:"before_count"`
	AfterCount    int    `json:"after_count"`
	RepairedCount int    `json:"repaired_count"`
	Available     bool   `json:"available"`
	Error         string `json:"error,omitempty"`
}

ScopeDriftTableRepair captures one table's repair outcome.

type ScopeMode added in v0.24.0

type ScopeMode string

ScopeMode controls how tenant/org defaults are applied.

const (
	ScopeModeSingle ScopeMode = "single"
	ScopeModeMulti  ScopeMode = "multi"
)

type SealDurableExports added in v0.141.1

type SealDurableExports struct {
	Actor export.Actor `json:"-"`
}

Trusted operator adapters supply Actor; no public route/factory is installed.

func (SealDurableExports) Type added in v0.141.1

func (SealDurableExports) Type() string

func (SealDurableExports) Validate added in v0.141.1

func (m SealDurableExports) Validate() error

type SealDurableExportsHandler added in v0.141.1

type SealDurableExportsHandler struct{ Gate *DurableExportRecoveryGate }

func (*SealDurableExportsHandler) Execute added in v0.141.1

func (*SealDurableExportsHandler) Run added in v0.141.1

type SecureLinkConfig added in v0.19.0

type SecureLinkConfig struct {
	SigningKey string            `json:"signing_key"`
	Expiration time.Duration     `json:"expiration"`
	BaseURL    string            `json:"base_url"`
	QueryKey   string            `json:"query_key"`
	AsQuery    bool              `json:"as_query"`
	Routes     map[string]string `json:"routes"`
}

SecureLinkConfig captures securelink defaults for onboarding flows.

func DefaultSecureLinkConfig added in v0.26.0

func DefaultSecureLinkConfig(basePath string) SecureLinkConfig

DefaultSecureLinkConfig returns securelink defaults for onboarding flows.

func (SecureLinkConfig) Enabled added in v0.19.0

func (c SecureLinkConfig) Enabled() bool

Enabled reports whether the config has enough data to build a manager.

func (SecureLinkConfig) GetAsQuery added in v0.19.0

func (c SecureLinkConfig) GetAsQuery() bool

func (SecureLinkConfig) GetBaseURL added in v0.19.0

func (c SecureLinkConfig) GetBaseURL() string

func (SecureLinkConfig) GetExpiration added in v0.19.0

func (c SecureLinkConfig) GetExpiration() time.Duration

func (SecureLinkConfig) GetQueryKey added in v0.19.0

func (c SecureLinkConfig) GetQueryKey() string

func (SecureLinkConfig) GetRoutes added in v0.19.0

func (c SecureLinkConfig) GetRoutes() map[string]string

func (SecureLinkConfig) GetSigningKey added in v0.19.0

func (c SecureLinkConfig) GetSigningKey() string

type SecureLinkManagerSetter added in v0.19.0

type SecureLinkManagerSetter interface {
	WithSecureLinkManager(userstypes.SecureLinkManager)
}

SecureLinkManagerSetter allows injecting securelink managers into host components.

type SecureLinkUIConfig added in v0.19.0

type SecureLinkUIConfig struct {
	QueryKey string `json:"query_key"`
	AsQuery  bool   `json:"as_query"`
}

SecureLinkUIConfig exposes link parsing details for templates.

func SecureLinkUIConfigFromConfig added in v0.26.0

func SecureLinkUIConfigFromConfig(cfg SecureLinkConfig) SecureLinkUIConfig

SecureLinkUIConfigFromConfig reads securelink parsing defaults from config.

type SecureLinkUsersOption added in v0.19.0

type SecureLinkUsersOption func(*secureLinkUsersOptions)

SecureLinkUsersOption customizes go-users securelink wiring.

func WithSecureLinkInviteRoute added in v0.19.0

func WithSecureLinkInviteRoute(route string) SecureLinkUsersOption

WithSecureLinkInviteRoute overrides the invite accept route key used by go-users.

func WithSecureLinkPasswordResetRoute added in v0.19.0

func WithSecureLinkPasswordResetRoute(route string) SecureLinkUsersOption

WithSecureLinkPasswordResetRoute overrides the password reset route key used by go-users.

func WithSecureLinkRegistrationRoute added in v0.19.0

func WithSecureLinkRegistrationRoute(route string) SecureLinkUsersOption

WithSecureLinkRegistrationRoute overrides the registration route key used by go-users.

type SeedLocalizedNavigationOptions added in v0.26.0

type SeedLocalizedNavigationOptions struct {
	MenuSvc       admin.CMSMenuService             `json:"menu_svc"`
	MenuCode      string                           `json:"menu_code"`
	Items         []LocalizedSeedMenuItem          `json:"items"`
	DefaultLocale string                           `json:"default_locale"`
	Reset         bool                             `json:"reset"`
	ResetEnv      string                           `json:"reset_env"`
	Logf          func(format string, args ...any) `json:"logf"`
	SkipLogger    bool                             `json:"skip_logger"`

	// AutoCreateParents allows seeds to omit intermediate path segments; missing parents are scaffolded as group nodes.
	AutoCreateParents bool `json:"auto_create_parents"`
}

SeedLocalizedNavigationOptions drives localized menu seeding with stable menu IDs.

type SeedNavigationOptions

type SeedNavigationOptions struct {
	MenuSvc   admin.CMSMenuService `json:"menu_svc"`
	MenuCode  string               `json:"menu_code"`
	Items     []admin.MenuItem     `json:"items"`
	Reset     bool                 `json:"reset"`
	Reconcile bool                 `json:"reconcile"`
	// AllowDestructive lets reconcile delete generated replacement candidates during apply.
	// It is false by default so normal startup seeding preserves stale generated rows.
	AllowDestructive bool `json:"allow_destructive"`
	// RetireManagedExclusions allows deletion only for explicitly identified,
	// quickstart-owned generated rows without enabling general destructive reconciliation.
	RetireManagedExclusions bool                                `json:"retire_managed_exclusions"`
	ResetEnv                string                              `json:"reset_env"`
	Locale                  string                              `json:"locale"`
	RawInventory            admin.NavigationRawInventoryOptions `json:"raw_inventory"`
	Logf                    func(format string, args ...any)    `json:"logf"`
	SkipLogger              bool                                `json:"skip_logger"`
	Reportf                 func(NavigationReconcileReport)     `json:"-"`

	CapabilityOmissions     []string                     `json:"capability_omissions,omitempty"`
	PermissionFilteredItems []string                     `json:"permission_filtered_items,omitempty"`
	ManagedExclusions       []NavigationManagedExclusion `json:"managed_exclusions,omitempty"`

	// AutoCreateParents allows seeds to omit intermediate path segments; missing parents are scaffolded as group nodes.
	AutoCreateParents bool `json:"auto_create_parents"`
}

SeedNavigationOptions drives the quickstart menu seeding workflow.

type SessionUser

type SessionUser struct {
	ID              string            `json:"id,omitempty"`
	Subject         string            `json:"subject,omitempty"`
	Username        string            `json:"username,omitempty"`
	Email           string            `json:"email,omitempty"`
	Role            string            `json:"role,omitempty"`
	TenantID        string            `json:"tenant_id,omitempty"`
	OrganizationID  string            `json:"organization_id,omitempty"`
	Environment     string            `json:"environment,omitempty"`
	ResourceRoles   map[string]string `json:"resource_roles,omitempty"`
	Metadata        map[string]any    `json:"metadata,omitempty"`
	Scopes          []string          `json:"scopes,omitempty"`
	IssuedAt        *time.Time        `json:"issued_at,omitempty"`
	ExpiresAt       *time.Time        `json:"expires_at,omitempty"`
	IsAuthenticated bool              `json:"is_authenticated"`
	DisplayName     string            `json:"display_name,omitempty"`
	Subtitle        string            `json:"subtitle,omitempty"`
	Initial         string            `json:"initial,omitempty"`
	AvatarURL       string            `json:"avatar_url,omitempty"`
}

SessionUser captures session metadata to expose in templates and APIs.

func ApplyScopeDefaultsToSession added in v0.24.0

func ApplyScopeDefaultsToSession(session SessionUser, cfg admin.Config) SessionUser

ApplyScopeDefaultsToSession backfills tenant/org values for single-tenant mode.

func BuildSessionUser

func BuildSessionUser(ctx context.Context) SessionUser

BuildSessionUser extracts actor/claims data from the request context.

func FilterSessionUser

func FilterSessionUser(session SessionUser, gate fggate.FeatureGate) SessionUser

FilterSessionUser hides tenant/org data when those features are disabled.

func (SessionUser) ToViewContext

func (s SessionUser) ToViewContext() map[string]any

ToViewContext converts the session into snake_case keys for templates.

type SettingsUIOption added in v0.24.0

type SettingsUIOption func(*settingsUIOptions)

SettingsUIOption customizes the settings UI wiring.

func WithSettingsUIActive added in v0.24.0

func WithSettingsUIActive(active string) SettingsUIOption

WithSettingsUIActive overrides the active navigation key.

func WithSettingsUIRoute added in v0.24.0

func WithSettingsUIRoute(route string) SettingsUIOption

WithSettingsUIRoute overrides the URLKit admin route key.

func WithSettingsUITemplate added in v0.24.0

func WithSettingsUITemplate(name string) SettingsUIOption

WithSettingsUITemplate overrides the settings template name.

func WithSettingsUIViewContext added in v0.28.0

func WithSettingsUIViewContext(builder UIViewContextBuilder) SettingsUIOption

WithSettingsUIViewContext overrides the default view context builder.

type SharedActivitySinks added in v0.19.0

type SharedActivitySinks struct {
	Admin admin.ActivitySink `json:"admin"`
	Auth  auth.ActivitySink  `json:"auth"`
}

SharedActivitySinks bundles the admin + go-auth adapters.

func NewSharedActivitySinks added in v0.19.0

NewSharedActivitySinks builds a shared activity sink for admin/go-users/go-auth.

type SidebarUtilityItemKey added in v0.122.0

type SidebarUtilityItemKey string

SidebarUtilityItemKey identifies a quickstart-owned standard utility item.

const (
	SidebarUtilityItemSettings    SidebarUtilityItemKey = "settings"
	SidebarUtilityItemPreferences SidebarUtilityItemKey = "preferences"
	SidebarUtilityItemProfile     SidebarUtilityItemKey = "profile"
)

func DefaultSidebarUtilityItemKeys added in v0.122.0

func DefaultSidebarUtilityItemKeys() []SidebarUtilityItemKey

DefaultSidebarUtilityItemKeys returns the complete supported standard set.

type SiteStaticPrefixInput added in v0.49.0

type SiteStaticPrefixInput struct {
	AssetsPrefix     string `json:"assets_prefix,omitempty"`
	FormgenPrefix    string `json:"formgen_prefix,omitempty"`
	RuntimePrefix    string `json:"runtime_prefix,omitempty"`
	SyncClientPrefix string `json:"sync_client_prefix,omitempty"`
	EChartsPrefix    string `json:"echarts_prefix,omitempty"`
	ShellPrefix      string `json:"shell_prefix,omitempty"`
}

SiteStaticPrefixInput describes the static asset mount prefixes that site fallback reservations should align with when the host customizes them.

func ResolveSiteFallbackStaticInput added in v0.49.0

func ResolveSiteFallbackStaticInput(cfg admin.Config, opts ...StaticAssetsOption) SiteStaticPrefixInput

ResolveSiteFallbackStaticInput returns a site fallback static-input payload that matches the current static asset mount options.

type StartupPolicy added in v0.25.0

type StartupPolicy = admin.ModuleStartupPolicy

StartupPolicy controls how module startup validation errors are handled.

const (
	// StartupPolicyEnforce fails startup when module startup validation fails.
	StartupPolicyEnforce StartupPolicy = admin.ModuleStartupPolicyEnforce
	// StartupPolicyWarn logs startup validation failures and continues.
	StartupPolicyWarn StartupPolicy = admin.ModuleStartupPolicyWarn
)

type StaticAssetsOption

type StaticAssetsOption func(*staticAssetsOptions)

StaticAssetsOption customizes the asset mounting behavior.

func WithAssetsPrefix

func WithAssetsPrefix(prefix string) StaticAssetsOption

WithAssetsPrefix overrides the base assets route prefix.

func WithDashboardShellPrefix added in v0.110.0

func WithDashboardShellPrefix(prefix string) StaticAssetsOption

WithDashboardShellPrefix overrides the go-dashboard shell assets prefix.

func WithDiskAssetsDir

func WithDiskAssetsDir(dir string) StaticAssetsOption

WithDiskAssetsDir configures a disk-backed asset directory (for dev overrides).

func WithDiskAssetsFS

func WithDiskAssetsFS(fsys fs.FS) StaticAssetsOption

WithDiskAssetsFS supplies a disk asset filesystem directly.

func WithEChartsPrefix

func WithEChartsPrefix(prefix string) StaticAssetsOption

WithEChartsPrefix overrides the go-dashboard ECharts assets prefix.

func WithExtraAssetsFS

func WithExtraAssetsFS(fsys ...fs.FS) StaticAssetsOption

WithExtraAssetsFS appends additional asset fallbacks.

func WithFormgenPrefix

func WithFormgenPrefix(prefix string) StaticAssetsOption

WithFormgenPrefix overrides the formgen assets route prefix.

func WithRuntimePrefix

func WithRuntimePrefix(prefix string) StaticAssetsOption

WithRuntimePrefix overrides the formgen runtime route prefix.

func WithSidebarAssetsFS

func WithSidebarAssetsFS(fsys fs.FS) StaticAssetsOption

WithSidebarAssetsFS adds sidebar asset overrides ahead of the packaged quickstart assets. Files missing from the supplied filesystem continue to fall back to the packaged asset set.

func WithSyncClientPrefix added in v0.84.0

func WithSyncClientPrefix(prefix string) StaticAssetsOption

WithSyncClientPrefix overrides the sync-core runtime asset route prefix used by static-prefix discovery and site fallback reservation helpers.

type StorageBundle added in v0.27.0

type StorageBundle struct {
	Provider uploader.Uploader `json:"provider"`
	Manager  *uploader.Manager `json:"manager"`
}

func NewStorageBundle added in v0.27.0

func NewStorageBundle(ctx context.Context, cfg StorageBundleConfig) (*StorageBundle, error)

type StorageBundleConfig added in v0.27.0

type StorageBundleConfig struct {
	Provider         uploader.ProviderConfig `json:"provider"`
	ValidateProvider bool                    `json:"validate_provider"`
	Validator        *uploader.Validator     `json:"validator"`
	Logger           uploader.Logger         `json:"logger"`
}

type TemplateFuncOption

type TemplateFuncOption func(*templateFuncOptions)

TemplateFuncOption customizes default template functions.

func WithTemplateBasePath added in v0.24.0

func WithTemplateBasePath(basePath string) TemplateFuncOption

WithTemplateBasePath configures the fallback base path used by adminURL helper.

func WithTemplateDefaultLocale added in v0.52.0

func WithTemplateDefaultLocale(locale string) TemplateFuncOption

WithTemplateDefaultLocale configures the locale used when translation helpers do not receive a request-bound context value.

func WithTemplateFeatureGate added in v0.20.0

func WithTemplateFeatureGate(gate fggate.FeatureGate, opts ...fgtemplates.HelperOption) TemplateFuncOption

WithTemplateFeatureGate registers feature template helpers using the provided gate.

func WithTemplateIconRenderer added in v0.25.0

func WithTemplateIconRenderer(renderFunc func(ref string, variant string) string) TemplateFuncOption

WithTemplateIconRenderer injects an icon renderer for template functions. The render function takes (ref string, variant string) and returns HTML. If not provided, templates use the built-in legacy icon rendering.

func WithTemplateTranslator added in v0.52.0

func WithTemplateTranslator(translator admin.Translator) TemplateFuncOption

WithTemplateTranslator configures translation helpers for template rendering.

func WithTemplateURLResolver added in v0.24.0

func WithTemplateURLResolver(urls urlkit.Resolver) TemplateFuncOption

WithTemplateURLResolver configures the URLKit resolver used by adminURL helper.

func WithWidgetTitleFunc

func WithWidgetTitleFunc(fn func(string) string) TemplateFuncOption

WithWidgetTitleFunc replaces the widget title resolver.

func WithWidgetTitleMap

func WithWidgetTitleMap(titles map[string]string) TemplateFuncOption

WithWidgetTitleMap replaces the default widget title map.

func WithWidgetTitleOverrides

func WithWidgetTitleOverrides(overrides map[string]string) TemplateFuncOption

WithWidgetTitleOverrides updates the default widget title map.

type TemplateIconRenderer added in v0.25.0

type TemplateIconRenderer interface {
	RenderFromString(rawRef string, trusted bool, variant string) string
}

TemplateIconRenderer defines the interface for rendering icons in templates. This is satisfied by admin.IconService.

type TemporaryPasswordGateConfig added in v0.55.0

type TemporaryPasswordGateConfig struct {
	SessionContextKey string
	ChangePath        string
	AllowPaths        []string
	RedirectStatus    int
	JSONStatus        int
}

TemporaryPasswordGateConfig configures middleware that confines temporary password sessions to a password-change/reset flow.

type ThemeOption

type ThemeOption func(*themeOptions)

ThemeOption customizes the default theme manifest/registry.

func WithThemeAssets

func WithThemeAssets(prefix string, files map[string]string) ThemeOption

WithThemeAssets configures manifest asset files plus an optional manifest asset prefix. Use this for go-theme manifests/selectors; for final config-level URL overrides, use admin.Config.ThemeAssets or quickstart.WithThemeAssetURLs.

func WithThemeManifest

func WithThemeManifest(manifest *theme.Manifest) ThemeOption

WithThemeManifest overrides the default manifest entirely.

func WithThemeRegistry

func WithThemeRegistry(registry theme.Registry) ThemeOption

WithThemeRegistry supplies a registry for theme registration.

func WithThemeVariants

func WithThemeVariants(variants map[string]theme.Variant) ThemeOption

WithThemeVariants overrides the default variant definitions.

type TranslationCapabilityMenuMode added in v0.25.0

type TranslationCapabilityMenuMode string

TranslationCapabilityMenuMode controls whether quickstart seeds translation capability menu items into the server-side navigation tree.

const (
	// TranslationCapabilityMenuModeNone keeps translation links out of server-seeded menus.
	// Use this when translation links are intentionally omitted from server-seeded navigation.
	TranslationCapabilityMenuModeNone TranslationCapabilityMenuMode = "none"
	// TranslationCapabilityMenuModeTools seeds translation links into a dedicated Translations group.
	// The name is retained for backward compatibility.
	TranslationCapabilityMenuModeTools TranslationCapabilityMenuMode = "tools"
)

type TranslationChecker added in v0.24.0

type TranslationChecker interface {
	CheckTranslations(ctx context.Context, id uuid.UUID, required []string, opts cmsinterfaces.TranslationCheckOptions) ([]string, error)
}

TranslationChecker is the minimal contract needed to validate translations.

type TranslationCriteria added in v0.24.0

type TranslationCriteria struct {
	Locales                 []string            `json:"locales,omitempty"`
	RequiredFields          map[string][]string `json:"required_fields,omitempty"`
	ReviewRequired          *bool               `json:"review_required,omitempty"`
	AllowPublishOverride    *bool               `json:"allow_publish_override,omitempty"`
	AssignmentLifecycleMode string              `json:"assignment_lifecycle_mode,omitempty"`
	DefaultWorkScope        string              `json:"default_work_scope,omitempty"`
}

TranslationCriteria captures locale/field requirements for a transition or environment.

type TranslationExchangeApplyDefaults added in v0.82.0

type TranslationExchangeApplyDefaults = admin.TranslationExchangeApplyDefaults

TranslationExchangeApplyDefaults configures import/apply wizard option defaults.

type TranslationExchangeAsyncApplyFunc added in v0.25.0

type TranslationExchangeAsyncApplyFunc func(context.Context, admin.TranslationImportApplyInput) (admin.TranslationExchangeResult, error)

TranslationExchangeAsyncApplyFunc allows hosts to hand off apply flows to async backends. The implementation may enqueue work and return a queued/accepted result contract.

type TranslationExchangeConfig added in v0.25.0

type TranslationExchangeConfig struct {
	Enabled bool `json:"enabled,omitempty"`
	// CommandExecutionMode applies per-command routing policy overrides for translation exchange commands.
	// Hosts can still override specific command ids through WithCommandExecutionPolicy.
	CommandExecutionMode gocommand.ExecutionMode     `json:"command_execution_mode,omitempty"`
	UI                   TranslationExchangeUIConfig `json:"ui"`

	Store        admin.TranslationExchangeStore        `json:"-"`
	RuntimeStore admin.TranslationExchangeRuntimeStore `json:"-"`
	Exporter     admin.TranslationExchangeExporter     `json:"-"`
	Validator    admin.TranslationExchangeValidator    `json:"-"`
	Applier      admin.TranslationExchangeApplier      `json:"-"`

	AsyncApply TranslationExchangeAsyncApplyFunc `json:"-"`

	PermissionRegister PermissionRegisterFunc `json:"-"`
}

TranslationExchangeConfig configures optional translation exchange wiring in quickstart.

type TranslationExchangeLocaleOption added in v0.82.0

type TranslationExchangeLocaleOption = admin.TranslationExchangeLocaleOption

TranslationExchangeLocaleOption describes a selectable locale.

type TranslationExchangeResourceOption added in v0.82.0

type TranslationExchangeResourceOption = admin.TranslationExchangeResourceOption

TranslationExchangeResourceOption describes a selectable exchange resource.

type TranslationExchangeTemplateOption added in v0.82.0

type TranslationExchangeTemplateOption = admin.TranslationExchangeTemplateOption

TranslationExchangeTemplateOption configures the template download affordance.

type TranslationExchangeUIConfig added in v0.82.0

type TranslationExchangeUIConfig = admin.TranslationExchangeUIConfig

TranslationExchangeUIConfig carries JSON-safe exchange wizard settings.

type TranslationPolicyConfig added in v0.24.0

type TranslationPolicyConfig struct {
	// DenyByDefault blocks transitions when no explicit requirements are configured.
	DenyByDefault bool `json:"deny_by_default,omitempty"`
	// RequiredFieldsStrategy controls how unknown required-field keys are handled.
	// Valid values: error, warn, ignore (defaults to error).
	RequiredFieldsStrategy admin.RequiredFieldsValidationStrategy `json:"required_fields_strategy,omitempty"`
	// PageEntities declares policy entities that should prefer the page translation
	// checker when both page/content checkers are configured.
	PageEntities []string `json:"page_entities,omitempty"`
	// EntityAliases maps input policy entities to canonical policy keys.
	// Useful for irregular nouns or legacy names that singular/plural inflection
	// cannot resolve deterministically.
	EntityAliases map[string]string `json:"entity_aliases,omitempty"`
	// Required maps entity -> transition -> requirements.
	Required map[string]TranslationPolicyEntityConfig `json:"required,omitempty"`
}

TranslationPolicyConfig captures translation enforcement rules for workflow transitions. Defaults are permissive (no enforcement) unless requirements are configured.

func DefaultContentTranslationPolicyConfig added in v0.25.0

func DefaultContentTranslationPolicyConfig() TranslationPolicyConfig

DefaultContentTranslationPolicyConfig returns a permissive, content-type agnostic baseline with no built-in entity assumptions.

func DefaultTranslationPolicyConfig added in v0.24.0

func DefaultTranslationPolicyConfig() TranslationPolicyConfig

DefaultTranslationPolicyConfig returns permissive defaults (no enforcement).

func NormalizeTranslationPolicyConfig added in v0.24.0

func NormalizeTranslationPolicyConfig(cfg TranslationPolicyConfig) TranslationPolicyConfig

NormalizeTranslationPolicyConfig applies defaults and normalizes strategy values.

type TranslationPolicyDiagnostic added in v0.84.0

type TranslationPolicyDiagnostic struct {
	Code            string         `json:"code"`
	Message         string         `json:"message"`
	Hint            string         `json:"hint,omitempty"`
	MissingServices []string       `json:"missing_services,omitempty"`
	Metadata        map[string]any `json:"metadata,omitempty"`
}

TranslationPolicyDiagnostic captures policy wiring diagnostics for startup and Doctor checks.

func DiagnoseTranslationPolicyServices added in v0.84.0

func DiagnoseTranslationPolicyServices(cfg TranslationPolicyConfig, services TranslationPolicyServices) []TranslationPolicyDiagnostic

DiagnoseTranslationPolicyServices reports explicit policy configs that cannot be evaluated.

type TranslationPolicyEntityCatalog added in v0.25.0

type TranslationPolicyEntityCatalog struct {
	Transitions map[string]TranslationPolicyTransitionCatalog `json:"transitions"`
}

TranslationPolicyEntityCatalog describes known transitions and field keys for one entity.

type TranslationPolicyEntityConfig added in v0.24.0

type TranslationPolicyEntityConfig map[string]TranslationPolicyTransitionConfig

TranslationPolicyEntityConfig maps transition names to requirements.

type TranslationPolicyServices added in v0.24.0

type TranslationPolicyServices struct {
	Pages   TranslationChecker `json:"pages"`
	Content TranslationChecker `json:"content"`
}

TranslationPolicyServices supplies translation checkers for pages and content.

type TranslationPolicyTransitionCatalog added in v0.25.0

type TranslationPolicyTransitionCatalog struct {
	RequiredFields []string `json:"required_fields"`
}

TranslationPolicyTransitionCatalog describes known required-field keys for one transition.

type TranslationPolicyTransitionConfig added in v0.24.0

type TranslationPolicyTransitionConfig struct {
	Locales                 []string                       `json:"locales,omitempty"`
	RequiredFields          map[string][]string            `json:"required_fields,omitempty"`
	ReviewRequired          *bool                          `json:"review_required,omitempty"`
	AllowPublishOverride    *bool                          `json:"allow_publish_override,omitempty"`
	AssignmentLifecycleMode string                         `json:"assignment_lifecycle_mode,omitempty"`
	DefaultWorkScope        string                         `json:"default_work_scope,omitempty"`
	Environments            map[string]TranslationCriteria `json:"environments,omitempty"`
}

TranslationPolicyTransitionConfig describes requirements for a transition and optional environments.

type TranslationPolicyValidationCatalog added in v0.25.0

type TranslationPolicyValidationCatalog struct {
	Entities map[string]TranslationPolicyEntityCatalog `json:"entities"`
}

TranslationPolicyValidationCatalog describes known policy entities/transitions/fields. Validation is optional and used by hosts that want strict startup checks.

func DefaultTranslationPolicyValidationCatalog added in v0.25.0

func DefaultTranslationPolicyValidationCatalog() TranslationPolicyValidationCatalog

DefaultTranslationPolicyValidationCatalog is empty by default so hosts can supply their own entity catalogs.

type TranslationPolicyValidationResult added in v0.25.0

type TranslationPolicyValidationResult struct {
	Warnings []string `json:"warnings"`
}

TranslationPolicyValidationResult includes non-fatal warnings produced by validation.

func ValidateTranslationPolicyConfig added in v0.25.0

ValidateTranslationPolicyConfig validates policy keys against a known catalog. Strategy controls unknown-key handling: - error: returns an error - warn: records warnings - ignore: suppresses unknown-key issues

func ValidateTranslationPolicyContentTypeCoverage added in v0.84.0

func ValidateTranslationPolicyContentTypeCoverage(cfg TranslationPolicyConfig, contentTypes []string) (TranslationPolicyValidationResult, error)

ValidateTranslationPolicyContentTypeCoverage is an explicit alias for ValidateTranslationPolicyCoverage.

func ValidateTranslationPolicyCoverage added in v0.84.0

func ValidateTranslationPolicyCoverage(cfg TranslationPolicyConfig, contentTypes []string) (TranslationPolicyValidationResult, error)

ValidateTranslationPolicyCoverage checks that family/readiness content types have effective publish policy requirements.

type TranslationProductConfig added in v0.25.0

type TranslationProductConfig struct {
	SchemaVersion int                        `json:"schema_version,omitempty"`
	Profile       TranslationProfile         `json:"profile,omitempty"`
	Exchange      *TranslationExchangeConfig `json:"exchange,omitempty"`
	Queue         *TranslationQueueConfig    `json:"queue,omitempty"`
}

TranslationProductConfig configures productized translation capabilities.

type TranslationProfile added in v0.25.0

type TranslationProfile string

TranslationProfile defines the quickstart translation capability profile.

const (
	TranslationProfileNone         TranslationProfile = "none"
	TranslationProfileCore         TranslationProfile = "core"
	TranslationProfileCoreExchange TranslationProfile = "core+exchange"
	TranslationProfileCoreQueue    TranslationProfile = "core+queue"
	TranslationProfileFull         TranslationProfile = "full"
)

type TranslationQueueConfig added in v0.25.0

type TranslationQueueConfig struct {
	Enabled bool `json:"enabled,omitempty"`
	// CommandExecutionMode applies per-command routing policy overrides for translation queue commands.
	// Hosts can still override specific command ids through WithCommandExecutionPolicy.
	CommandExecutionMode  gocommand.ExecutionMode `json:"command_execution_mode,omitempty"`
	EnableOpenPool        bool                    `json:"enable_open_pool"`
	EnableDashboard       bool                    `json:"enable_dashboard_widget"`
	EnableNotifications   bool                    `json:"enable_notifications"`
	EnableAutoCreate      bool                    `json:"enable_auto_create"`
	EnhancedFilterSelects bool                    `json:"enhanced_filter_selects,omitempty"`
	DefaultPriority       string                  `json:"default_priority,omitempty"`
	SupportedLocales      []string                `json:"supported_locales,omitempty"`

	Repository admin.TranslationAssignmentRepository `json:"-"`
	Service    admin.TranslationQueueService         `json:"-"`
	// ActorOptionProvider enables host-owned assignee/reviewer option eligibility.
	ActorOptionProvider admin.TranslationActorOptionProvider `json:"-"`
	// SuggestionService enables the optional translation suggestion command wiring.
	SuggestionService       admin.TranslationSuggestionService                `json:"-"`
	SuggestionEligibility   admin.TranslationSuggestionEligibilityChecker     `json:"-"`
	SuggestionAssistContext admin.TranslationSuggestionAssistContextExtractor `json:"-"`
	SuggestionPermission    string                                            `json:"-"`
	SuggestionResource      string                                            `json:"-"`

	PermissionRegister PermissionRegisterFunc `json:"-"`
}

TranslationQueueConfig configures optional translation queue wiring in quickstart.

type UIRouteOption added in v0.13.0

type UIRouteOption func(*uiRouteOptions)

UIRouteOption customizes the default UI route wiring.

func WithUIActivityActive added in v0.14.0

func WithUIActivityActive(active string) UIRouteOption

WithUIActivityActive sets the active menu key for the activity route.

func WithUIActivityPath added in v0.14.0

func WithUIActivityPath(route string) UIRouteOption

WithUIActivityPath overrides the activity route path.

func WithUIActivityRoute added in v0.14.0

func WithUIActivityRoute(enabled bool) UIRouteOption

WithUIActivityRoute toggles the activity route registration.

func WithUIActivityTemplate added in v0.14.0

func WithUIActivityTemplate(name string) UIRouteOption

WithUIActivityTemplate overrides the activity template name.

func WithUIActivityTitle added in v0.14.0

func WithUIActivityTitle(title string) UIRouteOption

WithUIActivityTitle overrides the activity view title.

func WithUIBasePath added in v0.13.0

func WithUIBasePath(basePath string) UIRouteOption

WithUIBasePath overrides the base path used to build default routes.

func WithUIDashboardActive added in v0.13.0

func WithUIDashboardActive(active string) UIRouteOption

WithUIDashboardActive sets the active menu key for the dashboard route.

func WithUIDashboardPath added in v0.13.0

func WithUIDashboardPath(route string) UIRouteOption

WithUIDashboardPath overrides the dashboard route path.

func WithUIDashboardRoute added in v0.13.0

func WithUIDashboardRoute(enabled bool) UIRouteOption

WithUIDashboardRoute toggles the dashboard route registration.

func WithUIDashboardTemplate added in v0.13.0

func WithUIDashboardTemplate(name string) UIRouteOption

WithUIDashboardTemplate overrides the dashboard template name.

func WithUIDashboardTitle added in v0.13.0

func WithUIDashboardTitle(title string) UIRouteOption

WithUIDashboardTitle overrides the dashboard view title.

func WithUIFeatureFlagsActive added in v0.21.0

func WithUIFeatureFlagsActive(active string) UIRouteOption

WithUIFeatureFlagsActive sets the active menu key for the feature flags route.

func WithUIFeatureFlagsPath added in v0.21.0

func WithUIFeatureFlagsPath(route string) UIRouteOption

WithUIFeatureFlagsPath overrides the feature flags route path.

func WithUIFeatureFlagsRoute added in v0.21.0

func WithUIFeatureFlagsRoute(enabled bool) UIRouteOption

WithUIFeatureFlagsRoute toggles the feature flags route registration.

func WithUIFeatureFlagsTemplate added in v0.21.0

func WithUIFeatureFlagsTemplate(name string) UIRouteOption

WithUIFeatureFlagsTemplate overrides the feature flags template name.

func WithUIFeatureFlagsTitle added in v0.21.0

func WithUIFeatureFlagsTitle(title string) UIRouteOption

WithUIFeatureFlagsTitle overrides the feature flags view title.

func WithUINotificationsActive added in v0.13.0

func WithUINotificationsActive(active string) UIRouteOption

WithUINotificationsActive sets the active menu key for the notifications route.

func WithUINotificationsPath added in v0.13.0

func WithUINotificationsPath(route string) UIRouteOption

WithUINotificationsPath overrides the notifications route path.

func WithUINotificationsRoute added in v0.13.0

func WithUINotificationsRoute(enabled bool) UIRouteOption

WithUINotificationsRoute toggles the notifications route registration.

func WithUINotificationsTemplate added in v0.13.0

func WithUINotificationsTemplate(name string) UIRouteOption

WithUINotificationsTemplate overrides the notifications template name.

func WithUINotificationsTitle added in v0.13.0

func WithUINotificationsTitle(title string) UIRouteOption

WithUINotificationsTitle overrides the notifications view title.

func WithUITranslationDashboardActive added in v0.25.0

func WithUITranslationDashboardActive(active string) UIRouteOption

WithUITranslationDashboardActive sets the active menu key for the translation dashboard route.

func WithUITranslationDashboardPath added in v0.25.0

func WithUITranslationDashboardPath(route string) UIRouteOption

WithUITranslationDashboardPath overrides the translation dashboard route path.

func WithUITranslationDashboardRoute added in v0.25.0

func WithUITranslationDashboardRoute(enabled bool) UIRouteOption

WithUITranslationDashboardRoute toggles the translation dashboard route registration.

func WithUITranslationDashboardTemplate added in v0.25.0

func WithUITranslationDashboardTemplate(name string) UIRouteOption

WithUITranslationDashboardTemplate overrides the translation dashboard template name.

func WithUITranslationDashboardTitle added in v0.25.0

func WithUITranslationDashboardTitle(title string) UIRouteOption

WithUITranslationDashboardTitle overrides the translation dashboard view title.

func WithUITranslationExchangeActive added in v0.25.0

func WithUITranslationExchangeActive(active string) UIRouteOption

WithUITranslationExchangeActive sets the active menu key for the translation exchange route.

func WithUITranslationExchangePath added in v0.25.0

func WithUITranslationExchangePath(route string) UIRouteOption

WithUITranslationExchangePath overrides the translation exchange route path.

func WithUITranslationExchangeRoute added in v0.25.0

func WithUITranslationExchangeRoute(enabled bool) UIRouteOption

WithUITranslationExchangeRoute toggles the translation exchange route registration.

func WithUITranslationExchangeTemplate added in v0.25.0

func WithUITranslationExchangeTemplate(name string) UIRouteOption

WithUITranslationExchangeTemplate overrides the translation exchange template name.

func WithUITranslationExchangeTitle added in v0.25.0

func WithUITranslationExchangeTitle(title string) UIRouteOption

WithUITranslationExchangeTitle overrides the translation exchange view title.

func WithUITranslationSSRPresenter added in v0.86.0

func WithUITranslationSSRPresenter(presenter admin.TranslationSSRPresenter) UIRouteOption

WithUITranslationSSRPresenter overrides translation SSR hydration for route tests or custom hosts.

func WithUIViewContextBuilder added in v0.13.0

func WithUIViewContextBuilder(builder UIViewContextBuilder) UIRouteOption

WithUIViewContextBuilder overrides the default view context builder.

type UIViewContextBuilder added in v0.13.0

type UIViewContextBuilder func(ctx router.ViewContext, active string, c router.Context) router.ViewContext

UIViewContextBuilder mutates the view context for UI routes.

func DefaultAdminUIViewContextBuilder added in v0.24.0

func DefaultAdminUIViewContextBuilder(adm *admin.Admin, cfg admin.Config) UIViewContextBuilder

DefaultAdminUIViewContextBuilder returns the default admin UI view-context builder.

type UploadAuthorizeFunc added in v0.25.0

type UploadAuthorizeFunc func(context.Context) error

UploadAuthorizeFunc validates whether the request context can upload files. Return a non-nil error to block the upload.

type UploadHandlerConfig added in v0.25.0

type UploadHandlerConfig struct {
	BasePath            string               `json:"base_path"`
	DiskAssetsDir       string               `json:"disk_assets_dir"`
	FormField           string               `json:"form_field"`
	UploadSubdir        string               `json:"upload_subdir"`
	ResolveUploadSubdir UploadSubdirResolver `json:"resolve_upload_subdir"`
	MaxFileSize         int64                `json:"max_file_size"`
	AllowedMimeTypes    map[string]bool      `json:"allowed_mime_types"`
	AllowedImageFormats map[string]bool      `json:"allowed_image_formats"`
	Provider            uploader.Uploader    `json:"provider"`
	Validator           *uploader.Validator  `json:"validator"`
	Manager             *uploader.Manager    `json:"manager"`
	Authorize           UploadAuthorizeFunc  `json:"authorize"`
	PublicURL           UploadPublicURLFunc  `json:"public_url"`
	Response            UploadResponseFunc   `json:"response"`
}

UploadHandlerConfig configures a multipart upload endpoint backed by go-uploader.

type UploadPublicURLFunc added in v0.25.0

type UploadPublicURLFunc func(basePath string, meta *uploader.FileMeta) string

UploadPublicURLFunc builds the public URL returned in the JSON response.

type UploadResponseFunc added in v0.25.0

type UploadResponseFunc func(publicURL string, meta *uploader.FileMeta) any

UploadResponseFunc customizes the JSON response payload.

type UploadSubdirResolver added in v0.25.0

type UploadSubdirResolver func(router.Context) string

UploadSubdirResolver resolves the upload subdirectory for the current request.

type UserMigrationObserver added in v0.26.0

type UserMigrationObserver func(UserMigrationRegistration)

UserMigrationObserver receives ordered migration registration events.

type UserMigrationRegistration added in v0.26.0

type UserMigrationRegistration struct {
	Label string `json:"label"`
}

UserMigrationRegistration records one ordered migration registration step.

type UserMigrationsOption added in v0.19.0

type UserMigrationsOption func(*userMigrationsOptions)

UserMigrationsOption customizes user-related migrations registration.

func WithUserMigrationsAuthBootstrapEnabled added in v0.19.0

func WithUserMigrationsAuthBootstrapEnabled(enabled bool) UserMigrationsOption

WithUserMigrationsAuthBootstrapEnabled toggles go-users auth bootstrap migrations.

func WithUserMigrationsAuthBootstrapFS added in v0.19.0

func WithUserMigrationsAuthBootstrapFS(fsys fs.FS) UserMigrationsOption

WithUserMigrationsAuthBootstrapFS overrides go-users auth bootstrap migrations.

func WithUserMigrationsAuthEnabled added in v0.19.0

func WithUserMigrationsAuthEnabled(enabled bool) UserMigrationsOption

WithUserMigrationsAuthEnabled toggles go-auth migrations.

func WithUserMigrationsAuthExtrasEnabled added in v0.19.0

func WithUserMigrationsAuthExtrasEnabled(enabled bool) UserMigrationsOption

WithUserMigrationsAuthExtrasEnabled toggles go-users auth extras migrations.

func WithUserMigrationsAuthExtrasFS added in v0.19.0

func WithUserMigrationsAuthExtrasFS(fsys fs.FS) UserMigrationsOption

WithUserMigrationsAuthExtrasFS overrides go-users auth extras migrations.

func WithUserMigrationsAuthFS added in v0.19.0

func WithUserMigrationsAuthFS(fsys fs.FS) UserMigrationsOption

WithUserMigrationsAuthFS overrides the go-auth migrations filesystem (rooted at data/sql/migrations).

func WithUserMigrationsCoreEnabled added in v0.19.0

func WithUserMigrationsCoreEnabled(enabled bool) UserMigrationsOption

WithUserMigrationsCoreEnabled toggles go-users core migrations.

func WithUserMigrationsCoreFS added in v0.19.0

func WithUserMigrationsCoreFS(fsys fs.FS) UserMigrationsOption

WithUserMigrationsCoreFS overrides the go-users core migrations filesystem (rooted at data/sql/migrations).

func WithUserMigrationsNotificationPlacement added in v0.130.0

func WithUserMigrationsNotificationPlacement(order int, dependsOn ...string) UserMigrationsOption

WithUserMigrationsNotificationPlacement configures a permanent suffix-only placement for adopting notifications into an already persisted graph.

func WithUserMigrationsNotificationsEnabled added in v0.130.0

func WithUserMigrationsNotificationsEnabled(enabled bool) UserMigrationsOption

WithUserMigrationsNotificationsEnabled toggles the stable go-notifications migration source. It is enabled by default at order 50.

func WithUserMigrationsObserver added in v0.26.0

func WithUserMigrationsObserver(observer UserMigrationObserver) UserMigrationsOption

WithUserMigrationsObserver captures ordered migration registration steps.

func WithUserMigrationsProfile added in v0.26.0

func WithUserMigrationsProfile(profile UserMigrationsProfile) UserMigrationsOption

WithUserMigrationsProfile sets the canonical user migration registration profile.

func WithUserMigrationsValidationTargets added in v0.19.0

func WithUserMigrationsValidationTargets(targets ...string) UserMigrationsOption

WithUserMigrationsValidationTargets overrides validation targets used by go-persistence-bun.

type UserMigrationsProfile added in v0.26.0

type UserMigrationsProfile string

UserMigrationsProfile controls which migration sources are registered.

const (
	// UserMigrationsProfileCombined registers go-auth plus go-users core migrations.
	// Notifications are appended unless explicitly disabled.
	UserMigrationsProfileCombined UserMigrationsProfile = "combined"
	// UserMigrationsProfileAuthOnly registers go-auth followed by notifications
	// unless notifications are explicitly disabled.
	UserMigrationsProfileAuthOnly UserMigrationsProfile = "auth-only"
	// UserMigrationsProfileUsersStandalone registers go-users standalone tracks
	// followed by notifications unless explicitly disabled.
	UserMigrationsProfileUsersStandalone UserMigrationsProfile = "users-standalone"
)

type ViewEngineOption

type ViewEngineOption func(*viewEngineOptions)

ViewEngineOption customizes the view engine config.

func WithViewAdmin added in v0.131.10

func WithViewAdmin(adm *admin.Admin) ViewEngineOption

WithViewAdmin binds the exact normalized template stack to Admin's bounded structural-partial resolver during view-engine construction.

func WithViewAssetsFS

func WithViewAssetsFS(fsys ...fs.FS) ViewEngineOption

WithViewAssetsFS appends asset fallbacks.

func WithViewBasePath added in v0.24.0

func WithViewBasePath(basePath string) ViewEngineOption

WithViewBasePath sets the fallback admin base path used by template helpers (adminURL).

func WithViewDebug

func WithViewDebug(enabled bool) ViewEngineOption

WithViewDebug toggles view engine debug mode.

func WithViewDefaultLocale added in v0.52.0

func WithViewDefaultLocale(locale string) ViewEngineOption

WithViewDefaultLocale configures the fallback locale used by the default translation helpers when templates are rendered without request locale metadata.

func WithViewEmbed

func WithViewEmbed(enabled bool) ViewEngineOption

WithViewEmbed toggles embedded filesystem usage.

func WithViewExt

func WithViewExt(ext string) ViewEngineOption

WithViewExt sets the template extension.

func WithViewFeatureGate added in v0.20.0

func WithViewFeatureGate(gate fggate.FeatureGate, helperOpts ...fgtemplates.HelperOption) ViewEngineOption

WithViewFeatureGate registers feature template helpers using the provided gate.

func WithViewFiberV3TemplateFuncs added in v0.142.0

func WithViewFiberV3TemplateFuncs(funcs map[string]any) ViewEngineOption

WithViewFiberV3TemplateFuncs supplies v7 ports of application helpers. Overrides apply only to NewFiberV3ViewEngine and never alter the shared v2 function map.

func WithViewReload

func WithViewReload(enabled bool) ViewEngineOption

WithViewReload toggles template reload behavior.

func WithViewTemplateFuncs

func WithViewTemplateFuncs(funcs map[string]any) ViewEngineOption

WithViewTemplateFuncs overrides template functions.

func WithViewTemplatesFS

func WithViewTemplatesFS(fsys ...fs.FS) ViewEngineOption

WithViewTemplatesFS appends template overlays in precedence order. Earlier entries win over later overlays and the host base templates.

func WithViewTranslator added in v0.52.0

func WithViewTranslator(translator admin.Translator) ViewEngineOption

WithViewTranslator configures the default translation helpers exposed by the quickstart view engine.

func WithViewURLPrefix

func WithViewURLPrefix(prefix string) ViewEngineOption

WithViewURLPrefix sets the assets URL prefix.

func WithViewURLResolver added in v0.24.0

func WithViewURLResolver(urls urlkit.Resolver) ViewEngineOption

WithViewURLResolver sets the URLKit resolver used by template helpers.

type WorkflowBindingSpec added in v0.26.0

type WorkflowBindingSpec struct {
	ID          string `json:"id,omitempty" yaml:"id,omitempty"`
	ScopeType   string `json:"scope_type,omitempty" yaml:"scope_type,omitempty"`
	ScopeRef    string `json:"scope_ref,omitempty" yaml:"scope_ref,omitempty"`
	WorkflowID  string `json:"workflow_id,omitempty" yaml:"workflow_id,omitempty"`
	Priority    int    `json:"priority,omitempty" yaml:"priority,omitempty"`
	Status      string `json:"status,omitempty" yaml:"status,omitempty"`
	Environment string `json:"environment,omitempty" yaml:"environment,omitempty"`
}

WorkflowBindingSpec describes one canonical runtime binding in external config.

type WorkflowConfig added in v0.25.0

type WorkflowConfig struct {
	SchemaVersion int                               `json:"schema_version,omitempty" yaml:"schema_version,omitempty"`
	Workflows     map[string]WorkflowDefinitionSpec `json:"workflows,omitempty" yaml:"workflows,omitempty"`
	Bindings      []WorkflowBindingSpec             `json:"bindings,omitempty" yaml:"bindings,omitempty"`
	TraitDefaults map[string]string                 `json:"trait_defaults,omitempty" yaml:"trait_defaults,omitempty"`
}

WorkflowConfig captures external workflow definitions and trait workflow defaults.

func DefaultWorkflowConfig added in v0.25.0

func DefaultWorkflowConfig() WorkflowConfig

DefaultWorkflowConfig returns an empty config with current schema version.

func LoadWorkflowConfigFile added in v0.25.0

func LoadWorkflowConfigFile(path string) (WorkflowConfig, error)

LoadWorkflowConfigFile parses a JSON/YAML workflow config file.

func MergeWorkflowConfigs added in v0.25.0

func MergeWorkflowConfigs(base WorkflowConfig, override WorkflowConfig) WorkflowConfig

MergeWorkflowConfigs merges two configs where override values win.

func NormalizeWorkflowConfig added in v0.25.0

func NormalizeWorkflowConfig(cfg WorkflowConfig) WorkflowConfig

NormalizeWorkflowConfig normalizes config maps and scalar fields.

func ParseWorkflowConfigContents added in v0.25.0

func ParseWorkflowConfigContents(raw []byte, ext string) (WorkflowConfig, error)

ParseWorkflowConfigContents parses JSON/YAML workflow config contents.

type WorkflowConfigValidationError added in v0.25.0

type WorkflowConfigValidationError struct {
	Issues []WorkflowConfigValidationIssue `json:"issues"`
}

WorkflowConfigValidationError aggregates config validation issues.

func (WorkflowConfigValidationError) Error added in v0.25.0

func (WorkflowConfigValidationError) Is added in v0.25.0

type WorkflowConfigValidationIssue added in v0.25.0

type WorkflowConfigValidationIssue struct {
	Field   string `json:"field"`
	Message string `json:"message"`
}

WorkflowConfigValidationIssue reports one actionable field-level validation issue.

type WorkflowDefinitionSpec added in v0.25.0

type WorkflowDefinitionSpec struct {
	ID             string                   `json:"id,omitempty" yaml:"id,omitempty"`
	MachineVersion string                   `json:"machine_version,omitempty" yaml:"machine_version,omitempty"`
	InitialState   string                   `json:"initial_state,omitempty" yaml:"initial_state,omitempty"`
	Transitions    []WorkflowTransitionSpec `json:"transitions,omitempty" yaml:"transitions,omitempty"`
}

WorkflowDefinitionSpec describes one workflow definition declared in config. The map key under WorkflowConfig.Workflows is treated as workflow ID unless ID is set.

type WorkflowTransitionSpec added in v0.25.0

type WorkflowTransitionSpec struct {
	Name        string `json:"name,omitempty" yaml:"name,omitempty"`
	Description string `json:"description,omitempty" yaml:"description,omitempty"`
	From        string `json:"from,omitempty" yaml:"from,omitempty"`
	To          string `json:"to,omitempty" yaml:"to,omitempty"`
	Guard       string `json:"guard,omitempty" yaml:"guard,omitempty"`
}

WorkflowTransitionSpec describes one workflow transition in external config.

Source Files

Directories

Path Synopsis
Package admincontract provides reusable repository contract assertions.
Package admincontract provides reusable repository contract assertions.
cmd
examples
fiber-v3-presentation command
Command fiber-v3-presentation previews presentation inputs in a standalone native app.
Command fiber-v3-presentation previews presentation inputs in a standalone native app.
rpccontract
Package rpccontract is an executable consumer example, not an application helper API.
Package rpccontract is an executable consumer example, not an application helper API.
internal
Package site implements public-site delivery on top of go-admin CMS records.
Package site implements public-site delivery on top of go-admin CMS records.

Jump to

Keyboard shortcuts

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