The module docstring is argparse's description too, so it is the tool's `--help` text, and it
credited a planning file this repository does not carry: a reader following that pointer finds
nothing. The readings it names are written down in `docs/services/iam.md` and
`docs/services/sts.md`, which anyone reading the tool can open, so it points there instead.
Nothing else moves. The tool's 20 tests pass and a full run over a checkout still reads 2173
recordings over 1195 tests.
The regeneration and reuse tests compared the certificate file's
modification time 100 ms apart. On a filesystem that records times to
the second, a regenerated certificate usually keeps the same time. They
now compare the certificate content, as the spoof-flag test already
does, and no longer sleep.
* fix(memorydb): restore persistent cluster runtimes after restart
Restore account-scoped cluster backends, authentication and stable proxy endpoints from persisted metadata. Retain data storage across restart and preserve retryable ownership on failed provisioning cleanup.
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
* fix(memorydb): retain default backend and log names
Keep default-account/default-region container and engine-log names stable while retaining scoped runtime and proxy keys. Pass the logical name and stored owner through creation, restoration, deletion and rollback. Use an unambiguous separator for foreign Docker names in the retained hyphen-prefix collision case, without changing foreign log names or persisted volume identities. Preserve restore and cleanup coverage; new naming regressions fail the former manager. Local mocked-Docker and loopback RESP qualification only, no managed AWS or native runtime claim.
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
* test(memorydb): share container naming fixtures
Move the two naming cases into MemoryDbContainerManagerTest and reuse its manager setup. Share the four loopback PONG responders through one helper, observing completion and propagating responder failures. Preserve naming, collision, cleanup and lifecycle assertions. No production change.
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
---------
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
The '*' selector was missing from SqsMessageAttributeSelector.includes(),
so ReceiveMessage with MessageAttributeNames: ["*"] returned no
message attributes. AWS treats '*' the same as 'All' and '.*'.
- Add '*' to the includes() check
- Add '*' to the test loop that already covers 'All' and '.*'
Closes#7503
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
A failed stack update left AppSync entities changed or cleared by the update:
the provisioner had no rollbackUpdate, so the stack ended in
UPDATE_ROLLBACK_FAILED with "Rollback is not implemented".
Before an in-place update of a GraphQL API, data source, function, resolver or
API key, the provisioner records the members the update can change or clear.
The service applies an update member by containsKey, so replaying them puts
back both the changed and the cleared values. An update that fails part way
undoes itself through CfnRollback.guarded, and a failed undo keeps the
snapshot for ContinueUpdateRollback.
GraphQLSchema and a replaced AppSync resource are not covered.
tagResource, untagResource and putEnvironmentVariables change the stored API in place while updateGraphqlApi saves a copy, so a copy could overwrite a tag or variable written in between. Every method that writes a store now holds the service monitor, as startSchemaCreation does, and startSchemaCreation checks the API under it too. refreshGraphqlApiUris refreshes the stored API under the monitor instead of putting the instance it read earlier.
Every request and every response wakes a relay thread blocked on a socket
read. On a virtual thread that wakeup goes through the JDK poller and a
carrier handoff, which made the relay itself cost about 0.13 ms per
roundtrip in one Docker network (0.063 ms direct, 0.198 ms through the
proxy). The relay loops of the PostgreSQL, MySQL and opaque TCP bridges now
run on daemon platform threads; the accept loop and the handshake stay
virtual.
The IAM session guard read each backend message's type, length and payload
straight from the socket, plus an available() call per message. Its input
is now buffered, and the flush-on-pause check asks the socket only once the
buffer is drained.
A MySQL or MariaDB client that disconnects without COM_QUIT ended the
client-to-backend relay but left the backend-to-client relay blocked on a
backend that never speaks, and bridge() waited for both before closing
either socket. Close both sockets as soon as either relay ends, as the
PostgreSQL bridge already does, so a dropped client no longer holds a relay
thread and a backend connection open.
Returns a console log carrying the instance's SSH host public keys between the markers cloud-init prints, read from the running instance container, so clients can verify the host before connecting. An instance without a running container has an empty log.
Look the instance up in the request's region, read host keys only from a running container and treat a failed read as an empty log, build the response with XmlBuilder, and cover the SDK reading of the response.
AWS returns DryRunOperation for DryRun=true even for an empty or malformed instance id, so check the dry run first.
The key files are the guest's to write, so capture at most 16 KiB of stdout (and 1 KiB of stderr) through bounded streams, and answer an empty log, with a warning, when the output is larger than host keys can be.
* fix(cognito): offer configured providers in managed login
Preserve native authentication eligibility and request parameters for federated-only and mixed clients.
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
* fix(cognito): explain unavailable sign-in providers
Show an actionable managed-login error after every provider is removed, without enabling native credentials.
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
---------
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
Populate existing instance types with AWS-verified manufacturer values and expose them through DescribeInstanceTypes. Add SDK regression coverage for all 84 catalog entries.
Closesfloci-io/floci#7516
The controller read path parameters from the decoded JAX-RS path and
substituted them into the integration URI, so a path with an encoded space
threw from URI.create and answered 500 without reaching the backend. An
encoded ? or # cut the backend path short, %2F became a separator and %252F
lost a level of encoding.
Read the target URL's path parameters from the raw request path, for REST
HTTP_PROXY, REST HTTP and HTTP API HTTP_PROXY integrations. A value mapped
from elsewhere is percent-encoded. $request.path.X and header mappings keep
the decoded value. An integration URI that cannot be parsed now answers 502.
Routes match on the decoded path, so an encoded slash ahead of a parameter
shifts the segments read off the raw path. /a%2Fb/c/d on /a/b/{proxy+} called
the backend with /backend/d. A raw value that does not decode to the decoded
parameter is now ignored, and the decoded value is encoded instead. Comparing
values rather than literal segments also covers templates with no literals,
such as /{x}/{y}/{z+} and the HTTP API route /{x}/{y+}.
* fix(dynamodb): check the condition members of a PutItem or DeleteItem in order inside the validation envelope
* fix(dynamodb): reuse the expression member helper in the older PutItem and DeleteItem check
Several questions this repository had about AWS behaviour were settled one
at a time by opening LocalStack's AWS-validated snapshots by hand: the two
IAM constraint messages showing that IAM leaves the offending value out,
the enum set UpdateAccessKey names, the STS message for an invalid
parameter. A test LocalStack marks @markers.aws.validated ran against a
real account, so what its snapshot carries is a recording rather than an
emulator's answer, and there are 37 services' worth of them.
This asks the whole set at once. Per recording it prints the service, the
test, its marker, the date LocalStack recorded it, the path inside the
recorded content, and the error code, status and message. --grep adds every
other recorded string carrying a text, for a question that is not about an
error code; --services all reads every service that carries a snapshot, for
a wording Smithy writes rather than a service does; --tsv is one row per
line, for pasting into an issue. A marker other than validated is not
evidence of AWS behaviour, so those tests are left out unless
--all-markers asks for them, and then each line says which marker it
carries.
Three things decide whether what it prints can be trusted.
The markers are read off the parsed test file rather than matched line by
line. A parametrized test stacks @pytest.mark.parametrize between the
marker and the def, over a line per case, and matching lines found 10 of
IAM's 84 AWS-validated tests before this read the decorators instead. A
class's marker carries to the tests inside it, and a test's own wins over
it.
A marker is looked up by the key a snapshot names: Class::name for a test
in a class, the bare name for one at module level, and the bare name as
well for a name the file carries exactly once, since a snapshot key
sometimes names no class for a test that now sits in one. LocalStack
carries 20 names defined in more than one class, so keying those bare would
let one class's validated marker stand for another class's unmarked test,
and an unclassified recording would read as AWS evidence.
An answer is read off the object that holds it rather than by walking the
path string back down, so an error nested in a list keeps its message and
status, and a key with a dot in it is one step rather than two. The path
stays as a label for the reader. A field that would end the row or the
column, a newline or a tab, is escaped: 53 of the messages in these
snapshots carry one.
A snapshot is looked for all the way down a service's directory, since it
sits beside its test: 137 of the files in that tree are a directory or two
below the service's own door and hold 1505 recordings, which a search one
level deep reads none of. The service a recording belongs to is the
directory under tests/aws/services rather than the one the file sits in,
and a recording is reported under its key's own tail,
test_iam.py::TestOne::test_x[case], so two classes carrying one test name
stay two tests in the output and in the count. That tail is cut at the file
rather than at the last slash: 33 keys in that tree carry a slash inside
the parameter, and cutting there leaves name] where a test should be.
LocalStack is not vendored here, so the tool takes a checkout:
make snapshot-mine LOCALSTACK=../localstack. Its own tests cover each of
those readings and run with make snapshot-mine-test. A full run over a
checkout reads 2173 recordings over 1195 tests.
The table of request resources read only a request's body or Query
form, so no REST namespace was read: a REST request names its
resources in its path and its query. An OpenSearch Service request
naming its domain, DescribeDomain on
/2021-01-01/opensearch/domain/{DomainName}, was left unchecked by the
routes the previous change reads, as Floci could not check it on the
domain AWS checks it on.
- The generator reads a rest-json request's members in its path and
its query as members, under their botocore names, and records where
each one a resource reads is (`located`): a path label, `{Label}`, or
a query parameter, `?name`. RequestResources lays them over the body,
a label's value from the route the request matched in the vendored
routes (IamActionRegistry.pathLabels, IamRestRoutes now capturing
each label), a query parameter's from the query, so every kind of
resource reads them as it reads the body's. A located member is read
from where it is alone, as its handler reads it: one the body also
gives is dropped.
- A namespace read this way also takes the operations of each botocore
model Floci reads routes for under it (regen_rest_routes.MODELS) that
the reference lists for none of its clients, each the action of its
own name with that action's resource types, when the reference has
that action: the reference lists OpenSearch Service's `es` client
alone, while the `opensearch` client's operations are named after
`es` actions. --verify checks such an operation's action and types
against the reference's Actions, and reports one whose action AWS no
longer has.
- `es` moves from NOT_COVERED to NAMESPACES: 120 operations, both API
versions', 1505 over 34 namespaces. Every domain route Floci serves
reads its domain, from the path, the body or `?arn`, on
`domain/<DomainName>`, the ARN Floci mints. Those whose resource the
table does not find (outbound connections, applications, insights)
are routes Floci does not serve.
- Reading rest-json would also have read the Payment Cryptography data
plane's key from its path; Floci serves only the control plane, so
`payment-cryptography-data` joins CLIENTS_NOT_READ with its reason
and its operations stay as they were. No other entry changes.
With the domain operations in the table, the routes check them by the
resources-read half of the join rule. IamActionRegistryTest checks the
domain routes and the labels a request's path gives;
RequestResourcesTest reads a path label, a query parameter and a body
together; IamRestRouteEnforcementIntegrationTest checks DescribeDomain,
DescribeElasticsearchDomain and ListTags on the domain they name; the
generator tests cover the located members, a member two clients locate
apart, the REST models' operations and a round trip through --check and
--verify. iam.md says so.
The npm Docker test built the same publish body as the npm data plane
test's publishEnvelope, and five Docker tests each posted the same
PutPackageOriginConfiguration request by hand. Move both into
testing/CodeArtifactRequests, next to the other per service request
helpers, and call it from every one of those tests.
The shared origin configuration helper also asserts that the upstream
restriction came back as sent, which only the publish side checked
before. No production code changes.
* fix(ec2): associate elastic addresses with primary and detached interfaces
Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
(cherry picked from commit 28c17835d6e7dc480f5f5716e206fbbe5b81bee0)
Signed-off-by: Jackson Price <jxnprice@amazon.com>
* test(ec2): clean up partial address-association fixtures
Signed-off-by: Jackson Price <jxnprice@amazon.com>
* fix(ec2): serialize interface deletion and resolve managed interfaces
Signed-off-by: Jackson Price <jxnprice@amazon.com>
---------
Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
Signed-off-by: Jackson Price <jxnprice@amazon.com>
Co-authored-by: Andre Kurait <AndreKurait@gmail.com>
Add the missing virtual sizes in C6g, C6gn, C7g, C8g, M6g, M7g and M8g using captured AWS type metadata. Verify metadata and offerings through the Java SDK.
Closesfloci-io/floci#7500
* fix(lambda): validate VPC resources before configuration changes
Require declared subnets and security groups in the request account and region to belong to one VPC. Validate replacement settings before mutating the function. Preserve detachment, published-version snapshots and actual declared-resource fixtures.
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
* fix(lambda): preserve unknown VPC placeholder compatibility
Keep unknown subnet and security-group IDs in responses without inferring VpcId. Reject mixed known VPCs before mutation even when unknown IDs are also present. Restore placeholder EFS/CloudFormation fixtures and cover partial unknowns, updates and version snapshots. Addresses maintainer review 5766333414.
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
---------
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
* feat(ec2): report the service-network address as public IP when Floci runs in a container
Adds FLOCI_SERVICES_EC2_PUBLIC_IP_FROM_SERVICE_NETWORK (default false). When Floci itself runs as a container and the option is on, an instance's public IP is its address on Floci's own Docker network, so clients on that network reach the guest's real ports, port 22 included.
* fix(ec2): record the service-network address and follow protected guests to their helper
Resolve the address once at launch, start and restore instead of asking Docker on every public-address read, which DescribeAddresses does under a lock. A security-group protected guest shares its firewall helper's network namespace, so its address is the helper's.
* fix(ec2): share the helper lookup and retry a failed service-network lookup
Use one container: network-mode lookup for protectedNamespace and the service-network address. A lookup that fails on a Docker error is no longer recorded as the answer; the next address read retries it on the executor without waiting.
* fix(ec2): run service-network lookup retries off the launch pool
Retries ran on the bounded launch executor, whose blocking backpressure could leave launch workers waiting on each other. They now get their own virtual-thread executor, and a retry that cannot be scheduled is logged with the instance id.
* fix(ec2): publish a service-network lookup only for the container it read
A lookup records the container it starts for, asks Docker outside the instance lock, and publishes under the lock only while the instance still runs that container, so a lookup that outlives a replacement or a teardown cannot overwrite what came after it. The retry executor now comes in through the package-private constructor and is final.
* feat(sfn): apply the EventBridge connection to HTTP Tasks
An HTTP Task now resolves the connection named by InvocationConfig or
Authentication. Its authorization, headers, query parameters and body
parameters are merged over the task's, and the connection's value wins on
a duplicate key, as the AWS HTTP Task guide describes. The body is merged
before Transform encodes it. A string body with connection body
parameters fails with States.Runtime, and an unknown connection fails
with Events.ConnectionResource.ResourceNotFound.
The connection logic is the API destination's: EventBridgeInvoker exposes
it as connectionHttpParameters, so both callers share one implementation,
OAuth client credentials included.
* fix(sfn): keep case-distinct query parameters and bound OAuth by the HTTP Task timeout
A connection query parameter now replaces only a task parameter of the exact same name, since query names are case-sensitive. The connection's OAuth token exchange now spends the task's TimeoutSeconds, so the API request gets only the time left.
* chore: retrigger CI
* fix(cloudformation): drop a DynamoDB table's update snapshot once the update commits
* test(cloudformation): clean up the rollback retry test's stack and table even when it fails, using a shared ContinueUpdateRollback helper
CreateKey minted an ARN that the next request naming it was refused for in
GovCloud, EUSC and the ISO partitions. The vendored patterns widened the
partition the model writes but kept its region segment, which only fits a
two-letter prefix and one further part, so us-gov-west-1 and eusc-de-east-1
failed the full match.
The generator now widens the region on every pattern that carries it,
including the bare Region shape, to [a-z]{2,4}(-[a-z]{1,16})+-[0-9]+. The
pattern is slightly looser than the model, as the partition segment already
is, and still refuses a malformed ARN. Every region in partitions.json is
checked against it on both the Python and the Java side.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
CreateUserPoolDomain built its CloudFrontDistribution by hand from 14 hex
characters with no leading d, unlike the names an edge-optimized API Gateway
domain and an AppSync custom domain get. Use CloudFrontEdgeDomain.create, so
the name is d plus 13 hex on the partition's suffix. The name is stored, so
existing domains keep theirs.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* fix(apigateway): report the published regional hosted zones
A regional custom domain reported the invented Z2FDTNDATAQYL2 everywhere outside
GovCloud, so a Route 53 alias built from it pointed at a zone AWS does not have.
Vendor the data plane table of the API Gateway General Reference page into
region-facts.json, with the GovCloud guide kept as a cross-check. A region with no
row keeps the placeholder, now documented as one. Stored domains keep their id.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* test(apigateway): read the regional hosted zone through the SDK clients
Create and read the custom domains with ApiGatewayClient and ApiGatewayV2Client, so the test also shows both SDKs parse the zone fields.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
---------
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
Under IAM enforcement, a ProvisionPermissionSet for
ALL_PROVISIONED_ACCOUNTS is checked on each account the permission set
is provisioned to, which the permission check finds through
SsoAdminService.through. The handler then found those accounts again
and provisioned to each. Another request could provision the permission
set to one more account in between, with an account assignment of its
own, and a permission set change could leave that account
LATEST_PERMISSION_SET_NOT_PROVISIONED: this request then provisioned it
again, changing the account's state with no policy checked against it.
The accounts are now found once for the request and kept, in a
request-scoped SsoAdminRequestContext, as PaymentCryptographyRequestContext
keeps the key an alias named: the check and the provisioning use the
same accounts, and an account provisioned to since is left as the other
request left it. Each request finds them afresh, so the next one is
checked on it.
SsoAdminServiceTest replays the race: the check finds one account,
another account is assigned and a policy attached, and the provisioning
leaves the second account not provisioned. The IAM integration test
assigns a third account after a request was let through on two, and the
same grant no longer covers the next request. iam.md says so.
Eight vendored files were last generated with botocore 1.43.113 and
record it in their _source, while tools/aws/requirements.txt pins
1.43.118 and every other file records that: the IAM request resources,
tag-on-create, condition keys and passed network connectors tables,
the DynamoDB, Lambda Web and S3 Control condition keys, and the
Payment Cryptography request shapes. Each is regenerated with the
pinned botocore, so the next regeneration does not restate it.
Nothing they give changes: every operation, member and key is as
before. The regeneration also refreshes what the live Service
Reference gives, which adds Polly to tag-on-create's otherNamespaces,
the namespaces AWS gives tag-on-create keys and Floci does not serve,
and moves two retrieval dates.