Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update authorization header to use X-BARE-PASSWORD format #2338

Merged
merged 2 commits into from
Jan 20, 2025

Conversation

theocnrds
Copy link

Please describe the purpose of this pull request.
Fixes a bug in Python SDK. Setting token=<password> when instantiating a RESTClient was not sufficient to authorize since CheckPasswordMiddleware was checking for X-BARE-PASSWORD instead of 'Authorization` header.

RESTClient is now setting X-BARE-PASSWORD="password <password> as a header.

How to test

from letta.client.client import RESTClient

client = RESTClient(base_url="http://0.0.0.0:8283", token="<password>")
print(client.personas())

letta/client/client.py Outdated Show resolved Hide resolved
…uthorization

- Updated the constructor to accept an optional  parameter alongside the existing .
- Modified the header setup to use  for token-based authentication and  for password-based authentication.
- Added error handling to ensure either a token or password is provided.
@sarahwooders sarahwooders merged commit 86eae32 into letta-ai:main Jan 20, 2025
19 of 33 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.

2 participants