Skip to content

Commit 001d832

Browse files
review: merge generateProfileJsonLd JSDoc blocks (JavaScriptSolidServer#444)
The fresh-pod-only note added in 2285d05 lived in a separate JSDoc block above the original — JSDoc tooling only associates the closest block to the symbol, so the original @param entries for webId/name/podUri/issuer/@returns were getting orphaned. Merged into one block with the ownerVm @param + the fresh-pod warning inline. 855/855 tests pass.
1 parent e8a268b commit 001d832

1 file changed

Lines changed: 17 additions & 13 deletions

File tree

src/webid/profile.js

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,30 @@ const CID = 'https://www.w3.org/ns/cid/v1#';
1616
const LWS = 'https://www.w3.org/ns/lws#';
1717

1818
/**
19-
* Generate JSON-LD data for a WebID profile
19+
* Generate JSON-LD data for a WebID profile.
20+
*
2021
* @param {object} options
2122
* @param {string} options.webId - Full WebID URI (e.g., https://example.com/alice/profile/card#me)
2223
* @param {string} options.name - Display name
2324
* @param {string} options.podUri - Pod root URI (e.g., https://example.com/alice/)
2425
* @param {string} options.issuer - OIDC issuer URI
26+
* @param {object} [options.ownerVm] - Optional verificationMethod
27+
* entry for an owner-held key (Phase 2 of #437 / #443). Build via
28+
* `src/keys/provision.js#buildOwnerVerificationMethod`.
29+
*
30+
* **Fresh-pod-only when `ownerVm` is set.** The helper unconditionally
31+
* overwrites `verificationMethod`, `authentication`, and
32+
* `assertionMethod` with single-element arrays referencing this VM.
33+
* That's correct for the only current caller (fresh pod creation,
34+
* nothing to overwrite), but a future "rotate-keys" / re-provisioning
35+
* command using this helper to regenerate an existing profile would
36+
* silently drop any VMs / proof-purpose references the operator
37+
* added by hand. Either pass the existing profile through a merge
38+
* step before calling this, or treat the helper as fresh-pod-only.
39+
* See #444 review.
40+
*
2541
* @returns {object} JSON-LD profile data
2642
*/
27-
/**
28-
* NOTE on `ownerVm`: when provided, this helper unconditionally
29-
* overwrites `verificationMethod`, `authentication`, and
30-
* `assertionMethod` with single-element arrays. That's correct for
31-
* the only current caller (fresh-pod creation, where there's nothing
32-
* to overwrite), but if a future "rotate-keys" / re-provisioning
33-
* command ever calls this helper to regenerate an existing profile,
34-
* it will silently drop any VMs / proof-purpose references the
35-
* operator added by hand. Either pass the existing profile through
36-
* a merge step before calling this, or treat this helper as
37-
* fresh-pod-only. See #444 review.
38-
*/
3943
export function generateProfileJsonLd({ webId, name, podUri, issuer, ownerVm = null }) {
4044
const pod = podUri.endsWith('/') ? podUri : podUri + '/';
4145
// Document URL is the WebID without its fragment; service entries use

0 commit comments

Comments
 (0)