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

feat: add password protection to /admin routes on server #1025

Merged
merged 5 commits into from
Feb 18, 2024

Conversation

cpacker
Copy link
Collaborator

@cpacker cpacker commented Feb 18, 2024

Please describe the purpose of this pull request.

  • Puts /admin routes on REST server (used to create users, create API keys, etc) behind bearer token auth by default
  • The password (to be passed as a bearer token) can be specified when running the server using env variable MEMGPT_SERVER_PASS
  • If the password is not specified, it will be auto-generated (and written to stdout)

How to test

  • Start server
  • Try using /admin route w/o bearer token, should get 401 Unauthorized
  • Try adding the bearer token, it should then work
  • Also try specifying the password via the env var

Have you tested this PR?

 % memgpt server
Generated admin server password for this session: jBNDBB...w5_wg
image image
% export MEMGPT_SERVER_PASS="banana"
% memgpt server                     
Using existing admin server password from environment.
image

@cpacker cpacker marked this pull request as ready for review February 18, 2024 21:30
@cpacker cpacker merged commit dfa1d2a into main Feb 18, 2024
6 checks passed
@cpacker cpacker deleted the admin-endpoints-patch branch February 18, 2024 22:03
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