flanker / chromadb-admin

Admin UI for Chroma embedding database built with Next.js
https://chromadb-admin.com/
MIT License
133 stars 26 forks source link

Add chroma authentication #2

Open giannisanni opened 7 months ago

giannisanni commented 7 months ago

I set up a chroma docker server, i would like to be able to use chromadb-admin with it. But since i added auth header and api to my chromadb, when i connect to it via chromadb-admin i get an unautherized error.

this is what i did for the auth: to use X-Chroma-Token: test-token type of authentication header you can set an additional environment variable.

export CHROMA_SERVER_AUTH_CREDENTIALS="test-token" export CHROMA_SERVER_AUTH_CREDENTIALS_PROVIDER="chromadb.auth.token.TokenConfigServerAuthCredentialsProvider" export CHROMA_SERVER_AUTH_PROVIDER="chromadb.auth.token.TokenAuthServerProvider" export CHROMA_SERVER_AUTH_TOKEN_TRANSPORT_HEADER="X_CHROMA_TOKEN"

from https://docs.trychroma.com/usage-guide

giannisanni commented 7 months ago

I set up a chroma docker server, i would like to be able to use chromadb-admin with it. But since i added auth header and api to my chromadb, when i connect to it via chromadb-admin i get an unautherized error.

this is what i did for the auth: to use X-Chroma-Token: test-token type of authentication header you can set an additional environment variable.

export CHROMA_SERVER_AUTH_CREDENTIALS="test-token" export CHROMA_SERVER_AUTH_CREDENTIALS_PROVIDER="chromadb.auth.token.TokenConfigServerAuthCredentialsProvider" export CHROMA_SERVER_AUTH_PROVIDER="chromadb.auth.token.TokenAuthServerProvider" export CHROMA_SERVER_AUTH_TOKEN_TRANSPORT_HEADER="X_CHROMA_TOKEN"

from https://docs.trychroma.com/usage-guide

this is the response i get:
⨯ Response (55 bytes) { ok: false, url: "http://localhost:8000/api/v1/collections", status: 401, statusText: "Unauthorized", headers: Headers { "date": "Thu, 11 Apr 2024 18:44:24 GMT", "content-length": "55", "content-type": "application/json", "server": "uvicorn", }, redirected: false, bodyUsed: false, Blob (55 bytes)

flanker commented 5 months ago
image
flanker commented 5 months ago

hello @giannisanni

thanks for you message. I've added auth support in main branch. Could you please have a try?