Skip to content

feat: credential CLI, standing public auth, manifest scope removal#45

Merged
bvalosek merged 6 commits intomainfrom
feat/credential-ergo-and-cleanup
Apr 15, 2026
Merged

feat: credential CLI, standing public auth, manifest scope removal#45
bvalosek merged 6 commits intomainfrom
feat/credential-ergo-and-cleanup

Conversation

@bvalosek
Copy link
Copy Markdown
Member

@bvalosek bvalosek commented Apr 15, 2026

Summary

  • New credential CLI namespace: moved grant and revoke from content to dfos credential (alias cred) — cleaner command structure for access control operations
  • Standing public authorization: relays now allow unauthenticated blob/document reads when a valid public credential (aud: *) exists — no auth token needed for public content. Implemented in both Go and TS relays with full parity
  • Manifest scope removal: removed manifest: scoped credentials entirely from TS, Go, and specs. Resource hierarchy simplified to chain:* > chain:<contentId>
  • DocumentCID normalization fix: DocumentCID now calls NormalizeJSONNumbers before CBOR encoding, matching relay blob verification. Fixes blob upload failures on documents with integer values
  • Error handling hardening: content update --peer blob upload path now surfaces errors instead of silently swallowing. credential revoke --peer adds publishIdentityIfNeeded before submitting to peer
  • Go/TS isAttenuated parity: Go now checks childType == "chain" guard matching TS, preventing chain:* from incorrectly covering non-chain resources
  • Wildcard credential local check: CLI local download fast-path now correctly accepts chain:* (broad) credentials instead of rejecting them
  • Docs updated: README, CLI.md, and CLAUDE-SKILL.md all reflect the new credential namespace

Test plan

  • Conformance test added: anonymous read with standing auth + revocation
  • Run pnpm test — all protocol + relay tests pass
  • Run relay conformance suite against Go relay
  • Manual: dfos credential grant <id> <did> --read produces valid credential
  • Manual: dfos credential grant <id> <did> --read --broad produces wildcard credential accepted by local download
  • Manual: dfos credential revoke <cid> --peer <relay> succeeds (identity auto-published)
  • Manual: content with aud: * credential readable without auth token

Generated with Claude Code

bvalosek and others added 2 commits April 15, 2026 12:14
CLI improvements:
- Add `content revoke` command for credential revocation
- Fix `--broad` credential producing `chain:` instead of `chain:*`
- Fix `content create --peer` blob CID mismatch (upload canonical JSON)
- Fix `content publish` using wrong identity for blob upload auth
- Fix `content download` pre-empting relay auth with local creator check

Relay improvements:
- Allow unauthenticated blob/documents reads when a valid public standing
  credential (aud: *) exists — no auth token needed for public content
- Add `hasPublicStandingAuth` helper for the unauthenticated fast-path

Protocol cleanup:
- Add `SignRevocation` to Go protocol library
- Remove `manifest:` scoped credentials entirely (TS + Go + specs)
- Simplify resource hierarchy to `chain:*` > `chain:<contentId>`
- Remove `manifestLookup` from both relay implementations
- Update CREDENTIALS.md spec to reflect simplified scope model

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…blish fix

Review iteration addressing pattern, architect, and codex findings:

- Extract `authorizeRead` helper in Go relay (deduplicate standing auth block)
- Add standing auth to TS relay (blob + documents endpoints) for parity
- Move `grant`/`revoke` from `content` to `dfos credential` namespace
- Fix `content publish` to use active identity for blob auth (not creator)
- Surface blob upload errors instead of silently skipping
- Fix `json.Marshal` error handling in content create/update
- Clean stale manifest comments in auth.go and delegation.go
- Add conformance test: anonymous read with standing auth + revocation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bvalosek bvalosek changed the title feat: credential CLI improvements, standing auth, manifest scope removal feat: credential CLI, standing public auth, manifest scope removal Apr 15, 2026
bvalosek and others added 4 commits April 15, 2026 13:02
…D mismatch

DocumentCID (used by CLI to compute document CIDs) was calling
DagCborEncode directly, while the relay's blob verification used
DagCborCID which normalizes float64→int64 first. Documents with
integer values (e.g. "version": 1) produced different CIDs, causing
blob upload to fail with "blob bytes do not match documentCID".

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- content update blob upload now surfaces errors (was silently swallowing)
- Go isAttenuated adds childType==chain guard matching TS implementation
- Remove stale manifest comments in auth.ts
- Update CLI docs (README, CLI.md, CLAUDE-SKILL) for credential namespace

Co-Authored-By: Claude <noreply@anthropic.com>
Without this, revocations pushed to a peer that hasn't ingested
the issuer's identity chain will be rejected.

Co-Authored-By: Claude <noreply@anthropic.com>
…k, --broad help text

- Move verifyContentAccess JSDoc to correct location above the function
- Add wildcard (chain:*) guard in CLI local credential verification
- Clarify --broad flag help text

Co-Authored-By: Claude <noreply@anthropic.com>
@bvalosek bvalosek merged commit d86a473 into main Apr 15, 2026
9 checks passed
@bvalosek bvalosek deleted the feat/credential-ergo-and-cleanup branch April 15, 2026 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant