Skip to content

[LC-1383] allow profileId routes to accept DID or profileId#1015

Merged
TaylorBeeston merged 8 commits intolearningeconomy:mainfrom
Computer8004:feat/did-profileId-routes
Feb 26, 2026
Merged

[LC-1383] allow profileId routes to accept DID or profileId#1015
TaylorBeeston merged 8 commits intolearningeconomy:mainfrom
Computer8004:feat/did-profileId-routes

Conversation

@Computer8004
Copy link
Copy Markdown
Contributor

@Computer8004 Computer8004 commented Feb 19, 2026

LC-1383

This PR updates 19 routes across the brain service to accept either a profileId OR a DID (did:web or did:key) for the profileId parameter.

Changes

Uses the existing getProfileIdFromString helper to resolve identifiers, enabling more flexible API usage.

Routes Updated

profiles.ts:

  • getOtherProfile
  • connectWithProfile
  • connectWithExpiredInvite
  • cancelConnectionRequest
  • connectWithInvite
  • disconnectWith
  • acceptConnectionRequest
  • blockProfile
  • unblockProfile

boosts.ts:

  • sendCredential
  • addBoostAdmin
  • removeBoostAdmin
  • getOtherBoostPermissions
  • updateOtherBoostPermissions
  • sendBoostViaSigningAuthority

contracts.ts:

  • verifyContractConsent

credentials.ts:

  • sendCredential

presentations.ts:

  • sendPresentation

Testing

Added comprehensive tests for DID resolution in all affected routes, covering:

  • Plain profileId (backward compatibility)
  • did:web format
  • did:key format
  • Error handling for invalid identifiers

cc @TaylorBeeston

Closes #1014 (redoing on fresh branch as requested)

✨ PR Description

Purpose: Enhance API flexibility by allowing 19 profile-related routes to accept DID (did:web or did:key) in addition to profileId for improved interoperability across identity systems.

Main changes:

  • Added getProfileIdFromString resolution layer to 19 routes across boosts, contracts, credentials, presentations, profiles, and skill-frameworks services
  • Implemented consistent NOT_FOUND error handling when DID resolution fails before profile lookups
  • Added comprehensive test coverage for did:web, did:key, and invalid DID format validation across all modified endpoints

Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Description using Guidelines Learn how

@netlify
Copy link
Copy Markdown

netlify Bot commented Feb 19, 2026

‼️ Deploy request for staging-learncardapp rejected.

Name Link
🔨 Latest commit 6d1f2f2

@netlify
Copy link
Copy Markdown

netlify Bot commented Feb 19, 2026

Deploy Preview for learncarddocs canceled.

Name Link
🔨 Latest commit 3061bea
🔍 Latest deploy log https://app.netlify.com/projects/learncarddocs/deploys/69a0b23dd1dd5400083c4304

@atlassian
Copy link
Copy Markdown

atlassian Bot commented Feb 19, 2026

To enable Rovo Dev code reviews, link your GitHub account to your Atlassian account.

This is a one-time task that takes less than a minute. Once your account is linked, resubmit the pull request to trigger a code review.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Feb 19, 2026

🦋 Changeset detected

Latest commit: 3061bea

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 19 packages
Name Type
@learncard/network-brain-service Patch
@learncard/network-brain-client Patch
@learncard/network-plugin Patch
@learncard/init Patch
@learncard/chapi-example Patch
@learncard/app-store-demo-basic-launchpad Patch
@learncard/app-store-demo-lore-card Patch
@learncard/app-store-demo-mozilla-social-badges Patch
@learncard/create-http-bridge Patch
@learncard/cli Patch
@learncard/react Patch
@learncard/lca-api-plugin Patch
learn-card-discord-bot Patch
@learncard/lca-api-service Patch
@learncard/benchmarking Patch
learn-card-app Patch
scoutpass-app Patch
@learncard/snap-chapi-example Patch
learn-card-base Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Copy Markdown
Contributor

@gitstream-cm gitstream-cm Bot left a comment

Choose a reason for hiding this comment

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

✨ PR Review

LGTM

Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Review using Guidelines Learn how

@TaylorBeeston
Copy link
Copy Markdown
Collaborator

Please add a changeset

@Computer8004
Copy link
Copy Markdown
Contributor Author

@TaylorBeeston Changeset added ✅

@TaylorBeeston
Copy link
Copy Markdown
Collaborator

@Computer8004 I ran Opencode on this and it found some more routes that you messed. Can you please:

  • Check its work
  • Add some tests for this branch
  • Update docs

@TaylorBeeston
Copy link
Copy Markdown
Collaborator

@Computer8004 (see my earlier comment)

@TaylorBeeston
Copy link
Copy Markdown
Collaborator

Okay one more time. Please read my last two comments :)

@Computer8004
Copy link
Copy Markdown
Contributor Author

@TaylorBeeston Added tests for skill-frameworks admin routes (add/remove by did:web, did:key, and error case for unsupported DID format).

Regarding the other routes you added in 🐛 Catch more routes (boosts.ts and contracts.ts) - should I add DID resolution tests for those as well, or are the existing test patterns sufficient?

@TaylorBeeston TaylorBeeston requested a review from rhen92 February 24, 2026 22:46
@TaylorBeeston
Copy link
Copy Markdown
Collaborator

Looked through this and I think we're good to go =)

@claude do you mind doing a thorough review of this PR?

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Feb 24, 2026

Claude encountered an error —— View job

Failed with exit code 128

I'll analyze this and get back to you.

@TaylorBeeston TaylorBeeston changed the title feat: allow profileId routes to accept DID or profileId [LC-1383] allow profileId routes to accept DID or profileId Feb 24, 2026
@gitstream-cm
Copy link
Copy Markdown
Contributor

gitstream-cm Bot commented Feb 26, 2026

🥷 Code experts: TaylorBeeston, Custard7

TaylorBeeston, Custard7 have most 👩‍💻 activity in the files.
TaylorBeeston, Custard7 have most 🧠 knowledge in the files.

See details

services/learn-card-network/brain-service/src/routes/boosts.ts

Activity based on git-commit:

TaylorBeeston Custard7
FEB 263 additions & 237 deletions
JAN 283 additions & 76 deletions
DEC 222 additions & 3 deletions 55 additions & 22 deletions
NOV 415 additions & 5 deletions
OCT 11 additions & 3 deletions
SEP 1983 additions & 2 deletions

Knowledge based on git-blame:
TaylorBeeston: 79%
Custard7: 15%

services/learn-card-network/brain-service/src/routes/contracts.ts

Activity based on git-commit:

TaylorBeeston Custard7
FEB
JAN
DEC 50 additions & 44 deletions
NOV 3 additions & 0 deletions
OCT 22 additions & 6 deletions
SEP 1632 additions & 1 deletions

Knowledge based on git-blame:
TaylorBeeston: 74%
Custard7: 2%

services/learn-card-network/brain-service/src/routes/credentials.ts

Activity based on git-commit:

TaylorBeeston Custard7
FEB
JAN 14 additions & 1 deletions
DEC 5 additions & 5 deletions
NOV
OCT
SEP 213 additions & 0 deletions

Knowledge based on git-blame:
TaylorBeeston: 83%
Custard7: 8%

services/learn-card-network/brain-service/src/routes/presentations.ts

Activity based on git-commit:

TaylorBeeston Custard7
FEB
JAN
DEC 3 additions & 3 deletions
NOV
OCT
SEP 192 additions & 0 deletions

Knowledge based on git-blame:
TaylorBeeston: 98%
Custard7: 2%

services/learn-card-network/brain-service/src/routes/profiles.ts

Activity based on git-commit:

TaylorBeeston Custard7
FEB
JAN
DEC 6 additions & 6 deletions
NOV
OCT 15 additions & 4 deletions
SEP 1222 additions & 12 deletions

Knowledge based on git-blame:
TaylorBeeston: 95%

services/learn-card-network/brain-service/src/routes/skill-frameworks.ts

Activity based on git-commit:

TaylorBeeston Custard7
FEB
JAN
DEC
NOV 785 additions & 0 deletions
OCT
SEP

Knowledge based on git-blame:
TaylorBeeston: 83%

services/learn-card-network/brain-service/test/boost-templating.spec.ts

Activity based on git-commit:

TaylorBeeston Custard7
FEB
JAN 621 additions & 0 deletions
DEC
NOV
OCT
SEP

Knowledge based on git-blame:
Custard7: 100%

services/learn-card-network/brain-service/test/boosts.spec.ts

Activity based on git-commit:

TaylorBeeston Custard7
FEB
JAN 440 additions & 1 deletions
DEC 119 additions & 0 deletions
NOV 555 additions & 20 deletions
OCT
SEP 6316 additions & 0 deletions

Knowledge based on git-blame:
TaylorBeeston: 93%
Custard7: 6%

services/learn-card-network/brain-service/test/credentials.spec.ts

Activity based on git-commit:

TaylorBeeston Custard7
FEB
JAN
DEC 48 additions & 1 deletions
NOV
OCT
SEP 486 additions & 0 deletions

Knowledge based on git-blame:
TaylorBeeston: 91%

services/learn-card-network/brain-service/test/presentations.spec.ts

Activity based on git-commit:

TaylorBeeston Custard7
FEB
JAN
DEC
NOV
OCT
SEP 502 additions & 0 deletions

Knowledge based on git-blame:
TaylorBeeston: 100%

services/learn-card-network/brain-service/test/profiles.spec.ts

Activity based on git-commit:

TaylorBeeston Custard7
FEB
JAN
DEC
NOV
OCT
SEP 2461 additions & 0 deletions

Knowledge based on git-blame:
TaylorBeeston: 97%

services/learn-card-network/brain-service/test/skill-frameworks.spec.ts

Activity based on git-commit:

TaylorBeeston Custard7
FEB
JAN
DEC
NOV 1308 additions & 0 deletions
OCT
SEP

Knowledge based on git-blame:
TaylorBeeston: 56%

✨ Comment /gs review for LinearB AI review. Learn how to automate it here.

Computer8004 pushed a commit to Computer8004/LearnCard that referenced this pull request Feb 26, 2026
CI secrets are not available to PRs from forks, causing test failures
for external contributors. This change provides a default 64-character
fallback value ('a' * 64) when secrets are not available.

Fixes CI failures on fork PRs like learningeconomy#1015.
Computer8004 pushed a commit to Computer8004/LearnCard that referenced this pull request Feb 26, 2026
CI secrets are not available to PRs from forks, causing test failures
for external contributors. This change provides a default 64-character
fallback value ('a' * 64) when secrets are not available.

Fixes CI failures on fork PRs like learningeconomy#1015.
TaylorBeeston added a commit that referenced this pull request Feb 26, 2026
…alues (#1030)

* fix: default SEED and LEARN_CLOUD_SEED for fork PRs

CI secrets are not available to PRs from forks, causing test failures
for external contributors. This change provides a default 64-character
fallback value ('a' * 64) when secrets are not available.

Fixes CI failures on fork PRs like #1015.

* Update .github/workflows/test.yml

---------

Co-authored-by: Computer <computer@agentmail.to>
Co-authored-by: Taylor Beeston <39720479+TaylorBeeston@users.noreply.github.com>
@TaylorBeeston TaylorBeeston merged commit f5a9c0b into learningeconomy:main Feb 26, 2026
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants