admin

package
v1.801.150 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2026 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Overview

Package admin mounts the god-mode admin surface (/v1/admin/*) the Hanzo Admin Console (admin.hanzo.ai, apps/operator) calls, per the api.ts contract.

It is an AGGREGATOR, not a new store: identity (orgs/users/roles/applications/audit/me) is read from IAM, the money panels (spend/tokens/credits) from commerce, and System Health from o11y — every one a real upstream. The facade fans out over HTTP, shaping the reads into the /v1 envelope { status, msg, data, data2 } the operator's transport decodes.

The subsystem is decomposed into a shared kernel (clients/admin/core) plus one package per handler domain (audit/customer/revenue/finance). This file is the Mount: it builds the ONE core.State from Deps, then registers each domain's routes alongside the top-level reads (me/overview/orgs/users/usage/roles/applications/products/compute/o11y/ analytics/bases + the flags/waitlist control plane).

SECURITY — TWO tiers off ONE identity predicate, both fail-closed. PLATFORM routes are SuperAdmin ONLY (core.Guard). ORG-SCOPED routes (me/overview/orgs/users/usage/analytics/ bases) are core.GuardScoped: a SuperAdmin sees EVERY tenant; any other validated admin caller is HARD-limited to their OWN org subtree by core.ResolveScope/ScopedOrgs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mount

func Mount(app *zip.App, deps cloud.Deps) error

Mount registers the /v1/admin/* surface on app. Every handler gates on c.IsAdmin() first (via core.Guard/GuardScoped), then aggregates real upstream data.

The state is built from Deps fields NOT on cloud.Base (deps.Audit, deps.IAMIssuer), so it constructs the cloud.Service value directly (cloud.NewBase + &cloud.Service[core.State]{…}) rather than via cloud.Mount.

Types

This section is empty.

Directories

Path Synopsis
Package audit is the /v1/admin/audit query surface, wired to cloud's REAL tamper-evident audit store (the audit.Recorder Serve builds and hands over via deps.Audit).
Package audit is the /v1/admin/audit query surface, wired to cloud's REAL tamper-evident audit store (the audit.Recorder Serve builds and hands over via deps.Audit).
Package commerce is the admin cockpit's typed reader for the commerce billing plane.
Package commerce is the admin cockpit's typed reader for the commerce billing plane.
Package core is the shared kernel of the admin subsystem: the resolved upstream clients (State) plus the one-copy business primitives every admin domain composes — the two-tier gate, the /v1 envelope writers, the tenant-scope predicate, the IAM fan-in, the single credit-grant path, the tamper-evident audit emit, and the fleet activity/time-series model.
Package core is the shared kernel of the admin subsystem: the resolved upstream clients (State) plus the one-copy business primitives every admin domain composes — the two-tier gate, the /v1 envelope writers, the tenant-scope predicate, the IAM fan-in, the single credit-grant path, the tamper-evident audit emit, and the fleet activity/time-series model.
Package customer is the CUSTOMER management surface (/v1/admin/customers*) — the operator cockpit's core: the live fleet customer list (incl.
Package customer is the CUSTOMER management surface (/v1/admin/customers*) — the operator cockpit's core: the live fleet customer list (incl.
Package do reads DigitalOcean's billing API for the finance dashboard's cost side.
Package do reads DigitalOcean's billing API for the finance dashboard's cost side.
Package finance is the SaaS business/finance dashboard (/v1/admin/finance) — the profitability panel: what we pay every vendor (COGS), what we earn, the gross margin, how fast we're burning the DigitalOcean promo credit, and the runway that credit + burn imply.
Package finance is the SaaS business/finance dashboard (/v1/admin/finance) — the profitability panel: what we pay every vendor (COGS), what we earn, the gross margin, how fast we're burning the DigitalOcean promo credit, and the runway that credit + burn imply.
Package health probes an upstream's health endpoint (e.g.
Package health probes an upstream's health endpoint (e.g.
Package iam is the admin cockpit's typed reader for the Hanzo IAM management surface (/v1/iam/get-*).
Package iam is the admin cockpit's typed reader for the Hanzo IAM management surface (/v1/iam/get-*).
Package invoices is the fleet INVOICE view (/v1/admin/invoices) — every issued invoice across every tenant: number, org, amount, status, issue + due date, plus the id a future detail view fetches /v1/billing/invoices/:id with.
Package invoices is the fleet INVOICE view (/v1/admin/invoices) — every issued invoice across every tenant: number, org, amount, status, issue + due date, plus the id a future detail view fetches /v1/billing/invoices/:id with.
Package metrics is the fleet SaaS-operations god-view (/v1/admin/metrics) — the operator's business dashboard: MRR/ARR, net-new vs churned MRR, the plan/category mix, the top customers, and the recent subscription movements.
Package metrics is the fleet SaaS-operations god-view (/v1/admin/metrics) — the operator's business dashboard: MRR/ARR, net-new vs churned MRR, the plan/category mix, the top customers, and the recent subscription movements.
Package money is the admin cockpit's one billing unit: USD cents as a typed value, so no field or method anywhere has to spell "Cents" again and a dollar amount can never be silently passed where cents are meant.
Package money is the admin cockpit's one billing unit: USD cents as a typed value, so no field or method anywhere has to spell "Cents" again and a dollar amount can never be silently passed where cents are meant.
Package revenue is the fleet REVENUE aggregate (/v1/admin/revenue) — the operator's money board: total prepaid balances held, total realized spend, MRR, a per-customer revenue table, ARPU, and a real spend trend.
Package revenue is the fleet REVENUE aggregate (/v1/admin/revenue) — the operator's money board: total prepaid balances held, total realized spend, MRR, a per-customer revenue table, ARPU, and a real spend trend.
Package subscriptions is the fleet SUBSCRIPTION view (/v1/admin/subscriptions) — every tenant's plan subscription: customer/org, plan, status, monthly-normalized MRR, and the current-period start/renews.
Package subscriptions is the fleet SUBSCRIPTION view (/v1/admin/subscriptions) — every tenant's plan subscription: customer/org, plan, status, monthly-normalized MRR, and the current-period start/renews.

Jump to

Keyboard shortcuts

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