Repository navigation
feat: account/info for reading your own account - #42
Merged
Merged
Conversation
Owner
Author
|
App side: leviFrosty/witness-work#770 (Tools → Server account). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
POST /accounts/v1/account/infoso the app's developer Tools screen can show what D1 holds for the device's own account. This makes it possible to debug accounts in prod without the admin token.What it returns
accountId,accountPub,status,createdAt,inboxIds, andstatusChanges(each withstatusandcreatedAt).Why it's safe
{p, s}envelope asaccount/register, under theww-account/v1context with opaccount/info. Only the holder of the account key can read the account, and a register signature can't be replayed as an info request (there's a test for this).unknown_account.reason, which stays visible only through/admin/accounts/lookup.Changes
contracts.ts: adds theaccount/infoop.parseAccountRegisterbecomesparseAccountKeyPayload, since both ops share the payload.route.ts: envelope, signature and timestamp checks move into a sharedverifiedKeyPayload.store.ts: addsfindAccountInfo.openapi.ts: documents the new route, sharing the signed-body schema and the signature errors with register.src/e2e/accounts.e2e.test.ts.AGENTS.mddocuments the route.Verification
pnpm test: 735 passed.tsc --noEmit: clean.verify-ww-api:up,doctorok.pnpm test:e2e: 42 passed, 3 skipped (HERE/paid paths with no credentials). All 4 new accounts e2e cases ran, including the admin-suspension case. Thendown./openapi.jsonon the local worker lists/accounts/v1/account/info.Deploy
No migration and no new binding. After merging,
pnpm run deploy:devlets the app PR be tested against dev.