Skip to content

Commit

Permalink
Use internal endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
dwilkie committed Apr 15, 2024
1 parent f506d7d commit fc563fd
Show file tree
Hide file tree
Showing 5 changed files with 166 additions and 154 deletions.
4 changes: 2 additions & 2 deletions components/app/config/app_settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ production: &production
sentry_dsn: "<%= AppSettings.credentials.fetch('sentry_dsn') %>"
ahn_core_password: "<%= ENV.fetch('AHN_CORE_PASSWORD') %>"
ahn_http_password: "<%= AppSettings.credentials.fetch('ahn_http_password') %>"
call_platform_host: "https://api.somleng.org"
call_platform_host: "https://api.internal.somleng.org"
call_platform_password: "<%= AppSettings.credentials.fetch('call_platform_password') %>"

staging:
<<: *production
call_platform_host: "https://api-staging.somleng.org"
call_platform_host: "https://api-staging.internal.somleng.org"

development: &development
<<: *default
Expand Down
6 changes: 3 additions & 3 deletions components/app/spec/lib/call_platform/client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ module CallPlatform
it "creates a media stream" do
stub_request(
:post,
"https://api.somleng.org/services/media_streams"
"https://api.internal.somleng.org/services/media_streams"
).to_return(body: { "sid" => "393a227f-0602-4024-b38a-dcbbeed4d5a0" }.to_json)
client = Client.new(http_client_options: { url: "https://api.somleng.org" })
client = Client.new(http_client_options: { url: "https://api.internal.somleng.org" })

response = client.create_media_stream(
url: "wss://example.com/audio",
Expand All @@ -19,7 +19,7 @@ module CallPlatform
)

expect(response.id).to eq("393a227f-0602-4024-b38a-dcbbeed4d5a0")
expect(WebMock).to(have_requested(:post, "https://api.somleng.org/services/media_streams").with { |request|
expect(WebMock).to(have_requested(:post, "https://api.internal.somleng.org/services/media_streams").with { |request|
request_body = JSON.parse(request.body)
expect(request_body).to eq(
"url" => "wss://example.com/audio",
Expand Down
Loading

0 comments on commit fc563fd

Please sign in to comment.