mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 22:11:36 -05:00
fix(dynamodb): validate sort key in buildItemKey to prevent item collisions (#506)
This commit is contained in:
1 parent
63ed81c59d
commit
247c62cd19
3 files changed
+158
-2
No files matched your search
@@ -1622,9 +1622,11 @@ public class DynamoDbService {
|
||||
String skName = table.getSortKeyName();
|
||||
if (skName != null) {
|
||||
JsonNode skAttr = item.get(skName);
|
||||
if (skAttr != null) {
|
||||
return pk + "#" + extractScalarValue(skAttr);
|
||||
if (skAttr == null) {
|
||||
throw new AwsException("ValidationException",
|
||||
"One of the required keys was not given a value", 400);
|
||||
}
|
||||
return pk + "#" + extractScalarValue(skAttr);
|
||||
}
|
||||
return pk;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user