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

Also list shared ciphers in find_by_user #14

Merged
merged 3 commits into from May 13, 2018

Conversation

mprasil
Copy link
Contributor

@mprasil mprasil commented May 11, 2018

This splits the find_by_user into two separate functions: find_owned_by_user which retains previous functionality and lists only ciphers directly owned by user and find_by_user which now also lists all ciphers shared with user.

As a result shared ciphers are now visible in user's vault.

There's also small change in the /api/ciphers/purge handler to use the find_owned_by_user instead to only purge user's content and not the shared stuff.

@mprasil mprasil mentioned this pull request May 11, 2018
15 tasks
@dani-garcia
Copy link
Owner

With some light testing I've noticed a bug: If a cipher is added to more than one collection, the method returns multiple copies of the cipher, which seems to break the web vault listing, you need to make sure that the method doesn't return duplicated ciphers.

You should also change the /accounts/delete handler to also use the new owned function as well.

@mprasil
Copy link
Contributor Author

mprasil commented May 12, 2018

Well spotted! I'll have a look at that.

@mprasil
Copy link
Contributor Author

mprasil commented May 13, 2018

I believe the bug should be fixed with distinct(). I've also updated /accounts/delete to use proper function.

BTW /accounts/delete and /ciphers/purge have a lot in common, I might look into moving the common functionality under cipher.rs in some later PR if you agree.

@dani-garcia
Copy link
Owner

Okay, I've tested it again and it works correctly now, so I'll merge this. If you want to reduce the duplication in those functions in another PR, i'm OK with it.

@dani-garcia dani-garcia merged commit c29d342 into dani-garcia:master May 13, 2018
@mprasil mprasil deleted the shared_cipher branch May 13, 2018 13:29
thelittlefireman pushed a commit to thelittlefireman/bitwarden_rs that referenced this pull request Mar 19, 2021
Also list shared ciphers in find_by_user
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants