-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(iroh): add node wide default author for documents #2299
Merged
Conversation
This file contains 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
4 tasks
I think this would be good to have, but we can add it later when needed |
added this in the most recent commit! |
Frando
force-pushed
the
feat/default-author
branch
2 times, most recently
from
May 17, 2024 10:30
850ad4e
to
d5c9dc5
Compare
Frando
force-pushed
the
feat/default-author
branch
2 times, most recently
from
May 17, 2024 12:59
8f708de
to
b200d4b
Compare
Frando
force-pushed
the
feat/default-author
branch
from
May 21, 2024 09:03
bf6a6ae
to
8e5c238
Compare
dignifiedquire
force-pushed
the
feat/default-author
branch
from
May 22, 2024 11:53
b463910
to
5ccdf0b
Compare
Frando
force-pushed
the
feat/default-author
branch
from
May 23, 2024 00:00
7fbaccf
to
62423aa
Compare
## Description We used to store the console files (history and current author) in a subdirectory `console` under the iroh data dir. This got lost in some refacorings, and the console files currently are created in the iroh data directory directly. This is bad because the iroh data directory is a single namespace, and we should use it cautiously. This PR goes back to using a `console` subdirectory. Existing files are migrated on first start of the console. Based on #2299 because this already made the environment init functions async. ## Breaking Changes <!-- Optional, if there are any breaking changes document them, including how to migrate older code. --> ## Notes & open questions <!-- Any notes, remarks or open questions you have to make about the PR. --> ## Change checklist - [ ] Self-review. - [ ] Documentation updates if relevant. - [ ] Tests if relevant. - [ ] All breaking changes documented.
dignifiedquire
approved these changes
May 23, 2024
dignifiedquire
changed the title
feat: node-wide default author for documents
feat(iroh): add node wide default author for documents
May 23, 2024
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.
Description
This adds the notion of a node-wide default author for documents.
The default author can be retrieved via
iroh.authors.default()
. On persistent nodes, on first start a new author is created and its public key is saved toIROH_DATA_DIR/default-author
(as a base32 string). For in-memory nodes, a new author is created.When trying to delete the default author via
iroh.authors.delete
, an error is returned, stating that the default author may not be deleted.The default author can be changed with
iroh.authors.set_default
.If the
default-author
file is deleted manually, a new default author will be created on the next start.Breaking Changes
iroh.authors.default()
, which returns the author id of a single default author per nodeiroh.authors.set_default(&self, author_id: AuthorId)
, which allows to set the default author for the nodeiroh::util::path::IrohPaths
enum gained new variantDefaultAuthor
Notes & open questions
There are certainly other ways to go around the interactions between the iroh-local notion of a default author and the author database in the iroh-docs store. Quoting from discord (this PR implements option B.1):
Change checklist