Dashboard: an API key button that shows the key with a copy button
Behind the same sign-in as the rest of the dashboard (GET /api/key, no-store), so whoever can open the dashboard can hand the key to a client without a shell on the server. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
e814a2359d
commit
6fd82448c5
4 changed files with 58 additions and 3 deletions
|
|
@ -517,6 +517,11 @@ def make_handler(sampler, key, oidc=None):
|
|||
elif path == "/api/status":
|
||||
if self.authed():
|
||||
self.send_json(200, sampler.snapshot())
|
||||
elif path == "/api/key":
|
||||
# For handing to clients. Behind the same sign-in as everything else here;
|
||||
# send_json marks it no-store.
|
||||
if self.authed():
|
||||
self.send_json(200, {"key": key})
|
||||
elif path == "/api/logs":
|
||||
if self.authed():
|
||||
lines = [l for l in service.logs("model", 1500)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue