IronCoreLabs / IronCoreLabs/ironoxide

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

Open
#18 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
12
Forks
3
Avg merge
5h 4m
Merged PRs (30d)
3

Description

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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the Rust document_encrypt path using DocumentEncryptOpts, ExplicitGrants, and UserOrGroup, then trace where grant validation produces the current access error. Done means an attempted share with nonexistent users or groups reports the requested recipients and why the grant could not succeed, while still returning an error.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
authorization, cryptography
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.