Skip to content

Optimize cold start of neptune-query#214

Merged
PatrykGala merged 1 commit intomainfrom
pg/optimize-cold-start-v2
Feb 13, 2026
Merged

Optimize cold start of neptune-query#214
PatrykGala merged 1 commit intomainfrom
pg/optimize-cold-start-v2

Conversation

@PatrykGala
Copy link
Contributor

@PatrykGala PatrykGala commented Feb 13, 2026

This change reduces client startup latency by eliminating initial config/discovery network calls during get_client() initialization.
Instead of fetching client_id and token URLs from server config, auth refresh metadata is derived directly from OAuth token claims.

What changed

  • Simplified client bootstrap:
    • Removed get_config_and_token_urls() and TokenRefreshingURLs.
    • internal/client.py now creates the auth client directly from credentials.
  • Simplified auth client constructor path:
    • Removed client_id and token_refreshing_endpoint from AuthenticatedClient/NeptuneAuthenticator.
  • Moved refresh metadata to token payload:
    • OAuthToken now stores:
      • client_id from azp
      • token_endpoint from iss + /protocol/openid-connect/token
    • Refresh flow now uses self._token.token_endpoint.
  • Updated generated code templates and mirrored generated files.
  • Updated tests and fixtures (unit/e2e/perf) to match new auth model.

Impact

  • Fewer network calls on cold start.
  • Faster initial client creation.
  • Refresh endpoint/client identity now come from JWT claims (iss, azp) instead of config discovery.

@PatrykGala PatrykGala force-pushed the pg/optimize-cold-start-v2 branch from b943802 to 3261d21 Compare February 13, 2026 09:51
@PatrykGala PatrykGala marked this pull request as ready for review February 13, 2026 10:03
@PatrykGala PatrykGala added this pull request to the merge queue Feb 13, 2026
Merged via the queue into main with commit 00fcb6b Feb 13, 2026
22 checks passed
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