-
Notifications
You must be signed in to change notification settings - Fork 10
VAPI-2823 Implement BRTC Endpoints API with models, controllers, and tests #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
smoghe-bw
wants to merge
34
commits into
main
Choose a base branch
from
brtc-sdks
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 27 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
bf81c1a
Implement BRTC Endpoints API with models, controllers, and tests
smoghe-bw e4e4382
Refactor Connect and Endpoint classes to make toBxml method public; a…
smoghe-bw 69f3305
Refactor APIController to integrate BRTC endpoint methods; remove End…
smoghe-bw 3c425ff
Update APIController to use PHONENUMBERLOOKUPDEFAULT server for endpo…
smoghe-bw e77d05d
Add error handling for createEndpoint in ApiTest to improve test reli…
smoghe-bw 8bcf942
Refactor ApiTest to use endpointClient for endpoint-related tests
smoghe-bw c5a405a
Trigger build
smoghe-bw 8ceb7c7
Add BRTC OAuth2 token management to Configuration and BaseController;…
smoghe-bw b404ff9
Remove BRTC OAuth2 access token management from Configuration and Bas…
smoghe-bw 2424fa7
Refactor ApiTest to simplify error handling by removing apiFailMsg me…
smoghe-bw f625ed8
Trigger build
smoghe-bw d477bd1
Fix authorization header configuration in BaseController for token ma…
smoghe-bw 13f7408
Refactor authentication methods in BaseController and APIController t…
smoghe-bw c516d6d
Clear global basic auth before BRTC token exchange and handle token r…
smoghe-bw ef6edf9
Simplify token request body format in BaseController for BRTC authent…
smoghe-bw 3d8f45a
Refactor BRTC token exchange to use cURL for improved error handling …
smoghe-bw 741accb
Refactor configureBrtcAuth to streamline access token handling and im…
smoghe-bw 8eb21da
Refactor configureBrtcAuth to remove access token expiration check an…
smoghe-bw d4b7b47
Clear global Basic auth before setting Bearer token in configureBrtcA…
smoghe-bw d7d9913
Rename configureBrtcAuth to configureOAuth2Auth for clarity and updat…
smoghe-bw dcd3fee
Refactor grant_type parameter in configureOAuth2Auth to use associati…
smoghe-bw 486744b
Remove User-Agent header from OAuth2 token request for cleaner API calls
smoghe-bw f21f31a
Refactor grant_type parameter in configureOAuth2Auth to use Request\B…
smoghe-bw c7f870b
Update grant_type parameter in configureOAuth2Auth to use query strin…
smoghe-bw c7433fb
Clear global Basic auth in configureOAuth2Auth to prevent header over…
smoghe-bw ad2c358
Refactor endpoint properties and update API response handling for con…
smoghe-bw 107f54f
Update authentication handling to use Request\Body::form for grant_ty…
smoghe-bw 65ddbd7
Address PR review feedback: restructure BRTC into own module
8e3edc2
Remove try/catch blocks from BRTC tests and consolidate into single test
9682727
Add BRTC model unit tests and strengthen API/BXML test assertions
eb39a00
Fix models to match BRTC API spec: query params, Link, and ErrorObject
5de91da
Fix integration test: don't assert links array is non-empty
fd6acde
Remove BRTC model unit tests
09ebf21
Fix array_filter bug in BRTC models and improve test reliability
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,3 +4,4 @@ composer.lock | |
| .phpunit.result.cache | ||
| composer.phar | ||
| .idea | ||
| .env* | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| <?php | ||
| /** | ||
| * Connect.php | ||
| * | ||
| * Implementation of the BXML Connect verb for BRTC endpoints | ||
| * | ||
| * @copyright Bandwidth INC | ||
| */ | ||
|
|
||
| namespace BandwidthLib\Voice\Bxml; | ||
|
|
||
| use DOMDocument; | ||
| use DOMElement; | ||
|
|
||
| require_once "Verb.php"; | ||
|
|
||
| class Connect extends Verb { | ||
|
smoghe-bw marked this conversation as resolved.
|
||
| /** | ||
| * @var array | ||
|
smoghe-bw marked this conversation as resolved.
Outdated
|
||
| */ | ||
| private $endpoints; | ||
|
|
||
| /** | ||
| * @param array $endpoints Array of Endpoint objects | ||
| */ | ||
| public function __construct(array $endpoints = []) { | ||
| $this->endpoints = $endpoints; | ||
| } | ||
|
|
||
| /** | ||
| * Add an Endpoint to the Connect verb | ||
| * | ||
| * @param Endpoint $endpoint | ||
| * @return $this | ||
| */ | ||
| public function addEndpoint(Endpoint $endpoint): Connect { | ||
| $this->endpoints[] = $endpoint; | ||
| return $this; | ||
| } | ||
|
|
||
| /** | ||
| * Converts the Connect verb into a DOMElement | ||
| * | ||
| * @param DOMDocument $doc | ||
| * @return DOMElement | ||
| */ | ||
| public function toBxml(DOMDocument $doc): DOMElement { | ||
| $element = $doc->createElement("Connect"); | ||
| foreach ($this->endpoints as $endpoint) { | ||
|
smoghe-bw marked this conversation as resolved.
Outdated
|
||
| $element->appendChild($endpoint->toBxml($doc)); | ||
| } | ||
| return $element; | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| <?php | ||
| /** | ||
| * Endpoint.php | ||
| * | ||
| * Implementation of the BXML Endpoint verb for BRTC endpoints | ||
| * | ||
| * @copyright Bandwidth INC | ||
| */ | ||
|
|
||
| namespace BandwidthLib\Voice\Bxml; | ||
|
|
||
| use DOMDocument; | ||
| use DOMElement; | ||
|
|
||
| require_once "Verb.php"; | ||
|
|
||
| class Endpoint extends Verb { | ||
| /** | ||
| * @var string | ||
| */ | ||
| private $id; | ||
|
smoghe-bw marked this conversation as resolved.
Outdated
|
||
|
|
||
| /** | ||
| * @param string $id The endpointId to connect to | ||
| */ | ||
| public function __construct(string $id) { | ||
| $this->id = $id; | ||
| } | ||
|
|
||
| /** | ||
| * Converts the Endpoint verb into a DOMElement | ||
| * | ||
| * @param DOMDocument $doc | ||
| * @return DOMElement | ||
| */ | ||
| public function toBxml(DOMDocument $doc): DOMElement { | ||
| $element = $doc->createElement("Endpoint"); | ||
| $element->setAttribute("id", $this->id); | ||
|
smoghe-bw marked this conversation as resolved.
Outdated
|
||
| return $element; | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.