-
Notifications
You must be signed in to change notification settings - Fork 40
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
Add support for shamir recovery invitation #8819
base: master
Are you sure you want to change the base?
Conversation
2c19d47
to
c63b236
Compare
Missing tests for:
|
3dcdb16
to
35ea62b
Compare
@@ -289,8 +289,12 @@ class MemoryInvitation: | |||
type: InvitationType | |||
created_by_user_id: UserID | |||
created_by_device_id: DeviceID | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I grouped the attribute on purpose, to easily visualize those that are type dependent
if shamir_setup is None: | ||
# Since the author only knows about a shamir recovery if they are part of it, | ||
# we don't have a specific error for the case where the shamir setup doesn't exist | ||
return InviteNewForShamirBadOutcome.AUTHOR_NOT_ALLOWED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a specific reason to not define a SetupNotFound error ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIC we decided to not share the brief and removal certificates with users that are not part of the corresponding shamir. That means that users don't have a way to know whether another user has a shamir recovery setup when they are not part of it. For this reason, it would be weird to have the server give this information through an error status.
3. Start the invitation process from a device already part of the organization, | ||
then follow the steps on the Parsec client. | ||
{% elif is_shamir_recovery_invitation %} | ||
3. Get in touch with <b>{{ greeter }}</b> and follow the next steps on the Parsec client. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is one mail sent per greeter ? Does the order of greeter matter ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this context, the greeter is the user that created the invitation link. That user is part of the recipients so it's a good idea to include their name in the mail, although the claimer will have to contact some of the other recipients too.
InvitationEmailSentStatus::RecipientRefused => { | ||
println!( | ||
"Invitation email not sent to {} because the recipient was refused", | ||
); | ||
} | ||
InvitationEmailSentStatus::ServerUnavailable => { | ||
println!( | ||
"Invitation email not sent to {} because the server is unavailable", | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the email was not sent, should the CLI fail with an error ?
It's expected that the message being print to stdout and not stderr ? (println
vs eprintln
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand the email sent status as extra information, so maybe it could be a warning if the mail wasn't sent properly?
Also we should probably start a discussion about making sure that all commands use the same approach to error handling.
Missing multiple news fragments for the CLI change |
You mean for #8429 or for other shamir related commands? I don't think it's worth adding newsfragments for the different shamir commands, a single newsfragment commenting the general feature at the end is enough IMO. |
You would expect at least 2 newsfragment: one for the updated example in the CLI help message, and the other that could group the change related to the added/updated shamir command |
Does that really deserve a newsfragment though? I'd say no, but I can add it if necessary.
This will come later once the feature is fully implemented. |
#[arg(long)] | ||
email: String, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think of providing the email as a argument over an option ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does our clap_parser_with_shared_opts_builder
allow to do that?
libparsec/crates/protocol/schema/invited_cmds/invite_info.json5
Outdated
Show resolved
Hide resolved
@@ -489,7 +489,8 @@ fn invitation_addr_bad_type( | |||
&url, | |||
AddrError::InvalidParamValue { | |||
param: "a", | |||
help: "Expected `a=claim_user` or `a=claim_device`".to_string(), | |||
help: "Expected `a=claim_user`, `a=claim_device` or `a=claim_shamir_recovery`" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: Could we use constant here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel free to provide a suggested change
Part of #6090
Close #7359
Fix #8429
Tested with: