Skip to content

feat: ESSR authentication mode for KERIA API#335

Open
iFergal wants to merge 18 commits intoWebOfTrust:mainfrom
cardano-foundation:feat/essrTake2
Open

feat: ESSR authentication mode for KERIA API#335
iFergal wants to merge 18 commits intoWebOfTrust:mainfrom
cardano-foundation:feat/essrTake2

Conversation

@iFergal
Copy link
Collaborator

@iFergal iFergal commented Jun 24, 2025

Requires a new dev release once KERIA PR merged for integration tests.

This is the corresponding PR for WebOfTrust/keria#351. This newer version now allows both signed headers like before (with some refactoring), and ESSR - defined when creating the client. The default is signed headers.

createSignedRequest also remains.

@codecov
Copy link

codecov bot commented Jun 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.07%. Comparing base (78d0a69) to head (17514db).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #335      +/-   ##
==========================================
+ Coverage   97.53%   99.07%   +1.54%     
==========================================
  Files           1        1              
  Lines         324      326       +2     
  Branches       24       28       +4     
==========================================
+ Hits          316      323       +7     
+ Misses          8        3       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

services:
vlei-server:
image: gleif/vlei
image: gleif/vlei:0.2.0
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@kentbull There seems to be a problem with the latest vLEI docker image - see here: https://github.com/WebOfTrust/signify-ts/actions/runs/15855574402/job/44699896180 in Print logs section.

Server seems to be returning application/json instead of application/schema+json and it's causing KERIA to crash. (which sounds like another unhandled issue)

For now, locking it to the old version here works to get the integration tests to pass.

@iFergal iFergal marked this pull request as ready for review July 2, 2025 15:34
if (extraHeaders) {
extraHeaders.forEach((value, key) => {
final_headers.append(key, value);
headers.append(key, value);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't see any reason to not sign extraHeaders

body: _body,
headers: final_headers,
});
if (!res.ok) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

imo signature should be verified for non 2xx responses too

*/
async get(name: string): Promise<HabState> {
const path = `/identifiers/${encodeURIComponent(name)}`;
const path = `/identifiers/${name}`;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

encodeURIComponent was missing everywhere else that used name in case you passed something with special characters. However, this PR switches things to use new URL(url).pathname which automatically encodes things.

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