fix(athena): read and check a request naming no catalog as AwsDataCatalog (#7061)

Athena's GetDataCatalog, ListDatabases, ListTableMetadata and
GetTableMetadata handlers read the catalog name with has() and
asText(), so a JSON null became a catalog named `null`: GetDataCatalog
then answered InvalidRequestException rather than the AwsDataCatalog
it answers for a request naming none. They now read it through the
handler's text(), as GetWorkGroup and StartQueryExecution read
WorkGroup, so a JSON null names no catalog.

Under IAM enforcement, a GetDataCatalog naming no catalog was checked
on `*` though Floci answers AwsDataCatalog, so a grant on that catalog
was refused and a deny on it did not apply, and the three catalog
reads given a JSON null CatalogName were checked on `datacatalog/null`
as well as on AwsDataCatalog. The request-resources table now reads a
request naming none, or a JSON null, as naming AwsDataCatalog for all
four, as it reads Athena's primary workgroup.

The table's regeneration also takes up drift in AWS's Service
Reference since the last sync, which the online check of both IAM
tables fails on: AWS now lists cognito-idp:DescribeTermsByClient among
the actions it authorizes DescribeTermsByClient as, so the
authorized-actions map no longer maps it to DescribeTerms and the
request-resources table checks it as its own action, and the map
gains MediaConnect's new BatchGetDestinationEndpoint and
BatchGetSourceEndpoint. Floci serves none of these operations.
This commit is contained in:
Priamo Germosen authored and GitHub committed 2026-10-31 10:27:14 -05:00
1 parent f40d784f66
commit bfd3bcbbce
8 files changed
+69 -21

No files matched your search

+2
View File
@@ -36,6 +36,8 @@ Floci emulates Amazon Athena with **real SQL execution** powered by a [floci-duc
`ListDataCatalogs` accepts `MaxResults` from 2 to 50. Floci uses 50 when it is
omitted, since the API reference does not document a default. The built-in
`AwsDataCatalog` stays first, followed by registered catalogs in name order.
`GetDataCatalog`, `ListDatabases`, `ListTableMetadata` and `GetTableMetadata`
read `AwsDataCatalog` when the request names no catalog or a JSON null.
Pass the opaque `NextToken` to continue; final pages omit it. Tokens are scoped
to the action, caller account, and request region and remain resumable after a
cursor catalog is deleted. Malformed tokens, tokens outside the 1-to-1024
+2 -1
View File
@@ -1636,7 +1636,8 @@ naming no workgroup is checked on `workgroup/primary`, where `StartQueryExecutio
`ListQueryExecutions` and `ListNamedQueries` list, and `GetWorkGroup` answers. Athena's
`ListDatabases`, `ListTableMetadata` and `GetTableMetadata` are checked on the catalog their
`CatalogName` names and on `datacatalog/AwsDataCatalog`, the Glue Data Catalog Floci reads whichever
catalog they name. Cost Explorer's cost and usage reads are checked on `*`, not on the billing view
catalog they name, and a `GetDataCatalog` naming no catalog on `datacatalog/AwsDataCatalog`, the one it
answers. Cost Explorer's cost and usage reads are checked on `*`, not on the billing view
their `BillingViewArn` gives: Floci serves no billing views and answers the account's costs whichever
one is named. Data Exports' `CreateExport` is not checked on the
ARN its `Export.ExportArn` gives, which is the new export's own. CloudTrail's `StartLogging`,