From bc4689c04e268f4d4212b8300af1e9f378e602e6 Mon Sep 17 00:00:00 2001 From: Owais Jamil Date: Sat, 13 Jun 2026 23:21:51 -0500 Subject: [PATCH] feat: move endpoint inventory to docs * nested routing --- docs/reference/endpoints.md | 76 +++++ docs/tasks/16-public-stats-dashboard.md | 10 +- lib/tempest_web/live/home_live.ex | 273 +++++------------- priv/static/favicon.svg | 7 +- priv/static/images/icons/browser.svg | 14 + test/tempest/public_stats_test.exs | 7 +- test/tempest/sequencer_test.exs | 18 ++ .../controllers/page_controller_test.exs | 13 +- 8 files changed, 208 insertions(+), 210 deletions(-) create mode 100644 docs/reference/endpoints.md create mode 100644 priv/static/images/icons/browser.svg diff --git a/docs/reference/endpoints.md b/docs/reference/endpoints.md new file mode 100644 index 0000000..feebe18 --- /dev/null +++ b/docs/reference/endpoints.md @@ -0,0 +1,76 @@ +--- +title: Endpoint Reference +updated: 2026-06-14 +--- + +# Endpoint Reference + +This reference lists the public service routes and registered XRPC methods exposed by Tempest. It is intentionally documentation-only; the homepage should summarize system status, not carry a full endpoint inventory. + +## Service Routes + +| Method | Path | Access | +| ------ | ----------------------------------------- | ----------- | +| GET | `/.well-known/atproto-did` | public | +| GET | `/.well-known/did.json` | public | +| GET | `/.well-known/oauth-protected-resource` | metadata | +| GET | `/.well-known/oauth-authorization-server` | metadata | +| GET | `/oauth/jwks` | metadata | +| GET | `/xrpc/_health` | operational | +| GET | `/xrpc/_stats` | public | +| GET | `/xrpc/_admin/status` | operational | + +## XRPC Methods + +| HTTP | Auth | NSID | +| ------ | ------ | --------------------------------------------------- | +| GET | bearer | `app.bsky.actor.getPreferences` | +| POST | bearer | `app.bsky.actor.putPreferences` | +| GET | bearer | `com.atproto.identity.getRecommendedDidCredentials` | +| POST | bearer | `com.atproto.identity.requestPlcOperationSignature` | +| GET | public | `com.atproto.identity.resolveHandle` | +| POST | bearer | `com.atproto.identity.signPlcOperation` | +| POST | bearer | `com.atproto.identity.submitPlcOperation` | +| POST | bearer | `com.atproto.identity.updateHandle` | +| POST | bearer | `com.atproto.repo.applyWrites` | +| POST | bearer | `com.atproto.repo.createRecord` | +| POST | bearer | `com.atproto.repo.deleteRecord` | +| GET | public | `com.atproto.repo.describeRepo` | +| GET | public | `com.atproto.repo.getRecord` | +| POST | bearer | `com.atproto.repo.importRepo` | +| GET | bearer | `com.atproto.repo.listMissingBlobs` | +| GET | public | `com.atproto.repo.listRecords` | +| POST | bearer | `com.atproto.repo.putRecord` | +| POST | bearer | `com.atproto.repo.uploadBlob` | +| POST | bearer | `com.atproto.server.activateAccount` | +| GET | bearer | `com.atproto.server.checkAccountStatus` | +| POST | public | `com.atproto.server.confirmEmail` | +| POST | public | `com.atproto.server.createAccount` | +| POST | bearer | `com.atproto.server.createAppPassword` | +| POST | public | `com.atproto.server.createSession` | +| POST | bearer | `com.atproto.server.deactivateAccount` | +| POST | bearer | `com.atproto.server.deleteAccount` | +| POST | bearer | `com.atproto.server.deleteSession` | +| GET | public | `com.atproto.server.describeServer` | +| GET | bearer | `com.atproto.server.getServiceAuth` | +| GET | bearer | `com.atproto.server.getSession` | +| GET | bearer | `com.atproto.server.listAppPasswords` | +| POST | bearer | `com.atproto.server.refreshSession` | +| POST | bearer | `com.atproto.server.requestAccountDelete` | +| POST | bearer | `com.atproto.server.requestEmailConfirmation` | +| POST | bearer | `com.atproto.server.requestEmailUpdate` | +| POST | public | `com.atproto.server.requestPasswordReset` | +| POST | bearer | `com.atproto.server.reserveSigningKey` | +| POST | public | `com.atproto.server.resetPassword` | +| POST | bearer | `com.atproto.server.revokeAppPassword` | +| POST | public | `com.atproto.server.updateEmail` | +| GET | public | `com.atproto.sync.getBlob` | +| GET | public | `com.atproto.sync.getBlocks` | +| GET | public | `com.atproto.sync.getLatestCommit` | +| GET | public | `com.atproto.sync.getRecord` | +| GET | public | `com.atproto.sync.getRepo` | +| GET | public | `com.atproto.sync.getRepoStatus` | +| GET | public | `com.atproto.sync.listBlobs` | +| GET | public | `com.atproto.sync.listRepos` | +| POST | public | `com.atproto.sync.requestCrawl` | +| STREAM | public | `com.atproto.sync.subscribeRepos` | diff --git a/docs/tasks/16-public-stats-dashboard.md b/docs/tasks/16-public-stats-dashboard.md index abb29c9..1dd754d 100644 --- a/docs/tasks/16-public-stats-dashboard.md +++ b/docs/tasks/16-public-stats-dashboard.md @@ -22,12 +22,12 @@ keeping admin-only operations and sensitive internals private. application start. - [x] T16-05: Add a public health summary with `ok`, `degraded`, and `unhealthy` states. -- [ ] T16-06: Add `GET /xrpc/_stats` returning sanitized public JSON. -- [ ] T16-07: Add `GET /stats` public HTML dashboard. -- [ ] T16-08: Link the public stats dashboard from the home page. -- [ ] T16-09: Add dashboard cards for hosted accounts, commits, collections, +- [x] T16-06: Add `GET /xrpc/_stats` returning sanitized public JSON. +- [x] T16-07: Add `GET /stats` public HTML dashboard. +- [x] T16-08: Link the public stats dashboard from the home page. +- [x] T16-09: Add dashboard cards for hosted accounts, commits, collections, records, last indexed, uptime, and health. -- [ ] T16-10: Add helper copy explaining that `lastIndexedAt` is local repo, +- [x] T16-10: Add helper copy explaining that `lastIndexedAt` is local repo, commit, or sequencer activity observed by this PDS. - [ ] T16-11: Add ConnCase tests for `/stats` and `/xrpc/_stats` without admin authorization. diff --git a/lib/tempest_web/live/home_live.ex b/lib/tempest_web/live/home_live.ex index 10d9d64..82c2084 100644 --- a/lib/tempest_web/live/home_live.ex +++ b/lib/tempest_web/live/home_live.ex @@ -2,45 +2,10 @@ defmodule TempestWeb.HomeLive do use TempestWeb, :live_view alias Tempest.{Config, PublicStats} - alias Tempest.Xrpc.{Method, Registry} + alias Tempest.Xrpc.Registry @refresh_interval :timer.seconds(15) - @service_routes [ - %{ - verb: "GET", - name: "/.well-known/atproto-did", - href: "/.well-known/atproto-did", - badge: "public", - badge_class: "badge-success" - }, - %{ - verb: "GET", - name: "/.well-known/did.json", - href: "/.well-known/did.json", - badge: "public", - badge_class: "badge-success" - }, - %{ - verb: "GET", - name: "/.well-known/oauth-protected-resource", - href: "/.well-known/oauth-protected-resource", - badge: "meta", - badge_class: "badge-info" - }, - %{ - verb: "GET", - name: "/.well-known/oauth-authorization-server", - href: "/.well-known/oauth-authorization-server", - badge: "meta", - badge_class: "badge-info" - }, - %{verb: "GET", name: "/oauth/jwks", href: "/oauth/jwks", badge: "meta", badge_class: "badge-info"}, - %{verb: "GET", name: "/xrpc/_health", href: "/xrpc/_health", badge: "ops", badge_class: "badge-info"}, - %{verb: "GET", name: "/xrpc/_stats", href: "/xrpc/_stats", badge: "public", badge_class: "badge-success"}, - %{verb: "GET", name: "/xrpc/_admin/status", href: "/xrpc/_admin/status", badge: "ops", badge_class: "badge-ghost"} - ] - @impl true def mount(_params, _session, socket) do if connected?(socket), do: schedule_refresh() @@ -123,13 +88,13 @@ defmodule TempestWeb.HomeLive do -
+
- Live Status + {@center_title}
-
+

{card.label}

@@ -143,24 +108,7 @@ defmodule TempestWeb.HomeLive do

-
-
-
- Public Metrics -
-
-
-
-

{metric.label}

-

- {metric.value} -

-

{metric.note}

-
-
-
-
- +
Health Checks @@ -193,36 +141,6 @@ defmodule TempestWeb.HomeLive do
-
-
- Endpoint Surface -
-
- <%= for endpoint <- @endpoint_rows do %> - - {endpoint.verb} - - {endpoint.family} - {endpoint.name} - - {endpoint.badge} - -
- {endpoint.verb} - - {endpoint.family} - {endpoint.name} - - {endpoint.badge} -
- <% end %> -
-
-

Internet Shortcuts