Repository navigation
Key removal under Advanced; profile-key logic in a tested library - #7
Merged
Merged
Conversation
The merge, idempotence, fragment choice and removal rules move out of the page into pure functions (find a method by key, merge one in, take one out, next free fragment), covered by node --test fixtures with relative and absolute ids, string and object entries. package.json gains test and check scripts; a workflow runs both.
For a lost or replaced key: the keys the pod accepts are listed with a Remove button that asks twice, then PUTs the profile without the method and without any authentication or assertionMethod reference to it. The page uses the shared lib for merging too.
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.
Two commits.
Library and tests. The merge, idempotence, fragment-choice and removal rules move out of
doctor.jsinto pure functions inlib/profile-keys.js(find the method holding a key, merge one in, take one out, next free#nostr-key-N).test/profile-keys.test.jscovers them with fixtures using relative and absolute ids, string and object entries, single values and arrays.package.jsongainstestandcheck(syntax plus vendored checksums); a workflow runs both on push and PR.Removal. Under Advanced, "Nostr keys in this profile" lists every Multikey method that encodes a Nostr key, with a Remove button that asks twice, then PUTs the profile without the method and without any
authenticationorassertionMethodreference to it.Verified against a local JSS: a second key linked as
#nostr-key-2, listed, removed; the profile afterwards holds only#nostr-key-1. Note that JSS caches profile lookups on the NIP-98 path for five minutes (src/auth/cid-doc-fetch.js), so a removed key keeps working for up to that long; the note on the page says so.