Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
…dd integration test for endpoint management
…pointsController and update tests accordingly
… update APIController to use new auth method
…eController; update APIController to use generic auth method
…thod and using direct exception messages
…o implement configureBrtcAuth for BRTC endpoints
…equest errors in BaseController
…and remove global basic auth interference
…prove cURL initialization
…d streamline authorization header setup
…uth to prevent interference with API requests
…e APIController references
…ve array for clarity
…ody::form for improved request handling
…g format for consistency
…ride during token requests
…pe in BaseController
| */ | ||
| protected function configureAuth(&$headers, $authType) | ||
| { | ||
| if (!empty($this->config->getAccessToken()) && |
There was a problem hiding this comment.
why is all of this deleted? removing this is essentially removing OAuth support from every endpoint in the SDK, which we definitely do not want to do. All of this needs to be brought back, BRTC should be able to use this in its API calls to also support OAuth. We'll probably need to set up the username/password stuff in the configuration and then add logic to the configure auth function to set those as a fallback
src/Controllers/BaseController.php
Outdated
| * | ||
| * @param array $headers The headers for the request (passed by reference) | ||
| */ | ||
| protected function configureOAuth2Auth(&$headers) |
There was a problem hiding this comment.
this is unnecessary, the SDK already supports OAuth, so we don't need a BRTC specific oauth function, we need to remove this and use the pre-existing logic that was in the configureAuth function
|
|
||
| require_once "Verb.php"; | ||
|
|
||
| class Connect extends Verb { |
There was a problem hiding this comment.
this is missing the eventCallbackUrl attribute
src/Voice/Bxml/Connect.php
Outdated
|
|
||
| class Connect extends Verb { | ||
| /** | ||
| * @var array |
There was a problem hiding this comment.
| * @var array | |
| * @var array(Endpoint) |
src/Voice/Bxml/Connect.php
Outdated
| */ | ||
| public function toBxml(DOMDocument $doc): DOMElement { | ||
| $element = $doc->createElement("Connect"); | ||
| foreach ($this->endpoints as $endpoint) { |
There was a problem hiding this comment.
id like to add the isset check we do in other verbs here
tests/ApiTest.php
Outdated
| $this->assertNotNull($createResp->endpointId); | ||
| $this->assertEquals('WEBRTC', $createResp->type); |
There was a problem hiding this comment.
we need to be asserting as many fields on the response as possible, feel free to copy what i did for the tn lookup tests
tests/ApiTest.php
Outdated
| $this->assertEquals('WEBRTC', $createResp->type); | ||
|
|
||
| // List endpoints | ||
| try { |
There was a problem hiding this comment.
same as above for the try catch and including more assertions
tests/ApiTest.php
Outdated
| $this->assertContains($createResp->endpointId, $ids, 'Created endpoint should be in list'); | ||
|
|
||
| // Get endpoint | ||
| try { |
tests/ApiTest.php
Outdated
| // $voiceClient->updateEndpointBxml($accountId, $createResp->endpointId, $bxml); | ||
|
|
||
| // Delete endpoint | ||
| try { |
tests/ApiTest.php
Outdated
| $this->assertEquals(204, $deleteResp->getStatusCode()); | ||
| } | ||
|
|
||
| public function testCreateEndpointResponseFields() { |
There was a problem hiding this comment.
this and every test after are all unnecessary, we need to be asserting as many fields as possible in our 1 test run, like I mentioned in one of the other SDKs, these tests are strictly to test the SDK functionality, not the API.
- Restore original configureAuth with OAuth2 client_credentials support that was accidentally deleted; remove redundant configureOAuth2Auth - Move all BRTC endpoints out of Voice controller into new src/BRTC/ module with its own BRTCClient and APIController - Add BRTCDEFAULT server URL constant and configuration mapping - Register getBRTC() accessor on BandwidthClient - Fix Connect BXML: add eventCallbackUrl attribute, isset guards, correct @var doc to array(Endpoint) - Fix Endpoint BXML: rename property to endpointId, render as text content (createTextNode) instead of XML attribute - Fix BXML test expected output for Endpoint text content - Create proper response wrapper models matching API spec: CreateEndpointResponse (links/data/errors), CreateEndpointResponseData (with token field), EndpointResponse, ListEndpointsResponse (with page), Endpoints (list summary without devices) - Fix Device model fields: deviceId, deviceName, status, creationTimestamp (matching Python SDK spec) - Fix Endpoint model fields to match spec: endpointId, type, status, creationTimestamp, expirationTimestamp, tag, devices - Fix EndpointEvent model to match spec: add eventTime, eventType, device; remove fabricated fields - Fix CreateEndpointRequest: direction is required (no null default), add connectionMetadata field - Replace ErrorResponse with ErrorObject (type, description) - Replace Page with spec-correct fields (pageSize, totalElements, totalPages, pageNumber) - Remove Enums.php (use plain strings per SDK convention) - Add Link model for BRTC responses - Fix listEndpoints to accept explicit query params (type, status, direction, pageToken, pageSize) following getMessages pattern - All BRTC API methods use configureAuth and BRTCDEFAULT server URL - Update smoke tests to use BRTC client and wrapped response models Generated from Claude9 with Claude Code Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Removed all try/catch wrappers from BRTC API calls — let tests fail naturally on exceptions, matching the pattern used by TN lookup and other existing smoke tests - Removed 6 redundant test methods (testCreateEndpointResponseFields, testGetEndpointFields, testListEndpointsContainsCreated, testListEndpointsEachItemIsEndpointsInstance, testCreateMultipleEndpointsAndDeleteAll, testDeleteEndpointRemovedFromList) - Consolidated all assertions into testCreateListGetDeleteEndpoint following the create → list → get → delete flow - Added thorough field assertions on each response (status, creationTimestamp, expirationTimestamp, tag, first list element) Generated from Claude9 with Claude Code Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
No description provided.