Adds GetOpenIdTokenForDeveloperIdentity for developer-authenticated
identities. Each (DeveloperProviderName, developer user) pair gets a
stable IdentityId; additional logins must name a provider the pool is
configured for and are linked by the user their token identifies, so a
login already linked to another identity answers
ResourceConflictException and a developer user registered elsewhere
DeveloperUserAlreadyRegisteredException. Tokens are RS512 JWS signed
with a per-pool key, carry PrincipalTags, and use AWS's regional issuer.
The pool's OIDC discovery document and JWKS are served under
/.well-known and follow the cognito-identity service's enablement.
Closes#9995
CreateCrawler and UpdateCrawler model CatalogId, the catalog that
receives the crawler's output, but Floci's request models did not know
the field, so a request carrying it failed JSON conversion. The field is
now read, the account's default catalog works as before, and since
Floci writes crawler output only to the default catalog, any other
catalog is refused with InvalidInputException before the crawler is
created or changed.
DeleteResource removed only the named resource, so its children stayed
in the store under a parent that no longer existed and GetResources kept
returning them. The whole subtree is now deleted, read from one listing
of the API's resources; the root is still refused and siblings are
untouched. PutRestApi in overwrite mode deletes the old resources from
the store directly, so it no longer fails on a child the cascade already
removed.
DeleteFunction left the function's event invoke configs in the store, so
a function created later under the same name inherited the deleted
one's retry, event age and destination settings. Deleting the whole
function now removes its configs for every qualifier, leaving other
functions alone, including ones whose names share a prefix. Put and
Update of a config take the same per-function lock as the delete, so a
write racing a delete gets ResourceNotFoundException instead of bringing
the settings back.
The default SearchTables order (database, then table name) was written
twice: in GlueService's search comparator and in the federated S3 Tables
fast path added by #10048. Both now use GlueService.defaultSearchOrder,
which also stays the tie-break for explicit sorts, so the two paths
cannot drift. Responses, order and paging are unchanged.
Compare the optional locking token with the latest hosted version for the profile before storing a new configuration. Two callers that read the same version can no longer both complete conditional writes against it.
Co-authored-by: Andre Kurait <AndreKurait@gmail.com>
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
Signed-off-by: Jackson Price <jxnprice@amazon.com>
SearchTables refused a missing catalog with a different message from
the default-catalog guard, and BatchDeleteConnection repeated the same
catalog lookup. One helper now decides the refusal for all three, so a
missing or foreign catalog reads "Catalog not found: <id>" everywhere.
SearchTables keeps InvalidInputException, and BatchDeleteConnection
keeps its 200 with per-name EntityNotFoundException errors.
Give the temporary configuration and certificate files an old modification time. A rewrite then gets a distinct timestamp even on filesystems with coarse time resolution, so the reload and reuse tests can run without sleeping.
Co-authored-by: Andre Kurait <AndreKurait@gmail.com>
Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Jackson Price <jxnprice@amazon.com>
Creating a field-level encryption config or profile kept only its
CallerReference and Comment, so reads came back nearly empty. The whole
FieldLevelEncryptionConfig and FieldLevelEncryptionProfileConfig element
is now stored as sent and replayed on every read.
GetFieldLevelEncryptionConfig answers with a FieldLevelEncryptionConfig
root in the CloudFront namespace, GET /field-level-encryption/{Id} and
GET /field-level-encryption-profile/{Id}/config are served, and the
lists return the summary shapes. Records stored by an older Floci are
rebuilt from the fields they kept.
Closes#7914
A queue target used to log and drop an event whose delivery failed. A
queue now gets the events of one publish in batches of up to
MaxBatchSize, and a failed batch is retried and dead-lettered as a
function's is. The first attempt still runs before PutEvents returns;
only the retries run in the background, and a FIFO subscriber's later
batches wait behind one being retried. A subscriber deleted or reset
during the first attempt sends no retries or dead letters. The
dead-letter record's error code follows the stage that failed:
CUSTOMER_VALIDATION for a DelaySeconds that is no integer or a batch the
queue refuses whole, RESOURCE_NOT_FOUND for a missing queue, and
PARTIAL_BATCH_FAILURE when the queue refuses some entries. An expression
with no value now leaves its parameter out, and a standard dead-letter
queue gets the first event's group id.
The guide's "How CloudWatch stores histogram metrics" says CloudWatch
converts an explicit-bucket histogram to an exponential one at
ingestion, keeping the count and sum exactly and placing each source
bucket's count in the exponential buckets that cover its range,
weighted by how its density compares with its neighbors' rather than
spread evenly. The guide does not give the algorithm, so Floci's is
its own.
A delta data point's bucket has its density run linearly between edge
densities averaged with each neighbor, and its unbounded buckets reach
its min and max. Any other data point, a cumulative one among them,
has its buckets spread evenly and its min and max unread: the guide's
"Querying histogram metrics" reads a cumulative histogram's growth with
rate, which takes a falling bucket for a counter reset, and a bucket
weighted by its neighbors, or reaching a maximum, gives up part of its
range as they grow. Without a min the lowest bucket reaches down to
zero as histogram_quantile assumes of a classic histogram, without a
max the highest is held just above its bound, a bucket that reaches
zero becomes the zero bucket, and the schema is the finest at most 8
that holds the buckets in 160, the OpenTelemetry SDK default. The
layout depends on the bounds, never the counts, so a cumulative series
with fixed bounds keeps it, and lengths are halved before they are
subtracted, so bounds far apart keep finite counts.
Explicit-bucket series are labelled __type__="histogram" and
__temporality__ as exponential ones are, sharing one reader. Summaries
still carry no sample: the guide lists gauge, sum, histogram and
exponential histogram as the metric types it stores.
Part of #7030.
The Docker host override every container Floci starts relies on was
read from the Lambda section by core classes. floci.docker.host-override
(env FLOCI_DOCKER_HOST_OVERRIDE) is now the key, read through
EmulatorConfig.effectiveDockerHostOverride() by DockerHostResolver and
TlsProxyServer. It wins when set and not blank; otherwise the former
floci.services.lambda.docker-host-override still applies, giving every
reader the value it gave before, and its first use logs a deprecation
warning. The docs say which key wins and that the self-signed TLS
certificate does not name the override.
Copy the execution under the same lock that protects its status updates. A query can finish between the handler and the HTTP writer, so the response needs its own copy.
Co-authored-by: Andre Kurait <AndreKurait@gmail.com>
Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Jackson Price <jxnprice@amazon.com>
CreateChangeSet now stores the template with its AWS::Include snippets
merged beside the submitted one, and DescribeChangeSet and
ExecuteChangeSet use that copy, so overwriting or deleting the S3
object after creation no longer changes the preview or what deploys. A
new change set reads the current object, UsePreviousTemplate included,
and a snippet that can't be read at creation fails the change set with
the reason in StatusReason. Creating a change set retries at most three
times when the stack changes under it, then answers ServiceUnavailable.
Co-authored-by: Andre Kurait <AndreKurait@gmail.com>
A SAML provider registered with CreateIdentityProvider now signs users
in through /oauth2/authorize, as OIDC and Google providers do. Floci
sends an unsigned AuthnRequest to the metadata's SingleSignOnService
and accepts the response at /saml2/idpresponse, on a custom domain and
on Floci's host, when its signature verifies with a metadata
certificate, it answers the request Floci sent, and its issuer,
audience, time window and bearer confirmation hold. The user is
reconciled as <ProviderName>_<NameID>, its attributes mapped by SAML
attribute name, and the client gets a Cognito authorization code.
The signature check moves to core/common/SamlSignatures, shared with
AssumeRoleWithSAML, and both now read an assertion's elements from
their parents' own children, so nothing placed inside a signature,
which its digest leaves out, is read.
A Step Functions task calling Scheduler, ECS, EMR, CloudFormation or
DynamoDB createTable was checked for its action and the roles it passes
but never for the tags it sends. Every arm now goes through
RequestChecks, so a runTask, createCluster, createStack family call or
createTable with tags needs the tag-on-create and tagging permissions
the generated tables give a direct call, and a request without tags is
checked exactly as before.
An ecs:runTask task now launches its tasks with the tags it is checked
for, building its request through the new EcsService.runTaskRequest
that the EventBridge and Scheduler targets share. RunTask with
propagateTags TASK_DEFINITION now gives a task the task definition's
tags beside the request's own, the request's value winning on a shared
key, instead of dropping the request's tags, and RunTask and StartTask
refuse a request whose merged tags would exceed 50 before any task
launches.
The DescribeNetworkInterfaces entry now lists the network interfaces of
interface VPC endpoints, and the guide shows the AWS CLI call that
finds them by the requester-managed and interface-type filters.
Co-authored-by: Andre Kurait <AndreKurait@gmail.com>
A PutEvents event carried EventGroupId and DeduplicationId in its
SystemMetadata only when the entry gave them. Both are now always set:
DeduplicationId is the given value or a random UUID, and EventGroupId is
the given value or that DeduplicationId. SystemMetadata follows AWS's
key order, aws:IngestionTime always has three fraction digits, and a
FIFO dead-letter queue takes the event's EventGroupId instead of a
random group of its own.
histogram_quantile, histogram_fraction, histogram_stddev and
histogram_stdvar follow Prometheus v3.16. A native histogram's quantile
is found from the lowest bucket below 0.5 or for a NaN sum and from the
highest otherwise, interpolated exponentially (Go's Log2 and Exp2) or
linearly in the zero bucket, which reaches only to zero when one side
has no buckets; NaN observations give the NaN-result and skew infos.
The fraction interpolates each bound the same way, and the variance
takes each bucket at the geometric mean of its bounds, Kahan-summed.
Float series with an le label are classic histograms, grouped by their
other labels: BucketQuantile and BucketFraction sort, coalesce and raise
falling counts, with the forced-monotonicity info merged over samples
as Prometheus merges it. A malformed or NaN le (read as Go's ParseFloat
reads it) and a native histogram of a classic one's labels are left out
with Prometheus's warnings. quantile, quantile_over_time and
histogram_quantile warn of a quantile outside 0 to 1.
log2 now takes Go's own Log of the fraction rather than Java's Math.log,
which differed in the last bit for some inputs and so moved a quantile
interpolated through it. Shortest number formatting writes the one digit
Go writes for the smallest subnormals (5e-324, where Java's toString
gives 4.9E-324), in the API's numbers and in annotations alike.
Part of #7030.
AWS::SES::ConfigurationSet accepted only Name, so a template with Tags
or any option property, including a CDK app with a Tags.of(...) aspect,
ended CREATE_FAILED. The provisioner now accepts Tags and every option
property, validates their shapes against the registry schema and passes
the values to SES. An in-place update writes only the options and tag
keys the stack owns, a tag change is checked against the final set
before anything is written, and a failed update rolls back only what it
changed. Boolean options are read through the shared
resolveOptionalBoolean.
A second DeleteStack can start while the first failure is still being recorded. Queue the failure event with the original request token, then save the failure under the same lock that admits the retry.
Co-authored-by: Andre Kurait <AndreKurait@gmail.com>
Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Jackson Price <jxnprice@amazon.com>
AssociateRouteTable associated a subnet with a route table from a
different VPC, and DisassociateRouteTable removed a VPC's main route
table association. Both now fail with InvalidParameterValue and EC2's
message, the refusal comes before the DryRunOperation answer, and a
rejected call writes nothing.
UpdateStage ignored a remove operation on /variables/<name>, so a stage
variable could never be deleted from an existing stage. The operation
now removes that key from the patched stage only.
Adds CreateGroup, DescribeGroup, ListGroups, DeleteGroup,
CreateGroupMembership, ListGroupMemberships, DeleteGroupMembership and
ListNamespaces. Groups and memberships are namespace-scoped records in
the account-aware store, a membership records the member's user ARN,
and DeleteUser and DeleteGroup remove the memberships they leave behind
by ARN in one atomic write. ListNamespaces reports default plus every
namespace holding a user or a group, since namespaces are implicit
here. The list operations share the module's pagination.
Closes#9836
The EC2 nightly test could reach the published port before the guest's
echo server was listening. It now waits up to 30 seconds for the first
echo, retrying when the relay closes before a byte arrives or the socket
reports an I/O error, while a wrong byte still fails at once. The socket
that returned the echo is the one the connection tracking checks use.
Co-authored-by: Andre Kurait <AndreKurait@gmail.com>
Adds CoreBoundImportGuardTest, a source-scanning test that keeps the
infrastructure classes bound for floci-core (storage, Docker, DNS, TLS,
lifecycle, service registry, request plumbing, XML), listed in
core-boundary/core-bound.txt, free of AWS service code. Ignoring
comments, it fails on an io.floci.aws.services reference in code or in a
string literal, a service-specific ServicesConfig accessor read from
EmulatorConfig, or one of their config types. allowlist.tsv records the
88 references that predate the guard, and a stale line fails too, so
the list only shrinks until ALLOWLIST_MUST_BE_EMPTY makes it the rule.
rate, increase and delta of a histogram's range follow Prometheus
v3.16's histogramRate: the last histogram at the range's coarsest
schema less the first, each histogram before a counter reset added
back for a counter (the first taken as empty when the second follows a
reset), then extrapolated with the float path's factor, the count
standing in for the value. A counter reset is detected as
FloatHistogram.DetectReset detects one: a fall in the count, the zero
bucket or any bucket at the newer schema above the zero threshold, a
finer schema or a smaller zero threshold.
irate and idelta take the last two samples of either kind, resets and
changes count floats and histograms in time order, and a range of both
kinds has no rate with Prometheus's mixed-samples warning. Histograms
keep no counter reset hint, as the guide says rate treats every
histogram alike, so delta and idelta of histograms give Prometheus's
"this native histogram metric is not a gauge" warning.
Part of #7030.
Histogram samples now take part in arithmetic and aggregation as
Prometheus v3.16 lets them: a histogram is added to or taken from
another, multiplied by a float or divided by one, negated, and compared
with == and !=; two histograms are first brought to the coarser schema,
merging the finer one's buckets, and to the larger zero threshold, which
takes the buckets it then covers. Any other pairing keeps nothing, with
Prometheus's "incompatible sample types encountered for binary operator"
info between two vectors.
sum and avg add histograms with Kahan compensation (PromQlHistogramSum,
a port of KahanAdd on Floci's dense buckets), avg falling back to a
running mean when the sum overflows, and so do sum_over_time and
avg_over_time; a group or a range holding both floats and histograms has
no result and gets Prometheus's "encountered a mix of histograms and
floats" warning, which responses now carry under warnings. A computed
histogram is counted against the query's memory once, as a label set
is, and a data point whose buckets reach past the bucket of infinite
observations carries no sample.
Part of #7030.
Under enforcement a REST route no vendored model names runs unchecked, and Amazon MSK was among them: any caller could
create, describe, update or delete a cluster or a configuration. MSK's model routes are vendored
(regen_rest_routes.MODELS), so each request is checked as its operation's action, and kafka joins the generated tables
of request resources, passed roles and tags on create: a cluster, configuration, replicator, VPC connection or topic by
the ARN its path or body gives, CreateReplicator's and CreateChannel's service execution roles passed to kafka, and the
tags a create carries.
A JSON request carries a body member by its botocore locationName where one renames it, as MSK's do (Name is name on the
wire, ConfigurationInfo.Arn is configurationInfo.arn), and MSK's handler reads that name, so regen_iam_request_resources
names each body member path it reads as the request carries it (wire_named): a create is checked on the configuration or
cluster of the name MSK makes, and a body naming another under the botocore spelling too is checked on the one MSK
reads. GuardDuty's CreateFilter name and UpdatePublishingDestination destinationProperties, and API Gateway v2's portal
members, are read as their requests carry them too.
CreateClusterV2 names the configuration its brokers start from two structures deep (provisioned.configurationInfo.arn),
of a type the Service Reference lists for it, and the table read ARN members at most one structure deep, so
regen_iam_request_resources._nested_arns now reads too the members ending in Arn or Arns, holding a string, of a
top-level structure's structures, from botocore alone. 107 operations of other namespaces gain such a row; each ARN is
checked as one of the operation's types where it fits one and dropped where it does not, as one level deep already is,
so most (a KMS key, a role or a bucket naming no type of the action) change nothing. Those that do: Glue's CreateCatalog
and UpdateCatalog on their target catalog, EC2's RunInstances on the resource group a capacity reservation target names,
and Amazon Managed Service for Prometheus' CreateScraper on its workspace and EKS cluster and UpdateScraper on its
workspace. A create checks the tags it carries on what it makes alone, which the table marks by the type its name gives
past its verb; CreateClusterV2's subject, ClusterV2, names no type, so with_made now reads a subject named with a
version that names none without it, and CreateClusterV2 makes a cluster as CreateCluster does: a tagged create needs
kafka:TagResource on the new cluster, not on the configuration it names. A resource the request names by its ARN, or the
service's default a row stands for, exists already, so with_made never counts it as one the create makes, as no such row
of the table was: Glue's tagged CreateCatalog needs glue:TagResource on the catalog it makes, not on the Redshift
catalog it targets. That marks the created row of 95 creates across 38 namespaces; where the created row does not
resolve, the tag check still falls back to every resource the request names, so only a create naming an existing
resource of one of its types by ARN checks its tags on less.
MskStoredResourceArns answers the tags MSK holds on a cluster, read in place in the ARN's account, which an
aws:ResourceTag condition reads where the Service Reference gives the key (a cluster, not a configuration); a tag MSK
keeps with no value is read as an empty one, so it never fails the check.
AWS tags no MSK configuration: CreateConfiguration takes no tags, AWS::MSK::Configuration has none, the Service
Authorization Reference gives a configuration no aws:ResourceTag key and TagResource only assessment, cluster and
vpc-connection, and AWS's evaluation suite notes that TagResource rejects a configuration ARN ("Invalid input resource
arn"). Floci tagged them since #2366, so TagResource, UntagResource and ListTagsForResource now refuse a configuration's
ARN with that BadRequestException, as AWS does, and floci.services.msk.configuration-tags
(FLOCI_SERVICES_MSK_CONFIGURATION_TAGS, off by default) keeps the earlier tagging for state or scripts relying on it;
IAM checks those calls on '*', as no type of the action fits a configuration.
A namespace the table reads is served on its tag routes only at the ARN its path encodes, as Backup's and the others'
are, so MskControllerIntegrationTest's tag calls send the ARN encoded, as the SDKs do, rather than with its '/' raw.
The tables also take the RDS cluster group types (cluster-group, cluster-group-snapshot, cluster-group-auto-backup) AWS
added to the Service Reference on 2026-12-02, on its tagging and restore actions, which the online verify gate reads.
IamRestRouteEnforcementIntegrationTest checks that with no grant a configuration's read is refused, that a grant on one
configuration reads it and refuses another, that an aws:ResourceTag condition reads a cluster's tags, that a cluster
holding a tag with no value is refused rather than answered with a 500, and that CreateConfiguration is checked on the
configuration of the name MSK reads, a body naming another under the botocore spelling too included; that a deny on the
configuration CreateClusterV2 names refuses the create, and that a tagged one needs kafka:TagResource on its new cluster
alone; MskServiceTest and MskControllerIntegrationTest check that a configuration's tag calls are refused unless
configuration-tags is on; IamRequestResourceEnforcementIntegrationTest checks that a deny on the catalog Glue's
CreateCatalog targets refuses it and a deny on tagging that catalog does not refuse a tagged one;
test_regen_iam_request_resources checks the wire names a JSON body path is read by the path read two structures deep,
the type a create named with a version makes, and that no resource named by ARN is made.