Skip to content

Soprano omnimsg contract + provider-token (oauth2 / managed-identity) auth - #4

Open
Hou (SciencePotato) wants to merge 5 commits into
mainfrom
epp-provider-token
Open

Soprano omnimsg contract + provider-token (oauth2 / managed-identity) auth#4
Hou (SciencePotato) wants to merge 5 commits into
mainfrom
epp-provider-token

Conversation

@SciencePotato

Copy link
Copy Markdown
Collaborator

Summary

Adds Soprano's omnimsg delivery contract and provider-token (Entra JWT) auth across all three samples (JavaScript, Python, .NET), rebased cleanly onto main.

Changes

  • Soprano → /messages/omnimsg: single endpoint for SMS and voice via messageTypes; FILTERED mapped to Fail; null-safe destination; shutter-mode diagnostics note.
  • Envelope hardening: reject unknown envelope type; refuse an expired passcode (ttlSeconds <= 0).
  • Provider-token auth (new): the function mints its own app-only Entra JWT (client-credentials) for the provider API and sends it as a Bearer token — never the caller's inbound token.
    • Selectable via EPP_PROVIDER_AUTH_MODE=oauth2.
    • EPP_PROVIDER_MI_CLIENT_ID enables secretless workload-identity federation (managed identity federated on our app); otherwise a client secret is used.
    • Issuer = our app (EPP_PROVIDER_CLIENT_ID), authority = provider tenant (EPP_PROVIDER_TENANT_ID), audience = provider app (EPP_PROVIDER_SCOPE).
    • Fail-closed: no token → no delivery.
  • Consistent across JavaScript, Python and .NET, with tests and the docs/local.settings.sample.json contract updated.

Tests

  • JavaScript: 41 passing
  • Python: 29 passing
  • .NET: 28 passing

Hou Chi Chan added 5 commits August 28, 2026 13:07
One endpoint for every channel: POST {base}/messages/omnimsg with text/destination/messageTypes/correlationId/shutterMode. Soprano renders voice TTS from the same text, so the text2voice block and the provisioned-source fields go away; destination is E.164 without the leading +. SOPRANO_SHUTTER_MODE opts into Soprano-side shutter for connectivity tests.
QA4 answers 201 with status FILTERED when an account/destination filter stops delivery, on both the omnimsg and the legacy per-channel path. Pin it instead of leaning on the fail-closed default.
Adds an omnimsg payload test per language (endpoint, messageTypes, destination without the leading +, passcode in text) - the rewrite previously rode on suites that never asserted the new shape. Makes the .NET destination null-safe like the other two, and strips every leading + in JavaScript so all three agree. Documents SOPRANO_SHUTTER_MODE as diagnostics-only, since a 2xx with a matching nonce stops SAS falling back, and records that Soprano voice ignores locale.
Two deviations from the CYOT endpoint contract. The type field was parsed and logged but never validated, so a future contract version would have been interpreted as v1; it is now pinned per language. ttlSeconds <= 0 was logged and delivered anyway, which spends a message on a code that can no longer authenticate; all three now return 400 and dispatch nothing. CONTRACT.md said the old behaviour was intended, so it is corrected alongside.
… federation)

Mint an app-only Entra JWT for the provider API (issuer our app, audience the provider app) and send it as a Bearer token, selectable via EPP_PROVIDER_AUTH_MODE=oauth2. EPP_PROVIDER_MI_CLIENT_ID enables secretless workload-identity federation; otherwise a client secret is used. Consistent across JavaScript, Python and .NET, with tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant