Skip to content

Fix SDK connection with plain URIs (no embedded credentials)#372

Open
ArnavAgrawal03 wants to merge 1 commit intomainfrom
arnav/fix-sdk-non-local-uri
Open

Fix SDK connection with plain URIs (no embedded credentials)#372
ArnavAgrawal03 wants to merge 1 commit intomainfrom
arnav/fix-sdk-non-local-uri

Conversation

@ArnavAgrawal03
Copy link
Collaborator

Summary

  • Fixes ValueError: not enough values to unpack when connecting with a plain URI like http://0.0.0.0:8000
  • _setup_auth assumed every URI had @-embedded credentials (name:token@host), making it impossible to connect to a non-localhost server without auth
  • Now checks for @ in the netloc: if present, parses credentials as before; if absent, uses the URI directly as the base URL with no auth token

Test plan

  • Morphik(uri="http://0.0.0.0:8000") no longer crashes
  • Morphik(uri="http://192.168.1.100:8000") works for LAN deployments
  • Morphik() still defaults to http://localhost:8000
  • Credential-embedded URIs (name:token@host) continue to work as before

🤖 Generated with Claude Code

_setup_auth assumed every URI had @-embedded credentials, crashing
with ValueError when given plain URIs like http://0.0.0.0:8000.
Now handles the no-credentials case by using the URI directly as
the base URL with no auth token.
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.

1 participant