Skip to content

feat(renown): issue credentials via renown_issueCredential + authenticated profile writes - #2883

Open
acaldas wants to merge 1 commit into
mainfrom
feat/renown-credential-issuance-sdk
Open

feat(renown): issue credentials via renown_issueCredential + authenticated profile writes#2883
acaldas wants to merge 1 commit into
mainfrom
feat/renown-credential-issuance-sdk

Conversation

@acaldas

@acaldas acaldas commented Jul 23, 2026

Copy link
Copy Markdown
Member

What

Updates @renown/sdk's SwitchboardClient and signIn to work with a switchboard that has authorization enabled — the sign-in bootstrap in #2881. Companion to the renown-credential-issuance subgraph PR in powerhouse-inc/renown-package (which adds the server-side renown_issueCredential mutation).

Changes

  • issueCredential now calls the dedicated renown_issueCredential mutation (validates the EIP-712 proof and writes without requiring auth), with a fallback to the generic createEmptyDocument + INIT path when the switchboard runs an older renown-package that lacks the mutation. It only falls back on a schema error (missing field/type), never on a resolver validation rejection.
  • Profile writes are now authenticated. signIn no longer writes the RenownUser profile through an unauthenticated path; it defers to a best-effort upsertUserProfile using the caller's bearer token, retried past the read-model indexing lag. A profile can therefore only be written by someone who has proven control of the address — prevents profile impersonation.
  • #request / createEmptyDocument / mutateDocument accept an optional bearer token (Authorization: Bearer …).
  • index.ts re-exports ./constants.js so CREDENTIAL_TYPES is part of the public API (matches the published surface).

Tests

test/switchboard.test.ts + test/signin.test.ts — 15 tests, covering issuance, the older-switchboard fallback, no-fallback-on-rejection, authenticated upsertUserProfile (asserts the bearer token is sent), and the deferred profile write during sign-in.

Note

Depends on the renown-package PR being deployed for the primary (non-fallback) issuance path to be available on a given switchboard.

…cated profile writes

SwitchboardClient.issueCredential now calls the renown-package
`renown_issueCredential` mutation (which validates and writes the credential
without requiring auth), falling back to the generic createEmptyDocument+INIT
path on older switchboards that lack the mutation. This fixes sign-in when the
switchboard runs with authorization enabled (#2881).

The RenownUser profile is no longer written through an unauthenticated path.
signIn defers it to a best-effort authenticated request (upsertUserProfile with
a bearer token, retried past the read-model indexing lag), so a profile can
only be written by someone who has proven control of the address — preventing
impersonation. #request/createEmptyDocument/mutateDocument accept an optional
bearer token; index.ts re-exports constants so CREDENTIAL_TYPES is public.
Copilot AI review requested due to automatic review settings July 23, 2026 19:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

2 participants