3.0 KiB
3.0 KiB
Secret API Backend (secretapi)
Deterministic backend for wallet-first designation, membership activation, and governance install authorization.
Run
cd /Users/vsg/Documents/VSG\ Codex/web/backend/secretapi
go run .
Default listen address is :8080.
Test
cd /Users/vsg/Documents/VSG\ Codex/web/backend/secretapi
go test ./...
Endpoint Surface
Membership
POST /secret/wallet/intentPOST /secret/wallet/verifyPOST /secret/membership/quotePOST /secret/membership/confirmGET /secret/membership/status
Governance install + availability
POST /governance/install/tokenPOST /governance/install/confirmGET /governance/install/statusPOST /governance/lease/heartbeatPOST /governance/lease/offline-renew
Member app channel
POST /member/channel/device/registerPOST /member/channel/device/unregisterGET /member/channel/eventsPOST /member/channel/events/{event_id}/ackPOST /member/channel/support/ticket
Sponsorship Behavior
Membership quote supports ownership wallet and distinct payer wallet:
address: ownership wallet (required)payer_wallet: optional payer walletpayer_proof: required when payer differs from owner
Distinct payer proof uses owner-signed personal message:
EDUT-PAYER-AUTH:{designation_code}:{owner_wallet}:{payer_wallet}:{chain_id}
This enables company-sponsored mint flows while preserving deterministic owner authorization.
Company-first sponsor path is also supported:
- If
sponsor_org_root_idis provided and thepayer_walletis a storedorg_root_ownerprincipal for that org root with active entitlement status, quote issuance is allowed withoutpayer_proof.
Key Environment Variables
Core
SECRET_API_LISTEN_ADDR(default:8080)SECRET_API_DB_PATH(default./secret.db)SECRET_API_ALLOWED_ORIGIN(defaulthttps://edut.ai)SECRET_API_MEMBER_POLL_INTERVAL_SECONDS(default30)SECRET_API_CHAIN_ID(default84532)SECRET_API_CHAIN_RPC_URL(optional, enables on-chain tx receipt verification)SECRET_API_REQUIRE_ONCHAIN_TX_VERIFICATION(defaultfalse; whentrue, membership confirm fails closed without chain receipt verification)
Membership
SECRET_API_INTENT_TTL_SECONDS(default900)SECRET_API_QUOTE_TTL_SECONDS(default900)SECRET_API_DOMAIN_NAMESECRET_API_VERIFYING_CONTRACTSECRET_API_MEMBERSHIP_CONTRACTSECRET_API_MINT_CURRENCY(defaultETH)SECRET_API_MINT_AMOUNT_ATOMIC(default5000000000000000)SECRET_API_MINT_DECIMALS(default18)
Governance install
SECRET_API_INSTALL_TOKEN_TTL_SECONDS(default900)SECRET_API_LEASE_TTL_SECONDS(default3600)SECRET_API_OFFLINE_RENEW_TTL_SECONDS(default2592000)SECRET_API_GOV_RUNTIME_VERSIONSECRET_API_GOV_PACKAGE_URLSECRET_API_GOV_PACKAGE_HASHSECRET_API_GOV_PACKAGE_SIGNATURESECRET_API_GOV_SIGNER_KEY_IDSECRET_API_GOV_POLICY_HASHSECRET_API_GOV_ROLLOUT_CHANNEL(defaultstable)