Axon 911 Frontend Docs
    Loading navigation…
U
User
Switch to light mode
  1. Working With Data
  2. Axonmundi
  3. Testing Dev Router

Test against the dev router

Call the dev Cosmo router with a real token, check subscriptions, and point a local responder at it

These steps call the dev Cosmo router with your own token. You need the Carbyne VPN (setup guide). They are not yet verified end to end, including the token step. Set the router URL once. It is the Cosmo router's dev URL from AxonMundi onboarding:
  1. Get a token. Sign in with Keycloak at https://auth.ng911.dev/login?client=axon-proto&returnTo=https%3A%2F%2Fswitchboard.ng911.dev%2F. The returnTo matters: without a console, switchboard, wallboard or localhost returnTo, axon-proto offers only Okta, and an Okta token is refused. Then open https://auth.ng911.dev/api/auth/session?client=axon-proto and export the accessToken:
    Do not use ?client=responder: it returns a Doorkeeper token. See Authentication for which tokens the router accepts.
  2. Check the router is up. The -4 flag is there because the VPN has no IPv6:
  3. Check auth is enforced. Make the same call with { currentUser { id } }. Expect a 401.
  4. Call with the token. Add -H "authorization: Bearer $TOKEN". Expect your user. If you get data: null with Failed to fetch from Subgraph 'prepared911', Rails refused the token.
  5. Smoke-test a subscription. From an AxonMundi checkout, run its scripts/smoke-subscription.mjs:
  6. Try it from the responder. Local only, commit nothing.
    • In apps/responder/public/config/appConfig.json, set:
      AUTH_HOST_URL is the local apps/auth host that the next steps run.
    • In apps/responder/src/config/mundi.ts, drop || auth.clientId !== AuthClientId.Responder.
    • In apps/auth/.env, uncomment the KEYCLOAK_ISSUER, KEYCLOAK_CLIENT_ID and KEYCLOAK_SCOPE lines from .env.example. Without them the local sign-in offers only Okta.
    • Run apps/auth, then pnpm dev:responder, and sign in with Keycloak.
    The navbar bell queries currentUser and subscribes to userNotification.
Do not paste the token into tickets, PRs, or Studio Playground sessions.
Previous
AxonMundi / Real-time data and WebSockets
Next
Testing strategy / Testing Principles