Files
floci/src/main/java/io/github/hectorvent
Abhishek Dubey a40dc52f4d feat: implement read-only describe/list APIs for resource collection (#1581)
* feat: implement read-only describe/list APIs for resource collection

Several read-only AWS actions returned UnsupportedOperation (HTTP 400) — or,
where no route existed, a 404 the AWS SDKs deserialize to a retryable
UnknownError. Both break clients that enumerate an account read-only: the 400
aborts the collection of the whole resource type, and the 404 sends the SDK
through its full retry/backoff schedule (~9 attempts, minutes) on every call.

Implement minimal, wire-accurate responses that mirror each service's documented
contract so SDK clients complete the read:

- IAM
  - GetLoginProfile -> NoSuchEntity (404), the documented result when a user has
    no console password; clients branch on it, so a 200 or 400 misleads them.
  - GetAccessKeyLastUsed -> the "never used" shape (ServiceName/Region = N/A, no
    LastUsedDate).
  - ListSAMLProviders / ListOpenIDConnectProviders / ListServerCertificates ->
    empty lists (non-paginated; ListServerCertificates carries IsTruncated=false).
- RDS: DescribeDBSnapshots / DescribeDBProxies / DescribeDBClusterSnapshots ->
  empty results (empty wrapper, no Marker).
- DocDB: DescribeDBClusterSnapshots -> empty result (RDS namespace).
- ElastiCache: DescribeCacheSubnetGroups / DescribeCacheParameterGroups -> empty.
- Glue: GetJobs / GetCrawlers / ListDataQualityRulesets /
  GetSecurityConfigurations / GetTags -> empty result under each result key.
- SSM: ListDocuments / ListAssociations / DescribeMaintenanceWindows -> empty
  (NextToken omitted).
- AWS Backup: GetBackupVaultNotifications / GetBackupVaultAccessPolicy ->
  ResourceNotFoundException (400), the documented "not configured" signal.
- S3 Control: ListAccessPoints -> empty AccessPointList (200), replacing the
  missing-route 404 that triggered the SDK retry storm.

Responses are grounded in the AWS API reference for each action (error codes,
HTTP statuses, and "empty"/"never used" shapes). Adds focused unit and
integration tests for each handler.

* docs: ground ListAccessPoints comment in the S3 Control contract

Drop the consumer-specific retry magnitude ("~9 attempts") from the
ListAccessPoints comment and justify the empty-200 response purely on the AWS
contract: ListAccessPoints documents a single success path — HTTP 200 with an
AccessPointList (empty when the account has none) and an optional NextToken.
404 is not a documented outcome for the operation, so a missing route leaves
SDK clients unable to map the response to the expected result or a known error.

* fix(glue): keep GetTags delegating to the schema registry

The earlier commit replaced Glue GetTags with a hardcoded empty {"Tags":{}},
which regressed the schema-registry tagging path: GetTags must return the tags
stored for a registry/schema ARN and InvalidInputException for an unknown ARN.
Restore the original handleGetTags delegation and drop the empty-stub test for
it. GetTags was already implemented — only GetJobs/GetCrawlers/
ListDataQualityRulesets/GetSecurityConfigurations were genuine gaps, and those
remain empty stubs.

Fixes GlueSchemaRegistryMetadataAndTagsIntegrationTest (getTagsReturnsAddedTags,
untagResourceRemovesKey, getTagsOnUnknownArnReturnsInvalidInput) and the
sdk-test-java GlueSchemaRegistryTest compat failure.

* fix(iam): omit empty UserName from GetAccessKeyLastUsed

UserName is optional in the IAM model and its type is non-empty
(length 1-128). The emulator has no AccessKeyId->UserName lookup, so
emitting an empty <UserName></UserName> could be rejected by a strict
client. Omit the element entirely instead; callers that need the owner
already have it from the preceding ListAccessKeys response.

* fix(backup): drop unused headers param from vault notification/access-policy stubs

* test(iam): cover GetLoginProfile, ListSAMLProviders, ListOpenIDConnectProviders, ListServerCertificates
2026-07-06 22:49:55 -05:00
..