mirror of
https://github.com/floci-io/floci.git
synced 2026-11-27 07:39:24 -05:00
fix(dynamodb): authorize ListTables against its regional collection (#7336)
* fix(dynamodb): authorize ListTables against its regional collection * test(dynamodb): reject ListTables authorization through ignored selectors * fix: generate the DynamoDB ListTables request resource Record the measured table collection as a generated correction and dispatch table-owned operations before hand-built fallbacks. Preserve batch, transaction and PartiQL resource extraction. Signed-off-by: Andre Kurait <AndreKurait@gmail.com> --------- Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
This commit is contained in:
1 parent
2b07f85a71
commit
918c57a64e
10 files changed
+223
-10
No files matched your search
@@ -50,6 +50,11 @@ public final class RequestResources {
|
||||
private RequestResources() {
|
||||
}
|
||||
|
||||
/** Whether the generated table owns this operation, including corrections to hand-built namespaces. */
|
||||
public static boolean reads(String operation) {
|
||||
return operation != null && RequestResourceMembers.table().operations().containsKey(operation);
|
||||
}
|
||||
|
||||
/**
|
||||
* The ARNs of the resources a request names, in the request's partition, Region and account: empty when the
|
||||
* table does not read the operation or its request names none, so it is checked on {@code *}. The operation,
|
||||
|
||||
@@ -190,6 +190,9 @@ public class ResourceArnBuilder {
|
||||
if (credentialScope == null) {
|
||||
return List.of("*");
|
||||
}
|
||||
if (operation != null && operation.startsWith(credentialScope + ":") && RequestResources.reads(operation)) {
|
||||
return namedResources(credentialScope, operation, ctx, region, accountId, partition);
|
||||
}
|
||||
String path = "s3".equals(credentialScope) ? ctx.getUriInfo().getPath()
|
||||
: IamActionRegistry.decodedPath(ctx);
|
||||
return switch (credentialScope) {
|
||||
|
||||
Reference in new issue
Block a user