mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 14:10:49 -05:00
5bf8075d52840b20ae4f0fa2d4efe4c46c2cc2fa
62
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
efcbc4d993 | feat(marketplace-metering): emulate AWS Marketplace Metering API (#3344) | ||
|
|
3c080e1ea6 | feat(marketplace-reporting): emulate AWS Marketplace Reporting API (#3343) | ||
|
|
6b17ef2b1c |
feat(redshift): emulate GetClusterCredentials and GetClusterCredentialsWithIAM (#3273)
* feat(redshift): add RedshiftCredentialBroker for short-lived Db credentials * refactor(rds-proxy): widen PasswordValidator to a three-value AuthResult The wire-level password check the PostgreSQL/MySQL proxy handlers take now returns REJECT / PASSTHROUGH / MASTER_EQUIVALENT instead of a boolean, so a caller can tell the proxy to open the backend leg as the cluster master for a client it has vouched for. RdsAuthProxy keeps its own boolean master-password callback, renamed MasterPasswordCheck to free the PasswordValidator name, and adapts it at the handler boundary (non-master stays PASSTHROUGH). * feat(redshift): auth proxy accepts live GetClusterCredentials credentials passwordValidatorFor now returns AuthResult and consults RedshiftCredentialBroker: the master pair and any live minted credential resolve to MASTER_EQUIVALENT, a known broker user with a stale password is REJECTed, everyone else PASSTHROUGH. * feat(redshift): add default-credential-duration-seconds config * feat(redshift): implement GetClusterCredentials action Mints a short-lived DbUser/DbPassword pair via RedshiftCredentialBroker and returns it as Query-protocol XML. AutoCreate prefixes IAM: on the DbUser, DbGroups are echoed, DurationSeconds is validated to 900-3600 (default from the new config key), and an unknown ClusterIdentifier propagates ClusterNotFound. The two credential actions are registered in AwsQueryController.REDSHIFT_ACTIONS and the Query dispatch now forwards the Authorization header to the handler. * feat(redshift): implement GetClusterCredentialsWithIAM action Derives the DbUser from the caller's IAM identity resolved via the Authorization header: an IAM user maps to IAM:<name>, an assumed role to IAMR:<role>, and an unresolvable caller to the IAMR:floci fallback with a WARN so local and CI flows are not blocked. Any DbUser request parameter is ignored. * feat(redshift-data): resolve non-master DbUser via GetClusterCredentials resolveViaDbUser now accepts a DbUser that has a live credential in RedshiftCredentialBroker, connecting to the container as the cluster master (the minted DbUser is nominal). An unknown non-master DbUser still fails with ValidationException. * test(redshift): end-to-end GetClusterCredentials + Data API non-master DbUser Docker-gated: mints a credential for a non-master DbUser via GetClusterCredentials then runs SELECT 1 through the Data API as that DbUser, asserting the result. * test(compat): SDK coverage for Redshift GetClusterCredentials Adds getClusterCredentials and getClusterCredentialsWithIAM assertions to the AWS SDK Redshift compatibility test. * docs(redshift): document GetClusterCredentials and GetClusterCredentialsWithIAM Regenerates the redshift.md action table (excluding the DbGroups member-name switch label), fills the two new descriptions, updates the wire-auth and redshift-data.md DbUser notes, and bumps the Service Matrix count to 23. * fix(redshift): reject a wrong master password instead of passing it through passwordValidatorFor only treated the master pair as MASTER_EQUIVALENT and let everything else fall to the broker. A request with the master username but a wrong password is unknown to the broker, so it classified as PASSTHROUGH; the wire proxy then opened the backend leg as master (isMaster is username-only) and the client authenticated with the wrong password. Now the master username is decided on its own password: match to MASTER_EQUIVALENT, mismatch to REJECT. * fix(redshift): reject proxy logins when the cluster row is gone; strip IAM user path passwordValidatorFor fell through to the broker when the cluster was absent from the account partition, classifying an unknown user as PASSTHROUGH; the wire proxy reads isMaster from its own start-time config, so that still opened the backend as master for the master username with any password. Return REJECT when there is no cluster row to validate against. RedshiftIamDbUserResolver now strips an IAM path prefix from a user ARN (user/team/alice -> alice), matching how AWS names the DbUser. * fix(redshift): keep concurrent credentials, revoke on delete, bound the config default Addresses PR review (greptile): - RedshiftCredentialBroker now holds every unexpired credential per DbUser instead of one slot, so a reissue no longer invalidates a still-live password (matches AWS, which keeps each issued credential valid to its own expiry). - Add revokeCluster(); RedshiftService calls it on deleteCluster and at the start of createCluster, so a cluster recreated with the same identifier does not inherit master-equivalent access from a stale credential. - resolveDurationSeconds now holds the YAML default to the same 900-3600 bounds as a request value, falling back to 900 with a WARN instead of minting a credential that is already expired or over-range. * fix(redshift): revoke temp credentials on createCluster rollback too The greptile review asked for revocation on 'relevant rollback paths'. Both createCluster failure branches that delete the cluster row now also call credentialBroker.revokeCluster, so a credential issued by a concurrent GetClusterCredentials while the row briefly existed cannot outlive it. * fix(redshift): correct GetClusterCredentials AutoCreate prefix AWS prefixes the returned DbUser with IAM: when AutoCreate is false and IAMA: when it is true. The handler returned IAM: when true and no prefix when false, so a client using the returned name could not authenticate and the value diverged from GetClusterCredentialsWithIAM, which already issues prefixed identities. The broker keys on the returned name, so the proxy and Data API now expect the prefixed DbUser. Tests and the redshift docs are updated to match. * test(redshift): give compat GetClusterCredentials tests distinct @Order Three methods shared @Order(2), leaving their relative order undefined. Number the two credential tests 3 and 4 and move testDeleteCluster to 5. |
||
|
|
48d2928061 | feat(marketplace-deployment): emulate AWS Marketplace Deployment API (#3341) | ||
|
|
2d51259120 |
feat(verifiedpermissions): add full service emulation (#3128)
* feat(verifiedpermissions): add full service emulation * fix(verifiedpermissions): harden OIDC and schema validation * test(verifiedpermissions): add service layer coverage * fix(verifiedpermissions): support native Cedar runtime * fix(verifiedpermissions): package Cedar native FFI * fix(verifiedpermissions): register Cedar deserializers for native * fix(verifiedpermissions): bound JWKS refreshes * fix(verifiedpermissions): avoid Cedar entity reflection * fix(verifiedpermissions): register Cedar native reflection * fix(verifiedpermissions): refresh rotated OIDC keys safely * fix(verifiedpermissions): retry failed JWKS refreshes * refactor(verifiedpermissions): isolate Cedar in sidecar * fix(verifiedpermissions): harden Cedar sidecar runtime * fix(verifiedpermissions): build cedar sidecar in compatibility CI * fix(verifiedpermissions): remove stale cedar jni config * fix(verifiedpermissions): recover cedar sidecar * fix(verifiedpermissions): bound OIDC document responses * fix(verifiedpermissions): start cedar sidecar in native sdk CI |
||
|
|
cbfa034470 |
feat(identity-center): complete IAM Identity Center emulation (#3331)
* feat(ssoadmin): add region operation * feat(ssoadmin): attach customer managed policies * feat(ssoadmin): create applications * feat(ssoadmin): create application assignments * feat(ssoadmin): create account instances * feat(ssoadmin): create ABAC configuration * feat(ssoadmin): create trusted token issuers * feat(ssoadmin): delete account assignments * feat(ssoadmin): delete applications * feat(ssoadmin): delete application access scopes * feat(ssoadmin): delete application assignments * feat(ssoadmin): delete application authentication methods * feat(ssoadmin): delete application grants * feat(ssoadmin): delete identity center instances * feat(ssoadmin): list principal account assignments * feat(ssoadmin): provision permission sets * feat(ssoadmin): list provisioned permission sets * feat(ssoadmin): list accounts for provisioned permission set * feat(ssoadmin): describe permission set provisioning status * feat(ssoadmin): list permission set provisioning status * feat(ssoadmin): describe account assignment deletion status * feat(ssoadmin): list account assignment creation status * feat(ssoadmin): list account assignment deletion status * feat(ssoadmin): delete permission sets * feat(ssoadmin): detach customer managed policy references * feat(ssoadmin): list customer managed policy references * feat(ssoadmin): get inline permission set policies * feat(ssoadmin): put permission set boundaries * feat(ssoadmin): get permission set boundaries * feat(ssoadmin): delete permission set boundaries * feat(scim): create groups * feat(scim): create users * feat(scim): delete groups * feat(scim): delete users * feat(scim): get groups * feat(scim): get users * feat(scim): list groups * feat(scim): list users * feat(scim): get schemas * feat(scim): list schemas * feat(scim): list resource types * feat(scim): add service provider config * feat(scim): patch groups * feat(scim): patch users * feat(scim): put users * feat(ssoadmin): delete ABAC configuration * feat(ssoadmin): delete trusted token issuers * feat(ssoadmin): describe applications * feat(ssoadmin): describe application assignments * feat(ssoadmin): describe instances * feat(ssoadmin): describe ABAC configuration * feat(ssoadmin): describe regions * feat(ssoadmin): describe trusted token issuers * feat(ssoadmin): describe application providers * feat(ssoadmin): list application assignments * feat(ssoadmin): list principal application assignments * feat(ssoadmin): list applications * feat(ssoadmin): list application providers * feat(ssoadmin): list regions * feat(ssoadmin): list trusted token issuers * feat(ssoadmin): put application access scopes * feat(ssoadmin): get application access scopes * feat: support listing application access scopes * feat(ssoadmin): get application assignment configuration * feat(ssoadmin): put application assignment configuration * feat(ssoadmin): get application authentication methods * feat(ssoadmin): put application authentication methods * feat(ssoadmin): list application authentication methods * feat(ssoadmin): get application grants * feat(ssoadmin): put application grants * feat(ssoadmin): list application grants * feat(ssoadmin): get application session configuration * feat(ssoadmin): put application session configuration * feat(ssoadmin): list resource tags * feat(ssoadmin): tag resources * feat(ssoadmin): untag resources * feat(ssoadmin): remove regions * feat(ssoadmin): update applications * feat(ssoadmin): update instances * feat(ssoadmin): update ABAC configuration * feat(ssoadmin): update trusted token issuers * feat(ssooidc): register clients * feat(ssooidc): start device authorization * feat(ssooidc): create public client tokens * feat(ssooidc): create IAM-authenticated tokens * feat(ssoportal): list assigned accounts * feat(ssoportal): list assigned account roles * feat(ssoportal): issue assigned role credentials * feat(ssoportal): invalidate portal sessions * docs(ssoadmin): report complete operation count * fix(identity-center): repair CI validation * fix(identity-center): harden auth and native build * fix(ssooidc): disambiguate RestAssured query parameter * fix(identity-center): resolve CI compatibility failures * fix(identity-center): address maintainer review * fix(ssoadmin): preserve application provider partition * fix(identity-center): repair Java compatibility tests * fix(identity-center): trust local TLS in browser flows * fix(identity-center): register refresh token grant in SDK test |
||
|
|
87f2c2d1a8 | feat(marketplace-entitlement): emulate AWS Marketplace Entitlement API (#3340) | ||
|
|
c99ecea0da | feat(marketplace-agreement): emulate AWS Marketplace Agreement API (#3339) | ||
|
|
50fa334dc5 | feat(marketplace-catalog): emulate AWS Marketplace Catalog API (#3338) | ||
|
|
483dfb4e1c |
feat(agentcore): expand Bedrock AgentCore control-plane coverage (#3317)
* feat(agentcore): emulate CreateBrowser * feat(agentcore): emulate GetBrowser * feat(agentcore): emulate ListBrowsers * feat(agentcore): emulate DeleteBrowser * feat(agentcore): emulate CreateBrowserProfile * feat(agentcore): emulate GetBrowserProfile * feat(agentcore): emulate ListBrowserProfiles * feat(agentcore): emulate DeleteBrowserProfile * feat(agentcore): emulate CreateCodeInterpreter * feat(agentcore): emulate GetCodeInterpreter * feat(agentcore): emulate ListCodeInterpreters * feat(agentcore): emulate DeleteCodeInterpreter * feat(agentcore): emulate CreateGatewayRule * feat(agentcore): emulate GetGatewayRule * feat(agentcore): emulate ListGatewayRules * feat(agentcore): emulate UpdateGatewayRule * feat(agentcore): emulate DeleteGatewayRule * feat(agentcore): emulate CreateApiKeyCredentialProvider * feat(agentcore): emulate GetApiKeyCredentialProvider * feat(agentcore): emulate ListApiKeyCredentialProviders * feat(agentcore): emulate UpdateApiKeyCredentialProvider * feat(agentcore): emulate DeleteApiKeyCredentialProvider * feat(agentcore): emulate CreateOauth2CredentialProvider * feat(agentcore): emulate GetOauth2CredentialProvider * feat(agentcore): emulate ListOauth2CredentialProviders * feat(agentcore): emulate UpdateOauth2CredentialProvider * feat(agentcore): emulate DeleteOauth2CredentialProvider * feat(agentcore): emulate GetResourcePolicy * feat(agentcore): emulate PutResourcePolicy * feat(agentcore): emulate DeleteResourcePolicy * docs(agentcore): update expanded coverage * fix(agentcore): align expanded control-plane contracts * fix(agentcore): address PR review findings * test(agentcore): cover persistent delete replay |
||
|
|
9d4e71f8a2 |
feat(securityhub): add organization configuration operations (#3161)
* feat(securityhub): add organization configuration operations * fix(securityhub): complete organization configuration contracts * fix(securityhub): harden organization contracts * test(securityhub): log tolerated organization state * test(securityhub): clean organization fixture state * test(securityhub): isolate organization cleanup failures * fix(securityhub): return modeled invalid access error |
||
|
|
fd3c4d9ab6 |
feat(cloudtrail): support AdvancedEventSelectors and CloudFormation Trail provisioning (#2720)
* feat(cloudtrail): support AdvancedEventSelectors in PutEventSelectors and S3 capture Adds AdvancedEventSelector/AdvancedFieldSelector models, JSON wiring through PutEventSelectors/GetEventSelectors, mutual-exclusivity enforcement against basic EventSelectors, and field-selector evaluation (Equals/NotEquals/StartsWith/NotStartsWith/EndsWith/NotEndsWith) in the S3 data-event capture path. Lets a trail exclude its own log-delivery bucket via resources.ARN NotStartsWith, avoiding the CloudTrail circular-logging cost problem. Basic-selector behavior is unchanged. * feat(cloudtrail): add CloudFormation provisioner for AWS::CloudTrail::Trail Handles create/update/delete of AWS::CloudTrail::Trail via CloudTrailService, applies EventSelectors or AdvancedEventSelectors (mutually exclusive, same JSON shapes as PutEventSelectors), starts logging when IsLogging is true, and sets the trail ARN as the resource's physical id and Arn attribute. Delete is idempotent when the trail is already gone. * feat(cloudtrail): implement ListTrails and trail tagging Adds ListTrails (returns Name/TrailARN/HomeRegion for trails visible in the region, including multi-region trails), plus AddTags/ListTags backed by per-trail stored state, keyed by trail name or ARN. * fix(cloudtrail): emit data events for the trail's own log deliveries CloudTrailLogWriter.flushTrail() wrote delivered log files via a direct S3Service.putObject() call, bypassing S3Controller.emitCloudTrailEvent() - the only place that recorded an S3 data event. A trail whose selector matched its own destination bucket (the exact circular-logging config from upstream issue #1192 / PR #1194) never saw its own deliveries, so the emulator could prove the dangerous config was live but not reproduce the loop it causes. flushTrail now calls cloudTrailService.emitS3DataEvent() after each delivery, so internal writes are evaluated against selectors identically to API-driven ones. Closes issues/0034. * docs: mark issue 0034 fixed * fix(cloudtrail): resources.type reflects actual S3 resource, not hardcoded object Advanced selector matching hardcoded resources.type to AWS::S3::Object for every event, so an object-scoped AdvancedEventSelectors exclusion (the real-world fix for the issue 0034 self-delivery loop) still let bucket-level calls like ListObjects through against the excluded bucket. Now derived per event from whether an object key is present. Live-verified on 1160-ct: loop confirmed unbounded and compounding with external writes, then confirmed stopped by the real AdvancedEventSelectors remediation, with this gap found and closed in the same pass. Details in issues/0034 and issues/0035. * docs(0034): add raw delivery-size timeline from 1160-ct verification Per-cycle size data showing the burst-compounding and the fix-stop point concretely, not just summarized. * fix(cloudtrail): match delete() to current CfnResourceProvisioner signature Upstream/main dropped the accountId parameter from CfnResourceProvisioner.delete() since this branch was originally authored; the provisioner never used accountId in its body, so the fix is a straight signature match with no behavior change. * docs(cloudtrail): regen action table and register CFN Trail resource type New ListTrails/AddTags/ListTags actions and the CloudFormation AWS::CloudTrail::Trail resource type need doc entries per the repo's docs-check gate. * fix(cloudtrail): enforce AddTags 200-tag list limit Botocore's AddTagsRequest.TagsList models a 200-item max (service-2.json, cloudtrail 2013-11-01); the handler accepted an unbounded list. RED test added first (addTagsRejectsMoreThanTwoHundredTags), confirmed failing (200 instead of 400), then fixed by rejecting oversized lists with TagsLimitExceededException, matching AWS's modeled error for AddTags. * fix(cloudformation): close two audit-control gaps in CloudTrailCfnProvisioner Local code review flagged two HIGH findings in the new CFN provisioner: - physicalId was only set after selector validation and startLogging succeeded, so a create that failed on the mutually-exclusive EventSelectors/AdvancedEventSelectors check left a real trail with no recorded physical id for the engine to clean up. Now set immediately after createTrail returns. - update only called startLogging when IsLogging was explicitly true, never stopLogging when it was explicitly false, so a template setting IsLogging: false on a currently-logging trail silently left logging enabled. RED tests confirmed both failures against the pre-fix code, then GREEN after the fix (6/6 provisioner tests, 51/51 CloudTrail suite). * docs(issues): ledger deferred CloudTrail local-review findings MEDIUM/LOW findings from the local code-review pass, plus a few inherited-not-ours items on code this branch didn't touch, that are real but out of scope for the CFN provisioner / advanced-selectors PR. * style(cloudtrail): brace unbraced conditionals in ListTrails and event-matching traversal Per AGENTS.md style rule (always use braces in conditionals). * fix(cloudtrail): avoid NPE on List.of(trailName) when TrailName is missing PutEventSelectors/GetEventSelectors called List.of(trailName) with a possibly-null trailName before findTrailOrThrow could validate it, throwing an NPE (500 InternalFailure) instead of the modeled TrailNotFoundException. Guard the lookup so the null flows through to the existing validation. * fix(cloudtrail): do not re-queue records on self-delivery emission failure flushTrail wrapped the self-delivery emitS3DataEvent call in the same try/catch as the S3 write. A failure there re-queued records that were already durably written, causing the next flush to redeliver the same batch. Split the write and the emission into separate try blocks so only a write failure triggers requeue. * docs(cloudformation): register AWS::CloudTrail::Trail in the resource-type inventory CfnResourceInventoryTest and the docs-sync resource-type table both derived from supported-resource-types.tsv, which never picked up CloudTrailCfnProvisioner's registration. * docs(issues): drop fork-local ledger files from the PR Per maintainer review, the issues/ ledger entries are fork-local tracking notes and are kept out of the upstream contribution. * fix(cloudformation): wire CloudTrailCfnProvisioner into CfnProvisionerFixture CfnProvisionerFixtureTest.everyProvisionerIsReachableThroughThePublicBuilderOrExplicitlyExempt failed because CloudTrailCfnProvisioner had no field, setter, or construction arm in the test fixture, so a test naming CloudTrailService would silently fall through to the stub arm instead of exercising the real provisioner. Add cloudTrailService field, cloudTrail(CloudTrailService) setter, and the discovered.add(new CloudTrailCfnProvisioner(...)) construction arm, mirroring the existing Route53Service wiring. * fix(cloudtrail): drop em-dashes from new test comments per AGENTS.md style check * fix(cloudtrail): reject mixed basic and advanced selectors with InvalidEventSelectorsException PutEventSelectors does not model InvalidParameterCombinationException; the error it declares for an invalid selector combination is InvalidEventSelectorsException (botocore cloudtrail/2013-11-01). Both the JSON handler and the AWS::CloudTrail::Trail provisioner now throw that code, and the integration test pins it. Also braces the remaining one-line conditionals in matchesAdvancedFieldSelector. |
||
|
|
4944764fa3 |
feat(inspector2): add organization configuration operations (#3162)
* feat(inspector2): add organization configuration operations * fix(inspector2): complete organization contracts * fix(inspector2): scope organization account state * test(inspector2): log tolerated organization state * test(inspector2): isolate organization cleanup |
||
|
|
d99675a512 |
feat(controlcatalog): add control lookup operations (#3130)
* feat(controlcatalog): add control lookup operations * fix(controlcatalog): complete control lookup contracts * test(controlcatalog): verify pagination continuation * fix(controlcatalog): move control model to package * fix(controlcatalog): integrate service storage lifecycle |
||
|
|
b9039fef1d |
feat(redshift-data): emulate the Amazon Redshift Data API (#3186)
* feat(redshift-data): resource resolver, connection factory, statement store, service registration * feat(redshift-data): field mapper, column metadata, SQL parameter binding * feat(redshift-data): execute, describe, and paged result retrieval * feat(redshift-data): batch execution, list statements, cancel * feat(redshift-data): schema introspection operations * test(redshift-data): end-to-end Data API over a real cluster plus SDK compatibility test * docs(redshift-data): document the Redshift Data API surface * fix(redshift-data): address code review findings - rejectMultiStatement now reuses the SQL tokenizer so a semicolon inside a comment, string literal, or dollar-quoted block no longer rejects a valid single statement - GetStatementResultV2 gains unit coverage for the typed and CSV envelopes - CSV output is RFC 4180 quoted (embedded comma, quote, CR, LF) - batch rollback is asserted transactionally in the integration test - RedshiftDataFieldMapper logs a swallowed blob-read SQLException - RedshiftPid/RedshiftQueryId use a non-negative hash - NextToken that decodes to a negative offset is rejected - CancelStatement leaves a FAILED statement FAILED - DescribeTable paginates ColumnList and emits NextToken - DbUser is echoed on the SecretArn path - the statement store no longer builds its sweeper executor in the test constructor * fix(redshift-data): address PR #3186 review findings - SQL scanner handles PostgreSQL escape strings (E'...'): a backslash-escaped quote no longer ends the literal and mis-detects a following :name as a bind marker; plain '...' literals still treat backslash as an ordinary character - ListStatements clamps MaxResults to 1..100 so MaxResults=0 no longer emits the same NextToken forever - DescribeTable matches Table / Schema exactly (=) instead of LIKE, so a name containing _ or % cannot merge other tables' columns into ColumnList - register the service in the README category table - drop a stray em dash from the neighbouring services.yaml comment * fix(redshift-data): bind string parameters untyped so real PostgreSQL infers the column type CI ran the integration test against a real Redshift (PostgreSQL 15) cluster and parameterisedStatement failed: a string bound to an int column via setString raised "operator does not exist: integer = character varying". H2 in PostgreSQL mode coerces it, so the unit test missed it. - RedshiftDataConnectionFactory adds stringtype=unspecified to the JDBC URL, so setString sends the value untyped and the server infers the target type, matching how AWS binds Redshift Data API parameters - ListStatements now rejects MaxResults above 100 with ValidationException instead of silently clamping (PR #3186 re-review) - RedshiftDataOperationsTest uses JBoss Logging, not java.util.logging (PR #3186 re-review) * fix(redshift-data): back the statement store with StorageFactory The store held a bare ConcurrentHashMap outside the configured storage and lifecycle model. It now obtains an account-aware backend through StorageFactory ("redshift-data", statements.json), the same as Athena's query store, resolved to the global storage mode via the catalog descriptor. Default mode stays memory, so statements are still lost on restart as documented; the 24h TTL sweep now walks every account partition and deletes per account since the sweep thread has no request context. StoredStatement is annotated for reflection and field-visible serialization so persistent modes round-trip it. * test(redshift-data): cover StoredStatement serialization round-trip and values() The StorageFactory-backed store serializes StoredStatement in persistent modes. Adds a round-trip test through the exact mapper PersistentStorage builds, covering the ArrayNode, enum, Instant, and nested sub-statement fields plus the field-visibility annotation, and a values() test. * fix(redshift-data): register the nested Status enum for reflection PersistedModelReflectionTest walks every type reachable from a StorageFactory persistence root; StoredStatement.status pointed at an unregistered enum, so native-image deserialization of a persisted statement would fail on restart. |
||
|
|
5864b013d2 |
feat(detective): add organization member operations (#3190)
* feat(detective): add organization member operations * fix(detective): align organization operations with AWS * docs(detective): clarify member listing * fix(detective): enforce organization administration contracts |
||
|
|
7a5ae965e5 |
feat(budgets): add full service emulation (#3165)
* feat(budgets): add budget and notification operations * feat(budgets): complete service emulation * fix(budgets): enforce account and action contracts |
||
|
|
0321ae0ac8 |
refactor(cloudformation): move Cognito UserPool and UserPoolClient to CognitoCfnProvisioner (#3164)
* refactor(cloudformation): move Cognito UserPool and UserPoolClient to CognitoCfnProvisioner
Batch 3 of the CloudFormationResourceProvisioner split. AWS::Cognito::UserPool and
AWS::Cognito::UserPoolClient join the provisioner that already owns UserPoolDomain;
the two arms, their switch cases, the type-list entries, the Cognito-only
resolveStringMapOrNull helper and the CognitoService dependency leave the monolith.
Behaviour is preserved except for what the split's conventions require:
- the create/update branch reads ctx.isUpdate() instead of the resource's physical
id, which provision overwrites as it runs
- deletes go through CfnDeletes.safeDelete tolerating only ResourceNotFoundException;
a pool that still has a domain keeps failing the stack delete with
InvalidParameterException, as on AWS
- the client also exposes Name, the read-only attribute the registry schema declares
(ClientName stays for now), so CfnSchemaCoverageTest needs no gaps row
- the ReplacementCleanup hooks are wired for both types; nothing replaces yet, so
they are inert until create-only properties are honoured
The unit test covers both types with a mocked service: request map and generated
names, update carrying the prior id, the exact attribute sets, positional client
arguments, and delete tolerance. The domain delete path now branches on type first,
since a pool resource also carries a UserPoolId attribute.
* fix(cloudformation): replace a Cognito user pool client when its create-only properties change
UserPoolId and GenerateSecret are createOnlyProperties in the AWS::Cognito::UserPoolClient
registry schema: on AWS a change to either creates a new client and deletes the old one
after the update commits. The provisioner passed the new pool id to UpdateUserPoolClient,
which fails with ResourceNotFoundException because a client is only found through the
pool that owns it, and a changed GenerateSecret was silently ignored since the update
call has no such parameter.
The provisioner now looks the prior client up by id, updates in place only when both
create-only properties are unchanged, and otherwise creates the replacement; the
ReplacementCleanup record deletes the displaced client once the update completes or
restores it on rollback. A prior client that is already gone is created anew. The by-id
describeUserPoolClient overload is new on CognitoService, mirroring its delete pair.
* fix(cloudformation): resolve Cognito UserPoolTags as the map the schema declares
AWS::Cognito::UserPool.UserPoolTags is an object (the type's tagProperty), not the
[{Key, Value}] list most types carry. The provisioner parsed it with the list helper,
which yields nothing for a map, so the tags only reached the service through the raw
property map, where a non-string tag value arrives as a number. The tags are now
resolved as a string map and put explicitly, on create and on update.
* fix(cloudformation): give Fn::GetAtt ProviderName on a Cognito user pool AWS's shape
The attribute returned the pool name. On AWS it is cognito-idp.<region>.amazonaws.com/<pool id>,
the value templates feed into an identity pool's CognitoIdentityProviders (CDK derives the
same string in UserPool.fromUserPoolArn). ProviderURL deliberately stays Floci's local
issuer, <base-url>/<pool id>, since that is the iss of the tokens Floci mints and a template
wiring it into a JWT authorizer must validate locally; the generated resource-type table
now says so.
* fix(cognito): apply PoolName on UpdateUserPool so a CloudFormation rename takes effect
UpdateUserPoolRequest carries PoolName in the service model and AWS::Cognito::UserPool
lists UserPoolName as updatable in place, but updateUserPool only ran populateUserPool,
which never sets the name, so a renamed pool kept its old name through both the API and
a stack update. The service now applies a non-blank PoolName.
The provisioner sends PoolName on update only when the template names the pool: an
unnamed pool keeps the name its first execution generated instead of being renamed to a
freshly generated one on every update.
* fix(cloudformation): expose only the schema's attributes on a Cognito user pool client
The AWS::Cognito::UserPoolClient registry schema declares ClientId, Name and ClientSecret
as its read-only properties. ClientName is a request property, not an attribute; on AWS
Fn::GetAtt Client.ClientName fails template validation, so no working template depends on
it. It is dropped in favour of Name.
* fix(cloudformation): validate Cognito user pool client properties instead of dropping them
A non-integer AccessTokenValidity, IdTokenValidity or RefreshTokenValidity was parsed to
null and silently ignored, so the template's intent was lost without a word. The
provisioner now fails the resource with ValidationError "Value of property X must be an
integer.", as the ECS provisioner does for DesiredCount. UserPoolId, the schema's one
required property, is likewise rejected when missing rather than passed through as null.
* test(cloudformation): cover Cognito user pool client replacement end to end
Through the CloudFormation API: a client moved to another pool and one whose
GenerateSecret flips are each replaced, with the displaced client gone once the update
completes; a rename updates the client in place; Fn::GetAtt Name and the pool's
ProviderName carry their AWS shapes; deleting the stack removes client and pools.
* fix(cloudformation): drop a stale ClientSecret attribute when a replacement client has none
The engine hands an update the prior attributes, and the provisioner only wrote
ClientSecret when the new client had one, so replacing a secret-bearing client with
GenerateSecret: false left the displaced client's secret readable through Fn::GetAtt.
The attribute is now removed when the client has no secret; rollback still restores it
from the cleanup record's snapshot.
* fix(cloudformation): refuse a Cognito client replacement that would reuse the prior client id
AWS client ids are random, so a replacement never collides with the client it replaces.
Under Floci's floci:override-cognito-client-id tag the id follows the client name, and a
replacement that kept the name (a GenerateSecret flip, or a move to a pool with the same
override) was created under the prior id: the store overwrote the prior client, the cleanup
record saw an unchanged id and recorded nothing, and the update could not be rolled back.
Neither overwriting nor delete-then-create can preserve the prior client, so the update is
now refused with ValidationError before anything changes and the stack rolls back intact.
CognitoService gains deterministicClientIdFor(userPoolId, clientName), sharing the id rule
with createUserPoolClient; the provisioner compares it with the prior id in the replacement
branch only.
* fix(cloudformation): refuse a Cognito client whose derived id another client already holds
The round-1 guard compared the derived id only with the client being replaced. Under
floci:override-cognito-client-id the store is keyed by client id alone, so a name whose
derived id belongs to any other client, in this pool or another, would overwrite that client
on create, and neither the cleanup record nor rollback knows about it. The guard now refuses
whenever an existing client holds the derived id, on a fresh create as well as a replacement.
* fix(cloudformation): make the deterministic Cognito client-id guard atomic and ignore orphaned records
Two gaps in the round-2 guard. CloudFormationService runs stack operations on a cached
thread pool and CognitoService's client store write is unconditional, so two stacks could
both find a derived id free and the later create overwrote the earlier stack's client; the
existence check and the create now run under one lock whenever the id is derived from the
name. And deleting a user pool does not remove its clients yet (#2949 adds that), so a client
of a deleted pool kept its derived id and the guard refused a legitimate create in another
pool; a holder whose pool no longer exists is now treated as a stale record the create may
take over. Random ids take neither path.
|
||
|
|
631df1dc01 |
feat(cloudformation): provision AWS::Backup::BackupVault (#3125)
Per-service provisioner over BackupService. Ref and Fn::GetAtt BackupVaultName are the vault name and Fn::GetAtt BackupVaultArn its ARN. The name is the physical id and createOnly, so an unnamed vault keeps its generated name across updates instead of getting a second vault, and a rename is refused as a replacement. EncryptionKeyArn is createOnly as well. BackupVaultTags are driven to the template's set on update, untagging dropped keys since TagResource only adds. Stack deletion deletes the vault and leaves the non-empty-vault refusal to surface as on AWS. The docs generator gains a label and row position for the new AWS::Backup namespace. Ported from lex00/floci#118. Tracked in lex00/floci#192. |
||
|
|
6264b09a28 |
feat(identitystore): add full service emulation (#3159)
* feat(identitystore): add groups users and memberships * feat(identitystore): add full service emulation * fix(identitystore): validate update attribute paths |
||
|
|
d80734e6de |
feat(account): add alternate contact operations (#3118)
* feat(account): add alternate contact operations * fix(account): complete alternate contact contracts |
||
|
|
aebed6e15c |
feat(accessanalyzer): add analyzer lifecycle (#3117)
* feat(accessanalyzer): add analyzer lifecycle * fix(accessanalyzer): complete service contracts * test(accessanalyzer): make SDK cleanup best effort * test(accessanalyzer): use project logging for cleanup |
||
|
|
162211de0c |
feat(route53): support cross-account VPC associations (#3116)
* feat(route53): support cross-account VPC associations * test(route53): add SDK cross-account compatibility coverage * fix(route53): harden cross-account VPC ownership * fix(ec2): scope default resources by account |
||
|
|
3927c66040 |
feat(macie2): add organization administration operations (#3105)
* feat(macie2): add organization administration operations * test(macie2): validate organization administration with sdk * fix(macie2): harden delegated administration routing |
||
|
|
1bf7494e99 |
feat(ssoadmin): add permission sets and assignments (#3103)
* feat(ssoadmin): add permission sets and assignments * test(ssoadmin): validate account assignments with sdk * fix(ssoadmin): complete pagination and lifecycle contracts |
||
|
|
6be9c1ee26 |
docs(cloudformation): note that a stack detaches an IoT policy before deleting it (#3042)
The generated resource-type table will say that a stack deletes an IoT policy after detaching it from its principals, while on AWS the delete fails with DeleteConflictException as long as the policy is attached. One notes entry in tools/docs/cfn_resource_types.yaml; the generator renders it once the type has an inventory row, which #3014 adds. |
||
|
|
c3d977a3e3 |
feat(apigateway): provision AWS::ApiGateway::DomainName and BasePathMapping (#3040)
* feat(apigateway): provision AWS::ApiGateway::DomainName and BasePathMapping Both types were stubs: the stack turned green while no domain or mapping existed, Fn::GetAtt on the domain resolved to the literal attribute name, and a request sent to the custom domain was not routed. The new provisioner calls the existing CreateDomainName and CreateBasePathMapping. Ref and every Fn::GetAtt attribute return what GetDomainName reports, a changed DomainName or BasePath replaces the resource (created before the prior one is deleted), and everything else is patched in place. The physical id of a mapping is the compound identifier CloudFormation uses for the type, <DomainName>|<BasePath>, with (none) for an empty base path. Service fixes needed so the provisioned values can be read back through the API: CreateDomainName keeps regionalCertificateArn and regionalCertificateName (both were dropped), an EDGE domain gets a distributionDomainName and the fixed CloudFront hosted zone, GetDomainName returns domainNameArn, endpointConfiguration.types and tags, UpdateDomainName accepts the /endpointConfiguration/types/EDGE patch path, domain tags are managed through the tag API on the domain ARN, and CreateDomainName checks the name and stores the domain under one lock so two concurrent creates cannot both succeed. * fix(apigateway): keep the distribution in step with a domain's endpoint type A move to EDGE through UpdateDomainName left the domain without a distributionDomainName, and a move back to REGIONAL kept the old one, so GetDomainName and Fn::GetAtt reported CloudFront fields that did not match the endpoint type. Both create and update now go through one helper that puts a distribution in front of an EDGE domain and drops it for a REGIONAL one. * fix(apigateway): serialize domain and mapping changes, refuse a taken base path, validate the endpoint patch path The stores hand out live objects, so a domain patch, a tag write and a mapping patch were read-modify-write steps that concurrent calls could lose or corrupt: eight concurrent tag writes on one domain kept four tags. Every change to a custom domain or a base path mapping now runs under one lock, and a tag write replaces the tag map instead of changing the one a reader may be iterating. CreateBasePathMapping on a base path that already has a mapping answers ConflictException as AWS does; before, the new mapping silently replaced the old one, so eight concurrent creates of one base path all succeeded. UpdateDomainName accepted any /endpointConfiguration/types/<x> path; the path must now name the type the domain has, as on AWS. The provisioner sends the PATCH before it reconciles the tags, so a rejected update leaves the tags as they were. Tests cover every case above, the remaining cells of the update matrix (a prior resource gone under a new name), and the REGIONAL to EDGE move end to end through a stack. * fix(apigateway): refuse an endpoint type other than REGIONAL or EDGE on CreateDomainName UpdateDomainName already rejected any other value, but CreateDomainName stored whatever string the request carried, so a PRIVATE or misspelled type produced a domain that was neither regional nor edge-optimized and that nothing could route or describe. Private custom domains are not emulated, so the create now answers BadRequestException with the same message as the update, and nothing is stored. Adds the two remaining provisioner matrix cells as tests: a taken domain name fails the resource without deleting anything, and a resource without Properties is rejected. |
||
|
|
dd9cdc1207 |
feat(cognitoidentity): identity pool management plane (CRUD, roles, principal-tag maps, tags) (#2977)
* feat(cognitoidentity): identity pool management plane (CRUD, roles, principal-tag maps, tags) Emulates the Cognito Identity (federated identity pools) management API: CreateIdentityPool through DeleteIdentityPool, ListIdentityPools with pagination, SetIdentityPoolRoles/GetIdentityPoolRoles including role mappings, Set/GetPrincipalTagAttributeMap, and resource tagging. JSON 1.1 under the AWSCognitoIdentityService target prefix, signing name cognito-identity. * fix(cognitoidentity): require AllowUnauthenticatedIdentities and key tag writes by pool region An omitted AllowUnauthenticatedIdentities returned success with false persisted. It now fails with ValidationException. TagResource and UntagResource wrote the pool back under the signing region rather than the region in its ARN. * fix(cognitoidentity): reject a non-boolean AllowUnauthenticatedIdentities Jackson coerced strings and numbers to a boolean instead of failing the request. |
||
|
|
9220c057b7 |
feat(iot): domain configurations (#3008)
* feat(iot): add the domain configuration model and service Stores AWS IoT Core domain configurations the way the API reports them: a new configuration is ENABLED and CUSTOMER_MANAGED (ENDPOINT without a domain name), carries one VALID server certificate, the default TLS policy and an ARN with the short id AWS appends. Update changes the status, authorizer, TLS, certificate and protocol settings; delete refuses an ENABLED configuration, as AWS does; list filters by service type and pages with marker and pageSize. Tags work on the ARN. * feat(iot): serve the domain configuration API Adds the REST-JSON routes CreateDomainConfiguration, DescribeDomainConfiguration, UpdateDomainConfiguration, DeleteDomainConfiguration and ListDomainConfigurations under /domainConfigurations, registered with the IoT service so the X-Amzn-Errortype header is set for unsigned callers too. Tags on a configuration ARN go through IotTagHandler; the IoT /untag route now uses the same handler as /tags instead of calling IotService directly. DescribeEndpoint accepts iot:CredentialProvider, the endpoint type that pairs with the CREDENTIAL_PROVIDER service type. * feat(iot): provision AWS::IoT::DomainConfiguration Adds IotDomainConfigurationCfnProvisioner over the domain configuration service. Ref is the configuration name; Fn::GetAtt Arn, DomainType and ServerCertificates resolve to what DescribeDomainConfiguration reports (ServerCertificates as a JSON string, since attributes are strings). Like the CloudFormation handler, a configuration is created ENABLED and a DomainConfigurationStatus of DISABLED is applied with a follow-up update; tags go through TagResource and are reconciled on update; a delete disables the configuration first because the API refuses to delete an ENABLED one. UpdateStack keeps the configuration when the createOnly properties (DomainName, ServiceType, ValidationCertificateArn, ServerCertificateArns) are unchanged and replaces it otherwise, with a fresh generated name when the template names none. Inventory TSV, fixture wiring and the generated resource-type table updated. * docs(iot): describe domain configurations and add the stack integration test IotDomainConfigurationCfnIntegrationTest provisions the type through a stack and asserts Ref and every Fn::GetAtt attribute against DescribeDomainConfiguration, the in-place status update, and that DeleteStack removes the configuration. * test(iot): cover domain configurations in the Java and Go SDK suites Both cases create, describe, list, update and delete a configuration through the real SDK clients and check the AWS error types on the duplicate create, the refused delete of an ENABLED configuration and the describe after deletion. * fix(iot): remove a renamed domain configuration and keep the status when the template omits it A template that changes DomainConfigurationName creates the new configuration and now removes the previous one, as the generated-name replacement already did; before, the old configuration outlived the stack. An update without DomainConfigurationStatus no longer forces ENABLED: the field is omitted and the current status stays, as the AWS handler does. The service rejects a structured JSON value where a string, boolean, list or object is expected instead of turning it into an empty string or silently clearing the authorizer, and validates the whole update before touching the stored record. * fix(iot): let stack rollback remove a domain configuration and make same-name creates atomic A configuration created by a stack is recorded, with the owned marker, before the follow-up status update, so a failure there still lets the create rollback delete it. A replacement that fails after the new configuration exists removes it again, re-enables the previous one if it had been disabled on the way out, and marks the resource restored, as the other provisioners do. CreateDomainConfiguration checks and stores the name in one step, so two overlapping creates of the same name cannot both succeed. A tags value that is not a list is rejected. The Java SDK compatibility case looks for a leftover configuration instead of swallowing every cleanup exception. * fix(iot): point the resource back at the prior domain configuration after a failed replacement After the unwind removes the replacement and re-enables the previous configuration, the resource now carries the previous name and attributes again, without the owned marker, so it describes the configuration that is still there rather than the one just removed. * feat(iot): serve the AWS-managed domain configurations Every AWS account has iot:Data-ATS, iot:Data, iot:CredentialProvider and iot:Jobs without creating them. They now exist in every region on first use: AWS_MANAGED, ENABLED, no server certificate, and the address DescribeEndpoint returns as their domain name. They can be updated and tagged like any other configuration, but not deleted, as on AWS. A client that starts by describing iot:Data-ATS gets an answer instead of a 404. * fix(iot): report a failed replacement cleanup as a rollback failure When the unwind of a failed replacement cannot remove the new domain configuration, the resource now carries the rollback-failure marker with the reason, so the stack ends in UPDATE_ROLLBACK_FAILED instead of reporting a clean rollback while the configuration is still there. The marker moves next to the restored one in CfnRollback so extracted provisioners can set it; the legacy provisioner keeps its alias. * fix(iot): serialise every read-modify-write on a domain configuration Update, delete, tag and untag read a record, change it and write it back. Two overlapping writers lost each other's changes: sixteen tag writers on one configuration left seven keys. All of them now run under the lock the create already used, and a test pins the invariant. A JSON round trip with the mapper setup persistent storage uses pins that the model reloads intact. * fix(iot): keep the prior status the unwind compares against and never delete a same-name replacement The store hands out its live record, so disabling the prior on the way to deleting it changed the very object the unwind later compared against, and a prior whose delete failed half way was left DISABLED while the stack reported a clean rollback. The status seen at the start is now kept and used. The test reproduces the aliasing instead of handing the provisioner a fresh copy per call. A replacement under the same explicit name normally fails on the create; if it goes through because the prior vanished in between, the prior is no longer deleted, which would have removed the configuration just created. * fix(iot): tolerate a domain configuration that vanishes while a stack delete disables it The disable that precedes the delete now treats ResourceNotFoundException as already deleted, the way the delete itself does. The SDK cases also enable an already ENABLED configuration, the call a client makes when it only wants to be sure the configuration is on. |
||
|
|
38176b9e05 |
feat(acm): provision AWS::CertificateManager::Certificate (#3003)
* feat(acm): provision AWS::CertificateManager::Certificate Adds AcmCfnProvisioner over the existing AcmService. Ref and Fn::GetAtt CertificateArn both resolve to the certificate ARN instead of the stub's literal "LogicalId.CertificateArn". Maps DomainName, SubjectAlternativeNames, ValidationMethod (default DNS), KeyAlgorithm and Tags; DomainValidationOptions is accepted and ignored because the certificate is ISSUED at once, there is nothing to validate locally. UpdateStack: a change to a createOnly property (DomainName, SubjectAlternativeNames, KeyAlgorithm) requests a new certificate and deletes the previous one; otherwise tags are reconciled in place. Delete tolerates an already removed certificate and lets ResourceInUseException propagate. Tests: AcmCfnProvisionerTest (attribute keys, update paths, delete), AcmCfnIntegrationTest (stack output is an ARN DescribeCertificate finds, gone after DeleteStack). Inventory TSV, fixture wiring and the generated resource-type table updated. * fix(acm): remove the replacement certificate when the prior one cannot be deleted On a replacing update, a failure deleting the previous certificate (ResourceInUseException, for one) made the update fail after the new certificate existed. CloudFormationService restores the previous StackResource on a failed update and never learns the new ARN, which orphaned that certificate. Delete it and mark the resource restored for the rollback walker, as Route53CfnProvisioner does for zones. Also pins that a ValidationMethod-only update keeps the certificate: the property is writeOnly in the registry schema and "No interruption" in the AWS docs, and ACM has no call to change it on an issued certificate. |
||
|
|
df0e7bc79c | feat(route53): update supported operations and add VPC association actions (#2959) | ||
|
|
eb0472fccc |
docs: fix stale image tags, release model, service nav and contributor checklists (#2980)
The getting-started and contributor docs had drifted from what the workflows and the code actually do: - quick-start and CONTRIBUTING pointed users at a `latest-jvm` image that the release pipeline never publishes; both now name the `-compat` image, and `make docs-check` greps the docs for any `-jvm` tag - the CONTRIBUTING branching model now matches the workflows: `main` is published as the nightly channel, a maintainer runs the Release Cut workflow to tag a release, and the tag triggers the publish; PR builds produce compat images but never publish them - README and the docs landing page carried a hand-maintained service count and a second copy of the service table, both stale; they now link to the Services Overview - the Service Matrix gains the ELB Classic row it was missing, with an `elb` alias so the check no longer resolves the Classic key to the v2 page, and check_service_matrix.py now also fails on a docs/services page that has no row - the README category table lists 16 documented services it omitted - mkdocs nav gains 11 service pages that were unreachable from the site, drops a duplicate CloudTrail entry, and the docs job now runs `mkdocs build --strict` with nav and link validation so a page without a nav entry fails CI - AGENTS.md, CONTRIBUTING.md and docs/contributing.md told contributors to register a service in ServiceRegistry, which has no registration API; all three now point at ResolvedServiceCatalog and list the config, storage, native-image, docs, tooling and compat-suite touchpoints a new service needs |
||
|
|
961d82dda9 | fix(cloudformation): provision AWS::Scheduler::ScheduleGroup (#2796) | ||
|
|
10192f05d5 |
feat(translate): add Amazon Translate mock service (#2879)
* feat(translate): add Amazon Translate mock service JSON 1.1 stub for Amazon Translate covering the three self-contained sync operations: TranslateText, TranslateDocument, ListLanguages. Follows the existing Comprehend/Textract stub pattern (stateless, echoes input, AI_MOCK_CONFIG override for TranslateText). - TranslateText echoes Text, enforces the 10,000-byte limit, allows any language pair; an auto source is reported back as en. - TranslateDocument echoes the base64 Content and enforces the English-pivot rule, the ContentType allow-list, valid base64, and the 100 KB cap (InvalidRequestException, matching the operation's error model). The encoded length is checked before decoding so an oversized payload cannot force a large allocation. - ListLanguages returns a fixed ~35-language catalog; DisplayLanguageCode is validated, pagination inputs are accepted but ignored. Untrusted request values are truncated before being echoed into error messages. * chore(translate): remove em-dashes per AGENTS.md style guide Replace em-dashes in the Translate doc page and Java comments with colons, commas, or periods, and the ellipsis in the error-message preview helper with "...". Addresses the Greptile review note on PR #2879. |
||
|
|
afe26c6ad1 |
fix(elb): route Classic (v1) requests to a dedicated handler instead of ELBv2 (#2619)
* feat(elb): implement Classic (v1) Elastic Load Balancing Classic ELB (2012-06-01) and ELBv2 (2015-12-01) share an endpoint host and an `elasticloadbalancing` credential scope, but they are different APIs. Every Classic request was reaching the ELBv2 handler, which rejected a well-formed one with `ValidationError: Name is required for load balancer.` — because the name arrived as `LoadBalancerName`, the Classic parameter — and answered a request that guessed `Name` with an ALB object in the 2015-12-01 namespace, a shape Classic has no concept of. Route on the API version. Every Query-protocol request carries the version it speaks as the `Version` form parameter, and both service models declare it, so that is the discriminator: 2012-06-01 to the new Classic handler, 2015-12-01 to ELBv2. This is the same in-case split the `rds` scope already uses to separate RDS, Neptune and DocumentDB. Requests that omit `Version` fall back to their parameter shape — an action unique to one API, else `LoadBalancerName` / `LoadBalancerNames` selecting Classic, else ELBv2 as before. Classic state is its own model, not the v2 one: keyed by name, no ARN, listeners inline, and one structured attribute record. Responses follow the 2012-06-01 model's wrapper and element names — `CreateLoadBalancerResult` carries `DNSName` and nothing else. Scope is what the AWS provider drives for `aws_elb` and for an Auto Scaling group attached to one: Create/Delete/DescribeLoadBalancers, the listener operations, ConfigureHealthCheck, Register/DeregisterInstances, DescribeInstanceHealth, Modify/DescribeLoadBalancerAttributes, the subnet, availability-zone and security-group operations, and tagging. The stickiness and backend-server policy operations, and SetLoadBalancerListenerSSLCertificate, answer `UnsupportedOperation` in the 2012-06-01 namespace rather than a fabricated result. There is no Classic data plane: listener ports are recorded but no socket is opened. Health is checked per instance from the single `HealthCheck.Target` string — `HTTP:`/`HTTPS:` probed with a request, `TCP:`/`SSL:` by connecting — with the same counters and thresholds ElbV2HealthChecker uses. An ASG naming Classic load balancers in `LoadBalancerNames` now registers and deregisters its instances with them, so a `min_elb_capacity` wait can be satisfied. * docs(elb): register ElbClassicQueryHandler in services.yaml Unblocks 'make docs-check', which fails on rebase without this — the handler was never registered when the Classic ELB feature landed. * fix(elb): register ElbClassicService for native init, deregister stale ASG instances from Classic ELBs ElbClassicService's SecureRandom field wasn't declared under --initialize-at-run-time, which fails GraalVM native image builds (image-heap Random instances have cached seeds). Registers it alongside the other services/*.Service entries in application.yml. Also closes a gap Greptile flagged: removeStaleInstances() pruned an ASG's dead instance references without deregistering them from target groups or named Classic load balancers first, unlike the terminating- and scale-in paths, leaving orphaned registrations visible through DescribeLoadBalancers/DescribeInstanceHealth. * fix(elb): return the documented 409 for a Classic multi-VPC subnet set CreateLoadBalancer's own Errors table puts InvalidConfigurationRequest at HTTP 409; the Classic path raised it at 400. The error code was already right, so a client that retries on 409 but fails hard on 400 got the wrong signal from the one place the two can be told apart. Covered by a unit test that asserts the status, not just the code. Also from review: the empty-Listeners ValidationError carried a message copied from an unrelated subnet/AZ check, and the new cross-reference to the Classic docs page split elb.md's opening sentence mid-paragraph instead of following it. |
||
|
|
0b46d804c0 |
feat(codegurureviewer): repository association lifecycle with tagging (#2741)
* feat(codegurureviewer): repository association lifecycle with tagging AssociateRepository, DescribeRepositoryAssociation, DisassociateRepository and ListRepositoryAssociations over CodeGuru Reviewer's REST JSON protocol, with TagResource/UntagResource/ListTagsForResource served on the shared /tags path. The Repository union is validated as AWS validates it (exactly one provider, Owner/ConnectionArn for third-party providers, KMSKeyId required for CUSTOMER_MANAGED_CMK), duplicate associations report ConflictException, and an association is Associated from the first read so provider waiters complete immediately. * fix(codegurureviewer): paginate ListRepositoryAssociations, register the model for reflection, generate the action table ListRepositoryAssociations now honours MaxResults and NextToken with real pagination (the filter query keys stay singular - ProviderType, State, Name, Owner - matching the wire mapping the API reference documents for the plural request fields). RepositoryAssociation carries @RegisterForReflection so native-image persistence survives a restart. The docs page now uses the generated action-table markers, has its service-matrix row, and maps the hyphenated codeguru-reviewer signing name to its doc slug. * fix(codegurureviewer): reject a malformed MaxResults with ValidationException, not 404 A JAX-RS Integer binding fails during parameter conversion, so MaxResults=abc surfaced as 404 before the handler ran. The parameter is now bound as a String and parsed in the controller, routing bad values through the modeled 400 ValidationException. |
||
|
|
7b6266e902 |
feat(connect): instance management (CreateInstance family, attributes, storage configs, tags) (#2740)
* feat(connect): instance management (CreateInstance family, attributes, storage configs, tags) Amazon Connect control plane: CreateInstance/DescribeInstance/ListInstances/ DeleteInstance, instance attributes, instance storage configs, and resource tagging over REST JSON, registered under the connect signing name. Instances report ACTIVE from the first read so the Terraform provider's status poll completes immediately. 17 integration tests cover the lifecycle, attribute validation against the AWS InstanceAttributeType/DirectoryType/InstanceStorageResourceType enums, storage-config association, and tag round-trips. * docs(connect): register connect in the action-table catalog The Action-tables CI gate requires every service registered in ResolvedServiceCatalog to have an index row and a generated action table; connect's page was hand-written and unregistered. * fix(connect): validate boolean instance attribute values UpdateInstanceAttribute stored any nonblank string while the inbound/outbound flags coerced it to boolean, so an invalid value read back inconsistently across DescribeInstanceAttribute and DescribeInstance. Reject anything but true/false with InvalidParameterException and store the canonical lowercase form. |
||
|
|
b76eadc98e |
docs(cloudformation): generate the supported resource-type table (#2739)
The "Supported Resource Types" table was hand-maintained, and had drifted: ten provisioned types were undocumented, including the whole CloudFront row, Lambda's Permission/MicrovmImage/NetworkConnector, RDS DBProxy and DBProxyTargetGroup, ECS capacity providers, EC2 VPCEndpoint and ApiGatewayV2 Authorizer. Generate it from the provisioner inventory TSV that CfnResourceInventoryTest already pins to the CDI-resolved registry, so the table cannot drift from what Floci actually provisions. Wired into docs-sync and docs-check, with the inventory path added to the workflow filters: it lives under src/test/resources, which src/main/** did not cover, so a slice that moved a type between owners would have skipped the gate. The table is prose as much as data, so presentation stays configurable in cfn_resource_types.yaml: service labels, curated type order (types not listed there are appended alphabetically, so a new type still appears), per-type notes, and extra_types for capabilities that are real but are not provisioner types, each needing a stated reason. Nested Stack and the Custom::* wildcard are the two such entries; the wildcard cannot be an inventory type because the registry is keyed by exact type. The generator reads the TSV rather than the Java because several provisioners return Set.of(CONSTANT, CONSTANT) from resourceTypes(), which a source regex only partly sees. Also flags two things cheaply, before anyone waits on a Quarkus boot: a provisioner missing @ApplicationScoped, and a type claimed by both the legacy switch and a provisioner. |
||
|
|
a1383fdd3d |
feat(redshift): implement Redshift emulation with snapshot and parameter group support (#2472)
* feat: add redshift domain models
* feat: add redshift service and test
* feat: add redshift query handler and routing
* feat(redshift): implement data plane container manager and wire storage
This commit implements Redshift Container Manager, wires the StorageFactory into RedshiftService, uses AwsException for error handling, implements Describe/Delete Clusters, and adds integration tests with AWS SDK in the compatibility tests project.
* feat: add redshift operations models and service logic
* fix: correct yaml indentation for redshift storage config
* fix: remove invalid redshift storage properties
* feat: implement pg_dump and psql for redshift snapshots
* feat: add redshift core operations query actions
* test: add redshift operations integration test
* fix(redshift): Write snapshot SQL dumps to file storage and add Parameter model
* docs: add redshift implementation plan, design spec, and PR description
* chore: remove superpowers working files
* fix(redshift): scope snapshots and cluster recovery per account, restore original password
- Scope snapshot SQL dump files under redshift-dumps/{accountId}/ so
same-identifier snapshots from different accounts no longer collide,
overwrite, or delete each other's data.
- Restore uses the source cluster's real master password instead of a
hardcoded value, falling back to "admin" only when the source cluster
no longer exists.
- Recreate Docker containers for all persisted "available" clusters on
startup, across every account (not just the default), fixing clusters
that were reloaded with stale endpoints but no running container.
- Add AccountAwareStorageBackend.accountId() accessor needed for the
account-scoped dump path.
* fix(redshift): add logging for cleanup failures in RedshiftOperationsTest
* fix(redshift): scope container identity per account, persist snapshot password
- RedshiftContainerManager now keys its in-memory container map and Docker
container name by accountId + clusterIdentifier, instead of just the
cluster identifier. Previously two accounts creating a cluster with the
same identifier would share (and clobber) the same Docker container,
so startup recovery for the second account silently skipped its own
cluster and left it advertised with a stale endpoint.
- Snapshot now captures masterPassword at snapshot-creation time, so
restoreFromClusterSnapshot can recover the original credential even
after the source cluster has been deleted, instead of falling back to
"admin".
- Clean up fully-qualified java.nio.file / commons-compress references in
RedshiftContainerManager in favor of imports.
* feat(redshift): implement adoptOrStart method to reuse existing containers
* chore: gitignore subagent-driven-development scratch workspace
* feat(redshift): add tagging support to RedshiftService
- Add tags field to Cluster, Snapshot, and ClusterParameterGroup models
- Inject RegionResolver into RedshiftService constructor
- Implement tag CRUD methods: createTags, deleteTags, describeTags, listTagsForResource
- Add resolveTagHandle ARN resolver for tagging operations
- Add 6 new unit tests covering tag operations and error cases
* feat(redshift): wire CreateTags/DeleteTags/DescribeTags into the query handler
* feat(redshift): store real parameter values on ClusterParameterGroup
* fix(redshift): use proper imports and preserve parameter metadata on modify
* feat(redshift): wire ModifyClusterParameterGroup, return real DescribeClusterParameters values
* feat(redshift): add ClusterSubnetGroup model and CRUD
* feat(redshift): wire ClusterSubnetGroup CRUD into the query handler
* feat(redshift): add ClusterSubnetGroupName/VpcSecurityGroupIds metadata to Cluster
* feat(redshift): add RedshiftContainerManager.alterUserPassword
* fix(redshift): prevent SQL injection in alterUserPassword via username validation
* feat(redshift): add RedshiftService.modifyCluster
* feat(redshift): add RedshiftService.rebootCluster (dump/restore based, no data loss)
* feat(redshift): wire ModifyCluster/RebootCluster into the query handler
* test(redshift): add compatibility coverage for tagging, subnet groups, modify/reboot
* fix(redshift): use imports and unique names in compatibility test
Follow this file's established conventions: proper imports instead of
fully-qualified SDK types, and TestFixtures.uniqueName() instead of
hardcoded resource names, matching the pattern used by the sibling
test methods.
* fix(redshift): address final whole-branch review findings
* fix(redshift): address PR review feedback and green the CI
Review comments:
- Translate three Vietnamese comments in RedshiftContainerManager and
RedshiftService to English (repo is English-only).
- alterUserPassword: reword the single-quote guard to cite the AWS
ModifyCluster MasterUserPassword constraint rather than the psql SQL
literal, and enforce the full documented set for parity — reject
' " \ / @, require length 8-64 and at least one upper/lower/digit.
- adoptOrStart: LOG.warnv on the container-gone branch so a fresh empty
cluster after a lost container is a searchable line, not a silent one.
- Move the .superpowers/ scratch ignore from the shared .gitignore to
.git/info/exclude (local tooling, not project output).
CI failures:
- Register redshift.model.Parameter for reflection so
PersistedModelReflectionTest passes and native-image persistence works
(fixes CI shard 3 and the native sdk-test-java compat run).
- Convert RedshiftQueryHandler.handle() from an if/else chain to
switch (action) so the docs action-table generator can extract the
action list, matching every other Query handler. Bodies unchanged.
- Register redshift in tools/docs/services.yaml, add docs/services/redshift.md
with the generated action table, and add the Service Matrix row in
docs/services/index.md (fixes Docs Action Tables / Action tables in sync).
* fix(redshift): reject path traversal in SnapshotIdentifier
createSnapshot spliced the request's SnapshotIdentifier straight into a
host path (<persistentPath>/redshift-dumps/<accountId>/<id>.sql). A value
with traversal segments or an absolute prefix escaped the account dump
directory: snapshot creation would write pg_dump output over an arbitrary
host file, and the resulting absolute path was persisted so a later
restore (arbitrary read into an attacker-controlled DB) or delete
(arbitrary unlink) trusted it.
- validateSnapshotIdentifier: enforce AWS's format (1-255 chars, leading
letter, letters/digits/non-consecutive hyphens) — rejects '.', '/', '\'
so no separator can appear.
- Keep a normalise + startsWith(dumpDir) containment check as defence in
depth.
- restore/delete now verify the stored sqlDump path still resolves inside
the account dump dir before touching it, so a path written by the
pre-fix code can't be acted on.
Also replace inline java.* fully-qualified names in RedshiftService and
RedshiftQueryHandler with top-of-file imports.
* fix(redshift): validate snapshot dump path before restore provisioning
The trusted-dump-path check added in the previous commit ran inside the
try block, after restoreFromClusterSnapshot had already persisted the
target cluster as "creating" and started its container. Rejecting an
untrusted path then left the container running and a "failed" cluster
record behind, blocking a retry with the same identifier
(ClusterAlreadyExists).
Move the check ahead of all provisioning — right after the snapshot is
loaded, before clusters.put and containerManager.start — so a rejected
restore creates no resources.
---------
Signed-off-by: Vũ Thế Huy <31652864+vuthehuyht@users.noreply.github.com>
|
||
|
|
2a7c94b04d |
feat(applicationautoscaling): evaluate target-tracking and step-scaling policies against ECS (#2692)
Adds a generic CloudWatch alarm evaluator plus an ECS CapacityAdjuster, so a firing policy calls UpdateService to change desiredCount instead of sitting inert. Adds DescribeScalingActivities to observe the result. Closes #2565 Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com> |
||
|
|
cf6fede453 |
feat(rekognition): add Amazon Rekognition sync image-analysis actions (#2706)
* feat(rekognition): add Amazon Rekognition sync image-analysis actions Implements DetectLabels, DetectFaces, DetectText, CompareFaces, and DetectModerationLabels as fixed AWS-shaped stub responses over the real JSON 1.1 wire protocol (X-Amz-Target: RekognitionService.*). Image/SourceImage/TargetImage input is required and validated (must specify Bytes or S3Object) but never decoded, matching the pattern already used for Textract's Document input. Content-listing operations (DetectLabels, DetectText) always return one canned entry, matching TextractService's stub precedent. Face and moderation operations (DetectFaces, CompareFaces, DetectModerationLabels) return empty results by default rather than fabricating biometric attributes or a moderation flag for content that was never analyzed, matching ComprehendService's PII-detection precedent. Face-collection persistence, custom-model training, live video (StreamProcessor), async video jobs, and Face Liveness sessions are out of scope for this PR. Closes #2705 * fix(rekognition): reject wrong-typed Bytes/S3Object as SerializationException requireImage() only checked field presence via hasNonNull(), so a wrong-typed Bytes (e.g. a number) or S3Object (e.g. a string) was silently accepted instead of rejected, same class of bug as the Comprehend Text/LanguageCode type-coercion fix. Bytes must now be textual and S3Object must be an object when present, both rejected as SerializationException (a shape/marshalling mismatch) otherwise. Content-level validation (well-formed base64 in Bytes, S3Object's Bucket/Name presence, rejecting both Bytes and S3Object together) is intentionally not added: S3Object has no required members in AWS's own model, and nothing in the model declares supplying both fields invalid — documented as intentional deviations. Addresses review feedback on #2706. |
||
|
|
5c1b69c45f |
feat(comprehend): add Amazon Comprehend sync text-analysis actions (#2674)
* feat(comprehend): add Amazon Comprehend sync text-analysis actions Implements DetectSentiment, DetectKeyPhrases, DetectDominantLanguage, DetectPiiEntities, and ContainsPiiEntities as fixed AWS-shaped stub responses over the real JSON 1.1 wire protocol (X-Amz-Target: Comprehend_20171127.*). Input validation (Text and LanguageCode required, LanguageCode checked against Comprehend's supported set) matches real API behavior and raises InvalidRequestException/UnsupportedLanguageException per botocore's declared error shapes. The async job/model-training surface (DocumentClassifier, EntityRecognizer, Flywheel, Dataset, Endpoint) and DetectEntities/ DetectSyntax are out of scope for this PR. Real (non-stub) detection logic is planned as a follow-up once this lands. Closes #2660 * fix(comprehend): restrict PII detection to en/es language codes DetectPiiEntities and ContainsPiiEntities were validated against the full 12-language set shared with DetectSentiment/DetectKeyPhrases, but AWS's own operation docs for DetectPiiEntitiesRequest.LanguageCode state PII detection only supports English (en) and Spanish (es). Split the allowlist so the two PII operations reject other languages with UnsupportedLanguageException, matching real Comprehend behavior. Addresses review feedback on #2674. * fix(comprehend): reject non-string Text/LanguageCode as SerializationException getStringField() coerced any JSON value via asText() instead of enforcing the modeled string type, so a numeric or boolean Text/ LanguageCode silently succeeded instead of being rejected. Reuses the codebase's existing SerializationException convention (see JsonErrorResponseUtils.createSerializationErrorResponse()) since a wrong-typed field is a shape/marshalling mismatch caught before business logic runs, distinct from a missing field (InvalidRequestException, a modeled business error). Scoped to ComprehendJsonHandler only. Addresses review feedback on #2674. |
||
|
|
277809fb41 |
feat(aps): add Amazon Managed Service for Prometheus workspaces (#2604)
* feat(aps): add Amazon Managed Service for Prometheus workspaces
Implements the AMP workspace lifecycle (CreateWorkspace,
DescribeWorkspace, ListWorkspaces, UpdateWorkspaceAlias,
DeleteWorkspace) plus tagging through the shared /tags/{resourceArn}
dispatcher via a TagHandler with service key aps. Previously the aps
service did not exist, so aws_prometheus_workspace could not be created
through Terraform or Pulumi at all.
Workspaces are ACTIVE from birth so the provider's create waiter
(CREATING to ACTIVE) completes on its first DescribeWorkspace poll, and
a deleted workspace answers DescribeWorkspace with the typed
ResourceNotFoundException its delete waiter matches. createdAt is
serialized as restJson1 epoch-seconds; the ListWorkspaces alias
parameter is a prefix filter, matching the provider's alias_prefix.
clientToken is accepted and ignored, kmsKeyArn is stored and echoed,
and no alertmanager/rulegroups/scraper/logging operations are included.
* refactor(aps): build ARNs via RegionResolver and parse tag ARNs with AwsArnUtils
Replaces the inlined AwsArnUtils.Arn.of + config.defaultRegion pair with
regionResolver.getRegion()/buildArn so a request signed for another
region gets an ARN and endpoint in that region, and drops the
EmulatorConfig dependency that existed only for that getter. The tag
dispatcher path now parses ARNs with AwsArnUtils.parse plus an explicit
workspace/ prefix check (the SchedulerTagHandler idiom), so a
non-workspace aps ARN fails with ValidationException instead of a
misleading workspace ResourceNotFoundException. Also makes the delete
and alias mutators void (their returns were unused) and removes a dead
DELETING status mutation.
* docs(aps): map the aps service key to managed-prometheus.md in the service matrix
The docs-check gate matches ResolvedServiceCatalog external keys against
docs/services/index.md rows by filename; aps is documented at
managed-prometheus.md, so it needs the same alias treatment as
kafka -> msk.
* fix(aps): partition workspaces by request region and align minor wire details
Review follow-ups from #2604:
- Key the workspace store by region (region::workspaceId, like
CloudWatchLogsService's groupKey), and thread the SigV4-resolved request
region through every lifecycle and TagHandler operation, so workspaces
created in one region are invisible to describe/list/delete/tag calls
served in another. Covered by unit and HTTP region-isolation tests.
- Default ListWorkspaces to pages of 100 (AWS's documented default) while
keeping the 1000 ceiling, via Pagination's seven-argument overload.
- Strip leading/trailing blanks from aliases at create, alias update, and
the list prefix filter, per the documented normalisation.
- Return DeleteWorkspace's 202 with an empty body instead of {}.
- Reject tag keys beginning with the reserved aws: prefix in TagResource
with a ValidationException.
* refactor(aps): align the reserved tag-key check with sibling services
- Match the aws: prefix case-insensitively as a plain loop, the same idiom
as FisService and BatchService, instead of a case-sensitive stream chain.
- Derive key() from keyPrefix() so the :: separator lives in one place, and
hoist the region prefix out of the scan predicate.
- Replace the two near-identical SigV4 Authorization literals in the
integration test with an auth(region) helper.
|
||
|
|
d60bd6ead2 |
feat(route53resolver): add Route 53 Resolver with DNS Firewall domain lists (#2582)
* feat(route53resolver): AWS-managed DNS Firewall domain lists
New JSON 1.1 service exposing ListFirewallDomainLists with the four
AWS-managed domain lists, deterministic ids stable across restarts.
LZA's NetworkPrepStack Custom::ResolverManagedDomainList Lambda resolves
managed list ids by name and previously failed with UnknownOperation.
* feat(route53resolver): full-parity build-out (16 ops)
Adds firewall domain list CRUD, resolver endpoint CRUD, resolver rule
CRUD, and rule-association management, backed by four new
StorageBackend stores. The pre-existing deterministic AWS-managed
domain list logic (AWS_MANAGED_DOMAIN_LIST_NAMES, managedList(),
FirewallDomainList) is untouched -- LZA's bootstrap Lambda depends on
those ids being stable across calls.
Also fixes the JSON-1.1 dispatch case in AwsJson11Controller to pass
the account id through to the handler, matching every other service's
dispatch signature (route53resolver was the one holdout still calling
handle() with the old 3-arg signature).
* fix(config): declare route53resolver enabled toggle in both application.yml files
Upstream's ServiceConfigYamlCoverageTest requires every service config with an
enabled() toggle to declare it explicitly in both files; this branch predates
that test and fails it without the declaration.
* docs(route53resolver): register the generated action table
* fix(route53resolver): declare storageKey and storageMode on the service descriptor
The service persists four stores through StorageFactory, but its catalog
descriptor left storageKey and storageMode null, so it was invisible to
PersistentPathValidator's boot check and to per-service storage config
resolution. Mirror the organizations descriptor.
* fix(route53resolver): make creates idempotent on CreatorRequestId
CreateFirewallDomainList, CreateResolverEndpoint and CreateResolverRule
allocated a new resource on every call, so an LZA/CloudFormation retry of
the same CreatorRequestId left duplicates behind. Real AWS returns the
resource the token originally created. Dedupe per store, after the
operation's own validation so a replayed token cannot excuse a malformed
body; a blank or absent token still allocates.
* fix(route53resolver): give outbound resolver endpoints rslvr-out ids
Every CreateResolverEndpoint allocated an inbound-style rslvr-in- id
regardless of Direction, so an outbound endpoint carried an id AWS would
never issue. Key the prefix off Direction (INBOUND/INBOUND_DELEGATION ->
rslvr-in, OUTBOUND -> rslvr-out) and reject values outside the
ResolverEndpointDirection enum instead of silently defaulting to inbound.
* test(route53resolver): assert managed domain lists by name, not by count
ListFirewallDomainLists returns the four managed lists plus whatever
custom lists other tests in the run have created, so size()==4 and the
[0] index extraction were both order-dependent. Assert the four managed
names are present and pick the id by name. Also drop the call-site counts
from the 404-convention comment, which would go stale on any refactor.
* docs(route53resolver): correct the scoping limitation
The limitation claimed resources are visible regardless of the caller's
account. They are not: all four stores are created through StorageFactory,
which wraps every backend in AccountAwareStorageBackend, so keys are
prefixed with the calling credential's account id and both scan() and
keys() filter on that prefix. Region and VPC are what go unenforced, and
the AWS-managed lists are region-derived and globally visible by design.
* fix(route53resolver): validate Direction before the CreatorRequestId replay check
endpointIdPrefix ran only on the allocation path, so replaying a known
CreatorRequestId with an unrecognised Direction returned 200 and the
original endpoint instead of InvalidParametersException. Bind the prefix
right after the Direction is read, so every request is validated whether
or not it turns out to be a replay.
* fix(route53resolver): enforce the RuleType and ResolverEndpointType enums
CreateResolverRule stored any RuleType string it was given and UpdateResolverEndpoint
copied any ResolverEndpointType through, so Get/ListResolverRules and
GetResolverEndpoint reported values outside botocore's RuleTypeOption
(FORWARD/SYSTEM/RECURSIVE/DELEGATE) and ResolverEndpointType (IPV6/IPV4/DUALSTACK).
Both now reject with the same InvalidParametersException the Direction check uses.
* fix(route53resolver): reject an empty TargetIps list
The model pins TargetIps to list min 1; a present-but-empty array was
stored verbatim. Absent stays allowed for SYSTEM rules. Found by the
botocore-grounded review pipeline; the hand audit missed it.
* fix(route53resolver): make the CreatorRequestId replay check atomic
Two overlapping create retries with the same token could both pass the
replay scan before either put, persisting two resources with different
ids. The three create methods are now synchronized, making the
scan-then-put pair atomic on this ApplicationScoped singleton.
* fix(route53resolver): scope the CreatorRequestId replay to the request's region
replayOf matched purely on CreatorRequestId content across the whole
account-partitioned store, which carries no region in its keys. The same
account replaying a token in a second region got the first region's
resource and ARN back instead of the regional resource it asked for.
Route 53 Resolver is regional, so a token identifies one resource per
region: match the candidate's region too, taken from the ARN this service
builds rather than a stored field, so nothing new reaches the wire.
Also folds the two stacked javadoc blocks above replayOf into one; the
second was shadowing the first, which left the idempotency contract out
of the generated docs.
* docs: correct service count to 79 after the #2579 merge
The upstream/main merge (
|
||
|
|
715bab68e7 |
feat(networkfirewall): emulate AWS Network Firewall (#2580)
* feat: emulate AWS Network Firewall
* docs: register Network Firewall service
* feat(networkfirewall): add AssociateFirewallPolicy
Sets FirewallPolicyArn on the stored firewall, validating that both the
firewall and the policy exist. Round-trip covered by an integration test
(create -> associate -> describe shows the new policy ARN).
FirewallPolicyChangeProtection is not enforced; documented as a limitation.
* docs(networkfirewall): register the generated action table
* docs(networkfirewall): correct the service matrix protocol and action count
The Network Firewall row claimed JSON 1.1 with 25 actions; the service speaks
x-amz-json-1.0 and the generated action table lists 27.
* test(networkfirewall): assert list membership instead of positional indexes
hasSize(1) and [0] assertions coupled these tests to JUnit's method order and
to being the only resource in the store.
* fix(networkfirewall): declare the storage key and mode in the service catalog
The service persists four backends through StorageFactory, but its descriptor
left storageKey and storageMode null, so it was skipped by PersistentPathValidator
and by per-service storage configuration.
* fix(networkfirewall): reject DeleteFirewall when delete protection is enabled
AWS raises InvalidOperationException rather than deleting a protected firewall;
the emulator deleted it regardless of the flag it had already stored.
* fix(networkfirewall): give the subnet and AZ association ops real semantics
All four routed through updateFirewall, which copies request fields onto the
stored firewall wholesale. That ignored SubnetChangeProtection and
AvailabilityZoneChangeProtection, and a Disassociate call left the mappings it
was meant to remove in place. Associate now adds deduplicated mappings,
Disassociate removes the named ones, and either is rejected with
InvalidOperationException while the matching change protection is set.
DescribeFirewall only synthesises endpoints for a firewall created without
SubnetMappings, so draining every subnet now reports no sync states.
* fix(networkfirewall): name the resource kind in ResourceAlreadyExistsException
createNamed passed the response wrapper field, so a duplicate create reported
"RuleGroupResponse already exists" instead of "RuleGroup already exists".
* fix(networkfirewall): validate association requests before touching the firewall
mappingsOf() creates the mappings array on the live stored node, so it ran
before the request array was validated: a rejected DisassociateSubnets on a
firewall created without SubnetMappings left an empty array behind and
permanently suppressed the synthetic sync states in DescribeFirewall.
* fix(networkfirewall): name the resource kind in ResourceNotFoundException
describeNamed passed the response wrapper field as the kind, so a miss reported
"RuleGroupResponse not found". Same defect as the create path; the now-unused
responseField parameter goes with it.
* fix(networkfirewall): return the deleted firewall and its status from DeleteFirewall
AWS responds with {Firewall, FirewallStatus}; the emulator returned only the ARN
and name, so an SDK client parsed an empty response. The handler already had the
region in scope, so no controller change was needed.
* fix(networkfirewall): enforce modeled enums on rule group Type and logging config
Three modeled enums were read and stored without being checked.
CreateRuleGroup/UpdateRuleGroup Type: the model enumerates STATELESS, STATEFUL
and STATEFUL_DOMAIN. The prefix choice was a two-way branch, so every unmodelled
value (including a lowercase "stateful") silently fell through to the
stateful-rulegroup ARN and was persisted as a rule group AWS would have
rejected. The branch keeps its meaning deliberately: only STATELESS gets the
stateless prefix, and both stateful variants share stateful-rulegroup, matching
AWS. A test pins STATEFUL_DOMAIN to that prefix so the mapping is no longer
implicit.
UpdateLoggingConfiguration LogType (ALERT/FLOW/TLS) and LogDestinationType
(S3/CloudWatchLogs/KinesisDataFirehose): the LoggingConfiguration is stored
verbatim, so an unmodelled or wrongly-cased value was persisted and echoed back
by DescribeLoggingConfiguration. Enforced case-sensitively, as the model spells
them and as LZA's network-firewall construct sends them.
Rejections use InvalidRequestException, which both operations list.
* fix(networkfirewall): validate association requests before mutating stored mappings
mappingsOf handed back the live stored array (or installed one), so a
request with a valid mapping followed by an invalid one mutated the
firewall before the rejection. The mappings are now a detached copy,
validated in full, and attached only when storeAndRespond commits.
* fix(networkfirewall): whitelist mutable fields on the shared UpdateFirewall* path
The generic update loop copied every raw request field onto the stored
firewall, so an UpdateFirewallDescription request carrying SubnetMappings
or AvailabilityZoneMappings persisted them without the change-protection
checks the Associate/Disassociate ops enforce. The loop now copies only
the union of fields the six UpdateFirewall* operations actually model
(Description, the four protection flags, EnabledAnalysisTypes), matching
AWS dropping unmodeled request members.
* fix(networkfirewall): scope UpdateFirewall* to the invoked op's own field
The shared updateFirewall path copied any field present in the raw
request that appeared in the union of all UpdateFirewall* mutable
fields, regardless of which specific action was invoked. A plain
UpdateFirewallDescription request could therefore smuggle
DeleteProtection (or any other operation's field) past its own
dedicated operation and change-protection checks.
Each UpdateFirewall* operation models exactly one mutable field
(botocore 2020-11-12); replace the shared whitelist with a per-action
field map so a request only ever mutates the field its own action
models.
* fix(networkfirewall): default DeleteProtection/SubnetChangeProtection/FirewallPolicyChangeProtection to true
botocore's network-firewall 2020-11-12 model documents CreateFirewall as
initializing these three flags to TRUE when the caller omits them;
AvailabilityZoneChangeProtection is the lone exception, documented as
defaulting to FALSE (already correct). Floci defaulted all four to false,
so the enforcement code in firewallForChange/deleteFirewall was correct
but unreachable in the common case of an SDK/Terraform caller that omits
the flags entirely.
RED-first: createFirewall_withoutProtectionFlags_defaultsToProtected
failed against the old defaults (DeleteProtection false, expected true).
Existing tests that relied on the old false default to exercise
mutation paths now pass explicit false for the flags they don't intend
to test, matching how a real caller opts out of protection.
NetworkFirewallIntegrationTest: 27/27 green.
* fix(networkfirewall): flatten UpdateFirewall* response to the modelled shape
All six UpdateFirewall* operations shared updateFirewall(), which returned
firewallResponse()'s nested {Firewall, FirewallStatus} envelope -- the
CreateFirewall/DescribeFirewall shape. botocore 2020-11-12 models each
UpdateFirewall*Response as a flat {FirewallArn, FirewallName, <field>,
UpdateToken}, confirmed for all six ops (UpdateFirewallDescription,
UpdateFirewallDeleteProtection, UpdateSubnetChangeProtection,
UpdateFirewallPolicyChangeProtection, UpdateAvailabilityZoneChangeProtection,
UpdateFirewallAnalysisSettings). A typed SDK client got null back from every
modelled accessor.
RED-first: updateFirewallDeleteProtection_returnsTheFlatModelledShape failed
(FirewallArn/DeleteProtection/UpdateToken were all null at the top level;
present one level down inside Firewall). CreateFirewall/DescribeFirewall
still use firewallResponse() and are unaffected -- only the six Update*
callers changed. NetworkFirewallIntegrationTest: 28/28 green.
* fix(networkfirewall): omit optional update fields instead of echoing null
UpdateFirewallDescription and UpdateFirewallAnalysisSettings read the response
member back with path(), so a firewall created without Description or
EnabledAnalysisTypes serialised the resulting MissingNode as an explicit null.
Both members are optional on these ops (botocore 2020-11-12 marks no required
members on either), so the response now omits what was never set.
* docs: correct service count to 79 after the #2579 merge
The upstream/main merge (
|
||
|
|
2e843e9f23 |
feat(servicecatalog): emulate AWS Service Catalog with Control Tower Account Factory (#2585)
* feat: emulate AWS Service Catalog * docs: register Service Catalog service * feat(servicecatalog): full API parity for 55 operations Closes the entire botocore servicecatalog gap surface found by a full-manifest scan (56 ops; 55 landed, DescribeServiceAction escalated because no store exists for it and a single write op may not invent one). Each operation is dispatch-reachable, covered by a wire-level test asserting response values (not just status codes), and falsifiability-checked at method granularity. Tests are one class per operation family so falsification isolates per operation. Nine previously-unshipped bugs surfaced and fixed along the way, recorded as issues 0017-0025: wrong field names in describeConstraint, three incompatible service-action association keys across the single-op and batch-op pairs, a Type discriminator collision leaking phantom entries into ListServiceActions, the provisioned-product-plan family having no persistence at all, five cases of an operation returning a generated id (RecordId, CopyProductToken, plan ids) that nothing ever persisted, a hardcoded-empty ListConstraintsForPortfolio, and TerminateProvisionedProduct reporting the wrong RecordType. Limitations documented in docs/services/service-catalog.md. * chore: drop local-only bug-ledger files before upstream issues/0017-0025 are this fork's internal tracking, not something upstream has a convention for. * fix(config): restore EmrServerless config body lost in rebase The rebase onto upstream/main collided where both upstream and this branch declare a new service config interface sharing a trailing body; the EmrServerless interface was left open, so the file did not parse. * docs: state a single correct service count Collapse the duplicated claim left by the docs merge to one number matching the 74 services this branch registers. * fix(servicecatalog): adapt to upstream's Organizations model (OrganizationAccount, 5-arg createAccount) * docs(servicecatalog): register the generated action table * docs(servicecatalog): correct action descriptions after audit * docs(servicecatalog): name the real Control Tower catalog triggers * fix(servicecatalog): reject missing identifiers instead of failing with 500 Store lookups passed the request's identifier straight through to the backing map, so an operation called without its id parameter died on a null key and surfaced as InternalFailure. Guard the lookup helpers and name the missing parameter in an InvalidParametersException. * fix(servicecatalog): report a plan's own identifiers in its plan details DescribeProvisionedProductPlan and ListProvisionedProductPlans reused the plan's own id and provisioned-product name for ProvisionProductId and PlanName, so callers could never recover the product a plan targets or the plan's name. Read the distinct fields the plan already stores. * fix(servicecatalog): require ProvisionProduct to name a real product ProvisionProduct ignored ProductId and ProductName, so every request took the Control Tower Account Factory path: an unrecognised product id still created an Organizations member account and recorded it under the seeded Account Factory identifiers. Resolve the target product and its provisioning artifact first, reject what the catalog does not hold, and touch Organizations only when the request really names Account Factory. Other stored products now provision a plain record. Product and artifact resolution is shared with DescribeProvisioningParameters, which already validated a request the same way. * docs: state one service count and ProvisionProduct's validated behaviour docs/index.md still claimed 74 services while docs/services/index.md, the canonical matrix, listed 77. The Service Catalog page also described ProvisionProduct taking the Account Factory path for every request, which stopped being true once it started resolving the product it was given. * fix(servicecatalog): resolve ProductId by product id only requireProduct also matches provisioning-artifact ids, so ProvisionProduct with ProductId set to the Account Factory artifact id resolved the owning product and created an Organizations account. resolveProduct now does a strict id lookup; artifact ids in ProductId get ResourceNotFoundException. * fix(servicecatalog): enforce the modeled enums and AccountId format on stored values Five request members were read and stored, or used as a filter, without the constraint botocore pins on them: - Create/Update/DeletePortfolioShare built the share's store key from AccountId and OrganizationNode.Type unchecked, so a short account id or a node type outside OrganizationNodeType became a share DescribePortfolioShares reported back verbatim. - CreateProvisionedProductPlan accepted any PlanType and then described the plan as CLOUDFORMATION, the only member ProvisionedProductPlanType has. - CreateServiceAction stored any DefinitionType, likewise a one-member enum. - DescribePortfolioShares and ListOrganizationPortfolioAccess filtered on an unvalidated type, turning a typo into an empty result rather than an error. * fix(servicecatalog): enforce the PrincipalType enum on principal association The model pins PrincipalType to IAM or IAM_PATTERN; the value was stored verbatim. Found by the botocore-grounded review pipeline on its first sweep — the hand audit of the same service missed it. * fix(servicecatalog): reject an ambiguous ProductName on ProvisionProduct Product names are not unique keys, so first-match could resolve a user-created product carrying the Account Factory name — or vice versa — and either skip or wrongly enter the Organizations account workflow. More than one match now raises the modeled DuplicateResourceException. * fix(servicecatalog): keep a missing AccountEmail inside the Service Catalog model ProvisionProduct passed AccountEmail straight to Organizations, so omitting it surfaced Organizations' InvalidInputException — a shape absent from Service Catalog's model — to a servicecatalog client, which cannot deserialize it into a typed exception. Validate it on the Account Factory path and raise the service's own InvalidParametersException, matching how the createAccount failure a few lines below is already translated. A plain stored product needs no email, so the guard sits inside accountFactoryAccountId rather than at the top of provisionProduct; a test pins that provisioning a non-Account-Factory product without AccountEmail still succeeds. * fix(servicecatalog): refuse to delete a portfolio or product that is in use DeletePortfolio and DeleteProduct deleted the resource and then cascaded, removing every association naming the portfolio and every share keyed to it. AWS refuses the call instead — a portfolio with associated products, users, constraints, or shared accounts, and a product associated with a portfolio, are both ResourceInUseException — so what AWS makes a recoverable no-op was here unrecoverable data loss reported as 200. The scans that drove the cascade now detect the in-use condition. Every row AWS lists for a portfolio carries PortfolioId, so one scan covers products, principals and constraints alike; the portfolio cascade is gone because it is now unreachable. Tag-option associations key off ResourceId, are absent from AWS's list, and were never cleaned by the old cascade either, so nothing is orphaned that was not orphaned before. For a product only the portfolio association blocks, so its remaining associations are still cleaned up on delete. |
||
|
|
a2bd22d5f8 |
feat(ssoadmin): serve Identity Center ListInstances (#2581)
* feat(sso): serve Identity Center ListInstances under SWBExternalService
LZA's Custom::GetIdentityCenterInstanceMetadata Lambda calls SSO Admin
ListInstances (target prefix SWBExternalService., the service's AWS-internal
codename, cf. config's StarlingDoveService) and requires exactly one instance
with InstanceArn and IdentityStoreId. Previously no descriptor matched the
target, so the call died with UnknownOperationException. Identifiers are
fixed constants so they survive restarts — LZA persists them into SSM
parameters between stages.
* fix(config): declare ssoadmin enabled toggle in both application.yml files
Upstream's ServiceConfigYamlCoverageTest requires every service config with an
enabled() toggle to declare it explicitly in both files; this branch predates
that test and fails it without the declaration.
* docs(ssoadmin): defer the single-op handler from action-table generation
* docs(ssoadmin): alias the sso descriptor to the IAM page
* fix(ssoadmin): report the caller's account as OwnerAccountId and assert the unsupported-operation error type
* fix(ssoadmin): use UnknownOperationException for unrecognized actions
Matches this codebase's JSON 1.1 dispatch convention (ServiceQuotas, Network
Firewall, and others already use it) and is a real modelled shape unlike the
bare UnsupportedOperation string, which has no Exception suffix and isn't in
sso-admin's error model.
* docs: correct service count to 79 after the #2579 merge
The upstream/main merge (
|
||
|
|
f912c3b717 |
feat(servicequotas,ram): add Service Quotas and AWS RAM resource sharing (#2579)
* feat(servicequotas,ram): add Service Quotas and RAM sharing stub
Two Landing Zone Accelerator pipeline prerequisites:
- servicequotas: ListServiceQuotas/GetServiceQuota (+ AWS-default
variants) over JSON 1.1 with curated real quota codes for codebuild
and lambda, deterministic generated quotas for other services, and
offset-token pagination
- ram: EnableSharingWithAwsOrganization returning {returnValue: true}
* feat(ram): model resource shares with the reads LZA's TGW share flow needs
RamController previously registered only /enablesharingwithawsorganization;
every other restJson1 RAM path fell through to S3's /{bucket} template route
and returned an XML error the LZA Lambdas' JSON parser choked on
(SyntaxError: Unexpected token '<'). Adds CreateResourceShare,
GetResourceShares (SELF vs OTHER-ACCOUNTS visibility incl. org/OU
principals), GetResourceShareInvitations (always empty — organization
sharing auto-accepts, matching real AWS), and ListResources with RAM
resource-type derivation.
* fix(ram): show every non-owned share to OTHER-ACCOUNTS callers
Launched-container credentials resolve to the emulator default account,
so LZA's Custom::GetResourceShare Lambda never matches an account-ID
principal check for the account it actually runs in. Principal-based
visibility hid IPAM pool shares from the accepting NetworkVpcStack while
org-ARN shares (TGW) passed, failing Network_VPCs. The Lambda filters
client-side by owningAccountId + name, so returning all non-owned shares
is safe.
* feat(servicequotas): add RequestServiceQuotaIncrease
Persists the requested increase and returns a RequestedServiceQuotaChange
the subsequent Get/List operations can read back. Limitations documented in
docs/services/servicequotas.md.
* fix(config): restore EmrServerless config body lost in rebase
The rebase onto upstream/main collided where both upstream and this branch
declare a new service config interface sharing a trailing body; the
EmrServerless interface was left open, so the file did not parse.
* fix(ram): persist resource shares
* feat(ram): add principal associations and resource-share lifecycle
* fix(test): conform RAM storage test doubles to upstream StorageFactory API
e9826026 introduced SharedStorageFactory overriding StorageFactory.create with
the pre-upstream return type StorageBackend<String,V>; upstream now returns
AccountAwareStorageBackend<V>. Matches the template used by upstream's own
CodeBuildServicePersistenceTest.
* fix(ram): restrict resource-share mutations to the owning account
Every mutating RAM operation resolved the share ARN with a global
all-accounts scan, so any caller holding an ARN could rename, retag,
associate resources into, or delete another account's resource share.
Thread the caller's account into the mutation paths and resolve the
share only within it; a non-owner now gets the same
UnknownResourceException an unknown ARN gets, matching AWS, which
resolves share ARNs inside the caller's account. Read visibility under
OTHER-ACCOUNTS is unchanged.
* fix(ram): return 400 SerializationException for a malformed request body
An unparseable body left readTree throwing UncheckedIOException, which
escaped the controller and surfaced as a 500 InternalFailure. Reject it
with the modeled restJson1 client error instead.
* fix(config): restore the bedrock-agent-core-control enabled flag
A rebase left the key with a null body in both the main and test
application.yml, silently dropping the service's enabled flag.
* docs(servicequotas): fix the docs path in the consumer test javadoc
* docs: correct the service count and the Service Quotas and RAM matrix rows
docs/index.md still claimed 75 services and listed RAM under JSON 1.1;
the canonical count in docs/services/index.md is 78 and RAM speaks
restJson1. Bring the Service Quotas row up to its five handled actions
and the RAM row up to its twelve REST operations.
* docs(tooling): acknowledge the RAM controller in the docs registry
RAM's action table is hand-written and carries a method-and-path column
the generator does not emit, so register it as a deferred handler rather
than a rest-mode source.
* test(ram): cover owner mutation over HTTP and pin the non-owner error message
The ownership checks were asserted only against the service; nothing
exercised the caller account the controller now threads through, so a
mismatch between the identity stamped at create time and the one
resolved at delete time would have gone unnoticed. Select the existing
SELF assertion by share name, since the store is shared across the
class.
* docs(ram): generate the action table from the controller
The RAM table was hand-written and only acknowledged in the docs
registry, so the drift sentinel could never fire on it. Fold the method
and path into each description the way the FIS REST controller's doc
does, add the generator markers, and register the controller as a
rest-mode source. Also record that mutations are owner-only.
* fix(ram): enforce the modeled resourceOwner enum on the share read paths
GetResourceShares, ListPrincipals and ListResources all read resourceOwner and
fed it to a two-way visibility fork: "SELF" meant owned shares, and literally
anything else meant OTHER-ACCOUNTS. The model enumerates exactly SELF and
OTHER-ACCOUNTS, so a caller who sent "self" or "OTHER_ACCOUNTS" was silently
handed the inverse of what they asked for rather than the InvalidParameterException
AWS returns — an error all three operations list.
Validated at the three entry points rather than inside the per-share visibility
check, so the rejection does not depend on the store being non-empty.
* test(ram): cover the resourceOwner enum rejection on the HTTP path
The service-level test proved the check; this pins the wire behaviour LZA
actually exercises. RamController substitutes "SELF" via asText("SELF") only for
an absent or null resourceOwner, so a present-but-unmodelled value — including a
non-string that Jackson coerces — must still reach the service and surface as a
400 InvalidParameterException on all three read routes. The absent case is
asserted to still return 200, so the default is not silently changed.
* fix(ram): stop exposing the contents of a deleted resource share
ListResources and ListPrincipals reported a deleted share's resources
as AVAILABLE to non-owning consumers. Both now skip DELETED shares,
while GetResourceShares keeps returning the share with DELETED status,
matching the retention window real RAM applies.
* fix(ram): reject a malformed GetResourceShareInvitations body
The endpoint ignores its body semantically, but malformed JSON is a
client error: it now goes through readTree and answers the modeled 400
SerializationException instead of 200 with an empty list.
* fix(ram): reject mutations on DELETED resource shares
A deleted share stays readable via GetResourceShares for the retention
window, but real RAM treats it as terminal: update, associate,
disassociate, tag, untag, and a second delete all raise
UnknownResourceException. findOwnedShare now filters DELETED so every
mutation path resolves a deleted share the same as an unknown ARN.
* fix(ram): apply the GetResourceShares filters and advance lastUpdatedTime
Four response-fidelity gaps from the maintainer review, interleaved in
the same two files:
GetResourceShares read only resourceOwner, so name, resourceShareArns
and resourceShareStatus were silently dropped and a caller narrowing by
share name got every visible share back. All three are applied now, and
an unmodelled resourceShareStatus is rejected with
InvalidParameterException the way resourceOwner already is.
lastUpdatedTime never advanced: ResourceShare had no such field and
creationTime was echoed in its place, on the share node, on the
association rows, and on ListPrincipals. The field now exists and is
stamped in putForOwner, the single seam every create and mutation
already passes through. State written before the field existed reads
back with creationTime, which is correct for a share never mutated
since.
Shares also report the modeled featureSet (STANDARD — floci has no path
to produce a policy-derived share), and DeleteResourceShare echoes the
clientToken the caller sent, both of which the model carries.
* docs(ram): record the filter support and the unrouted-operation behavior
* fix(ram): require resourceOwner on the share read paths
GetResourceShares, ListPrincipals and ListResources all substituted
SELF for a missing resourceOwner, which the model marks required. That
answered a question the caller never asked, and answered it with the
caller's own shares rather than an error. All three now pass a missing
or null value to the validator that already rejected unmodelled ones,
so it surfaces as InvalidParameterException.
* docs(ram): name GetResourceShareAssociations in the fall-through note
Per review, the unrouted-operation note is more useful if it names the
operation Terraform's association resources read on every refresh, and
says the symptom is an S3 NoSuchBucket XML body rather than a
credentials problem.
* fix(ram): reject trailing tokens after a valid JSON body
Jackson's default readTree stops at the first complete value, so a body
like "{} not-json" parsed as an empty object and the request executed
instead of returning the modeled 400 SerializationException. Read with
FAIL_ON_TRAILING_TOKENS, the convention the JSON 1.0/1.1 controllers,
FIS, Signin and EventBridge already follow.
* fix(servicequotas): validate the ServiceCode shape
ServiceCode was only checked for emptiness. Because an unknown code
deliberately generates a quota catalog, that meant a caller typoing
"!!!" got three invented quotas back instead of an error. Validate
against the modeled [a-zA-Z][a-zA-Z0-9-]{1,63} and 63-character cap;
unknown-but-well-formed codes keep generating as before.
|
||
|
|
ac6cb06af4 |
feat(lakeformation): lake formation (#2427)
* feat(lakeformation): implement Lake Formation emulator * chore(docs): register LakeFormationJsonHandler in deferred_handlers * fix(lakeformation): resolve code review comments * fix(lakeformation): ensure wildcard exclusions generate distinct keys * fix(lakeformation): include tableCatalogId in DataCellsFilter keys * fix(lakeformation): include LF-tag values in permission identity key and add integration tests * fix(lakeformation): configure Jackson for PascalCase and fix JSON-1.1 handler * fix(lakeformation): escape tag values in permission key to prevent collision * fix(lakeformation): include embedded CatalogId in permission key and fix tag value encoding collision * fix(lakeformation): include embedded CatalogId in permission key and fix tag value encoding collision * feat(lakeformation): migrate from JSON 1.1 dispatcher to REST JSON - Remove LakeFormationJsonHandler and its routing in AwsJson11Controller - Create standard JAX-RS LakeFormationController mapped to specific actions - Update ResolvedServiceCatalog to correctly route Lake Formation requests via restProxyClasses - Implement regional data isolation via keys prefixing region in MemoryLakeFormationStorage - Add modeled AlreadyExistsException and EntityNotFoundException handling in LakeFormationService - Update LakeFormationIntegrationTest to send standards-compliant HTTP POST calls to mapped endpoints * fix(lakeformation): revoke grant options when base permission is revoked When a permission exists in both permissions and permissionsWithGrantOption and a revoke names it only in permissions, the grant option is now properly revoked as well to prevent dangling grant options and inconsistent permission states returned to clients. * fix(lakeformation): correct LF tag casing to match AWS wire protocol The AWS Lake Formation API uses LFTags, LFTag, LFTagPolicy, and LFTagExpression on the wire. The Jackson PascalCase naming strategy incorrectly converted internal lfTags fields to LfTags, causing silent mapping failures (e.g. AddLFTagsToResourceRequest lost its tags, and TBAC Resource.LFTag lost its resource identity entirely). Added explicit @JsonProperty annotations to ensure strict compliance with AWS specifications. * fix(lakeformation): apply filters when listing resources and permissions The list-resources and list-permissions endpoints were completely ignoring the provided filters and returning the entire in-memory storage, which violates AWS behavior and breaks Terraform synchronization (since it sees permissions of other principals). Updated MemoryLakeFormationStorage to natively apply: - listResources: EQUALS, NOT_EQUALS, and BEGINS_WITH for RESOURCE_ARN FilterConditions - listPermissions: Principal identification checks and exact Resource matching * fix(lakeformation): resolve multiple minor conformance issues - Add @JsonInclude(NON_NULL) to all Lake Formation model classes to omit empty JSON fields from wire responses - Validate that PermissionsWithGrantOption is a subset of Permissions in GrantPermissions - Validate that ResourceArn starts with 'arn:' in RegisterResource - Create AwsThrowableMapper to map generic service NPEs to standard AWS 500 InternalFailure responses - Update index.md documentation to reflect Lake Formation's REST JSON protocol instead of JSON 1.1 * test(lakeformation): cover missing API operations and TBAC grant Added explicit coverage for the remaining 8 Lake Formation operations to ensure all endpoints execute against the mock storage cleanly: - RegisterResource, DescribeResource, ListResources, DeregisterResource (Resource lifecycle) - ListLFTags, DeleteLFTag (Tag lifecycle extension) - AddLFTagsToResource, RemoveLFTagsFromResource (Tag assignment) Also added a dedicated TBAC round-trip test (grantAndListPermissionsTBAC) to assert that grants scoped to LFTag resources serialize correctly and are successfully retrievable via ListPermissions. * fix(lakeformation): enforce AWS-compatible FilterCondition operators and logic - MemoryLakeFormationStorage now correctly implements AWS's EQ and NE operator strings instead of EQUALS and NOT_EQUALS (which bots and SDKs never send). - Unrecognized operators now throw an InvalidInputException instead of silently matching everything. - LakeFormationService now correctly ANDs all filters in the FilterConditionList by passing the entire list to storage rather than arbitrarily dropping all but the first. - Fixed a Quarkus JAX-RS deployment conflict where Resource Explorer 2 and Lake Formation both mapped to POST /ListResources. The conflict was resolved by rewriting Resource Explorer 2's ambiguous path at the pre-matching filter layer, allowing both services to co-exist securely. * fix(lakeformation): enforce required inputs on GrantPermissions and handle malformed records - Added explicit validation to GrantPermissions and RevokePermissions to ensure Principal, Resource, and Permissions are present, throwing an InvalidInputException if missing. - Null-guarded principal and resource dereferencing in MemoryLakeFormationStorage's listPermissions filter. This prevents a malformed grant record from triggering a NullPointerException and causing a 500 InternalFailure for all subsequent list operations. * chore(lakeformation): pin ListResources filter in tests and document intentional omissions - Updated LakeFormationIntegrationTest.resourceLifecycle to register a second resource, strictly asserting that ListResources with an EQ filter correctly isolates and returns only the requested resource. - Added code comments to MemoryLakeFormationStorage documenting the deliberate omission of pagination (MaxResults, NextToken) and specific optional list filters (ResourceType, IncludeRelated), clarifying the design choice for future maintainers. - Reverted the repo-wide AwsThrowableMapper addition as it falls outside the scope of the Lake Formation protocol fixes and warrants its own dedicated review. * chore(lakeformation): Reverted the repo-wide AwsThrowableMapper - Reverted the repo-wide AwsThrowableMapper addition as it falls outside the scope of the Lake Formation protocol fixes and warrants its own dedicated review. --------- Signed-off-by: NAMAN JAIN <naman.049259@tmu.ac.in> |
||
|
|
d3871e1f25 |
feat(resourceexplorer2): add AWS Resource Explorer 2 with cross-service resource discovery (#2485)
* feat(resourceexplorer2): Add AWS Resource Explorer 2 with cross-service resource discovery Resource Explorer 2 lets AWS SDK clients discover resources across S3, RDS, DynamoDB, ElastiCache, and OpenSearch through a single query interface — the same way real AWS Resource Explorer aggregates resources from multiple services. Architecture: a ResourceProvider CDI interface in core/resource/ decouples Resource Explorer from individual services. Each service implements the interface to expose its resources. Resource Explorer discovers all providers via CDI Instance<ResourceProvider> and queries them live on every request — no intermediate store, no eventual consistency. New services become discoverable by implementing the interface; Resource Explorer never imports service packages directly. Query parsing: hand-written character-by-character tokenizer that implements the full Resource Explorer filter syntax — all 10 filter attributes (accountid, application, id, region, resourcetype, resourcetype.supports, service, tag, tag.key, tag.value), comma-OR within filters, negation (-), wildcard suffix (*), quoted strings, backslash escaping, and free-form text keywords. ListResources rejects free-form text (filter-only mode); Search accepts both. Tokens are classified by splitting on the first unescaped colon and looking the prefix up against the known attributes, matching the documented grammar. API surface: 20 REST JSON endpoints covering ListResources, Search, ListSupportedResourceTypes, full Index CRUD (CreateIndex always creates LOCAL — promote via UpdateIndexType, matching real AWS), full View CRUD with Scope and FilterString, BatchGetView with Errors for missing ARNs, default view association, and pagination with NextToken on all list operations. Tag operations use the existing SharedTagsController + TagHandler infrastructure. A default AGGREGATOR index and default view with tags included are auto-provisioned on startup so ListResources works without setup. AWS behavioral fidelity (matched against the API reference, not guessed): ListResources/Search with no view and no regional default return UnauthorizedException (401), not 404; the default view is scoped per region; CreateView requires a unique, regex-valid ViewName (ConflictException 409 / ValidationException 400) and only accepts "tags" as an included property; promoting a second aggregator index returns ConflictException; ListResources suppresses NextToken at MaxResults=1000; Search/ListResources cap results at the first 1000 matches; QueryString is required (empty string allowed) and MaxResults is range-validated. Pagination offsets are clamped so a stale NextToken against a shrunk live result set returns an empty page instead of a 500. All response JSON uses PascalCase field names built via Jackson ObjectNode (never valueToTree on domain models) to match the AWS SDK wire format exactly. Verified by decompiling every SDK model class with javap and comparing field-by-field, then running 16 read-only SDK tests against production resource-explorer-2 in us-east-1. ElastiCache ReplicationGroup gains arn and region fields so Resource Explorer can discover it. RDS resources get tags via ResourceGroupsTaggingService (the cross-service tagging API) since floci's RDS service doesn't implement AddTagsToResource. Indexes and views are persisted (hybrid storage) in production; tests pin the service to in-memory storage so runs stay isolated and idempotent. Testing: - 50 query parser unit tests covering the full grammar - 20 filter evaluation unit tests against synthetic resources - 9 pagination unit tests for the offset clamp and 1000-result cap - 73 integration tests (@QuarkusTest + RestAssured), grouped with @Nested by behavior class: conditional/stateful response fields, data provenance across services, edge/boundary pagination, cross-service data consistency, filter semantics, and AWS API fidelity (401 no-default-view, conflict on duplicate view name and second aggregator, view-name and included-property validation) - 28 SDK compatibility tests using real AWS SDK v2 ResourceExplorer2Client, asserting every field the SDK model exposes. Dual-mode: run against floci or real AWS via FLOCI_TARGET=aws (mutating tests skipped against real AWS). * feat(lambda): expose functions to Resource Explorer 2 Implement ResourceProvider so Lambda functions surface via the Resource Explorer 2 ListResources/Search APIs and lambda appears in ListSupportedResourceTypes. Iterates $LATEST versions only so published versions don't produce duplicate function entries. * feat(sns): expose topics to Resource Explorer 2 * feat(kms): expose keys to Resource Explorer 2 * feat(sqs): expose queues to Resource Explorer 2 Queue ARNs aren't persisted on the model; reconstruct them from the region (recovered from the storage key) plus the queue name via regionResolver.buildArn. * feat(ecr): expose repositories to Resource Explorer 2 * feat(stepfunctions): expose state machines to Resource Explorer 2 * feat(msk): expose clusters to Resource Explorer 2 * feat(pipes): expose pipes to Resource Explorer 2 * feat(acm): expose certificates to Resource Explorer 2 * feat(cognito): expose user pools to Resource Explorer 2 * feat(iam): expose users and roles to Resource Explorer 2 IAM is a global service: its ARNs carry no region, and Resource Explorer reports global resources with the region "global" (not an empty string), matching real AWS. Emit two resource types, iam:user and iam:role. * test(resourceexplorer2): parameterize per-service ListResources coverage The ten single-service resource tests were byte-for-byte identical except for the service name and resource type — the same service-filter/assert-no-foreign-service/assert-type-present shape copied ten times. Fold them into one @ParameterizedTest whose CsvSource carries the (service, resourceType) pairs, so adding a service is one row instead of a new @Nested class. IAM stays separate: it reports the global region and two resource types, which the shared shape can't express. * feat(amazonmq): expose brokers to Resource Explorer 2 Amazon MQ arrived on main after this branch was cut. Implement ResourceProvider so brokers surface via Search/ListResources and mq appears in ListSupportedResourceTypes, matching the other services already wired into Resource Explorer. Brokers carry an ARN and tags, so the mapping is the same shape as the rest: one mq:broker resource per stored broker. * feat(lightsail): expose resources to Resource Explorer 2 Lightsail landed upstream (#1583) after this branch began and models taggable, ARN-bearing resources (instances, disks, static IPs, key pairs) that AWS Resource Explorer indexes. Without a ResourceProvider its resources were invisible to Search/ListResources, unlike every other resource-owning service on this branch. LightsailService now implements ResourceProvider: getResources() maps each stored resource node to an ExplorerResource, deriving region and account from the ARN and resourceType as lightsail:<Type>; getSupportedResourceTypes() advertises the four stored types (static IPs flagged non-taggable, matching AWS). Coverage: a focused unit test asserts the node->ExplorerResource mapping (arn, type, region, account, tags) without Quarkus, plus the parameterized RE2 integration test seeds a Lightsail instance and disk and asserts both surface via ListResources. * feat(rum): expose app monitors to Resource Explorer 2 CloudWatch RUM (added upstream in #1797) owns taggable, ARN-addressable app monitors, so it fits the ResourceProvider extension point the rest of this branch uses to surface resources to Resource Explorer 2 Search, ListResources, and ListSupportedResourceTypes. RUM is the first RE2 provider whose API model carries neither an ARN nor a region (GetAppMonitor returns neither), so getResources() reconstructs the ARN: the region comes from the storage key, and the owning account is captured at creation time on the AppMonitor. That owner account is @JsonIgnore'd so it never leaks into the RUM API body and is not persisted; getResources() falls back to the default account for monitors reloaded from disk. Resolving the account at creation rather than at query time is what keeps a monitor's identity stable — an earlier draft read the account from the request context inside getResources(), which stamped every resource with the account of whoever called ListResources instead of its true owner. Injecting RegionResolver into RumService (threaded through the existing unit tests) and adding RegionResolver.getDefaultAccountId() support this. Adds RumResourceProviderTest, including a regression test proving the owner account is the creator's, not the querying caller's, plus a RumServiceTest assertion that the owner account never appears in the serialized API body. Extends ResourceExplorer2IntegrationTest to seed an app monitor and assert rum:appmonitor surfaces via ListResources and ListSupportedResourceTypes. * feat(resourceexplorer2): complete the API surface and close the AWS gaps Follow-up to the Resource Explorer 2 branch, addressing the gaps found reviewing it against the AWS API reference and search-syntax documentation. Wire-level corrections: - MaxResults ceilings are now per-operation, as AWS models them: 1000 for Search/ListResources/ListSupportedResourceTypes, 100 for indexes, 50 for views, 10 for member indexes. ListSupportedResourceTypes previously rejected page sizes AWS accepts, and ListViews accepted ones it rejects. - ListViews is scoped to the calling Region. AWS returns "the views available in the AWS Region in which you call this operation"; every Region's views were being listed. - Free-form keywords are OR'd rather than AND'd, which is how AWS reads them. The remaining deviation — AWS ranks a non-matching resource lower instead of excluding it — is documented rather than emulated, since a keyword-only search returning the whole account is not a useful local answer. - A tag filter against a view whose IncludedProperties omit `tags` is rejected with a ValidationException, as AWS documents for tag: / tag.key: / tag.value: / application:, instead of being evaluated on data the view may not expose. - Backslash escaping is honoured throughout the query grammar: escapes now survive tokenization and are resolved only where the character's meaning is decided, so `\-`, `\:`, `\,` and `\*` are literal text and a quoted phrase neutralises every operator inside it. - application: matches the application name as well as the resource-group ARN; resourcetype.supports:tags consults the provider's declared tag support instead of passing everything through; free-form keywords match tag keys and values. The remaining 12 operations are implemented, taking the service to all 32: the multi-Region setup lifecycle (CreateResourceExplorerSetup, DeleteResourceExplorerSetup, GetResourceExplorerSetup) provisions real indexes and views and records each Region's outcome independently, so one Region's failure is reported through its ErrorDetails rather than abandoning the task. The organization and trusted-service surfaces answer with the wire-accurate empty result, since floci models neither. Eleven more services expose their resources: EC2 (instances, VPCs, subnets, security groups, volumes, internet and NAT gateways, route tables), CloudFormation, CloudWatch Logs, EventBridge, Secrets Manager, SSM, ECS, EKS, Kinesis, Firehose, and ELB v2 — thirty providers in total. API Gateway and Route 53 stay out: RestApi carries no Region and Route53Service resolves no account id, so each needs a field added to an unrelated service first. Also documents the service, which a new service requires: docs/services/ resource-explorer.md with the generated action table, the deviations above, and the routing note, plus the mkdocs nav, README, and environment-variable entries. Seven existing tests asserted on the emulator's total resource count, which thirty providers push past Search's 1000-result cap; they are scoped to a bounded slice so their arithmetic stays meaningful. 24 tests added for the new behaviour. * fix(rum): keep a monitor's owning account across updates UpdateAppMonitor rebuilds the AppMonitor from its current state and never carried ownerAccountId over, so an update silently reassigned the monitor to whichever account next called ListResources. Resource Explorer then reported a wrong ARN and OwningAccountId for any monitor not owned by that caller. getResources' fallback for monitors reloaded from disk — where the transient owner account did not survive — was the configured default account. monitorStore.keys() is already scoped to the calling account by the account-aware backend, so a monitor reachable there is owned by that caller by construction; the caller's account is the correct fallback. Also addresses review findings on the Resource Explorer branch: braces in the compatibility test's cleanup, a synchronized override in the Lightsail provider test's storage stub, and four unread locals in the integration test. * chore: drop the stray local-dev Dockerfile docker/Dockerfile.localdev was carried in with the Resource Explorer work but is unrelated to it: nothing in the repo references it, and its header points at a CI pipeline and dev cluster that do not exist in this org. * fix(resourceexplorer2): order paginated results before slicing NextToken is a bare offset, but the list it indexes into is rebuilt on every call by iterating Instance<ResourceProvider> and StorageBackend.scan, neither of which promises an order. Offset pagination is only well defined over a stable order: page through Search or ListResources with MaxResults smaller than the result set and the second page indexes into a differently arranged list, silently dropping or repeating resources. Sort on a unique key before every paginate call: ARN for resources and indexes, the view ARN for ListViews, the resource type for ListSupportedResourceTypes. The regression test drives a provider that reshuffles its resources on each call, which is what an unordered map-backed store is free to do; without the sort a 25-resource set pages down to 16 distinct ARNs. This also makes ResourceProvider#getResources()'s "ordering is not significant" contract true rather than merely permitted. * docs: add the Resource Explorer row to the service matrix The downmerge picks up #2465's service-matrix gate, which fails `make docs-check` for any service registered in ResolvedServiceCatalog without a row in docs/services/index.md — resource-explorer-2 was one. The descriptor's external key carries the API version suffix while the page is resource-explorer.md, so it also needs an alias entry, the same way apigatewayv2 and cognito-idp do. * test(resourceexplorer2): scope the tag-provenance lookup to the caller's Region dynamoDbTagResourceUpdatesResourceExplorer took Resources[0] from an unfiltered ListResources and tagged it. ListResources spans every Region the view covers while DynamoDB TagResource resolves the table in the request's Region, so the ARN it picked only worked as long as the first result happened to be local. Deterministic ARN ordering makes that assumption fail reliably instead of by luck: the first table is now eu-west-2's and TagResource reports it as not found. Filter on region:us-east-1, the same way the region-scoping tests in this class already do. --------- Co-authored-by: Marius Volkhart <marius@volkhart.com> Co-authored-by: Hector Ventura <hectorvent@gmail.com> |