Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/next-release/changeset-murf-ws-header-auth.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"livekit-plugins-murf": patch
---

Pass API key via the `api-key` HTTP header on the WebSocket handshake instead of as a URL query parameter.
5 changes: 5 additions & 0 deletions .github/next-release/changeset-neuphonic-ws-header-auth.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"livekit-plugins-neuphonic": patch
---

Drop redundant API key from WebSocket URL query string (it was already being sent via the X-API-KEY header).
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,10 @@ def provider(self) -> str:
async def _connect_ws(self, timeout: float) -> aiohttp.ClientWebSocketResponse:
session = self._ensure_session()
url = self._opts.get_ws_url(
f"/v1/speech/stream-input?api-key={self._opts.api_key}&sample_rate={self._opts.sample_rate}&format={self._opts.encoding}&model={self._opts.model}"
f"/v1/speech/stream-input?sample_rate={self._opts.sample_rate}&format={self._opts.encoding}&model={self._opts.model}"
)
return await asyncio.wait_for(session.ws_connect(url), timeout)
headers = {API_AUTH_HEADER: self._opts.api_key}
return await asyncio.wait_for(session.ws_connect(url, headers=headers), timeout)

async def _close_ws(self, ws: aiohttp.ClientWebSocketResponse) -> None:
await ws.close()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def __init__(
async def _connect_ws(self, timeout: float) -> aiohttp.ClientWebSocketResponse:
session = self._ensure_session()
url = self._opts.get_ws_url(
f"/speak/en?api_key={self._opts.api_key}&speed={self._opts.speed}&lang_code={self._opts.lang_code.language}&sampling_rate={self._opts.sample_rate}&voice_id={self._opts.voice_id}"
f"/speak/en?speed={self._opts.speed}&lang_code={self._opts.lang_code.language}&sampling_rate={self._opts.sample_rate}&voice_id={self._opts.voice_id}"
)
if self._opts.jwt_token:
url += f"&jwt_token={self._opts.jwt_token}"
Expand Down
Loading