Skip to main content

Developer Portal Service — Domain Model

Version: 1.0 Status: Draft Owner: Product + Developer Relations (DevRel) Last Updated: 2026-04-20 Companion: SERVICE_OVERVIEW · API_CONTRACTS · EVENT_SCHEMAS


1. Intent

Define the aggregates, entities, value objects, and invariants that the Developer Portal owns. The portal is the developer-facing surface for documentation, sandbox, self-serve API key management, consumption analytics, SDK distribution, and the managed Verify API. Identity and key secret material remain in auth-service; this service stores only metadata and orchestration state.

2. Aggregates

  • DeveloperAccountTBD (linked 1:1 with auth-service Account; profile, default tenant, locale, MFA preference)
  • ApiKey (metadata)TBD (env, scopes, label, last-used; secret stored in auth-service)
  • SandboxSessionTBD
  • VerifySessionTBD (verificationId, channelOrder, currentChannel, attempts, expiresAt, codeHash)
  • VerifyTemplateTBD
  • SdkReleaseTBD
  • DocsArticleTBD

3. Entities

  • TBD

4. Value Objects

  • ChannelSMS | VOICE | WHATSAPP | EMAILTBD
  • Localeen | ps | faTBD
  • EnvironmentSANDBOX | PRODUCTIONTBD
  • VerifyStatePENDING | DELIVERED | APPROVED | FAILED | EXPIREDTBD

5. Invariants

  • API key secret material is never persisted in devportal Postgres — only prefix + metadata. TBD
  • Verify code is stored as HMAC-SHA-256(code, server-pepper), never plaintext. TBD
  • A VerifySession cannot transition out of a terminal state (APPROVED | FAILED | EXPIRED). TBD
  • attempts is monotonically non-decreasing within a session. TBD

6. Domain Events

  • devportal.key.created.v1TBD
  • devportal.key.revoked.v1TBD
  • devportal.verify.requested.v1TBD
  • devportal.verify.delivered.v1TBD
  • devportal.verify.approved.v1TBD
  • devportal.verify.failed.v1TBD
  • devportal.verify.spend_cap_hit.v1TBD
  • devportal.sdk.released.v1TBD
  • devportal.sdk.downloaded.v1TBD

7. Aggregate Boundaries

TBD (write boundaries, transactional consistency surfaces, references to other aggregates by id only).

8. Glossary

TBD