Skip to content

feat: define token-type-dependent phoneNumber handling for registration POST /sessions (#158) - #1

Closed
deepakjaiswal1 wants to merge 1 commit into
mainfrom
feat/issue-158-registration-phonenumber
Closed

deepakjaiswal1 wants to merge 1 commit into
mainfrom
feat/issue-158-registration-phonenumber

Conversation

@deepakjaiswal1

Copy link
Copy Markdown
Owner

What

Adds an optional phoneNumber field to the create-registration request body (POST /sessions) and defines how the subscriber is identified for both access-token types, with strict validation.

Why

Resolves camaraproject#158. WebRTC registrations target softphones, which are decoupled from any SIM, so a single deviceId can be associated with multiple numbers (e.g. an enterprise activating one number from its pool on a user's device). In the CAMARA model an access token resolves to at most one subscriber identity:

  • A three-legged token carries the subscriber identity, so the operator resolves the phoneNumber server-side.
  • A two-legged token carries no subscriber identity, so the API consumer must state the phoneNumber explicitly.

Previously the spec only covered the three-legged case, leaving no way to register a specific number under a two-legged token.

Changes

  • New optional phoneNumber property in RegSessionRequest (references the existing PhoneNumber schema; remains out of required).
  • POST /sessions description updated to specify token-type-dependent behaviour.
  • New 422 response (CreateSessionUnprocessable422) with codes MISSING_IDENTIFIER and UNNECESSARY_IDENTIFIER, referenced from POST /sessions.
  • Uniqueness-constraint wording generalised so the phoneNumber source is correct for both token types.

Behaviour (strict)

  • Three-legged: phoneNumber MUST NOT be in the body (resolved from token) → 422 UNNECESSARY_IDENTIFIER if present.
  • Two-legged: phoneNumber MUST be in the body → 422 MISSING_IDENTIFIER if omitted.

Rejecting (rather than validating) a body phoneNumber under a three-legged token also prevents the endpoint from being used as an MSISDN lookup/verification oracle.

Compatibility

Non-breaking. phoneNumber did not previously exist in the request body, so no existing client could have been sending it; the new 422 rules therefore cannot reject previously-valid requests. The existing (deviceId, phoneNumber) uniqueness model and 409 ALREADY_EXISTS behaviour are unchanged.

…on POST /sessions (camaraproject#158)

dds an optional phoneNumber field to POST /sessions and defines token-type-dependent subscriber identification.

- Three-legged token: phoneNumber resolved from token, MUST NOT be in body (422 UNNECESSARY_IDENTIFIER).
- Two-legged token: phoneNumber MUST be in body (422 MISSING_IDENTIFIER).

Adds the optional phoneNumber property and the CreateSessionUnprocessable422 response. Existing (deviceId, phoneNumber) uniqueness and 409 behaviour unchanged.

Signed-off-by: Deepak Jaiswal <deepak.jaiswal1@t-mobile.com>
@github-actions

Copy link
Copy Markdown

CAMARA Validation — FAIL

1 errors, 2 warnings, 30 hints | Profile: standard

View full results

@deepakjaiswal1

Copy link
Copy Markdown
Owner Author

Closing — opening against camaraproject/main.

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.

Clarification regarding multiple phoneNumbers registration

1 participant