-
Notifications
You must be signed in to change notification settings - Fork 864
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
VerifiedPermissions - Vague error returned when passing in attributes containing empty sets. #3645
Comments
Yes, as you suspected this is happening because the SDK will initialize collections by default in V3. In that same blog post you linked, there's another section on how we're addressing that in V4 (currently in preview and being tracked in #3362):
If I run your reproduction code but set that flag to
|
Unfortunately I am also working on a library, which means I cannot responsibly set a global flag in the awssdk that would affect other parts of the applications using my library. My workaround for now will be to say the library does not support empty sets as attributes, and internally remove any attribute item that is an empty set. Agree that V4 will help and look forward to upgrading to V4 when its released. |
@elexisvenator Good morning. Thanks for the response. The error is returned by the service due to empty body. Unfortunately, we do not have a request specific flag to flip the behavior in version |
Describe the bug
Calling
AmazonVerifiedPermissionsClient.IsAuthorized
orAmazonVerifiedPermissionsClient.BatchIsAuthorized
requires a series of entities to be passed in. These entities contain attributes which are dictionaries of values similar to what you would find on dynamodb.If you set an attribute's value to an empty set (which is a valid value) then an error is thrown that does not provide any information as to what went wrong. This is a problem as depending on your access model and policies the difference between an attribute with an empty set and a missing attribute may change the outcome of the access check.
Regression Issue
Expected Behavior
Running the same command in the console will not produce an error and will process the access check correctly.
(note nothing in this picture is sensitive data)
Current Behavior
The error is as follows (calling BatchIsAuthorized):
Reproduction Steps
Minimal reproduction (note that depending on your schema you may get a validation exception once this bug is fixed, but that is better than the current error)
Possible Solution
After reading the sdk V4 blogs I think the issue is related to what was discussed in this paragraph
https://aws.amazon.com/blogs/developer/preview-1-of-aws-sdk-for-net-v4/
Given this, I am not sure how this issue should be fixed in V3. It's a bit more problematic than not understanding intent though as it causes invalid payloads.
Additional Information/Context
No response
AWS .NET SDK and/or Package version used
AWSSDK.VerifiedPermissions 3.7.401.18
Targeted .NET Platform
.NET 9
Operating System and version
Windows 11
The text was updated successfully, but these errors were encountered: