mirror of
https://github.com/floci-io/floci.git
synced 2026-11-25 06:47:41 -05:00
313f91e06ccefe06a2d9811f4cbb98d2b2ddb016
700
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
ad20699a6b |
fix(apigateway): complete API Gateway API key responses (#3817)
Return timestamps, stage keys, tags, and customer ID across create, get, list, and update operations to prevent Terraform provider crashes and state drift. Generate opaque IDs by default while preserving legacy generateDistinctId=false behavior. Keep API key values hidden unless explicitly requested. Add REST, SDK, and CloudFormation regression coverage. |
||
|
|
30b491a546 |
feat(glue): table version reads and deletes, batch partition delete, SearchTables (#3828)
GetTableVersion answers one archived version by VersionId, or the current table when none is given; an unknown version is EntityNotFoundException and a non-integer one InvalidInputException. DeleteTableVersion and BatchDeleteTableVersion drop archived versions, the batch form reporting per-version Errors; the current version is refused, as AWS refuses it on the console and the API, since DeleteTable is the way to drop it. BatchDeletePartition deletes up to 25 partitions and reports the ones not found in Errors, the shape the other batch partition calls use. SearchTables searches every table of the catalog: SearchText as a substring of name, database, description, owner, columns and parameter values (exact when quoted), Filters with the API reference's tokenised match for string keys and a Comparator for the time fields, SortCriteria on the same fields, and MaxResults with NextToken paging. Closes #3826 |
||
|
|
54a5cf3e9c |
feat(rds): global clusters and FailoverDBCluster (#3819)
CreateGlobalCluster creates an Aurora global database, empty or with an existing Aurora cluster as its primary, in which case engine, version, database name and encryption come from that cluster and may not be given. CreateDBCluster with GlobalClusterIdentifier joins a cluster: the first becomes the primary, every later one a secondary in a region that holds no member yet, with the primary's credentials and database name and a point-in-time copy of its data through the pg_dumpall mechanism that snapshots and read replicas use. DescribeGlobalClusters answers the real records for RDS, with IsWriter and Readers per member; DocumentDB and Neptune keep the shared empty answer. SwitchoverGlobalCluster and FailoverGlobalCluster promote the named secondary and demote the current primary to a secondary, the topology AWS keeps on switchover and restores after a managed failover. RemoveFromGlobalCluster detaches a member into a standalone cluster and the primary goes last; DeleteGlobalCluster needs an empty, unprotected global cluster; ModifyGlobalCluster renames, protects or upgrades, with members following. DBCluster now carries the writer role: the first instance is the writer, IsClusterWriter reports it instead of true for every member, deleting the writer promotes a remaining member, and FailoverDBCluster moves the role to the named reader or the first one; a cluster without a reader is refused with InvalidDBClusterStateFault. Closes #3778 |
||
|
|
22b0627245 |
test(compat): assert recorded metric filter publishing through the SDK modules (#3809)
* feat(logs): add metric filters with per-event metric publication Implements PutMetricFilter, DescribeMetricFilters, DeleteMetricFilter and TestMetricFilter on the CloudWatch Logs JSON 1.1 handler, backed by a filter pattern engine for term, space-delimited and JSON patterns. The grammar is checked against 148 TestMetricFilter cases recorded from AWS, kept as fixtures under src/test/resources/cloudwatchlogs and recaptured with the opt-in script under tools/aws-capture/cloudwatchlogs. Validation follows the observed AWS wire behavior: the five regex-bearing filters per log group quota is shared with subscription filters through one canonical backend monitor, a filter pattern may hold at most two regular expressions, defaultValue must be a JSON number, DescribeMetricFilters requires metricName and metricNamespace together in both directions, and TestMetricFilter reports one-based event numbers with an empty public extractedValues map for JSON patterns. Ingested events publish samples into CloudWatch Metrics per event at the event timestamp: matching events contribute the extracted or literal value, non-matching events contribute defaultValue, dimensions are all-or-none, and system dimensions only attach to matching events. Failed publications are retried from a bounded queue of 10,000 samples with stable publication ids. Resettable gains beforeReset and afterReset default hooks so the metric filter publisher can pause and drain before a state reset wipes storage and resume afterwards. EmulatorInfoController.performReset is serialized and calls the hooks around the existing container teardown and storage wipe, running afterReset in a finally block so a failed wipe cannot leave a publisher paused. The GetMetricStatistics and GetMetricData Query responses now carry the CloudWatch namespace so both read paths return the same samples. * feat(cloudformation): provision AWS::Logs::MetricFilter Adds LogsMetricFilterCfnProvisioner for creates, in-place updates, name changes and deletes. Ref and PhysicalResourceId are the filter name alone, as observed on AWS; the log group is kept as private resource metadata. A replacement deletes the old filter before creating the new one, matching the DELETE then CREATE event order AWS emits, and a failed replacement recreates the previous definition on rollback. Every mutation records an APPLIED, NOT_APPLIED or UNKNOWN outcome under the service lock so a failed or ambiguous call can never authorize deleting or overwriting a filter the stack does not own. Ownership that cannot be proven is resolved conservatively before the next mutation. The engine gains three small provisioner hooks that this type needs and others may reuse: - ProvisionContext carries a progress consumer so a provisioner can emit the intermediate DELETE_IN_PROGRESS and DELETE_COMPLETE events of a delete-first replacement while provision is still running. - rollbackUpdate(resource, progress) lets a provisioner restore its own previous state during UPDATE_ROLLBACK and report the steps as events. - hasPendingRollbackCleanup and retainsFailedUpdateState let a provisioner tell the engine that an UPDATE_FAILED resource still holds its own rollback snapshot, so the engine neither restores the previous resource over it nor refuses a later DeleteStack. Both default to false; only this provisioner overrides them. The type is listed in supported-resource-types.tsv, the generated resource table and CfnProvisionerFixture, with unit, integration, storage reload and SDK coverage. * docs(logs): document metric filters and the AWS verification record Describes the metric filter operations, publication semantics and CloudFormation support in docs/services/cloudwatch.md and adds cloudwatch-metric-filters-verification.md, the record of what was observed on AWS in eu-west-1, with which tools, and where each recorded fixture came from. Registers the handler and the verification page with the docs tooling and teaches the service inventory test to count facet pages. * feat(logs): publish metric filter samples off the PutLogEvents thread PutLogEvents evaluated each filter and wrote one CloudWatch Metrics sample per filter and event on the request thread while holding the filter-store monitor, up to a million writes for a maximal request, so ingestion latency depended on the Metrics sink and every PutMetricFilter waited behind the whole batch. The request thread now only evaluates the group's filters as they are at ingestion and hands the resulting immutable samples, with their stable publication ids, to a bounded queue of 100,000 samples. The existing single worker drains it and writes one sample per monitor acquisition, so a PutMetricFilter or a reset waits for at most one write. A batch that does not fit the queue is written inline on the request thread rather than dropped. Failed writes still land in the 10,000 sample retry map with the same ids and cadence as before. Reset pauses the worker, discards queued and failed samples and bumps a generation counter so a batch taken before the reset is never written into the wiped store. Shutdown drains the queue before storage shuts down and clears the retry map only after the worker has terminated. Samples ingested while Metrics is disabled are discarded at startup. Integration and SDK tests poll for the sample, as they would against AWS. * test(compat): assert recorded metric filter publishing through the SDK modules Extends the Java compatibility module with the publishing scenarios recorded from AWS: mixed defaults and quiet traffic, extraction and ordinary dimension series, system dimensions on matches only, and a Sum alarm driven by quiet defaults. Each series is read through the SDK's CloudWatch JSON protocol and again as a signed legacy Query request, so GetMetricStatistics and GetMetricData agree on every sample, timestamp, unit and dimension set. Expected values come from module-local copies of the root fixture metric-filter-publishing-aws.json. MetricFilterFixturePackagingTest checks the Java copy loads from the classpath and the root CloudWatchLogsMetricFilterFixturePackagingTest fails when either SDK module copy drifts from the root file. The Python module gains tests/metric_filter_replay.py, an opt-in replay of the same scenarios against a Floci endpoint or, with explicit profile, region and write acknowledgement, against AWS. Its logic is covered offline by tests/test_metric_filter_replay.py with the network blocked. Both module Dockerfiles are unchanged: the Java image already runs the whole suite and the Python image already copies tests/. * test(compat): assert every recorded statistic and poll for published samples The SDK publishing assertions compared only Sum and SampleCount although the AWS fixture also records Minimum and Maximum for the default-value scenarios. Both the SDK JSON reads and the signed legacy Query reads now assert every statistic the fixture carries, on GetMetricStatistics and GetMetricData. Publication now happens shortly after PutLogEvents returns, so present series are polled and absent series are asserted only after a later positive control of the same filter is visible, which the publisher's ordering guarantees. The read window ends at second 59 so a sample stamped on the following minute is never in scope. The live replay's Region check names the commercial partition explicitly. botocore already defaults get_available_regions to partition_name="aws", so GovCloud and China Regions were rejected before; the offline test now pins it. * test(compat): keep the metric filter SDK test on the Java 17 API of the compat image List.getLast() is Java 21; the sdk-test-java image compiles with Temurin 17. |
||
|
|
a3da2a3767 |
feat(rds): add SQL Server support to RDS (#3752)
* feat(rds): add SQL Server support * fix(rds): align SQL Server master handling * fix(rds): reject SQL Server DBName * fix(test): import Mockito matchers |
||
|
|
7e539155e1 |
fix(ec2): report the calling account as resource owner (#3814)
EC2 froze every resource's owner to the configured default account at construction time, so OwnerId came back as 000000000000 no matter which account the request resolved to. Per-account isolation itself worked, but the reported owner contradicted what STS returns for the same credentials and what SQS embeds in its ARNs. The visible consequence was DescribeImages --owners: the filter was honored but matched against the frozen value, so filtering on the account actually in use returned nothing, and the common Terraform pattern of pinning an AMI to a known owner account failed with "Your query returned no results". Resolve the owner per request through callerAccountId() instead, for the ownerId fields, the generated ARNs and the self owner alias. Callers outside a request scope (startup seeding, internal provisioning) still fall back to the configured default account. Closes #3775 |
||
|
|
008aa9ba35 |
feat(rds): read replicas with a point-in-time copy of the source (#3813)
CreateDBInstanceReadReplica creates a standalone instance with its own container and endpoint that inherits the source's engine, version, credentials, database name and, unless overridden, class, storage and minor version upgrades; a same-region replica also inherits the parameter, option, subnet and security groups, a cross-region one (source named by ARN) gets the region's defaults, as the API reference states. The replica starts with automated backups off, and both ends report the link the way DescribeDBInstances does: ReadReplicaSourceDBInstanceIdentifier plus a "read replication" StatusInfos entry on the replica, ReadReplicaDBInstanceIdentifiers on the source, identifier within a region and ARN across regions. A subnet group with a plain identifier source is refused with DBSubnetGroupNotAllowedFault. The replica's database is initialised from a pg_dumpall of the source taken at creation, the mechanism RestoreDBInstanceFromDBSnapshot already uses, so only PostgreSQL sources are accepted (CreateDBSnapshot draws the same line). Writes after creation are not streamed; the docs say so. PromoteReadReplica clears the link on both ends, turns backups on with the requested retention (one day when omitted) and window, and reboots the instance as RDS does. Deleting a source promotes its same-region replicas and leaves a cross-region replica with replication terminated, as the user guide documents for PostgreSQL; deleting a replica drops it from the source. SwitchoverReadReplica is refused with InvalidDBInstanceState, the only state error the API reference lists, since AWS supports it for Oracle and SQL Server only. PromoteReadReplicaDBCluster answers InvalidDBClusterStateFault because no cluster here is created as a replica. Refs #3778 |
||
|
|
75d1c2ae62 | feat(lambda): support custom Docker flags (#3751) | ||
|
|
9740b32b51 |
fix(athena): read Iceberg-format Glue tables via iceberg_scan (#3738)
* feat(athena): read Iceberg-format Glue tables via iceberg_scan Glue tables written by pyiceberg's GlueCatalog (Parameters.table_type= ICEBERG) never populate StorageDescriptor.InputFormat/SerializationLibrary, so GlueViewDdlBuilder's format-sniffing heuristic always fell through to read_csv_auto and failed parsing the table's binary Parquet data files. Detect Iceberg tables via Parameters.table_type and build the view from iceberg_scan(Parameters.metadata_location) instead, following the table's real manifest list rather than globbing every Parquet file physically present under its location -- which also fixes silently wrong results for any table with more than one snapshot (updates, deletes, repeated appends), not just the CSV-parse failure on a single-snapshot table. The iceberg extension is installed/loaded once, only when the DDL batch actually contains an Iceberg table. A table flagged ICEBERG but missing metadata_location falls back to the existing format-sniffed heuristic. Verified against a live build: pyiceberg write -> Athena SELECT returns correct rows for both a single-snapshot and a two-snapshot table; full athena + glue test suites (352 tests) pass with no regressions. Fixes #3737 This change was implemented by Claude (Anthropic's AI coding assistant), working on behalf of @maurice1979 who filed the linked issue. * docs(athena): fix formatting and clarify Iceberg handling explanation Corrected formatting and clarified the explanation regarding Iceberg tables and their handling in DuckDB. Signed-off-by: Jordi Vidal de LLobatera <is.maurice@protonmail.com> * docs(glue): cross-reference Iceberg handling from glue.md; fix em dash docs/services/glue.md still described only the InputFormat/SerdeInfo format-sniffing heuristic for choosing a DuckDB read function, without mentioning that Iceberg-format tables (Parameters.table_type=ICEBERG) bypass it entirely via iceberg_scan, per the change in the previous commit. Added a short cross-reference to Athena's format-inference docs so glue.md doesn't describe stale, pre-fix behavior. Also removed an em dash from GlueViewDdlBuilder's new Javadoc, per this repo's own AGENTS.md style rule (no em dashes; colons, commas, or periods instead). The matching instance in docs/services/athena.md was already fixed via the Copilot autofix suggestion. Both findings came from the Copilot pull request review on #3738. This change was implemented by Claude (Anthropic's AI coding assistant), working on behalf of @maurice1979. --------- Signed-off-by: Jordi Vidal de LLobatera <is.maurice@protonmail.com> |
||
|
|
0f4865e554 |
feat(rds): copy and reset parameter groups and copy option groups (#3781)
Add CopyDBParameterGroup, CopyDBClusterParameterGroup, CopyOptionGroup, ResetDBParameterGroup and ResetDBClusterParameterGroup. The groups, their overrides and options were already modelled and served by the create, modify, describe and delete actions; these five answered UnsupportedOperation. A copy resolves its source by name or ARN, creates the target through the existing create path so the already-exists check and the ARN come from one place, and copies the family and overrides, or the engine, major version and options for an option group, with any Tags applied. Source and target names must pass AWS's identifier rule, which is how AWS refuses to copy a managed default group: its name carries periods, and the answer is InvalidParameterValue with the identifier message. A reset drops the named overrides or all of them; ResetAllParameters together with a Parameters list is InvalidParameterCombination, and a managed default cluster group answers InvalidDBParameterGroupState as Modify does. Responses use the model's result wrappers and shapes. The action table in docs/services/rds.md is regenerated and its note that CopyOptionGroup is unimplemented removed. Closes #3777 |
||
|
|
d348686744 |
feat(sfn): support ItemReader InputType CSV (#3603)
* feat(sfn): support ItemReader InputType CSV
A Distributed Map can read a CSV dataset through ItemReader. Field names come
from the first row, or from ReaderConfig.CSVHeaders when CSVHeaderLocation is
GIVEN, and each data row becomes an object of string values.
Every value is a string, a row shorter than the headers pads with empty
strings, and a longer one drops the surplus, as AWS documents.
Drops the assertion that CSV is not implemented, which this replaces.
* feat(sfn): honour CSVDelimiter and quoted newlines in ItemReader CSV
ReaderConfig.CSVDelimiter selects COMMA, PIPE, SEMICOLON, SPACE or TAB. An
unsupported value fails the state with States.ItemReaderFailed.
CsvParser.parseAll gained a delimiter overload and now tracks quotes across
line breaks, so a quoted field may carry the delimiter or a newline without
ending the record. The single argument overload keeps comma behaviour for the
existing callers.
* fix(sfn): apply the documented CSV quote and backslash escaping
AWS preserves a doubled quote as a single quote whether or not the field is
quoted, so the reference dataset's {""MyKey"":""MyValue""} has to reach
States.StringToJson as {"MyKey":"MyValue"}. The reader dropped both quotes
instead: only a quote opening a field starts a quoted run, and the unquoted
case fell through to the toggle that consumed the pair.
Backslash escaping was missing as well. A backslash escapes another backslash,
a quote or the configured delimiter, and a backslash before anything else is
dropped.
parseLine and parseAll now share one scanner so the rules live in one place.
The backslash rules stay off for parseLine, which S3 Select and Athena use,
where a lone backslash is ordinary data.
|
||
|
|
6b389c33eb | feat(eks): authenticate EC2 workers through access entries (#3805) | ||
|
|
892927ceb5 |
feat(verifiedpermissions): run Cedar from the floci-sidecar-cedar image (#3799)
* feat(verifiedpermissions): run Cedar from the floci-sidecar-cedar image The Cedar sidecar now comes from floci-io/floci-sidecars as floci/floci-sidecar-cedar, pinned to an exact version because a cached :latest is never re-pulled. CedarSidecarManager reads the contract JSON that the image's /health returns: a sidecar speaking another contract major is refused immediately with a message naming the image and the FLOCI_SERVICES_VERIFIEDPERMISSIONS_CEDAR_IMAGE and _CEDAR_URL settings to change, instead of polling for thirty seconds or failing later on a request. A pre-configured URL is probed the same way. A sidecar whose health body is not JSON predates the contract and is accepted with a one-time warning. * test(verifiedpermissions): exercise the published Cedar image VerifiedPermissionsIntegrationTest no longer boots the in-tree sidecar in process: CedarSidecarManager starts the pinned image through Docker, the same path production takes, under a vp-test resource namespace so the manager's remove-before-start cannot kill a developer's live sidecar. It is skipped without Docker, and locally when the image is not present; in CI a missing image fails. VerifiedPermissionsServiceTest keeps its reject-before-persist coverage against a fake sidecar answering 400, and CedarSidecarClientTest pins the request shapes and the 200/400/other mapping Floci owns. * chore(build): drop the in-tree Cedar sidecar sidecars/cedar now lives in floci-io/floci-sidecars as cedar/ with its history. The build-helper test source root and the test-scoped cedar-java dependency existed only to boot that server inside the test JVM; the tests now run against the published image, so both go, along with the .dockerignore allowlist entry that let the sidecar Dockerfile see its sources from the repository root context. * ci: stop publishing the Cedar sidecar from this repository The release, nightly and reusable image workflows no longer build a Cedar image or record it in the provenance manifest; the sidecar is released from floci-io/floci-sidecars on its own cadence. The compatibility workflow no longer builds and starts the sidecar by hand: Floci pulls the pinned image itself over the mounted socket onto compat-net, exactly as it already does for floci-duck. The unit-test shards prefetch the pinned image, reading the tag from application.yml so the two cannot drift. The floci/floci:*-cedar tags stop at this change; whether the next release cut retags the sidecar image under the old name for a deprecation window is a release decision, not a workflow default. * docs(verifiedpermissions): document the external Cedar sidecar image The Verified Permissions page names floci/floci-sidecar-cedar, why it is pinned to an exact version, how to pre-pull it, where its API and the sidecar contract are documented, and what a contract mismatch looks like. The README's Docker integration table gains the Verified Permissions row it never had. AGENTS.md records the sidecar rule: own repository, no tag suffix on the Floci image, no :latest default, the sidecar releases first, and how a sidecar is tested from here. |
||
|
|
f004aeaad5 |
feat(cognito): implement federated sign-in (#3748)
* feat(cognito): add federation transaction stores * fix(cognito): atomically consume federation state * feat(cognito): support OIDC provider exchange * fix(cognito): validate OIDC federation providers * fix(cognito): validate OIDC endpoint schemes * feat(cognito): add federated oauth routes * fix(cognito): preserve oauth state and codes * feat(cognito): implement federated sign-in coverage * chore: remove internal task report * fix(cognito): use Cognito IdP callback for federation * fix(cognito): use provider callback for token exchange |
||
|
|
f7565dff3e |
feat(apigateway): honour the remaining REST integration settings (#3434)
* feat(apigateway): honour the remaining REST integration settings
PutIntegration persisted 6 of the 16 fields AWS documents. The rest were
accepted without error and silently dropped, so an integration could be created
exactly as intended and then behave as though the configuration were absent.
- timeoutInMillis is applied to the backend call and defaults to AWS's 29,000ms
rather than the previously hardcoded 30s. Values below AWS's 50ms floor are
rejected; the 29s ceiling is an edge-optimized limit, so Regional APIs may
exceed it.
- tlsConfig.insecureSkipVerification skips backend certificate and hostname
verification. Without it an HTTPS backend behind a private CA or a self-signed
certificate was unreachable with no way to opt out.
- contentHandling converts payloads in both directions: CONVERT_TO_TEXT
base64-encodes a binary request for mapping templates, CONVERT_TO_BINARY
decodes a base64 text request before it is sent. Integration responses accept
it too, applied as an output conversion after response templates.
- binaryMediaTypes on the RestApi marks content types as binary. A binary body
now reaches an AWS_PROXY integration base64-encoded with isBase64Encoded set;
previously it was read as a UTF-8 string, which corrupted it.
- connectionType VPC_LINK requires connectionId to name a link that exists and
is available. The five REST VPC Link operations are implemented at /vpclinks.
Floci has no real VPC, so a valid link routes straight to the integration URI;
what is enforced is the misconfiguration AWS also rejects.
- cacheNamespace and cacheKeyParameters drive response caching, gated on both
switches AWS requires: cacheClusterEnabled on the stage and caching/enabled on
the method. Only successful responses are cached, expiring after the method's
ttlInSeconds.
- credentials is persisted and returned. Floci does not enforce IAM, so the role
is not actually assumed.
The same fields are now carried through an OpenAPI import, which previously
dropped them from x-amazon-apigateway-integration.
* fix(apigateway): align TLS, cache keys and VPC link patches with AWS
Three review findings on the REST integration settings, all cases where the
local behaviour was looser than the contract AWS documents.
tlsConfig.insecureSkipVerification installed a trust-all X509TrustManager, so an
expired certificate, a broken chain or a chain with no root reached the backend
happily. AWS skips only the check that the certificate was issued by a supported
certificate authority; it still performs basic validation of the expiration
date, the hostname and the presence of a root certificate authority. A backend
that would fail in AWS therefore worked here, which is the direction that hides
a production TLS misconfiguration. The trust manager now verifies validity,
checks that the chain holds together and terminates in a self-signed root, and
requires cA=true on that root when it actually issued a leaf. Hostname
verification is now requested explicitly rather than being switched off: note
that java.net.http.HttpClient always applies HTTPS endpoint identification and
ignored the previous null algorithm, so the hostname was in fact still checked,
but the code and its documentation both claimed otherwise.
The response cache key appended the method and request path to cacheNamespace.
AWS allows one cacheNamespace across several resources exactly so those
resources return the same cached data, and no two resources share a path, so the
setting could never do what it exists for. The key is now the namespace plus the
declared cacheKeyParameters. The namespace still defaults to the resource id, so
resources that did not opt into sharing stay separate.
UpdateVpcLink never looked at op. Any operation on /name or /description was
applied, so op=remove,path=/name set the name instead of being rejected, and
every other path was silently ignored and reported as success. AWS's patch table
supports only replace on those two paths; anything else is now a
BadRequestException.
Also removes the em dashes AGENTS.md disallows from the test files this branch
adds, which the Documentation Style check flagged.
* fix(apigateway): enforce keyCertSign and name constraints under insecureSkipVerification
The comment on CaIssuanceSkippingTrustManager claimed the root check matched
AWS's two requirements on a private root, cA=true together with a keyUsage
including keyCertSign, but only getBasicConstraints() was ever consulted. A root
with CA:TRUE and no keyCertSign was accepted here and rejected by real API
Gateway, which is the direction that hides a broken certificate authority until
deployment. The keyUsage bit is now checked alongside basicConstraints. An
absent keyUsage extension is still accepted: RFC 5280 leaves the key
unrestricted when it is missing, and PKIX reads it the same way.
The rest of the chain walk is now the platform's PKIX validator, anchored on the
chain's own root, which is exactly the "stop checking that the root is one we
trust, keep checking everything else" semantic this setting has in AWS. That
brings X509v3 name constraints with it, which the hand-rolled walk did not
implement at all, along with basicConstraints and keyCertSign on intermediates
and pathLenConstraint. The anchor's own extensions are not examined by PKIX, so
the root's checks stay explicit, and its NameConstraints extension is passed
through to the TrustAnchor. Expiration stays explicit too, because PKIX exempts
a trust anchor from it and AWS does not.
A lone self-signed certificate keeps its own path: it is its own root and is the
plain self-signed-server case the setting exists to enable, so CA extensions are
not demanded of it.
Three tests against real HTTPS backends: a well-formed private CA chain is
reached, a root declaring CA:TRUE without keyCertSign is rejected, and a root
that permits itself only internal.example while issuing for localhost is
rejected. The latter two return 200 without this change.
* fix(apigateway): require keyUsage on a private root and evaluate name constraints properly
Two corrections to the previous round's TLS work.
AWS states the root constraint as "x509 extension keyUsage must have
keyCertSign", which a root carrying no keyUsage extension at all does not
satisfy. The previous commit read a missing extension as leaving the key
unrestricted, which is generic RFC 5280 semantics but not this API
Gateway-specific requirement, and so accepted a certificate authority real API
Gateway turns away. A root without the extension is now rejected.
The name constraints handling was also wrong, in a way its own test hid.
Constraints were unwrapped from the root and handed to the TrustAnchor, but the
platform validator refuses to process anchor-supplied constraints and fails with
"name constraints in trust anchor not supported". So a root carrying the
extension was rejected blindly, never evaluated, and the test asserting a
violated constraint passed on that unrelated error.
Root-level constraints are now rejected deliberately, with an error that says
so, rather than as a side effect of a validator limitation. That is also the
documented behaviour: AWS tells operators hitting validation errors under
insecureSkipVerification to check their CA certificates for Name Constraints
extensions and reissue without them. Constraints on an intermediate sit inside
the certification path, where the validator does read them, and those are
enforced for real: the log now shows "name constraints check failed" rather than
"not supported".
Tests follow the same split. A three-certificate chain whose intermediate
permits only internal.example while issuing for localhost is rejected, a chain
whose intermediate permits localhost is reached, so the first is failing on the
constraint rather than on chain length, and a root carrying constraints is
rejected as its own documented case. Plus a root with CA:TRUE and no keyUsage
extension, which returns 200 without this change.
* fix(apigateway): match binaryMediaTypes literally apart from the catch-all
The matcher expanded a subtype wildcard, so an image/* entry covered
image/png. Nothing in the AWS documentation establishes that as a
pattern: */* is documented concretely ("To support all binary media
types, specify */*"), while every other example names one exact media
type at a time, and the browser walkthrough tells you to register the
concrete image/webp even though the request's Accept header carries
image/*. Expanding it made Floci treat a payload as binary where AWS
would compare the entry as a literal string and treat it as text.
Entries are now compared literally, ignoring the charset parameter,
with */* as the one wildcard. The wildcard branch keeps its coverage
through a */* test, and a second test pins the subtype wildcard as
not expanded so the behaviour cannot drift back silently.
|
||
|
|
d624988ff8 |
feat(appconfig): implement ListDeployments (#3749)
* feat(appconfig): add deployment listing service * feat(appconfig): expose ListDeployments * docs(appconfig): document ListDeployments * chore(appconfig): clean controller imports * fix(appconfig): make deployment pagination cursor-based |
||
|
|
66bcdaf675 |
feat(codeartifact): add CodeArtifact control-plane support (#3713)
Floci had zero CodeArtifact support: no service package, no docs, nothing. Any terraform apply touching aws_codeartifact_domain, aws_codeartifact_repository, or either permissions-policy resource failed outright. This adds the full CodeArtifact control plane: domain and repository CRUD, resource policies with optimistic-locking revisions, tags, and the fixed set of real AWS-hosted external (upstream) connections (public:npmjs, public:pypi, public:maven-central, etc.). Package publish/fetch endpoints per format (npm, PyPI, Maven, NuGet, generic) are intentionally out of scope here: this closes the terraform apply gap, not real package serving. ListTagsForResource (POST /v1/tags?resourceArn=) is CodeArtifact's one tag operation that addresses the resource with a query parameter on the bare path rather than a path segment, unlike every other V1TagsController/SharedTagsController handler. That method lives on V1TagsController itself rather than the shared AbstractTagsController base: SharedTagsController (mounted at /tags) already declares its own bare POST (tagResourceByBody, for TagResource), so a bare POST on the shared base collides with it and Quarkus refuses to start. CodeArtifact's handler is @V1Tags-qualified and only ever registered against V1TagsController, so the method belongs there. core/common stays service-free: CodeArtifactTagHandler registers itself as a bean the same way MskTagHandler does, and TagHandler gained a default for the lowercase key/value entry names CodeArtifact uses instead of AWS's usual capitalized Key/Value. Known, documented limitations (see docs/services/codeartifact.md): no cycle detection across upstream chains, no referential-integrity check when deleting a repository other repositories reference as an upstream, and no authorization check on cross-account domainOwner addressing (consistent with Floci's opt-in IAM enforcement elsewhere). Verified against the real botocore codeartifact service-2.json (protocol, exact querystring vs. body placement per operation, exact ARN format, epoch-seconds timestamps, real error shapes) and the live AWS API docs for behavioral rules not in the wire model (DeleteDomain blocked while repositories exist, the real fixed external-connection name/format list, PutDomainPermissionsPolicy's all-body field placement vs. the sibling repository operation's querystring placement). Live-verified three ways: - Unit tests including a concurrent-create race test proving the synchronized guard actually holds under contention, plus full-stack QuarkusTest/RestAssured integration tests. - A real terraform init/apply/plan/destroy cycle against a running Floci instance, independently confirming destroy actually tore the domain down via a follow-up describe-domain call. - A live AWS SDK v2 Java test exercising the real CodeartifactClient against a live instance. |
||
|
|
d9abefb83f |
feat(redshift): seed catalog and system views (#3552)
* feat(redshift): seed catalog and system views on cluster startup Seed Amazon Redshift catalog and system views on container startup into both template1 and dev databases so BI, ORM, and migration tools (Tableau, Looker, DBeaver, Flyway, Liquibase, dbt) can introspect database schema metadata without missing-relation errors. * feat(redshift): record COPY failures in stl_load_errors and dynamicize query logs Record failed S3 COPY attempts into pg_catalog.stl_load_errors via LoadErrorRecorder across simple and extended query flows. Convert stl_query and svl_qlog into dynamic views backed by pg_stat_activity, and add stv_wlm_query_state and svv_diskusage catalog views. * fix(redshift): align catalog views with documented Redshift column schema * fix(redshift): separate catalog seeding from copy error recording * test(redshift): preserve container manager coverage |
||
|
|
996a680cdc |
fix(ec2): reject key pair requests without KeyName (#3727)
* fix(ec2): reject key pair requests without KeyName CreateKeyPair accepted a request with no KeyName and stored a nameless key pair; the duplicate check then dereferenced that name on every later CreateKeyPair, and the Query catch-all reported it as "Unexpected error: null". CreateKeyPair and ImportKeyPair now answer MissingParameter, ImportKeyPair answers InvalidKeyPair.Format instead of an InternalFailure for material that is not base64, DeleteKeyPair requires a name or an id and returns the deleted keyPairId, and the name comparisons tolerate a nameless record already sitting in a persistent store. The EC2 docs still described the placeholder key material that #3307 replaced. Closes #3356 * fix(ec2): return InvalidKey.Format for malformed key material on ImportKeyPair The EC2 API error reference lists InvalidKey.Format as the key pair not being in a valid OpenSSH public key format, which is the message this branch sends. InvalidKeyPair.Format is a separate documented code for a different failure. |
||
|
|
98c47c4347 |
feat(eks): implement access-entry management (#3745)
* feat(eks): implement access-entry management * test(eks): wait for cluster activation in access-entry compatibility test * fix(eks): validate access-entry maxResults with shared parser |
||
|
|
03603aeacd |
fix(ec2): stage user data outside guest temporary mounts (#3736)
* fix(ec2): stage user data outside guest temporary mounts * docs(ec2): correct user-data script staging path |
||
|
|
d4a96913df |
fix(ec2): issue instance-profile role credentials through IMDS (#3742)
* fix(ec2): issue instance-profile role credentials through IMDS * test(ec2): cover null IMDS unregister and shutdown revocation |
||
|
|
ef03c59864 |
fix(apigateway): prevent JWT issuer and JWKS SSRF (#3743)
* fix(apigateway): prevent JWT issuer and JWKS SSRF * fix(apigateway): import verifier types |
||
|
|
33d17c0146 |
feat(secretsmanager): add the five missing actions and correct response fidelity (#3711)
* feat(secretsmanager): add the five missing actions and correct response fidelity Secrets Manager implemented 18 of the 23 actions in the API reference. This adds the remaining five and corrects a number of response and validation divergences found by working through each operation's reference page. New actions: - CancelRotateSecret turns rotation off and reports the half-built AWSPENDING version an interrupted rotation left behind. The staging labels are left alone, as AWS leaves them, because that version id is the only handle on a stale AWSPENDING - and a stale AWSPENDING that is not also AWSCURRENT makes every later RotateSecret fail with "a previous rotation isn't complete". - ValidateResourcePolicy reports wildcard principals under the same REFLEXIVE_PRINCIPAL_CHECK name AWS uses. BlockPublicPolicy on PutResourcePolicy now enforces the same check. - ReplicateSecretToRegions, RemoveRegionsFromReplication and StopReplicationToReplica, backed by a replication model on Secret. Replicas carry the primary's ARN with the Region swapped, track later writes to the primary, and are read-only; a primary that still has replicas cannot be deleted. Scheduled rotation now fires. RotationRules were stored and echoed back but never acted on, so AutomaticallyAfterDays and ScheduleExpression described a schedule that could not happen. A background sweep rotates secrets whose NextRotationDate has passed, reusing the EventBridge Scheduler expression parser for rate() and cron(). The schedule advances when a rotation is dispatched rather than when it succeeds, so a failing rotation cannot pin the sweep on one secret forever. Response fidelity: - ListSecrets honours SortBy, SortOrder and IncludePlannedDeletion, and its entries carry SecretVersionsToStages, the rotation fields, DeletedDate and PrimaryRegion. - PrimaryRegion and ReplicationStatus appear only on multi-Region secrets, matching AWS's "only returns fields that have a value" rule. - Versions with no staging labels are deprecated: DescribeSecret and ListSecretVersionIds omit them unless IncludeDeprecated is set, and an empty VersionStages array is omitted rather than sent. - ListSecretVersionIds gained IncludeDeprecated, LastAccessedDate and paging. Validation, all previously accepted silently: - DeleteSecret rejects a recovery window outside 7-30 and the ForceDeleteWithoutRecovery/RecoveryWindowInDays combination. A window of 0 used to fall through to force-delete, turning a request for no recovery window into an unrecoverable delete. - CreateSecret uses ClientRequestToken as the version id and is idempotent on retry; UpdateSecret, which AWS documents as not idempotent, rejects a token that already names a version. - RotationRules bounds, secret name charset, SecretString/SecretBinary exclusivity, KMS key existence and state, and the documented caps on BatchGetSecretValue, Filters, ExcludeCharacters and ResourcePolicy. Secret values remain stored in the clear; encrypting them with the emulator's own KMS would protect nothing while making the store unreadable. KmsKeyId is validated instead, which is the part a caller can observe. Two deviations are deliberate and recorded in docs/services/secrets-manager.md: LastRotatedDate is retained after CancelRotateSecret, and RotateSecret with RotateImmediately=false does not create the throwaway AWSPENDING version. * test(secretsmanager): create a real KMS key in the sdk-test-java compat test kmsKeyIdPreservation asserted that floci round-trips whatever KmsKeyId it is handed, using an ARN that was never created. That passed only because floci did not check the key; real AWS rejects a key it cannot access, and so does the new validation. The test now creates a key through the emulated KMS and round-trips that ARN, so it still covers KmsKeyId preservation without depending on the missing check. A second case pins the rejection itself. * refactor(secretsmanager): import types instead of qualifying them inline AGENTS.md asks for imports unless a name collision forces qualification. AwsException and UUID had neither. * fix(secretsmanager): hold the rotation lock while promoting a replica StopReplicationToReplica wrote the promoted replica outside the per-secret lock every other mutation in this file takes. The promotion races the primary's replica sync, and losing that race writes the replica back over the copy the call just promoted. Also imports KmsKey, ConcurrentHashMap and HashMap rather than qualifying them inline, per the same AGENTS.md rule. * test(secretsmanager): assert the KMS rejection by exception type, not message text createSecretWithAnUnknownKmsKeyIsRejected matched "InvalidParameterException" against the message, but that is the exception type; the message itself reads "You can't access the KMS key ... in this Region". The assertion now checks the typed InvalidParameterException and the text it actually carries. * test(secretsmanager): give the new KMS compat test its own order createSecretWithAnUnknownKmsKeyIsRejected inherited @Order(13) from the test it was added next to, so two cases shared a position. JUnit breaks the tie deterministically, but the duplicate made the sequence misleading; the tail is renumbered so each case keeps a distinct order. Also sorts the new KMS imports, which landed between the lambda ones. * fix(secretsmanager): guard every write to a secret with its owning monitor UpdateSecret read, mutated and persisted without taking the secret's lock, unlike every other mutator in the class, so two concurrent calls could drop one another's field. StopReplicationToReplica locked the replica's own ARN, but persist() writes a primary's replica slots while holding only the primary's lock: two monitors guarding one store slot, so a sync landing after the promotion could overwrite the promoted copy. The promotion now runs under the primary's monitor, and its two halves run in one critical section so nothing lands between them. SecretsManagerWriteLockTest parks a write mid-flight and asserts the second caller waits; both cases fail without the fixes. |
||
|
|
1831f10105 |
fix(config): enforce safe default network binding (#3684)
* fix: enforce safe default network binding * fix(config): keep signed test authority stable Pin the integration-test listener to the existing all-interface test bind and opt into that bind only in the test profile. This preserves localhost-based SigV4 fixtures while production keeps the loopback default. * fix(config): keep compat image backward compatible * chore: retrigger CI * fix(config): mirror JVM image network binding |
||
|
|
a2fddaf08d |
feat(eks): expose IMDS on 169.254.169.254 inside cluster containers (#3693)
* feat(eks): expose IMDS on 169.254.169.254 inside cluster containers When applications or agents run on Kubernetes nodes or use hostNetwork: true, they expect the AWS Instance Metadata Service (IMDS) at the standard link-local address 169.254.169.254:80. In Floci, EKS k3s cluster containers lacked access to IMDS at this link-local address, preventing workloads from discovering instance identities, node IAM roles, or dynamic cluster credentials without custom endpoint overrides. This change exposes IMDS on 169.254.169.254:80 inside EKS cluster containers when floci.services.eks.imds is enabled. It configures a background TCP relay via socat pointing to the host's EC2 metadata port, registers a synthesized EC2 node instance with the cluster's IAM role and container IP in Ec2MetadataServer, extracts reusable metadata proxy logic into Ec2MetadataProxy, and documents node network namespace reachability and hop limit handling. * fix(eks): address review feedback on lifecycle check, default flag, and instance seed * fix(eks): synthesize distinct node instance profile and import CompletableFuture * test(eks): enable IMDS profile and provide curl in docker test fixture |
||
|
|
f99e507916 |
feat(apigateway): implement GetUsage (#3561)
* feat(apigateway): implement GetUsage GetUsage had no implementation, so a caller asking a usage plan what it had consumed hit an unsupported action. This returns the real envelope with zeroed numbers rather than metering anything. Shape captured from real API Gateway: an items map of API key id to one pair per day of the inclusive range, alongside usagePlanId, startDate and endDate, and no position element when there is no further page. The pair is [used, remaining], not [used, quota]. Measured on a live usage plan, the second element is the quota limit minus cumulative use in the period: a plan with a 1,000,000 limit reported 999863 after 137 calls, then 999740 after 123 more. Anything reading that element as a quota is reading it wrong. Both elements are zero here, deliberately. Nothing counts requests per API key, and a usage plan carries no quota to subtract from, so there is no limit to report against. Throttle settings are already accepted and stored without being enforced, so this is consistent with how the service treats the rest of that surface. Storing a quota on the usage plan and counting on the execute path are the two pieces still missing, and both the javadoc and the service docs say so. A caller that sums the used counts therefore gets zero, which is what it already got when the action did not exist, without having to special-case a missing endpoint. Validation follows the captured errors: an unknown plan is NotFoundException and an end date before the start date is BadRequestException, "Usage end date must be after start date". * fix(apigateway): paginate GetUsage GetUsage takes limit and position, which this did not accept at all: every attached key came back in one response, so the implementation only matched the single-page case the original capture happened to exercise. Pagination now runs over the API key entries, defaulting to 25 a page. The token is the last key id already returned rather than a positional offset, so a page resumes after a known key and a concurrent key attachment cannot shift it. No position is emitted on the terminal page, matching the shape captured from real AWS. Two edges deliberately differ from real API Gateway, because it is not a good guide there. It answers limit=0 with an InternalFailure, which is a fault rather than a contract, so a page size below one is a BadRequestException here. It also accepts a limit past the documented maximum of 500, so anything larger is clamped rather than refused. Both choices are written down in the service docs. An unrecognised position is a BadRequestException, "Invalid position parameter", which is the message real API Gateway returns. The existing tests looked keys up with a dotted GPath. API key ids are random and can begin with a digit, which Groovy then parses as a number, so every lookup into items now uses bracket notation. That was luck rather than correctness before. * fix(apigateway): stop inventing a GetUsage limit ceiling The previous head clamped any limit above 500 to 500, extrapolated from a single observation that 501 was accepted. One accepted value does not establish a rule. Probed properly against real API Gateway: 500, 501, 1000, 5000, 100000 and 2147483647 are all accepted without error. The documented maximum is not a rejection boundary, so no ceiling is imposed here either and the regression asserts the observed rule across that ladder rather than an emulator specific clamp. Whether the service caps the page it actually returns above 500 is not observable without a usage plan holding more than 500 keys, so nothing is assumed about it and the docs say as much. The lower bound stays a deliberate divergence, now with both values measured: limit=0 and limit=-1 both answer InternalFailure on real API Gateway. That is a fault rather than a contract, so a page size below one is a bad request here instead of a reproduced 500. * fix(apigateway): cap the GetUsage page at 500 while still accepting more Removing the ceiling entirely went too far the other way. The probe shows real API Gateway accepts a limit above 500, so rejecting one would be wrong, but it never showed the service returning more than 500 entries in a single page, and the documented contract caps a page at 500. Returning more than 500 was therefore as unevidenced as rejecting the request. Request acceptance and response page size are now separate: a larger limit is honoured as a request, and the page stays capped at 500 until a real result with more than 500 keys shows otherwise. resolveUsageLimit becomes package-private so the distinction can be asserted directly rather than needing a usage plan with 500 keys behind it. * fix(apigateway): return GetUsage key usage under the values wire key The response serialised the per-key usage map as "items", which is the SDK-side member name, not the wire key. The Usage shape models that member with locationName "values", so a real client parsing a body keyed "items" finds the field absent and reads no usage at all. Verified with botocore's own rest-json parser against the apigateway service model: a body keyed "values" populates the member, a body keyed "items" leaves it None. Assertions and the service docs move with it. Only GetUsage is affected; the sibling list actions are a different shape and are untouched. |
||
|
|
ef341e1c01 |
feat(sfn): support ItemReader InputType JSONL (#3602)
A Distributed Map could only read a JSON dataset: every other InputType failed the state with "not yet implemented". JSONL now reads one item per line, skipping blank lines, so a trailing newline is not an item. ReaderConfig.ItemsPointer stays JSON only, as on AWS, and MaxItems truncates a JSONL dataset the same way it truncates a JSON one. |
||
|
|
682989288a | fix: add Scheduler retry backoff and DLQ handling (#3687) | ||
|
|
e2aefa654b |
feat(sagemaker): add SageMaker emulation with Docker-backed training (#1949)
Implement the SageMaker control plane over the AWS JSON 1.1 protocol
(X-Amz-Target: SageMaker.*) plus the runtime invocation path:
- Models, endpoint configs, endpoints, training jobs, and tags with
AWS-shaped validation errors (ValidationException / ResourceInUse)
- CreateTrainingJob runs the training image as a real Docker container
using the /opt/ml contract: hyperparameters, resourceconfig and
inputdataconfig under /opt/ml/input/config, S3 channel data under
/opt/ml/input/data/<channel>, and /opt/ml/model uploaded back to S3
as model.tar.gz under the configured S3OutputPath
- CreateEndpoint hosts the model image as a long-lived container with
the serve command, /ping health checks, and ModelDataUrl artifacts
extracted into /opt/ml/model
- POST /endpoints/{name}/invocations proxies to the container and maps
model 5xx responses to ModelError (HTTP 424) like SageMaker Runtime
- Training container logs stream to CloudWatch Logs under
/aws/sagemaker/TrainingJobs
- Storage wired through StorageFactory with memory/persistent modes,
config in EmulatorConfig and both application.yml files
- Unit, integration, and Docker-gated integration tests plus a boto3
compatibility test; service and docs registered in the catalog
|
||
|
|
801edd863d |
feat(macie2): add member administration (#3488)
* feat(macie2): add member administration * fix(macie2): align member account fidelity * fix(macie2): align member pagination limit |
||
|
|
5db516d9d5 |
feat(sfn): Map ItemReader with s3:listObjectsV2 (#3460)
* feat(sfn): support the s3:listObjectsV2 Distributed Map ItemReader The Map state listed the resource as accepted at CreateStateMachine but failed every execution with States.ItemReaderFailed. It now calls the S3 service in process, reads every page under Prefix, and gives each child the AWS item shape: Etag, Key, LastModified, Size and StorageClass. Bucket and Prefix come from Parameters or JSONata Arguments. An empty prefix succeeds with zero iterations and ReaderConfig.MaxItems trims the list. LastModified is epoch seconds. Real AWS renders it as a double in JSONPath state machines and as an integer in JSONata ones, and the emulator does the same. Fixes #3409 * fix(sfn): evaluate ItemSelector in JSONata Map states A JSONata Map state passed ItemSelector through the JSONPath resolver, so every {% %} expression reached the child as a literal string. The Map state now resolves ItemSelector as a JSONata template with $states.input bound to the Map input and $states.context.Map.Item carrying Value and Index, as on AWS. Real AWS evaluates ItemSelector before it records MapIterationStarted. A failing expression therefore fails the Map state without any event for that iteration, in both query languages. The evaluation moved ahead of the iteration event to match. Verified against real Step Functions in us-east-1 on 2026-09-12. * chore(sfn): simplify the listObjectsV2 reader and the ItemSelector failure path The reader listed the bucket page by page although the S3 service returns the whole sorted listing in one call. The Map state kept two copies of the iteration failure handling. The tests reuse the shared mapper and one JSONata Map definition. * perf(sfn): cap the listObjectsV2 listing at MaxItems ReaderConfig.MaxItems keeps the first keys in key order on AWS, which is what the S3 service returns for maxKeys. The reader now passes MaxItems to the listing instead of building every item and trimming afterwards. * chore(sfn): declare local types in the listObjectsV2 reader Replace var with explicit types in the production code this branch added. * chore(sfn): declare local types in the listObjectsV2 reader tests Replace var with explicit types in the test code this branch added. * fix(sfn): list every object when MaxItems is absent S3Service now treats max keys 0 as a request for an empty page, as AWS does for max-keys=0. The listObjectsV2 reader passed 0 when ReaderConfig.MaxItems was not set, so the Map got no items. It now asks for Integer.MAX_VALUE in that case, like the DynamoDB import path. |
||
|
|
86072aaa84 |
fix(lambda): back off DynamoDB Streams retries and expire aged records (#3613)
* fix(lambda): back off DynamoDB Streams ESM retries and enforce MaximumRecordAgeInSeconds * fix(lambda): treat unset MaximumRecordAgeInSeconds as no age cutoff Keep expired records retrying when no finite Lambda age limit is configured. |
||
|
|
265344e304 |
feat(docs): add a service inventory reconciler and fix what it found (#3656)
* feat(docs): add a service inventory reconciler and fix what it found
"How many AWS services does Floci support?" had no answer anyone could defend.
Every source in the repo gave a different number, and two of them were written
down and contradicted each other: docker/localstack-parity.sh said Floci starts
"all 41 services" while migrate-from-localstack.md said "all 58". Neither is
close: the catalog registers 124 descriptors today.
tools/docs/service_inventory.py reconciles the five keyspaces that each answer a
slightly different question, and explains every delta rather than picking a
number: catalog descriptors, the config plane (EmulatorConfig accessors against
application.yml keys), Java packages under services/, the docs pages, and the
service matrix. It reports 119 documented services, 127 distinct API surfaces and
124 signing endpoints, and says which to quote for which question. 27 tests cover
the normalisation and the delta arithmetic.
It also enforces the rule that made this necessary: never write a count into
README.md or docs/, link to the Service Matrix instead. So the two stale counts
are removed rather than corrected, and the parity script and migration guide now
say "every service".
Three services the README's category table omitted are added: Lambda MicroVMs,
Cognito Identity and Bedrock AgentCore Control, each backed by a descriptor or a
docs page.
Two service-matrix corrections the reconciler surfaced:
- The sso alias pointed at iam, so the matrix resolved Identity Center's admin
API to the IAM page's facet. ResolvedServiceCatalog registers
descriptor("sso", "ssoadmin", ...) and docs/services/ssoadmin.md is its own
page, so the alias now points there.
- Both bedrock-agentcore deferrals are retired. bedrock-agentcore.md exists now,
so that entry has served its purpose; bedrock-agentcore-control has no page and
never needed one, because the control plane owns the shared page, so it becomes
an alias instead of a deferral that would expire and need renewing. The
deferred list is now empty.
check_service_matrix.py --strict passes before and after, so the matrix changes
are tidy-up rather than a fix for a failing gate.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* docs: add the STS README row the inventory tool still reported
The tool's own output at the previous head listed STS as the one service
with a Service Matrix row but no README category-table entry, the same
gap this branch closed for Lambda MicroVMs, Cognito Identity and Bedrock
AgentCore Control. Add it next to IAM, so section 5 of the report now
shows zero missing rows.
Also drop the unused pathlib import from the inventory test.
---------
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
|
||
|
|
a1eb65debd |
docs(testcontainers): add the .NET module page (#3655)
* docs(testcontainers): add the .NET module page Testcontainers.Floci exists and is published, but nothing in the docs pointed at it: no page, no mkdocs nav entry, no line in the language guide, and no row in either module table. The module table listed Java, Node.js, Python and Go, so a reader had no way to discover the .NET one. Adds docs/testcontainers/dotnet.md in the shape of the Java and Node pages, and wires it into the nav, the language list, and the tables in docs/testcontainers/index.md and README.md. Two things the other pages never have to explain are called out. The package is served from GitHub Packages rather than nuget.org, so it needs a nuget.config and a token with the read:packages scope. And the container-backed services carry the macOS caveats: the default RDS ProxyBasePort of 7000 collides with AirPlay Receiver, clients should use 127.0.0.1 rather than localhost to avoid IPv6, and the RDS proxy does not negotiate TLS. A Colima note covers the Ryuk socket path. The table row reads "see releases" rather than a version number. .NET releases on every push to main, so a number written here is stale on arrival; the other rows carry a version because their registries publish discrete releases. Signed-off-by: Hector Ventura <hectorvent@gmail.com> * docs(testcontainers): require package source mapping on the .NET page The nuget.config snippet added only the floci-io feed as a source, but Testcontainers.Floci is also published on nuget.org by the Testcontainers project, so a consumer with both sources configured could resolve that package instead of this module. Mirror the module README: keep both sources, add the credentials block, and route exactly Testcontainers.Floci to the floci-io feed through packageSourceMapping with everything else on nuget.org. Drop the dotnet nuget add source command, which registers the feed under a different name and cannot create the mapping, and link the feed to the package page. --------- Signed-off-by: Hector Ventura <hectorvent@gmail.com> |
||
|
|
1319ed19bc |
feat(sfn): honour ToleratedFailureCount and ToleratedFailurePercentage (#3605)
* feat(sfn): apply ItemBatcher to distributed Map children
ItemBatcher was parsed and then ignored: every child execution received one
item regardless of MaxItemsPerBatch, so a state machine that batches ran with a
different payload shape locally than on AWS, silently.
Items are now grouped into batches and each child execution receives
{"BatchInput": ..., "Items": [...]}. A batch closes on MaxItemsPerBatch or
MaxInputBytesPerBatch, in their literal, Path and JSONata expression forms, and
with neither set every item lands in one batch. ItemSelector still runs per item
before grouping, so the transform sees $$.Map.Item as it did before.
MaxConcurrency now bounds concurrent batches, and DescribeMapRun separates the
two counters it used to share: itemCounts counts items, executionCounts counts
child executions.
* fix(sfn): cap a batch at the 256 KiB child-input ceiling
MaxInputBytesPerBatch being optional let MaxItemsPerBatch alone build a child
input larger than Step Functions would ever start, and the byte count measured
the items alone, so a declared cap could still be exceeded by the envelope,
BatchInput and separators.
Batching now measures the serialized child payload and closes a batch at the
declared limit or at 256 KiB, whichever is smaller.
* fix(sfn): fail an item too large to start a child execution
An item whose serialized batch input already exceeded 256 KiB was added anyway,
because the split branch is skipped while the batch is empty, producing a child
input AWS would refuse to start.
Such an item now fails the state with States.DataLimitExceeded, naming its size
and pointing at ItemSelector as the way to reduce it.
* feat(sfn): honour ToleratedFailureCount and ToleratedFailurePercentage
Both fields were accepted and ignored: any failed item failed the Map run, and
DescribeMapRun reported a hardcoded zero for each, so a state machine that
relies on a failure budget behaved differently here than on AWS.
A declared tolerance now absorbs failed items while the run stays within it. An
absorbed failure contributes no result, so the Map output and any ResultWriter
export cover the successful children only. Exceeding the budget fails the state
with States.ExceedToleratedFailureThreshold. Both fields accept their literal,
Path and JSONata expression forms, the percentage is taken over the item count,
and declaring both applies the stricter of the two.
DescribeMapRun now reports the declared values. A Map that declares neither is
unchanged: the first failed item still fails the state with its own error.
* fix(sfn): export tolerated failures to FAILED_0.json
Filtering the ResultWriter input down to the successful children dropped every
absorbed failure from the export, which is exactly what the tolerance is meant
to keep observable.
Failed children now keep their input, timings and error, and are written to
FAILED_0.json with Status FAILED and the child's Error and Cause, listed under
ResultFiles.FAILED in the manifest.
* refactor(sfn): resolve every integer Map field through one helper
MaxConcurrency and the ItemBatcher limits read the same three forms, literal,
Path and JSONata expression, through two near-identical methods. The batcher one
already parameterized the field name, so the pair collapses into a single
resolver with a minimum: 0 for MaxConcurrency, where it means the service
ceiling, and 1 for a batch limit, where it is meaningless.
The shared resolver also clamps an oversized value to Integer.MAX_VALUE, which
only the MaxConcurrency copy did before.
|
||
|
|
97cbce205b |
feat(config): add aggregation authorization CRUD (#3627)
* feat(config): add aggregation authorization CRUD PutAggregationAuthorization, DescribeAggregationAuthorizations and DeleteAggregationAuthorization were unrouted, so the JSON handler answered InvalidAction and aws_config_aggregate_authorization could not be created. Authorizations are keyed by (AuthorizedAccountId, AuthorizedAwsRegion) within the request region, persisted through StorageFactory like the other durable Config resources. Put is an upsert that preserves the ARN and creation time of an existing authorization, and accepts Tags, which land in the same tag store that ListTagsForResource reads. Delete of an absent authorization succeeds: the Config model declares no not-found error for that operation. * fix(config): remove aggregation-authorization tags on every delete attempt Tag cleanup ran only when the delete found an entry to remove. A delete that removed the authorization but did not reach the tags left them behind, and the retry that should have cleaned them up skipped the cleanup because the entry was already gone. Put reuses a deterministic ARN, so those tags reappeared on the next authorization for the same account and region. The ARN is now derived from the key instead of read off the removed entry, and its tags are dropped on every attempt. The authorization map is still persisted only when an entry was actually removed. * fix(config): apply PutAggregationAuthorization tags at creation only PutAggregationAuthorization is idempotent, and AWS applies request tags at creation only: a later Put that finds the authorization already there ignores its Tags and leaves the existing ones alone. Tagging the existing ARN on every Put let a local test retag by re-putting, which production would silently refuse. Return the existing authorization untouched and tag only the one just created. Tags still change through TagResource/UntagResource, which is the only way AWS offers. * fix(config): make aggregation authorization put/delete atomic putAggregationAuthorization did a get-then-put on the region map with nothing holding the two together, and deleteAggregationAuthorization removed-then- persisted the same way. Two concurrent Puts for one (AuthorizedAccountId, AuthorizedAwsRegion) could both find nothing and both create: the second overwrote the first's CreationTime and re-applied creation tags over a set TagResource may already have changed, so the documented idempotency held only probabilistically. Both now take the same per-key lock putConfigRule/deleteConfigRule already use for rules. The lock keys are namespaced apart from the rule keys in the shared map rather than relying on rule names never containing '|'. The regression runs many short rounds rather than one wide one, because the unlocked window is a few instructions: repeated fresh starts land the race, more threads on one start do not. It asserts reference identity, which is what distinguishes the two cases -- the store is keyed on the pair so its size is 1 either way, the ARN is derived from the key so it is equal either way, and CreationTime is epoch seconds so a racing pair created inside one second is indistinguishable by timestamp. Verified to fail with the lock removed (17 mismatches) and pass with it, five runs. |
||
|
|
7813d14ee4 |
feat(network): add opt-in security group enforcement (#3681)
* feat(network): add opt-in security group enforcement * fix(ec2): make security group tests order independent * fix(network): emit valid ICMP nft rules and restart protected instances Three review findings on the opt-in security-group enforcement foundation: - SecurityGroupNftCompiler built "icmp type 8 code 0 accept" for an AWS ICMP rule carrying both FromPort (type) and ToPort (code). nftables header fields are separate expressions, so nft rejected the whole compiled policy and the manager then quarantined every endpoint. Each field now repeats the protocol keyword, and a protocol rule with no type or code becomes "meta l4proto icmp accept", which was equally invalid as a bare "icmp accept". - StartInstances followed the legacy restart path for a protected workload and waited for a Docker bridge IP on a container that shares the helper's network namespace and so has no attachment of its own. The helper survives the workload's stop, so start now reuses its transport address exactly as launch does, and skips the reachable private address rewrite the same way. - Replaced the newly introduced var declarations with explicit types and imported the inline java.util/model FQCNs, per AGENTS.md. * fix(network): scope the firewall helper to CAP_NET_ADMIN The helper only has to program nftables inside the namespace Docker already gave it, so full --privileged granted far more than the feature needs. ContainerLifecycleManager now adds CAP_NET_ADMIN for the container carrying the floci.security-group-helper label, mirroring the capability drop already applied to protected workloads at the same choke point, and the helper spec no longer asks for privileged mode. Also replaces the inline java.util FQCNs the previous commit missed in Ec2Service with imports, per AGENTS.md. --------- Co-authored-by: Alexy Grabov <Alexy.Grabov@cyberark.com> |
||
|
|
d3bfe2609c |
feat(redshift): implement zero-ETL integrations (#3559)
* feat(redshift): implement zero-ETL integrations
DescribeIntegrations had no implementation, so an application that
discovers its zero-ETL integration at runtime could not run against the
emulator.
Implementing that action alone would have been worse than leaving it out.
A caller matches its integration by SourceArn and treats "no match" as a
hard error, so an action that always answered with an empty list would turn
a clean "unsupported" into a confusing "no integration whose source is the
X table". CreateIntegration and DeleteIntegration come with it, so an
integration can exist and the empty list means what it says.
Shape captured from a live integration in us-west-2:
- Status is lower case ("active"), not ACTIVE
- Errors is present but empty on a healthy integration
- the record carries IntegrationArn, IntegrationName, SourceArn,
TargetArn, Status, CreateTime, KMSKeyId, Tags and
AdditionalEncryptionContext
- describing with an unknown IntegrationArn is IntegrationNotFoundFault,
"The requested integration doesn't exist."
- an account with no integrations answers with an empty list, not an
error
- no Marker element is emitted when there is no further page, which is
what stops a caller's pagination loop
This is metadata only: nothing replicates from the source, and the
integration settles as active immediately rather than passing through
creating, because there is no work for it to do.
* fix(redshift): correct the integration Query contract
Three gaps against the modelled Query API, each confirmed in the bundled
botocore service model rather than taken on trust.
Tags arrive under TagList, not Tags. The shape is a list whose member
carries locationName Tag, so a real client sends TagList.Tag.N.Key and
.Value. Reading Tags.Tag.N meant every tag an SDK sent was silently
dropped, which a hand written form-encoded test did not catch because it
used the wrong name too.
DescribeIntegrations is paginated and filterable. MaxRecords, Marker and
Filters.DescribeIntegrationsFilter.N were all ignored, so the operation
only worked while every record fitted in one response and a caller using
filters got unrelated integrations back. MaxRecords honours the documented
20 to 100 range, the marker is the last ARN already returned rather than an
offset, and no Marker is emitted on the terminal page. The four modelled
filter names are implemented: integration-arn, source-arn, source-types and
status. An unrecognised name is rejected rather than ignored.
CreateIntegration advertises Description and AdditionalEncryptionContext.
Both are now parsed, stored and rendered, with the documented rule that the
encryption context is only valid alongside a KMSKeyId, and Description
capped at the modelled 1000 characters.
* test(redshift): cross a real page boundary in the marker regression
The previous test created three integrations and asked for twenty, so it
only proved the terminal case: no Marker when everything fits. It never
forced a second page, never asserted a non-terminal page carries a Marker,
and never sent one back.
It now creates twenty-one records against the smallest legal page size and
walks every page, asserting that a full page carries exactly MaxRecords
records and a Marker, that no record appears on two pages, that the final
page omits the Marker, and that the traversal returns the same set as a
single large page. Other tests in this class share the store, so the
assertions are about the traversal rather than absolute counts.
* feat(redshift): validate IntegrationName against the modelled pattern
CreateIntegration only checked IntegrationName for non-blank, so a name
real AWS refuses was accepted: the member is modelled min 1, max 63,
pattern ^[a-zA-Z][a-zA-Z0-9]*(-[a-zA-Z0-9]+)*$. A leading digit or
hyphen, an underscore, a doubled hyphen and a trailing hyphen all got
through, as did a name over 63 characters.
Validate both constraints in createIntegration, alongside the existing
Description length and encryption-context rules.
Three regressions cover the rejected shapes, the over-length case and
acceptance at the 63 character boundary.
|
||
|
|
3c23784ca7 | feat(s3): evaluate bucket policies for authenticated callers (#3632) | ||
|
|
144b90e6fa |
fix(apigateway,appsync): sandbox VTL rendering with SecureUberspector and execution limits (#3542)
* fix(apigateway,appsync): sandbox VTL rendering with SecureUberspector and execution limits
VtlTemplateEngine and AppSyncVtlEngine rendered templates with Velocity's
default UberspectImpl introspector, which allows arbitrary reflection
through any context object (e.g. $util.getClass().forName('java.lang.Runtime')),
and had no cap on #foreach iterations, output size, or execution time,
making them vulnerable to both sandbox escapes and denial of service via
runaway loops or #set string doubling.
Add a shared VtlSandbox helper that both engines call to switch to
SecureUberspector and restrict introspection on java.lang.Class,
ClassLoader, Runtime, ProcessBuilder, System, Thread, java.io.File and
related reflection/scripting/process packages, plus three independent
limit layers: a native #foreach loop cap that truncates the loop without
failing the template, a cooperative execution deadline checked from a new
SandboxedForeach directive before each loop iteration, and a BoundedWriter
output-size cap. The latter two throw the new VtlLimitExceededException,
an unchecked RuntimeException that flows through each engine's existing
error handling exactly like any other Velocity evaluation failure, with
no new error shape. Limits are configurable via EmulatorConfig
(vtlMaxLoops, vtlMaxOutputChars, vtlTimeoutMillis; application.yml keys
vtl-max-loops, vtl-max-output-chars, vtl-timeout-millis), mirroring the
project's existing per-service numeric-tunable config pattern, and
documented in api-gateway.md and appsync.md.
The classpath-shadowed velocity.properties resource is kept for any
embedding that resolves it normally, but is not the actual enforcement
point: under this project's test/runtime classloader, Velocity's own
getResourceAsStream lookup for that exact resource path can resolve to
the copy bundled inside the velocity-engine-core jar instead of this
project's shadowed copy, silently leaving the insecure UberspectImpl
active even with a correct properties file on disk. VtlSandbox configures
SecureUberspector and swaps in SandboxedForeach directly via the
VelocityEngine Java API instead, which is unaffected by that ambiguity.
* docs(apigateway): correct foreach registration documentation
|
||
|
|
2ee3aa67c0 |
feat(apigateway): support Gateway Responses on REST APIs (#3326) (#3585)
Add the PutGatewayResponse / GetGatewayResponse / GetGatewayResponses /
UpdateGatewayResponse / DeleteGatewayResponse family, keyed per REST API by
responseType across the 21 AWS types. Uncustomised types are reported with
defaultResponse=true, their AWS default statusCode and the default
{"message":$context.error.messageString} template; UpdateGatewayResponse
patches /statusCode, /responseParameters/<name> and
/responseTemplates/<content-type>, and DeleteGatewayResponse restores the
default.
ImportRestApi and PutRestApi read the x-amazon-apigateway-gateway-responses
extension, and AWS::ApiGateway::GatewayResponse is provisioned by a new
CloudFormation provisioner whose Ref / Fn::GetAtt Id is
<restApiId>-<responseType>.
On the execute plane every gateway-generated answer (unmatched path or
method, AWS_IAM and Lambda authorizer rejections, missing API key, request
validation, unsupported media type, integration configuration errors and
Lambda proxy failures) resolves the customisation for its type, then
DEFAULT_4XX / DEFAULT_5XX, and applies the configured statusCode, the
gatewayresponse.header.* parameters (static, method.request.*, context.*,
stageVariables.*) and the response templates, with $context.error.* exposed
to VTL. An expired SigV4 signature selects EXPIRED_TOKEN and a malformed or
mismatching one INVALID_SIGNATURE, as AWS keeps those two contracts apart.
This is what puts Access-Control-Allow-Origin on a browser-visible
401/403/400 so the frontend can read the real status instead of a CORS
failure. Without a customisation every answer is unchanged.
Closes #3326
|
||
|
|
6f05442218 |
feat(bedrock-agentcore): implement InvokeHarness (#3557)
* feat(bedrock-agentcore): implement InvokeHarness InvokeHarness was the last gap keeping an application's agent chat on real AWS. #3556 added the Memory event data plane, so conversation history works locally, but the invoke call itself had nothing to answer it. There is no agent loop here and no model. What is emulated is the wire contract an application integrates against: POST /harnesses/invoke returns an application/vnd.amazon.eventstream response carrying messageStart, contentBlockStart, one contentBlockDelta per chunk, contentBlockStop, messageStop and metadata, in that order. The reply echoes the caller's last user message, which makes a chat client visibly work end to end and leaves a request that failed to parse obvious rather than hidden behind a fixed string. The wire bindings are the part worth knowing, and they are not what the request model suggests. harnessArn and qualifier are query parameters, runtimeSessionId and runtimeUserId are headers (X-Amzn-Bedrock-AgentCore-Runtime-Session-Id / -User-Id), and only messages, model and tools travel in the JSON body. Reading them from the body compiles, passes a hand-written test, and then fails against the real SDK with "harnessArn is required". A request carrying no user message is legitimate rather than an error: a caller whose memory already holds the current turn sends none, so that case answers with a canned line. harnessArn is not resolved, because the emulator models no harness resource; InvokeAgentRuntime is permissive for the same reason. BedrockStreamEncoder moves to core/common as AwsEventStreamWriter and becomes public, next to the AwsEventStreamEncoder it already delegates to. Both services now share one frame writer rather than duplicating the header-map wrapper. bedrock-runtime keeps its behaviour and its streaming tests are the regression guard. Tool execution, skills and multi-turn iteration are not emulated, so no tool-use block is produced even when a request supplies tools. * fix(bedrock-agentcore): validate the InvokeHarness request contract messages is a required member. Treating a missing or non-array field the same as an empty array made an omitted required member indistinguishable from a legitimate empty one, so the two are now separated: an empty array still gets the canned reply, an absent member is a ValidationException. harnessArn and runtimeSessionId were only checked for being non-blank. Both carry modelled constraints, taken from the bundled botocore service model rather than guessed: harnessArn arn:...:bedrock-agentcore:<region>:<account>:harness/ <name>-<10 alphanumerics> runtimeSessionId 33 to 100 characters, [a-zA-Z0-9][a-zA-Z0-9-_]* Real AgentCore enforces the ARN shape before anything else: an ARN of harness/h-1 comes back as "Invalid harness ARN format" even when the rest of the request is wrong too, which is why the test values in this branch had to change. The ARN's shape is checked but the harness is still not resolved, because the emulator models no harness resource. A well formed ARN naming nothing is accepted, and has a test saying so. * fix(bedrock-agentcore): report a malformed harness ARN before a missing session id The ARN shape was checked after both presence checks, so a request carrying a malformed ARN and no runtimeSessionId header came back as "runtimeSessionId is required" rather than the ARN error AWS returns. No test exercised two bad fields at once. The ARN is now validated whole, presence and shape together, before runtimeSessionId is read. |
||
|
|
917e94914f |
feat(sfn): apply ItemBatcher to distributed Map children (#3604)
* feat(sfn): apply ItemBatcher to distributed Map children
ItemBatcher was parsed and then ignored: every child execution received one
item regardless of MaxItemsPerBatch, so a state machine that batches ran with a
different payload shape locally than on AWS, silently.
Items are now grouped into batches and each child execution receives
{"BatchInput": ..., "Items": [...]}. A batch closes on MaxItemsPerBatch or
MaxInputBytesPerBatch, in their literal, Path and JSONata expression forms, and
with neither set every item lands in one batch. ItemSelector still runs per item
before grouping, so the transform sees $$.Map.Item as it did before.
MaxConcurrency now bounds concurrent batches, and DescribeMapRun separates the
two counters it used to share: itemCounts counts items, executionCounts counts
child executions.
* fix(sfn): cap a batch at the 256 KiB child-input ceiling
MaxInputBytesPerBatch being optional let MaxItemsPerBatch alone build a child
input larger than Step Functions would ever start, and the byte count measured
the items alone, so a declared cap could still be exceeded by the envelope,
BatchInput and separators.
Batching now measures the serialized child payload and closes a batch at the
declared limit or at 256 KiB, whichever is smaller.
* fix(sfn): fail an item too large to start a child execution
An item whose serialized batch input already exceeded 256 KiB was added anyway,
because the split branch is skipped while the batch is empty, producing a child
input AWS would refuse to start.
Such an item now fails the state with States.DataLimitExceeded, naming its size
and pointing at ItemSelector as the way to reduce it.
* refactor(sfn): resolve every integer Map field through one helper
MaxConcurrency and the ItemBatcher limits read the same three forms, literal,
Path and JSONata expression, through two near-identical methods. The batcher one
already parameterized the field name, so the pair collapses into a single
resolver with a minimum: 0 for MaxConcurrency, where it means the service
ceiling, and 1 for a batch limit, where it is meaningless.
The shared resolver also clamps an oversized value to Integer.MAX_VALUE, which
only the MaxConcurrency copy did before.
|
||
|
|
38d1d0a8e4 |
feat(glue): implement partition indexes (#3551)
* feat(glue): implement partition indexes
CreatePartitionIndex and DeletePartitionIndex were missing, and
GetPartitionIndexes was a stub that resolved the table and then always
returned an empty list. A client could create an index and read back
nothing, and Terraform's aws_glue_partition_index could not apply at all.
Behaviour captured against real Glue in us-west-2, on a table partitioned
by tenant/year/month/day:
- an index key must name a partition column, else InvalidInputException
"IndexKeys not a part of PartitionColumns. Verify the indexKeys : [x]"
- keys need not be a prefix of the partition keys, and need not be in
partition order: [year] and [month, tenant] are both accepted
- a repeated index name gives AlreadyExistsException "... already exists
with the same name."
- a repeated key list under a new name is refused too: "... already
exists with the same keys." The comparison is order sensitive, so
[year, month] and [month, year] are distinct indexes
- a fourth index gives ResourceNumberLimitExceededException "Partition
index limit exceeded. Maximum: 3", and the cap is evaluated before the
duplicate checks
- deleting an unknown index gives EntityNotFoundException "Index with the
given indexName : x does not exist."
- a read resolves each key to its name and type from the table's
partition keys, while a create carries names only
Indexes live in their own store keyed by the table key, so the existing
deleteTable cascade sweeps them and a recreated table starts clean.
One deliberate divergence: an index is stored ACTIVE immediately. Real
Glue creates asynchronously, reports CREATING while it backfills, and
refuses a concurrent create on the same table. Settling immediately keeps
tests free of polling, and a client that waits for ACTIVE (the Terraform
provider does) completes on its first read.
Verified end to end against a local floci: the SDK round-trips create,
read and delete, every error above matches the capture, and a real
aws_glue_partition_index applies and destroys cleanly.
* feat(glue): expose the partition index lifecycle
The first cut stored an index ACTIVE on create and removed it on delete,
treating the lifecycle as an internal detail. It is not: a caller reads
IndexStatus from GetPartitionIndexes and can branch on it, so collapsing
the states changed an AWS-visible contract.
Captured against real Glue in us-west-2:
- a new index reports CREATING for roughly 12 seconds, then ACTIVE
- a deleted index reports DELETING before it disappears
- while either is in progress, another create on the same table gives
ResourceNumberLimitExceededException "Index <name> is in <STATE>
state. Only 1 index can be created or deleted simultaneously per
table."
- an index that is still CREATING cannot be deleted: Glue reports
EntityNotFoundException "Index with the given indexName : <name> does
not exist." even while a read lists it as CREATING. Measured in
isolation, with nothing else in flight
The transitions are driven by reads rather than wall-clock time, so they
stay deterministic and tests need no sleeps: each GetPartitionIndexes
reports the current state and settles it, so the next read sees the
outcome. A client that polls converges on its second call.
FAILED is not emulated; it only arises from a backfill failure.
Verified with a real aws_glue_partition_index against a local floci:
apply polls CREATING to ACTIVE and completes, a refresh reports no drift,
and destroy passes through DELETING.
Also replaces var with explicit types and drops inline fully-qualified
names in the tests, per the AGENTS.md rule.
* docs(glue): correct two javadocs left behind by the index lifecycle
Both still said an index is stored ACTIVE immediately, which stopped being
true when createPartitionIndex started storing CREATING and letting
GetPartitionIndexes settle it.
* fix(glue): serialize partition index writes against their own reads
createPartitionIndex reads the stored indexes, checks the cap and the duplicate
rules, then writes, with nothing holding that together. Two concurrent creates
on a table at two indexes both saw room under the cap of three and both wrote,
leaving four. Nothing repairs that afterwards.
create, delete and the settling loop in getPartitionIndexes now carry the same
synchronized treatment updateTable already uses for its own check-then-write.
|
||
|
|
43a0d737e9 |
perf(iam): cache parsed policy and lowercase patterns once (#3635)
* perf(iam): cache parsed policy documents in IamPolicyEvaluator Every evaluate call parsed each policy document with Jackson again. A caller with a large managed policy such as ReadOnlyAccess (94 KB) paid that parse on every request under IAM enforcement. The evaluator now keeps the parsed statements per document text in a ConcurrentHashMap. Parsing is a pure function of the text, so entries never go stale. The map is bounded at 2048 entries and cleared when the bound is reached, which only matters for many distinct session policies. A document that fails to parse is cached as failed, so the warning is logged once instead of on every request. AWS managed policy catalog has 1566 documents. All 1566 parsed take about 9.5 MB of heap, and AWS caps a customer managed policy at 6144 characters and a session policy at 2048, so 2048 entries stay within tens of MBs in the worst case. * perf(iam): store policy patterns lowercased in the parsed statement cache Action and Resource matching is case-insensitive. globMatches lowercased both the pattern and the request value on every comparison, which for a policy like ReadOnlyAccess meant about 5800 new strings per request. The patterns are now lowercased once when the document is parsed and cached, and the request action and resource are lowercased once per evaluation. The public globMatches helper used by the trust policy and S3 public access evaluators is unchanged. * fix(iam): compare resource ARNs case-sensitively AWS documents the Action element as case-insensitive, but the Resource element is not: the IAM user name in a Resource ARN is case sensitive, and so are S3 object keys. The evaluator lowercased both sides of every Resource and NotResource comparison, so a grant on user/Bob also matched user/bob and a grant on bucket/Private/* also matched bucket/private/*. Resource and NotResource patterns are now kept as written in the parsed statement cache and the request resource is compared as is. Action and NotAction patterns stay lowercased once at parse time. |
||
|
|
c7b4a393d9 |
fix(rds): support IPV6 and DUAL network types on RDS Proxy (#3639)
CreateDBProxy/AWS::RDS::DBProxy rejected EndpointNetworkType/TargetConnectionNetworkType
outright for anything other than IPV4 ("Floci currently exposes IPv4 proxy networking only").
Both fields are now accepted and stored on the DbProxy record:
- EndpointNetworkType: IPV4, IPV6, or DUAL
- TargetConnectionNetworkType: IPV4 or IPV6 (no DUAL, matching AWS's own constraint)
They round-trip through DescribeDBProxies and CloudFormation the same way the proxy's other
control-plane settings (pool sizing, TLS, idle timeout) already did.
AWS's RDS Proxy network prerequisites require both the VPC and every selected subnet to carry
an associated IPv6 CIDR block for IPV6/DUAL. floci already modeled VPC-level IPv6 CIDR
associations; subnet-level association is now modeled too (Subnet.ipv6CidrBlockAssociationSet,
CreateSubnet's Ipv6CidrBlock parameter, and the DescribeSubnets/CreateSubnet response), and
createDbProxy validates both the VPC and every VpcSubnetIds entry before accepting a non-IPV4
network type, rejecting with InvalidParameterValue otherwise. Genuinely invalid enum values are
still rejected at both the RDS Query API and CloudFormation provisioner layers.
The CloudFormation update path now also refuses a changed EndpointNetworkType or
TargetConnectionNetworkType the same way it already refused a changed DBProxyName, EngineFamily,
or VpcSubnetIds: both are createOnlyProperties in the AWS::RDS::DBProxy registry schema, and
ModifyDBProxy has no such parameters, so silently accepting a changed value on UpdateStack would
report UPDATE_COMPLETE while the proxy's actual network type stayed put.
Added a Terraform compatibility scenario (rds-proxy-network-type-tf) with a genuinely
dual-stack VPC and subnets, plus negative cases for an IPv4-only VPC and for a dual-stack VPC
whose subnets lack an IPv6 CIDR block.
|
||
|
|
315dfe69f0 |
fix(rds): support tagging DB snapshots (#3649)
TagResource/UntagResource/ListTagsForResource rejected a snapshot ARN
outright ("not yet implemented by Floci"), and CreateDBSnapshot
silently dropped its Tags parameter even though DbSnapshot already had
a tags field. Both are now wired up: CreateDBSnapshot stores Tags, the
generic tag-resource dispatch resolves a "snapshot" ARN type against
the snapshot store, and DescribeDBSnapshots echoes DBSnapshotArn and
TagList like the other tagged resource types already do.
Snapshots are now region-scoped the same way DB instances and clusters
already are: CreateDBSnapshot/DescribeDBSnapshots/DescribeDBSnapshot-
Attributes/ModifyDBSnapshotAttribute/RestoreDBInstanceFromDBSnapshot
all thread the request's signed region through to snapshot storage and
lookup (via the same dbResourceKey/hasRdsResourceIdentity scoping the
instance/cluster stores use), so DBSnapshotArn reflects the request's
actual region and a snapshot created in one region is not visible to
Describe/Tag calls signed for another.
Verifying this live against a real floci instance via Terraform
surfaced two more gaps blocking any use of aws_db_snapshot at all,
regardless of tagging: DescribeDBSnapshotAttributes (called on every
read of the resource) and ModifyDBSnapshotAttribute were both
completely unimplemented. Added minimal support for both (the
"restore" attribute, i.e. cross-account copy/restore authorization,
modeled as plain in-memory state, no real cross-account sharing).
DeleteDBSnapshot is also unimplemented and was not added here — a
snapshot can be created and tagged but not destroyed via Terraform.
Noted in docs/services/rds.md as a follow-up, along with the other
resource types the original gap report mentioned (Aurora cluster
snapshots, reserved instances) that aren't modeled in Floci at all, so
tagging doesn't apply to them either.
Added a Terraform compatibility scenario (aws_db_snapshot with tags,
verifying create, tag read-back, a clean second plan, and an in-place
tag update) and ran it against a live floci instance before
committing, including a re-run after the region-scoping fix.
|
||
|
|
74d4782b51 |
feat(batch): support array and multi-node parallel jobs (#3595)
SubmitJob previously rejected arrayProperties/nodeProperties/nodeOverrides outright. Array jobs now fan out real child jobs (<parentId>:<index>) that run through the existing single-job pipeline; the parent's status and arrayProperties.statusSummary are computed live from its children on every DescribeJobs/ListJobs call instead of being stored and incrementally updated, which avoids a race between concurrently finishing children. Multi-node parallel jobs are supported via a new "multinode" job definition type (numNodes/mainNode/nodeRangeProperties, validated for full node coverage). SubmitJob runs one Docker container per node concurrently; per AWS's documented MNP semantics, the job's status, retry decision, and started/stoppedAt/statusReason are all determined solely by the main node, not by any node that happens to fail. nodeOverrides.numNodes is supported with AWS's real validation (requires an open-ended node range). ListJobs gains arrayJobId and multiNodeJobId support. dependsOn (job dependencies), CancelJob/TerminateJob (not implemented at all, pre-existing), EventBridge forwarding of these new fields, and CloudFormation-provisioned multinode job definitions remain out of scope and are noted in docs/services/batch.md. |
||
|
|
a5ebda01fb |
feat(ui): publish a console contract so any web console can be the sidecar (#3641)
Floci could run exactly one web console, the image it ships. This publishes the contract between Floci and a console so any image can take that slot, and an operator gets there by setting one image name rather than by configuring seven fields. Three things make a console a Floci console: it listens on the port in PORT, it serves GET /api/health, and it talks to Floci at AWS_ENDPOINT_URL. Everything else is detail the contract spells out, including the AWS baseline every launched container already receives, so a console built on any AWS SDK is configured by that SDK's ordinary endpoint and credential discovery. Floci learns a console's shape from three sources, in order. The image's own io.floci.console.* labels come first, so a console describes itself and needs no operator input at all. A built-in profile covers the consoles Floci already knows. The contract defaults (/api/health, port 4500, status: ok) cover the rest. Configuration overrides all three, for a console that describes itself neither way. That ladder is why the new config keys ship commented out in application.yml. They exist for the console that fits none of the three sources, and setting one silently disables the discovery that would otherwise just work. Every accessor is Optional or OptionalInt, so nothing is required and the test configuration needs no entry. A malformed label is ignored rather than fatal: a console that declares port="banana" starts on the default instead of failing the emulator, and the reason is logged. Docs: docs/ui/console-contract.md is the contract itself, written for console authors, and docs/ui/index.md is the operator's page. Both are in the mkdocs nav. Tests: 608 lines. ConsoleProfileResolverTest covers the resolution ladder including the precedence between its three sources; ContainerLifecycleManagerImageLabelsTest covers reading labels off an image; FlociUiManagerTest grows to cover the manager against the contract. Neutralising the label arm fails 5 of the 13 resolver tests, so the ladder is genuinely exercised rather than the tests only asserting defaults. |