Skip to content

Add mint API key support for session authentication in realtime client#185

Merged
rmittal-github merged 6 commits into
nvidia-riva:mainfrom
yhayarannvidia:dev/yhayaran/realtime_token_auth_changes
Jul 24, 2026
Merged

Add mint API key support for session authentication in realtime client#185
rmittal-github merged 6 commits into
nvidia-riva:mainfrom
yhayarannvidia:dev/yhayaran/realtime_token_auth_changes

Conversation

@yhayarannvidia

Copy link
Copy Markdown
Contributor
  • Introduced --mint-api-key argument for specifying the API key.
  • Implemented _mint_auth_headers function to include the API key in session requests.
  • Updated session initialization and WebSocket connection methods to utilize the client secret token.
  • Enhanced error handling for session authentication failures.

- Introduced `--mint-api-key` argument for specifying the API key.
- Implemented `_mint_auth_headers` function to include the API key in session requests.
- Updated session initialization and WebSocket connection methods to utilize the client secret token.
- Enhanced error handling for session authentication failures.
- Updated `_build_websocket_url` to remove token from query parameters.
- Introduced `_websocket_subprotocols` function to handle Sec-WebSocket-Protocol entries.
- Modified WebSocket connection methods in `RealtimeClientASR` and `RealtimeClientTTS` to include subprotocols for enhanced security and token handling.
@yhayarannvidia
yhayarannvidia force-pushed the dev/yhayaran/realtime_token_auth_changes branch from 301567c to 1b8ec31 Compare July 23, 2026 12:39
Comment thread riva/client/realtime.py Outdated
Comment thread riva/client/realtime.py Outdated
Comment thread riva/client/realtime.py
Comment thread riva/client/realtime.py Outdated
- Updated `_extract_client_secret_token` to return `None` if the token is not present, improving error handling.
- Introduced `_build_ssl_context` to create an SSL context for secure WebSocket connections.
- Refactored `_connect_websocket` to accept parameters for better flexibility and logging.
- Removed the old `_connect_websocket` method from `RealtimeClientASR` and `RealtimeClientTTS`, replacing it with the new implementation for improved clarity and maintainability.
- Renamed `_connect_realtime_websocket` to `_connect_websocket` for consistency.
- Removed logging statements related to client secret token usage to enhance security.
- Updated `RealtimeClientASR` and `RealtimeClientTTS` to utilize the new `_connect_websocket` method directly, improving clarity and maintainability.
@rmittal-github
rmittal-github merged commit 7fb5caa into nvidia-riva:main Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants