feat: Enhance SMS import client with JWT diagnostics and error handling - #45
Conversation
…or handling for authorization
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (4)
Disabled knowledge base sources:
📝 WalkthroughSummary by CodeRabbit
WalkthroughThis PR adds JWT-based diagnostics and expiry checks to the mobile app's SMS import client and auth utilities, and introduces structured failure codes to the web server's SMS import authentication library and endpoint, propagating auth error codes through API responses. ChangesSMS Import Auth Diagnostics and Coded Failures
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant App as Mobile App
participant Client as smsImportClient
participant API as Import API
App->>Client: postSmsImportBody(messages)
Client->>Client: getTokenDiagnostics(accessToken)
Client->>API: POST /sms-import (apikey if available)
API-->>Client: response (ok or 401)
alt non-OK response
Client->>Client: log warn with tokenDiagnostics
Client->>Client: mapApiError(status, payload)
else ok
Client->>Client: log warn (request ok)
end
Client-->>App: result or SmsImportClientError
sequenceDiagram
participant Client
participant Endpoint as sms-import.post.ts
participant Auth as authenticateSmsImportRequest
Client->>Endpoint: POST /api/v1/sms-import
Endpoint->>Endpoint: readAuthorizationHeader(event)
Endpoint->>Auth: authenticateSmsImportRequest(header, body)
Auth-->>Endpoint: AuthResult (ok or error with code)
alt auth failed
Endpoint-->>Client: jsonResponse {error, code}
else auth ok
Endpoint-->>Client: process import
end
Possibly related PRs
Suggested labels: Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
❌ TypeScript errors ( |
No description provided.