Skip to content
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 sending the password for a link share by Nextcloud Talk #11875

Conversation

danxuliu
Copy link
Member

@danxuliu danxuliu commented Oct 16, 2018

Requires nextcloud/spreed#1273

Sending the password by Nextcloud Talk for a link share behaves slightly different than when doing it for an e-mail share. When an e-mail share is protected with a password an e-mail is sent with the password. Due to this, when the password is protected by Talk a new password must be always set; otherwise the recipient would already have the password, and thus she would not need to request it to the sharer and protecting it by Talk would be pointless.

However, in the case of link shares, just setting the password does not disclose it to anyone; the sharer must explicitly send it to someone to be known. Therefore, when protecting the password of a link share by Talk it is not mandatory to set a different password than the one set before; protecting the password by Talk in this case is an additional step to protecting the share with a password. Due to this the checkbox to protect the password by Talk is shown only when there is a password set for the link share.

share-link-menu-no-password
share-link-menu-password

Reviewers: Although the Talk counterpart is still in development state the server part is ready for review and can be merged now even if the Talk part is not ready yet; the missing parts in Talk are just better naming of rooms and a more useful text in the notifications, but besides that it just works (or, at least, it should :-) ).

@danxuliu danxuliu added the 2. developing Work in progress label Oct 16, 2018
@danxuliu danxuliu force-pushed the add-support-for-sending-the-password-for-a-link-share-by-nextcloud-talk branch from 933efa0 to b4a5b7b Compare October 17, 2018 09:01
@danxuliu danxuliu added enhancement 3. to review Waiting for reviews feature: sharing and removed 2. developing Work in progress labels Oct 26, 2018
@danxuliu danxuliu added this to the Nextcloud 15 milestone Oct 26, 2018
@danxuliu danxuliu force-pushed the add-support-for-sending-the-password-for-a-link-share-by-nextcloud-talk branch from b4a5b7b to 9e5440f Compare October 26, 2018 16:48
Copy link
Member

@rullzer rullzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good. And yay for tests

Copy link
Member

@skjnldsv skjnldsv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐘

Copy link
Member

@skjnldsv skjnldsv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐘 🐘

@MorrisJobke
Copy link
Member

@danxuliu Could you resolve the conflicts? Most likely due to #12163

@MorrisJobke MorrisJobke added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Nov 1, 2018
@danxuliu danxuliu force-pushed the add-support-for-sending-the-password-for-a-link-share-by-nextcloud-talk branch from 9e5440f to aa6fc9e Compare November 1, 2018 12:23
@danxuliu
Copy link
Member Author

danxuliu commented Nov 1, 2018

Could you resolve the conflicts? Most likely due to #12163

Done (and, for reference, the conflicts came from #11898 ;-) ).

@MorrisJobke
Copy link
Member

CI failure due to the newly added "hide_download" setting ;)

@MorrisJobke MorrisJobke added 2. developing Work in progress and removed 4. to release Ready to be released and/or waiting for tests to finish labels Nov 1, 2018
@danxuliu danxuliu force-pushed the add-support-for-sending-the-password-for-a-link-share-by-nextcloud-talk branch from aa6fc9e to 5edc746 Compare November 1, 2018 17:28
@danxuliu
Copy link
Member Author

danxuliu commented Nov 1, 2018

CI failure due to the newly added "hide_download" setting ;)

"Someone" forgot to run the PHP tests before pushing... :-P Fixed now, and as an extra I also added some missing (minor) tests for notes and hide download ;-)

@MorrisJobke
Copy link
Member

CI failure is a segfault in the memcache tests -> ignore it.

@MorrisJobke MorrisJobke added the 3. to review Waiting for reviews label Nov 1, 2018
@MorrisJobke MorrisJobke removed the 2. developing Work in progress label Nov 1, 2018
Copy link
Member

@MorrisJobke MorrisJobke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good 👍

@MorrisJobke
Copy link
Member

I will wait with the merge of this after I merged #11844

@MorrisJobke MorrisJobke added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Nov 1, 2018
The update share tests only checked that the share returned by
"update()" had the expected values. However, as "update()" returns the
same share that was given as a parameter the tests were not really
verifying that the values were updated in the database.

In a similar way, the test that checked that a password was removed did
not set a password first, so even if the database returned null it could
be simply returning the default value for the share; a password must be
set first to ensure that it is removed.

Besides that, a typo was fixed too that made the checks on the original
share instead of on the one returned by "update()"; right now it is the
same share, so the change makes no difference, but it is how the check
should be done anyway.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
@danxuliu danxuliu force-pushed the add-support-for-sending-the-password-for-a-link-share-by-nextcloud-talk branch from 5edc746 to 86ad85c Compare November 2, 2018 01:55
@MorrisJobke
Copy link
Member

@danxuliu The failing acceptance tests in here are the ones you mentioned that they also fail on master, right?

When Talk is enabled the menu for link shares now shows a checkbox to
protect the password by Talk (that is, to show the "Request password by
Talk" UI in the authentication page for the link share).

Although in e-mail shares protecting the share with a password and
protecting the password by Talk are mutually exclusive actions (as when
the password is set it is sent to the sharee, so it must be set again
when protecting it by Talk to be able to verify the identity of the
sharee), in the case of link shares protecting the password by Talk is
an additional step to protecting the share with a password (as just
setting the password does not disclose it to anyone). As such, the
checkbox is shown only when there is a password set for the link share
(even if the field itself for the password is not shown, like when they
are enforced in the settings).

Note that the icon set for the field, "icon-passwordtalk", does not
currently exist; it is the same used for e-mail shares, and it is needed
simply to get the right padding in the menu.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
@danxuliu danxuliu force-pushed the add-support-for-sending-the-password-for-a-link-share-by-nextcloud-talk branch from 93feac7 to f57b07e Compare November 2, 2018 12:57
@danxuliu
Copy link
Member Author

danxuliu commented Nov 2, 2018

I have fixed the rendering by making the view to render again only when the password changes; it is not optimal, but at least it does not render again the whole view whenever a link share changed (and thus respects the changes made in #11844 ;-) ).

The failing acceptance tests in here are the ones you mentioned that they also fail on master, right?

Yes, fixed in #12215

@rullzer rullzer merged commit 30a1237 into master Nov 2, 2018
@rullzer rullzer deleted the add-support-for-sending-the-password-for-a-link-share-by-nextcloud-talk branch November 2, 2018 13:54
@jancborchardt
Copy link
Member

Especially considering this added yet another entry to the menu, I would really love your feedback on #12178 ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish enhancement feature: sharing high
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants