aws sdk - How to get only the rows user has access in Dynamodb using batch get item? -


i'm trying protect rows of dynamodb table based on key. can accomplish using dynamodb:leadingkeys condition. works if make single getitem query. have several rows load/check access, , want query of them @ once, , receive rows user has access.

for instance have following table in dynamo:

accesstype | key public | private | b

using following policy:

 {         "sid": "restrictprivate",         "effect": "allow",         "action": [             "dynamodb:batchgetitem",             "dynamodb:describetable",             "dynamodb:getitem",             "dynamodb:listtables",             "dynamodb:query",             "dynamodb:scan"         ],         "resource": [             "arn:aws:dynamodb:region:acc:table/keys"         ],         "condition": {             "forallvalues:stringequals": {                 "dynamodb:leadingkeys": [                     "public"                 ]             }         }     } 

it works single row query:

query key=a - returns ok

query key=b - returns accessdeniedexception

but slow, i'd make bulkgetitem , rows have access, if bulkgetitem results contains 1 denied row, fail entirely.

is there way query multiple rows containing allowed , disallowed rows, returning allowed ones 1 request?


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -