feat(renown): issue credentials via renown_issueCredential + authenticated profile writes - #2883
Open
acaldas wants to merge 1 commit into
Open
feat(renown): issue credentials via renown_issueCredential + authenticated profile writes#2883acaldas wants to merge 1 commit into
acaldas wants to merge 1 commit into
Conversation
…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.
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.
What
Updates
@renown/sdk'sSwitchboardClientandsignInto work with a switchboard that has authorization enabled — the sign-in bootstrap in #2881. Companion to therenown-credential-issuancesubgraph PR inpowerhouse-inc/renown-package(which adds the server-siderenown_issueCredentialmutation).Changes
issueCredentialnow calls the dedicatedrenown_issueCredentialmutation (validates the EIP-712 proof and writes without requiring auth), with a fallback to the genericcreateEmptyDocument+INITpath 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.signInno longer writes the RenownUser profile through an unauthenticated path; it defers to a best-effortupsertUserProfileusing 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/mutateDocumentaccept an optional bearer token (Authorization: Bearer …).index.tsre-exports./constants.jssoCREDENTIAL_TYPESis 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, authenticatedupsertUserProfile(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.