How onellan/tockrplatform works
Tockr Platform is a shared authority for identity, tenancy, and product access. Its primary runtime flow is user sign-in and session-protected account and tenancy management, backed by SQLite; it also exposes signed read-authority snapshots and change feeds to consumers. A separate operator workflow turns normalized inventory into a report and signed manifest, then supports protected import operations. The README documents the authority boundaries; sampled source confirms server startup, session persistence, read-authority endpoints, and parts of the import path, but not every handler’s wiring.
Main entry points: server.go HTTP handlers · store.go SQLite persistence · identity.go Store interfaces · read_authority.go Read-authority API
Components 26
Platform runtime
- HTTP service
cmd/platform/main.go - HTTP handlers
internal/platform/http/server.go - Admin UI
internal/platform/http/admin_ui.go - Platform UI
internal/platform/http/platform_ui.go - Web templates
web/templates/auth_templ.go - Store interfaces
internal/store/identity.go - SQLite persistence
internal/db/sqlite/store.go
Identity and access
- Authentication and MFA
internal/auth/token.go - Identity data
internal/domain/user.go - Organisation and workspace
internal/domain/workspace.go - Membership commands
internal/platform/http/membership_command.go - Product access
internal/domain/product_access.go - Audit and events
internal/events/event.go - Access assertions
internal/platform/assertion/assertion.go
Read authority
- Read-authority API
internal/platform/http/read_authority.go - Read-authority contract
internal/platform/readauthority/contract.go - Snapshot persistence
internal/db/sqlite/platform_read_authority.go - Consumer integration
internal/platform/assertion/consumer.go
Reconciliation
- Inventory proposal
cmd/platform-reconcile/main.go - Reconciliation logic
internal/platform/reconciliation/reconciliation.go - Manifest signing
cmd/platform-manifest/main.go - Protected import
cmd/platform-import/main.go - Production reconciliation
internal/platform/reconciliation/production.go
Other components
- Platform user
- Platform consumer
- Operator
Connections 31
- Platform user → HTTP handlers: submits requests
- HTTP service → SQLite persistence: opens database
- HTTP service → HTTP handlers: starts server
- HTTP service → Access assertions: configures issuer
- HTTP handlers → Authentication and MFA: validates credentials
- HTTP handlers → Store interfaces: manages sessions
- HTTP handlers → Store interfaces: changes tenancy
- HTTP handlers → Store interfaces: checks access
- HTTP handlers → Web templates: renders pages
- HTTP handlers → Admin UI: dispatches admin routes
- HTTP handlers → Platform UI: dispatches platform routes
- Membership commands → Store interfaces: submits commands
- Store interfaces → SQLite persistence: persists data
- SQLite persistence → Identity data: stores identities
- SQLite persistence → Organisation and workspace: stores tenancy
- SQLite persistence → Product access: stores entitlements
- SQLite persistence → Audit and events: records events
- Platform consumer → Read-authority API: requests snapshots
- Read-authority API → Read-authority contract: validates protocol
- Read-authority API → Store interfaces: reads snapshots
- Read-authority API → Store interfaces: reads changes
- Store interfaces → Snapshot persistence: loads snapshot records
- Snapshot persistence → SQLite persistence: queries Platform data
- Consumer integration → Access assertions: verifies assertions
- Operator → Inventory proposal: provides inventory
- Inventory proposal → Reconciliation logic: builds report
- Operator → Manifest signing: approves manifest
- Manifest signing → Reconciliation logic: builds and signs
- Operator → Protected import: requests operation
- Protected import → Production reconciliation: executes import
- Production reconciliation → SQLite persistence: applies changes