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

Bad error in the case of encrypt to users who don't exist. #18

Open
coltfred opened this issue Jul 14, 2019 · 1 comment
Open

Bad error in the case of encrypt to users who don't exist. #18

coltfred opened this issue Jul 14, 2019 · 1 comment

Comments

@coltfred
Copy link
Member

There are other sets of steps which produce this same result, but this is the simplest IMO.

  1. Initialize IronOxide.
  2. Call document_encrypt with DocumentEncryptOpts which only has ExplicitGrants{grant_to_author:false, grants: [UserOrGroup::User("does_not_exist")}

Result: The function will error with grants' failed validation with the error 'Access must be granted to document DocumentId("XXXXXXXXXXXXXXXX") by explicit grant or via a policy'

Expected result: The function should error telling you which people it tried to share with and why that didn't work. It's right to error all the way out, but since I did send in a valid ExplicitGrant I shouldn't get this error. As the caller I'm confused because I did send an ExplicitGrant, it's just a grant that didn't result in valid users.

I think we should add an error that catches the case and tells them what users or groups we tried to share with and why it couldn't be successful.

@coltfred coltfred changed the title Bad error in the case of policy that evaluates to a group that doesn't exist Bad error in the case of encrypt to users who don't exist. Jul 14, 2019
@clintfred
Copy link
Contributor

As of #27 the code to resolve public keys from grants/policies was consolidated in resolve_keys_for_grants. This would be a perfect place to use a non-empty list like vec1

resolve_keys_for_grants should with return a vec1 or error, preventing the confusing error situation described above.

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

No branches or pull requests

2 participants