Documentation
Demo Commands
The shark demo group provides runnable reference flows that exercise the full SharkAuth feature surface. Demos are self-contained — they provision synthetic resources, run the flow, and clean up. They are the canonical "show, don't tell" tool for screencasts and investor demos.
shark demo delegation-with-trace
Run a 3-hop delegation chain demo with DPoP-bound tokens at each hop, plus a vault token retrieval on hop 4. Produces a self-contained HTML report.
Synopsis
What it does
- Registers a synthetic user and 3 agents:
user-proxy,email-service,followup-service. - Configures
may_actdelegation policies between them. - Runs a token-exchange chain across all 3 hops, generating DPoP proofs at each step.
- Fetches a vault token on hop 4.
- Assembles a self-contained HTML report with full request/response traces, timing, and explanation.
- Auto-opens the report in the default browser (unless
--no-open). - Cleans up provisioned resources (unless
--keep).
Flags
| Flag | Type | Default | Description |
|---|---|---|---|
--base-url | string | http://localhost:8080 | Shark server base URL |
--admin-key | string | (env) | Admin API key (or SHARK_ADMIN_KEY) |
--output | string | ./demo-report.html | Path to write the HTML report |
--html | string | (none) | Alias for --output (deprecated — use --output) |
--plain | bool | false | Force plain stdout output only; skip HTML generation |
--no-open | bool | false | Do not auto-open the report in a browser |
--keep | bool | false | Keep temp DB for inspection after the run |
Admin key resolution order: --admin-key flag → SHARK_ADMIN_KEY environment variable. The command exits with an error if neither is set.
Examples
HTML Report
The output file is a self-contained HTML document — all assets are inlined. It can be:
- Opened directly in any browser (
file://) - Attached to emails or Slack messages
- Hosted on any static server
- Used as a visual aid during live screencasts (no server connection required after generation)
The report contains:
- A step-by-step timeline of all hops
- Full HTTP request/response traces (headers, bodies, tokens)
- Decoded JWT payloads at each hop
- DPoP proof details
- Vault retrieval trace
- Timing breakdown per step
Gotchas
- The demo requires a running shark server. Run
shark servein another terminal before executing. - The synthetic resources (user, agents) are created fresh each run. If
--keepis not set, they are deleted after the run. - The
--htmlflag is a deprecated alias for--outputand may be removed in a future version. - Device flow commands (OAuth device authorization) are disabled in v0.1 and are not exercised by this demo.