Skip to content

docs(design): specify v1/whoami in the index API protocol#462

Merged
consideRatio merged 2 commits into
sensmetry:mainfrom
consideRatio:docs/index-api-whoami
Jul 21, 2026
Merged

docs(design): specify v1/whoami in the index API protocol#462
consideRatio merged 2 commits into
sensmetry:mainfrom
consideRatio:docs/index-api-whoami

Conversation

@consideRatio

@consideRatio consideRatio commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Written by erik:

This is a useful endpoint for the client to validate credentials against, where for example using a token for test.sysand.com on sysand.com would otherwise not error on a "sysand auth login" command, because there would be no way to validate it before serious use - and that delay is a bad UX -- better fail early!

Extracted from #453

Ai text below

What

Adds a Token Identity section to design/index-api-protocol.md
specifying the GET v1/whoami endpoint:

  • bearer authentication
  • the 200 body shape: subject (type/name semantics per token type)
    and token (name, prefix, expires_at)
  • the unspecified 401 body
  • optional rate limiting
  • the requirement that the endpoint never consumes single-use credentials

Why now

The endpoint is already live on the index server (sysand.com and
staging), so the protocol spec should be documented in main rather than
waiting behind the larger client-side credential-storage work. This PR
extracts just the index-api-protocol.md addition from that branch so it
can land on its own.

Spec-only change: no code, no behavior change.

🤖 Generated with Claude Code

Add a Token Identity section to index-api-protocol.md covering the
GET v1/whoami endpoint: bearer auth, the 200 body shape (subject
type/name semantics per token type, token name/prefix/expires_at),
the unspecified 401 body, optional rate limiting, and the requirement
that the endpoint never consumes single-use credentials.

The endpoint is already live on the index server, so this spec lands
independently of the larger client credential-storage work.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EfyrkJkeo3mRngVoppJjUN
Signed-off-by: Erik Sundell <erik.sundell+2025@sensmetry.com>
@consideRatio
consideRatio force-pushed the docs/index-api-whoami branch from 12b1e6d to 85b7798 Compare July 20, 2026 09:06
Comment thread design/index-api-protocol.md
Comment thread design/index-api-protocol.md
Comment thread design/index-api-protocol.md Outdated
Co-authored-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Erik Sundell <erik.i.sundell@gmail.com>
@consideRatio consideRatio added the documentation Improvements or additions to documentation label Jul 20, 2026

@andrius-puksta-sensmetry andrius-puksta-sensmetry left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good enough for now.

using a token for test.sysand.com on sysand.com would otherwise not error on a "sysand auth login" command, because there would be no way to validate it before serious use

Token can e.g. be checked with e.g. HEAD request for index.json.
Edit: nevermind, public indexes don't require a token for reading...

@consideRatio
consideRatio merged commit a846d43 into sensmetry:main Jul 21, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants