You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Plugin api: bless getWebIdFromRequestAsync as api.auth.getAgent (request → WebID) #584
Split out of #206 (plugin-zero results comment): the third seam from the Tideholm mount — and the happiest finding, because no new code is needed, only a public blessing.
Finding
getWebIdFromRequestAsync(request) in src/auth/token.js already does everything an app plugin needs to answer "who is this?": Bearer (IDP-issued), Solid-OIDC DPoP, Nostr NIP-98, and LWS10-CID, uniformly, returning { webId, error }. The Tideholm adapter uses it directly and pod identities become game players with zero auth code of their own ("your WebID is your player").
The problem is only that reaching into src/auth/token.js is an internal import — the function's location, name, and shape are all unwarranted by anything public. Plugin zero works today and breaks the day auth is refactored.
Proposal
Bless it as the loader's identity seam:
api.auth.getAgent(request)// -> Promise<string|null> (WebID or null)
Thin wrapper over getWebIdFromRequestAsync, returning just the WebID (plugins that want the error detail can get a second method or the raw result later — start minimal).
Authentication only, deliberately not authorization: apps under an appPaths prefix (sibling issue) own their own permissioning; WAC stays out of their jurisdiction.
Until the loader lands, exporting it from the package root (javascript-solid-server/auth) would give manually-composed apps a stable import path.
Acceptance
Stable public accessor for request → WebID covering all four token types
Contract test pinning the shape (so auth refactors keep the seam)
Tideholm adapter migrated onto it (I'll do this the day it exists)
import{getAgent}from'javascript-solid-server/auth.js';constagent=awaitgetAgent(request);// WebID or did:nostr DID, null if anonymous
Contract notes that came out of review:
Returns the verified agent identifier — usually an HTTP(S) WebID, but a did:nostr: DID for NIP-98 agents without a WebID mapping. That's deliberate (DID agents are first-class); callers wanting strictly-HTTP WebIDs filter on the prefix.
Covers all five credential schemes: IdP Bearer, Solid-OIDC DPoP, Nostr NIP-98, LWS10-CID, WebID-TLS.
Bearer verification reads only headers; the signed schemes also read method/url/protocol/hostname — pass the real request.
Never throws on bad credentials.
Acceptance status:
Stable public accessor covering all schemes
Contract test (test/auth-agent.test.js)
Tideholm adapter migrated — b6774da: plugin zero now imports getAgent from javascript-solid-server/auth.js, zero internal-path auth imports remain
Activity
review(docs): appPaths requests never carry request.webId
bump version to 0.0.213
feat(auth): public getAgent accessor — request → WebID (#584) (#586)
bump version to 0.0.214
melvincarvalho commentedon Jul 10, 2026
Shipped in v0.0.214 (#586, squashed as 327bb01):
Contract notes that came out of review:
did:nostr:DID for NIP-98 agents without a WebID mapping. That's deliberate (DID agents are first-class); callers wanting strictly-HTTP WebIDs filter on the prefix.headers; the signed schemes also readmethod/url/protocol/hostname— pass the real request.Acceptance status:
test/auth-agent.test.js)feat(plugins): createServer({ plugins }) — the #206 loader (#589)
bump version to 0.0.215
feat(server): appPaths — WAC-exempt application mount points (JavaScr…