Files
floci/src/test/resources/application.yml
T
jwoa95andPriamo 17c40cecbd fix(cognito): reject token validity outside AWS's limits (#5160)
* fix(cognito): reject token validity outside AWS's limits

CreateUserPoolClient and UpdateUserPoolClient accepted any positive token
validity, so a client with one-minute access and ID tokens, or a
20-minute refresh token, worked locally and failed on deploy. AWS allows
access and ID tokens between 5 minutes and 1 day and refresh tokens
between 60 minutes and 3,650 days, in each token's TokenValidityUnits
unit (hours for access and ID tokens, days for refresh tokens, by
default). A client outside them now fails with InvalidParameterException
"Invalid range for token validity.", the message AWS returns.

floci.services.cognito.enforce-token-validity-limits (env
FLOCI_SERVICES_COGNITO_ENFORCE_TOKEN_VALIDITY_LIMITS, default true) turns
the check off for tests that want tokens shorter than AWS allows.

* test(scheduler): start recurring test schedules in the future

Since #5610 a rate schedule's first occurrence is its creation time, so
a schedule is due the moment it exists. The application's own dispatcher
keeps ticking every 10 seconds during @QuarkusTest and sees every
schedule, so a tick that lands between CreateSchedule and the test's own
dispatcher fires the schedule once more than the test expects.

Four tests create an enabled rate(1 minute) schedule and count exact
deliveries: recurringScheduleStartsOneExecutionPerOccurrence,
stepFunctionsDeleteScheduleStopsFutureOccurrence,
rateScheduleDeliversEachOccurrenceWithItsScheduledTime and
executionIdsDifferBetweenOccurrences. They now create the schedule
through SchedulerTestHarness.createRecurringSchedule, which sets a
StartDate a day ahead, and tick past it on their scoped dispatcher. The
application's dispatcher skips a schedule before its StartDate, and the
test profile and its tick interval stay as they are.

* test(compat): poll OpenSearch domain readiness every 250 ms against Floci

OpenSearchTest waited for the domain to finish processing in its own loop
that slept 5 s between checks and swallowed InterruptedException. Floci
flips Processing to false on its own 3 s readiness poll, so the test
could sit up to 5 s past the moment the domain was ready.

The wait now goes through TestFixtures.await, polling every 250 ms
against Floci and keeping the 5 s cadence against real AWS, with the
same 3 minute timeout.

* fix(opensearch): run domain containers under an init process so a stop ends them at once

The OpenSearch image's entrypoint is a bash script that starts the server
as its child instead of exec'ing it. Running as PID 1, that script ignores
SIGTERM, so every DeleteDomain, and every shutdown for each domain, waited
out the whole 5 s stop timeout before Docker sent SIGKILL. The server
never saw the SIGTERM either way.

Domain containers now run under Docker's init process, which takes the
SIGTERM and ends the container at once. Stopping a ready 2.11.1 container
took 5.27 s (exit 137) without it and 0.26 s (exit 143) with it, and
DeleteDomain in the compatibility OpenSearchTest took 5.3 s.

The two startDomain tests' shared setup moves into one helper, which the
new init test uses too.

* fix(cognito): keep a RefreshTokenValidity of 0 at 30 days in any unit

AWS replaces a RefreshTokenValidity of 0 with "the default value of 30
days". Floci stored the bare number 30 in the client's refresh token
unit, so a client with RefreshToken=minutes issued 30-minute refresh
tokens. With the token validity limits, any later UpdateUserPoolClient
that left the validity alone re-checked that stored 30 minutes and
failed with "Invalid range for token validity.", for a client Floci had
accepted.

A 0 now becomes 30 days in the client's refresh token unit (2592000
seconds, 43200 minutes, 720 hours or 30 days), on create and on update,
and the limits check runs on that normalized value. Also imports UUID on
a test line that spelled it out in full.

* fix(cognito): reset the settings UpdateUserPoolClient omits to their defaults

AWS: "If you don't provide a value for an attribute, Amazon Cognito sets
it to its default value." The developer guide adds that an update with
one parameter "sets all others to a default value". Floci kept the
stored value of every setting the request left out, so a client could
end up with a combination AWS never produces: an AccessTokenValidity of
60 kept from a minutes client, read in the hours of a units-only update,
was refused as out of range, where AWS resets the validity and accepts.

CreateUserPoolClient and UpdateUserPoolClient now build their settings
in one place, with a new client's default for each one the request
omits, and the update copies them onto the stored client. ClientName is
the exception: the API documents no default for it, so an update without
one keeps the name. The id, the secrets, the dates and the branding are
not settings and stay as they are. An explicitly empty list still clears
the setting.

The AuthSessionValidity tests and the boto3 compatibility test that
asserted the old keep-on-omit behaviour now expect the 3-minute default.

* test: share one self-signed and one user-cert TLS profile across the TLS integration tests

CustomDomainTlsIntegrationTest, TlsEnsureHostIntegrationTest, TlsHttp2HostRoutingIntegrationTest and EcrTlsDataPlaneDockerIntegrationTest each declared a self-signed TLS profile whose static block wrote its own CA-issued leaf before boot, and under @QuarkusTest that leaf is the one served. They now share SelfSignedTlsProfile, which writes one leaf for all four: the SANs TlsConfigSource uses by default, without 127.0.0.1, plus the API Gateway custom domain the HTTP/2 test routes to. The custom domain and ensure-host tests connect by IP and expect a name the leaf doesn't cover yet to be refused, and the JDK falls back to the peer address when the SNI name doesn't match, so a 127.0.0.1 SAN would let those handshakes through. The leaf and its metadata are written fresh every run, which also drops hostnames an earlier run learned at runtime, and the container CA bundle the ECR test relied on is written beside them.

TlsIntegrationTest and TlsUserCertIntegrationTest declared the same user-provided certificate setup apart from paths. They share UserCertTlsProfile, which keeps the certificate file carrying its private key, since TlsUserCertIntegrationTest checks /_floci/ca.pem never echoes it.

Both profiles live in the config test package, beside every class that uses them and the package-private default SAN list, and expose their paths as compile-time constants, so a test can read them without initializing the profile class and rerunning its static block under the running application.

Sharing an application also means no class may leave anything behind for the next. TlsHttp2HostRoutingIntegrationTest now removes the bucket, CloudFront public key, key group and distribution, and the REST API, domain name and base path mapping it creates. EcrTlsDataPlaneDockerIntegrationTest deletes the manifest it pushes, TlsIntegrationTest its queue and TlsUserCertIntegrationTest its parameter. CustomDomainTlsIntegrationTest and TlsEnsureHostIntegrationTest already end with a state reset, which keeps the configured names from the profile's metadata, so neither changes the leaf a later class is served.

The ECR test's registry container also outlived every run: keep-running-on-shutdown defaults to true and the test config never overrides it, and the next application to start adopted the container by name, a developer's own Floci registry included. SelfSignedTlsProfile now names it in the run's sidecar namespace, which SidecarContainersProfile exposes for this, and stops it at shutdown. The test checks for Docker through SidecarContainersProfile.requireDockerAndImage, so a registry a killed run left behind is removed like any other abandoned sidecar.

Part of #4542.

---------

Co-authored-by: Priamo <pgermosen@gmail.com>
2026-10-14 17:40:23 -04:00

552 lines
14 KiB
YAML

quarkus:
http:
port: 0
test-port: 0
# Integration signatures use localhost as the public test authority. Keep the test listener
# explicit so the production loopback default does not change the signed host.
host: 0.0.0.0
limits:
max-body-size: ${floci.protocols.max-request-size}M
# Groovy (a REST Assured dependency) starts DFA-cache-cleaner threads that never stop.
# Loaded parent-first they live in the shared system classloader, so they cannot pin a
# per-profile application classloader across the many app restarts of a test run.
class-loading:
parent-first-artifacts: org.apache.groovy:groovy
floci:
base-url: "http://localhost:4566"
network:
security-group-enforcement:
enabled: true
helper-image: floci/network-helper:local
default-region: us-east-1
default-account-id: "000000000000"
partitions:
strict: false
allow-unknown-regions: false
ai-mock-config-file: ${AI_MOCK_CONFIG:src/test/resources/fixtures/ai-mock-config.json}
storage:
mode: memory
persistent-path: ./target/test-data
prune-volumes-on-delete: true
wal:
compaction-interval-ms: 60000
services:
ssm:
flush-interval-ms: 60000
dynamodb:
flush-interval-ms: 60000
sns:
flush-interval-ms: 60000
lambda:
flush-interval-ms: 60000
cloudwatchlogs:
flush-interval-ms: 60000
cloudwatchmetrics:
flush-interval-ms: 60000
secretsmanager:
flush-interval-ms: 60000
acm:
flush-interval-ms: 60000
opensearch:
flush-interval-ms: 60000
sagemaker:
flush-interval-ms: 60000
batch:
flush-interval-ms: 60000
lightsail:
flush-interval-ms: 60000
codepipeline:
flush-interval-ms: 60000
s3vectors:
flush-interval-ms: 60000
s3tables:
flush-interval-ms: 60000
ecs:
flush-interval-ms: 60000
codebuild:
flush-interval-ms: 60000
config:
flush-interval-ms: 60000
transcribe:
flush-interval-ms: 60000
codedeploy:
flush-interval-ms: 60000
tagging:
flush-interval-ms: 60000
elasticbeanstalk:
flush-interval-ms: 60000
cloudfront:
appsync:
flush-interval-ms: 60000
rum:
flush-interval-ms: 60000
resourceexplorer2:
mode: memory
flush-interval-ms: 60000
fis:
flush-interval-ms: 60000
guardduty:
flush-interval-ms: 60000
emrserverless:
flush-interval-ms: 60000
lakeformation:
flush-interval-ms: 60000
auth:
validate-signatures: false
presign-secret: test-secret
security:
extra-cors-allowed-origins: ${EXTRA_CORS_ALLOWED_ORIGINS:}
extra-cors-allowed-headers: ${EXTRA_CORS_ALLOWED_HEADERS:}
extra-cors-expose-headers: ${EXTRA_CORS_EXPOSE_HEADERS:}
disable-cors-headers: false
# The test listener binds all interfaces so Quarkus keeps localhost as its test authority.
# This is test-only; production keeps the loopback default.
allow-unsafe-network-exposure: true
allow-private-jwt-targets: true
init-hooks:
shell-executable: /bin/sh
timeout-seconds: 5
shutdown-grace-period-seconds: 2
tls:
enabled: false
self-signed: true
protocols:
strict-claiming: false
reject-unknown-service-scope: true
docker:
log-max-size: "10m"
log-max-file: "3"
resource-namespace: ""
services:
ssm:
enabled: true
max-parameter-history: 5
sqs:
enabled: true
default-visibility-timeout: 30
max-message-size: 1048576
s3:
enabled: true
enforce-auth: false
default-presign-expiry-seconds: 3600
global-bucket-namespace: false
dynamodb:
enabled: true
vector-index-allocation-seconds: 0
vector-index-backfill-seconds: 0
backend: native
sns:
enabled: true
lambda:
enabled: true
docker-flags: ""
honour-architectures: false
zip-max-entries: 100000
async-retry-delay-seconds: 1
durable-sweep-enabled: true
durable-sweep-interval-seconds: 1
# aws-config-path:
hot-reload:
enabled: true
apigateway:
enabled: true
vtl-max-loops: 10000
vtl-max-output-chars: 1048576
vtl-timeout-millis: 5000
apigatewayv2:
enabled: true
iam:
enabled: true
enforcement-enabled: false
seed-deployer-principal: false
msk:
enabled: true
mock: true
default-image: "redpandadata/redpanda:latest"
amazonmq:
enabled: true
mock: true
amqp-host-port-base: 5672
amqp-host-port-max: 5699
console-host-port-base: 15672
console-host-port-max: 15699
kinesis-analytics:
enabled: true
mock: true
elasticache:
enabled: true
proxy-base-port: 6379
proxy-max-port: 6399
default-image: "valkey/valkey:8"
default-memcached-image: "memcached:1.6"
memorydb:
enabled: true
mock: false
proxy-base-port: 6400
proxy-max-port: 6419
default-image: "valkey/valkey:8"
redshift:
enabled: true
default-port: 5439
image-version: postgres:15-alpine
poll-interval-ms: 1000
proxy-base-port: 7100
proxy-max-port: 7199
default-credential-duration-seconds: 900
proxy-handshake-timeout-millis: 10000
proxy-backend-connect-timeout-millis: 5000
proxy-max-connections: 100
spectrum-max-rows: 1000000
rds:
enabled: true
mock: false
proxy-base-port: 7001
proxy-max-port: 7099
default-sql-server-image: "mcr.microsoft.com/mssql/server:2022-latest"
proxy-handshake-timeout-millis: 10000
proxy-backend-connect-timeout-millis: 5000
proxy-max-connections: 100
aurora-auto-pause-enabled: true
aurora-resume-delay-millis: 0
rds-data:
enabled: true
transaction-ttl-seconds: 180
redshift-data:
enabled: true
result-ttl-hours: 24
max-concurrent-statements: 10
queue-capacity: 100
shutdown-timeout-seconds: 10
redshift-serverless:
enabled: true
neptune:
enabled: true
proxy-base-port: 8182
proxy-max-port: 8282
default-image: "tinkerpop/gremlin-server:3.7.3"
eventbridge:
enabled: true
cloudmap:
enabled: true
emr:
enabled: true
wafv2:
enabled: true
scheduler:
enabled: true
cloudwatchlogs:
enabled: true
max-events-per-query: 10000
cloudwatchmetrics:
enabled: true
secretsmanager:
enabled: true
default-recovery-window-days: 30
kinesis:
enabled: true
list-shards-next-token-ttl-millis: 300000
firehose:
enabled: true
tick-interval-seconds: 1
flush-record-count: 0
staging-bucket: floci-firehose-staging
kms:
enabled: true
cognito:
enabled: true
enforce-token-validity-limits: true
stepfunctions:
enabled: true
allow-plaintext-http: true
mock-config-file: ${SFN_MOCK_CONFIG:src/test/resources/fixtures/sfn-mock-config.json}
max-wait-seconds: 30
swf:
enabled: true
timeout-sweep-enabled: true
timeout-sweep-interval-seconds: 1
cloudformation:
enabled: true
# Pinned to the shipped default: the retention tests advance the test clock past this
# window by name, so the value they assume is spelled out rather than inherited.
deleted-stack-retention-seconds: 30
# Fail an AWS::Lambda::Function whose S3 code cannot be read, as real CloudFormation
# does. Set true to fall back to the built-in stub handler instead (issue #2648).
allow-stub-lambda-code: false
# Pinned to the shipped default so a test sees what a user sees; the strict-mode test
# overrides it with its own profile.
allow-stub-unsupported-resource-types: true
acm:
enabled: true
validation-wait-seconds: 0
athena:
enabled: true
mock: true
glue:
enabled: true
ses:
enabled: true
opensearch:
enabled: true
mock: true
proxy-base-port: 9400
proxy-max-port: 9499
ec2:
# Optional complete catalog override for locally built guest images.
image-catalog-path: ${FLOCI_SERVICES_EC2_IMAGE_CATALOG_PATH:}
enabled: true
imds-port: 9169
ssh-port-range-start: 2200
ssh-port-range-end: 2299
publish-security-group-ports: true
app-port-range-start: 30000
app-port-range-end: 30999
max-published-ports-per-instance: 20
socat-image: alpine/socat
volume-block-devices: false
volume-helper-image: alpine:3.21
mock: true
instance-resource-limits: true
aws-faithful-private-ip: false
# container-ips-routable: true # see src/main/resources/application.yml
# Off explicitly, not merely by implication of mock: true above. Tests must not create or
# reconcile Docker networks on whatever daemon CI happens to have.
vpc-networks:
enabled: false
ecs:
enabled: true
mock: true
host-volume-roots: []
allow-unsafe-host-volumes: false
image-pull-behavior: prefer-cached
appconfig:
enabled: true
appconfigdata:
enabled: true
ecr:
enabled: true
tls-uri: false
ui:
enabled: true
bedrock:
enabled: true
bedrock-runtime:
enabled: true
eks:
enabled: true
mock: true
max-memory-mib: 0
max-vcpus: 0
ecr-registry-mirror: true
default-storage-class: false
imds: false
irsa-signing-key: true
embedded-dns: true
mwaa:
enabled: true
mock: true
pipes:
enabled: true
elb:
enabled: true
mock: true
elbv2:
enabled: true
mock: true
codebuild:
enabled: true
# docker-network: floci-network
sagemaker:
enabled: true
# docker-network: floci-network
gpu:
# Off by default: an existing deployment keeps launching CPU-only
# containers. How many GPUs an ml.* type has is shipped in
# sagemaker/instance-type-catalog.yaml; this is only about which of
# this machine's devices Floci may hand out.
enabled: false
# cdi | device-ids | count. Podman resolves only cdi, and accepts
# count while attaching no device, so cdi fails loudly instead.
mode: cdi
# Required for cdi and device-ids modes; unset allows no device.
# devices:
# - nvidia.com/gpu=GPU-<uuid>
batch:
enabled: true
runner-mode: immediate
codedeploy:
enabled: true
codepipeline:
enabled: true
source-poll-interval-ms: 100 # a shorter cycle so the "did not trigger" tests wait less
autoscaling:
enabled: true
applicationautoscaling:
enabled: true
elasticbeanstalk:
enabled: true
transfer:
enabled: true
backup:
enabled: true
job-completion-delay-seconds: 1
fis:
enabled: true
route53:
enabled: true
textract:
enabled: true
comprehend:
enabled: true
rekognition:
enabled: true
translate:
enabled: true
pricing:
enabled: true
ce:
enabled: true
cur:
enabled: true
emit-mode: off
bcm-pricing-calculator:
enabled: true
timestream-influxdb:
enabled: true
mock: true
bcm-data-exports:
enabled: true
emit-mode: off
oam:
enabled: true
cloudtrail:
enabled: true
flush-interval-seconds: 3600
lightsail:
enabled: true
cloudcontrol:
enabled: true
resourceexplorer2:
enabled: true
cloudfront:
enabled: true
allowed-private-origin-hosts: []
appsync:
enabled: true
schema-worker-threads: 4
schema-worker-shutdown-timeout-seconds: 30
vtl-max-loops: 10000
vtl-max-output-chars: 1048576
vtl-timeout-millis: 5000
s3vectors:
enabled: true
s3tables:
enabled: true
iot:
enabled: true
rule-sql-strict: false
mqtt:
enabled: true
auto-start: false
host: 127.0.0.1
port: 1883
tls-port: 8883
iotdata:
enabled: true
cloudhsmv2:
enabled: true
efs:
enabled: true
organizations:
enabled: true
rum:
enabled: true
networkfirewall:
enabled: true
servicecatalog:
enabled: true
guardduty:
enabled: true
emrserverless:
enabled: true
ssoadmin:
enabled: true
ssooidc:
enabled: true
local-principal-id: ${FLOCI_SERVICES_SSOOIDC_LOCAL_PRINCIPAL_ID:}
macie2:
enabled: true
account:
enabled: true
controlcatalog:
enabled: true
accessanalyzer:
enabled: true
identitystore:
enabled: true
scim-bearer-token: ${FLOCI_SERVICES_IDENTITYSTORE_SCIM_BEARER_TOKEN:floci-scim-token}
budgets:
enabled: true
inspector2:
enabled: true
securityhub:
enabled: true
detective:
enabled: true
controltower:
enabled: true
seed-landing-zone: true
route53resolver:
enabled: true
connect:
enabled: true
appintegrations:
enabled: true
dlm:
enabled: true
cognitoidentity:
enabled: true
globalaccelerator:
enabled: true
datasync:
enabled: true
aps:
enabled: true
lakeformation:
enabled: true
tagging:
enabled: true
configservice:
enabled: true
transcribe:
enabled: true
docdb:
enabled: true
mock: false
default-image: "mongo:7.0"
bedrock-agent-core:
enabled: true
bedrock-agent-core-control:
enabled: true
servicequotas:
enabled: true
verifiedpermissions:
enabled: true
ram:
enabled: true
codegurureviewer:
enabled: true
codeartifact:
enabled: true
marketplace:
enabled: true
dms:
enabled: true