mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 14:10:49 -05:00
4e2ccfb44fb1f38b872286d7a02f43ed4bf511e7
1177
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
03a0dfefdd |
fix(rds): honor restore IAM flags and reject malformed booleans (#5473)
* fix(rds): reject malformed restore flags * fix(rds): disable IAM authentication by default on restore * fix(rds): honor IAM settings on instance snapshot restore |
||
|
|
cc129007e4 |
perf(docker): cut healthy wait from 5 s to 0.1 s (#5447)
* perf(docker): cut healthy wait from 5 s to 0.1 s * fix(docker): wait up to 5 s for ready hooks before reporting healthy * fix(docker): build without pulling a Dockerfile frontend from Docker Hub |
||
|
|
4e769484df |
feat(iam): generate and read the Organizations access report (#5467)
GenerateOrganizationsAccessReport and GetOrganizationsAccessReport answered
UnsupportedOperation, which is not a reply any SDK models. They are the Access
Advisor job shape over a different question, and everything the question needs
was already here: an Organizations tree with roots, OUs, accounts and SCPs, a
policy evaluator, and a job model whose report is fixed at generation time.
The report is the services the service control policies along an entity path
leave reachable. The path names the organization, its root, and the OUs or
account below it, and the SCPs attached to each of those are read from
Organizations and evaluated. Only SCP logic applies, which the reference is
explicit about: identity policies, resource policies, ACLs, permissions
boundaries and trust policies play no part in this data.
Attached SCPs are a union within one level and the levels are intersected, so a
service survives only where every level allows it. That cannot be answered a
namespace at a time, because a service is reachable only while some action in it
survives the whole chain: two levels allowing single disjoint actions,
s3:GetObject under s3:PutObject, leave no S3 action at all, and a Deny on the one
action a level allows leaves none either. What a namespace-wide reading got right
stays right. An SCP denying s3:DeleteBucket alone keeps S3 on the list, because
every other S3 action is still reachable, and a Deny carrying a Condition or
naming particular resources closes nothing: the region guardrail on * that most
organizations carry, and a deny scoped to one bucket, both leave the service
reachable by every request they do not cover, and reading them as total denials
would report an organization that reaches nothing.
This is still not the existing scpAllows asked once per namespace. That question
needs a concrete action, and a request action of s3:* would not match a statement
naming s3:GetObject, a pattern globbing against a request value and never the
other way round. The survivors are found by probing instead, with the actions the
policies themselves name and one stand-in action per wildcard, which decides the
patterns policies are written with exactly: a deny on s3:GetObject leaves the
service reachable where a deny on s3:Get* does not. A wildcard that is not a
trailing one is the limit of it, since the stand-in for s3:*Object misses the
s3:GetObject that s3:Get* would allow; such a pattern leaves the service on the
list rather than off it, which is the side the namespace reading was already on.
The management account is not limited by SCPs, so its report lists every service
and an OrganizationsPolicyId passed with it is ignored, both as documented.
Passing that ID otherwise narrows the report to the one SCP named, and it has to
name one: Organizations keeps tag, backup, chatbot and opt-out policies in the
same ID space, none of them carries statements, and evaluating one as a ceiling
would read as a level that constrains nothing and report every service there is.
The entity path has to be a path the organization actually has. The segments
below the root name a chain of parent and child, so the path is held to the one
Organizations reports for its last node rather than each segment being resolved
on its own. Resolving them one at a time accepts a path assembled from two
branches, or one that skips an OU, and reports the policies of a chain the
organization does not have; it also lets a path whose last segment is the
management account take the unlimited answer with an OU above it that does not
exist.
Floci records no service access, so every service in a report is one principals
are allowed but never reached. The reference's own example gives such a service
as a namespace and a zero count with no region, entity path or last-authenticated
time, so that is the shape here and NumberOfServicesNotAccessed equals
NumberOfServicesAccessible. ServiceName carries a display name Floci has no
mapping for, so the namespace stands in for it as it does on the last-accessed
reader. SortKey is validated against its four values: the namespace keys sort
the list and the time keys leave it in namespace order, since ordering on a
timestamp no entry carries would be ordering on nothing.
A caller who is not the management account gets AccessDenied 403. Neither
operation models a code for that, but a per-action error list is additive: the
reference's common error types "that this AWS service may return" apply to every
action and include the 403 permission denial, and the user guide names the code
for a denied IAM action outright in its AddRoleToInstanceProfile entry. That page
spells it AccessDeniedException where the user guide and the rest of this
service's surface spell it AccessDenied; the latter is used, so a caller sees one
spelling across IAM and STS.
Three things are inferences, and they are the same inference three times. The
docs say so. The generator models no error for an entity path that is well-formed
but resolves to nothing, nor for the prerequisite the reference states, that SCPs
be enabled for the organization root, nor for an OrganizationsPolicyId naming a
policy of some other type, so each produces a FAILED job carrying ErrorDetails:
InvalidEntityPath or the Organizations code for the entity in the first case,
PolicyTypeNotEnabled in the second, Organizations' InvalidInputException in the
third. That is read off the shape of the API rather than off a sentence: AWS
publishes both fields on this reader for failures the generator does not report
synchronously. The alternatives are worse. Letting Organizations' own error
escape unchanged puts another service's code on an IAM operation, a COMPLETED job
with an empty list cannot be told apart from an organization that reaches no
services, and ValidationError is for a shape violation, which a well-formed path,
a disabled policy type and an existing policy of the wrong type are not.
ReportGenerationLimitExceeded, the generator's only modeled error, reports
concurrent generations and stays unreachable: a job completes the moment it is
created, so two never overlap.
The generator also carries the access-report resource type, so it leaves
UNRESOLVED_TYPES and resolves from the request. The reference spells the type as
access-report/${EntityPath}, so the entity path goes into the ARN whole: its
slashes are the organization's tree, not an IAM path, which is why it does not
go through the minting the creates use.
Both actions join AwsQueryController.IAM_ACTIONS as well as the handler, without
which inferService would never route them. That list and the handler now hold
166 each, still exactly in step.
Validation runs before the lookup, as AWS rejects a request shape whether or not
the job exists: a SortKey outside the enum answers ValidationError even for a
job ID nothing holds, where validating it afterwards would answer NoSuchEntity.
A member the request carries is held to its shape whatever it carries, an empty
value included, since SortKey= and OrganizationsPolicyId= are a malformed enum
and a malformed id rather than a way of leaving an optional member out. The
entity path reports the constraint that failed rather than the regular
expression for every case, so a path over the maximum length reads as a length
violation, which is what every other validated IAM member does.
Only the one Organizations answer that means something about the caller becomes
AccessDenied. A read that fails for any other reason keeps its own error, rather
than reaching the caller as a permission problem they do not have.
Two things are shared rather than copied. The job registry both report
generators keep, an account-scoped store keyed by job ID that answers
NoSuchEntity for an ID it does not hold, moves into IamJobStore and
ServiceLastAccessedService reads it from there; the two had the same three
methods and the same message. The report's timestamps come from the injected
Clock, which IamService already takes, rather than from Instant.now(), so they
agree with every other time IAM decides. IamQueryHandlerTest builds the handler
itself rather than through injection, so it passes the new service along with
the dependencies it already does not use.
Fourteen unit tests cover the chain semantics, including the allow-list idiom of
allowing everything and denying all but one namespace, levels allowing disjoint
single actions, a deny on the only action allowed and on a pattern wider than it,
a conditional deny, a deny scoped to one bucket, a level with an unreadable
document, and a level with none. Twenty-one integration tests drive the pair over
an organization built through the Organizations API, on a management account of
their own so they never contend with the existing Organizations suites for one.
Two of them are the ones that hold the walk honest: the OU path, where the root
leaves S3 and DynamoDB and the OU leaves DynamoDB and IAM, so only a report
reading both levels answers DynamoDB alone, and the management account path,
which reports every service and ignores the policy ID passed with it even with a
ceiling attached to the root above it. With the tree read deliberately broken the
first SCP test returns all 456 namespaces instead of the one, and it is the only
test that notices. Two more tests mock the Organizations read, which is the one
failure a real organization cannot be made to produce.
|
||
|
|
6d2aaba6a6 |
fix(s3): reject a PutObject or UploadPart over 5 GiB (#5469)
S3 takes at most 5 GB in one PutObject and 5 GiB in one part (User Guide, "Uploading objects" and the multipart upload limits table), but Floci only enforced that for UploadPartCopy. Since PutObject and UploadPart stream to disk, the only cap was FLOCI_PROTOCOLS_MAX_REQUEST_SIZE, so raising it past 5120 MB, as docs/services/s3.md says to for 5 GiB uploads, let a single request store any size up to the new limit. A request that declares more than 5 GiB of data, in Content-Length or, for an aws-chunked body, x-amz-decoded-content-length (its Content-Length also counts the framing), now fails with EntityTooLarge before any of its body is read. A body that declares no size, or less than it sends, fails the same way once it passes 5 GiB: the stream that digests a body on its way to disk counts it against the limit, while memory mode already stops at about 2 GiB. PutObject's "5 GB" is taken as 5 GiB, as CopyObject's is. The error is now the one S3 sends, as S3's answer to an oversized UploadPart logged in aws/aws-cli#5420 and an AWS-validated LocalStack capture record it: the message "Your proposed upload exceeds the maximum allowed size", not the error table's description, and the ProposedSize and MaxSizeAllowed fields, ProposedSize left out when a body passes the limit as it is read, since its whole size is then not known. It is built in one place and shared with UploadPartCopy and the memory-mode cap, which sent the table's wording and named neither size; the memory-mode cap names the most memory mode can hold. A client that sent Expect: 100-continue never sends a body it was not told to continue with, so answering it before reading the body left the connection waiting for that body and reading the client's next request as it (#5291). Such an answer now says Connection: close and the connection is closed after it, which covers this rejection as well as NoSuchBucket or a failed precondition. An aws-chunked body sent without a streaming x-amz-content-sha256 or an x-amz-trailer is read whole to be decoded. That read now fails with EntityTooLarge once it passes what one array holds, through the bounded read memory mode uses, instead of running the heap out of memory. Telling an aws-chunked body from its Content-Encoding is now one helper, which the four places that repeated the check use too. |
||
|
|
233253334d |
fix(elbv2): reject a listener certificate the account does not have (#5474)
A listener stored whatever certificate ARN it was given. CreateListener, ModifyListener and AddListenerCertificates each model CertificateNotFound, and all three took an ARN naming nothing and answered 200, so a listener could be left serving a certificate that was never uploaded. Only the other direction worked: ELBv2 reports its references to IAM, so DeleteServerCertificate already refused with DeleteConflict while a listener held one. The error is the one AWS publishes on those three operations and no others: botocore gives CertificateNotFoundException the code CertificateNotFound, 400, senderFault, and the API reference lists it under AddListenerCertificates, CreateListener and ModifyListener with one sentence, "The specified certificate does not exist." That sentence is the message rather than one naming the ARN, because it is the one the reference publishes. The check covers the listener types the member belongs to and no more. The reference marks Certificates "[HTTPS and TLS listeners]" on CreateListener and ModifyListener, and describes AddListenerCertificates as adding to the list "for the specified HTTPS or TLS listener", so a certificate on a listener of any other protocol is a configuration it does not describe. What AWS answers there is not CertificateNotFound on any evidence to hand, so such a request keeps the behaviour it had rather than being refused with a code read off the wrong case. A test pins each side of that line. The line follows the protocol the listener ends the call with, not the one it started with: ModifyListener takes a protocol without taking certificates, so when none arrive the certificates checked are the ones already on file. An HTTP listener holding an ARN that resolves to nothing is left alone, and the request that turns it into an HTTPS one, which is where those certificates start being served, is refused. A blank entry is refused the same way, rather than skipped. Certificates is the list of certificates the listener serves, an empty value in it names one no better than a value that is no ARN at all, and the Query parser turns an empty CertificateArn parameter into exactly that entry, so skipping it stored a certificate the listener cannot serve. ELB Classic already answered this question in full, resolving an ARN to an IAM server certificate or an ACM one and holding IAM's certificate lock across the write. This is the second caller, so the three private methods it kept, certificateExists, iamServerCertificate and acmCertificateExists, move to CertificateReferenceResolver in core.common and Classic reads them from there. Neither referrer owns the lookup: IAM holds server certificates, ACM holds the rest, and a listener carries only the ARN. Classic's public constructors are untouched, so its unit tests still build it the same way. The check alone is not enough, which is why the lock moves with it. A certificate can be deleted between the check and the write, and the delete walks the reference providers under IAM's own lock, so every write that records an IAM certificate runs inside that lock and re-checks there, while the fail-fast check outside it keeps the error precedence. That covers CreateListener as much as the two writes to a listener already published: until the new listener is in the map, nothing the delete walks can see that it holds the certificate. A race test drives each of them against DeleteServerCertificate over the wire, and with the lock removed they leave a listener holding a deleted certificate in 1 of 30 trials for AddListenerCertificates and 4 of 30 for CreateListener, so the guarantee is measured rather than asserted. Where the check sits in ModifyListener is part of the fix. The listener it modifies is the stored object, and the port, protocol and SSL policy were set before anything could refuse the request, so a refusal answered 400 over a listener already moved to the new port: no later read put it back, and the data plane was never restarted to match. Every refusal now lands before the first setter. An absent resolver leaves the old behaviour in place. ElbV2Service is wired by hand in its unit tests, with no IAM and no ACM, and a listener write there is the write it was before any certificate existed to check. The dependency is a field rather than a constructor parameter because that is how this class takes all six of its others, and converting it would be a refactor this change does not need. docs/services/elb.md said listener certificate ARNs are not validated when they are added, which was true and is the behaviour this removes, so it now documents the three operations, the protocols they cover, the empty value, the protocol change, the error and the lock, as the Classic page already does. Sixteen integration tests cover a missing IAM certificate, a missing ACM one, a blank entry, a value that is no ARN at all and an ARN of a service that serves no certificates, an uploaded certificate and an ACM certificate being accepted, a listener carrying no certificate, a TLS listener held to the same check as an HTTPS one and a listener of a protocol with no certificates left alone, a protocol change refused over the certificate it already held and allowed over one that exists, a second certificate being added, a refused change leaving the port and protocol as they were, and the two writes that must refuse without changing what the listener already serves. Every certificate and load balancer they make is registered for cleanup: the account's certificate quota is 20 and the Quarkus instance is shared, so one left behind fails an unrelated class's upload instead of anything here. Three things the reference states about these operations stay open, each wanting an error code no source here gives: CreateListener and ModifyListener take "exactly one certificate" and AddListenerCertificates "one certificate per call", where Floci accepts a list; TooManyCertificates is modeled on all three and no quota is enforced; and DescribeListenerCertificates is documented to report the default certificate alongside the list, with IsDefault telling them apart, which Floci does not model. Driven through the standard hashicorp/aws provider against a local instance as well, which is how the change was checked against a real client rather than only against the suite: an aws_iam_server_certificate and an aws_lb_listener serving it apply clean, and a listener naming a certificate nobody uploaded fails with CertificateNotFound and the reference's sentence. That failure arrives at the end of the provider's create timeout rather than at once, because the provider retries this error on all three calls, the AddListenerCertificates one against a constant named iamPropagationTimeout: real AWS is eventually consistent about a certificate just imported, so a client waits it out. Floci's storage is immediately consistent and nothing here models a propagation delay, so the retry simply ends in the refusal. The same contract is pinned at the SDK boundary too, as eight boto3 tests in compatibility-tests: the refusal on each of the three operations, the accepted cases, and both protocol edges. They run in under a second, where driving the same thing through Terraform in CI costs about a minute for the accepted case and nearly two for the refusal, almost all of it the provider's waiter and the retry above rather than anything Floci does. The suite had no ELB coverage at all before this. Each test takes its load balancer back out before its certificates, which is the order that frees them, and test_acm.py's private certificate builder moves to a conftest fixture taking the common name rather than being copied, since the new file needs the same pair. |
||
|
|
6d7d85f0f8 |
fix(lambda): enforce function policies on cross-account calls (#5476)
Under IAM enforcement, a caller whose own policy allowed lambda:InvokeFunction could invoke another account's function by ARN even when that function's policy granted nothing, and RotateSecret could be pointed at another account's function the same way. Three things combined: there was no resource-policy provider for Lambda, so the call was judged as same-account; the function name was cut at its first colon, so an ARN was evaluated as function:arn in the caller's account, where no Allow or Deny written for the function could match; and the invoke followed the account in the ARN. - LambdaResourcePolicyProvider supplies a function's policy statements and the account its ARN names, also when the function has no policy, so a call to another account's function needs that function's policy to allow the caller as well as the caller's own policy. It is keyed on the ARN, so RotateSecret's check on its rotation function, made under the secretsmanager scope, sees it too. - ResourceArnBuilder evaluates each call against the function it acts on. An invoke runs in the account and Region a full or partial ARN names, as the version or alias it names in the function name or in Qualifier, since Lambda authorizes a qualified call against the qualified ARN. GetFunction, GetFunctionConfiguration and ListDurableExecutionsByFunction read a qualified full ARN in the account it names, so they are evaluated there too, and a read of another account's function needs its policy as on AWS. Every other route acts on the caller's own function of that name, so it is evaluated against that function, unqualified because not all of their handlers act on the qualifier. - An invoke by partial ARN runs in the account it names, as one by full ARN already did. - RotateSecret looks its function up where the rotation runs it: in the ARN's account, and as the version or alias the ARN names. |
||
|
|
eb3c14d414 | fix(rds): reject malformed event subscription flags (#5481) | ||
|
|
1e92b7e17b | fix(rds): reject malformed cluster snapshot copy flags (#5472) | ||
|
|
1a0afce7ec |
feat(cognito): serve the OAuth token revocation endpoint (#4936)
POST /cognito-idp/oauth2/revoke, and /oauth2/revoke on a custom domain, revoke a refresh token through RevokeToken and answer as AWS's revocation endpoint does, as measured: 200 with no body for a revoked, already revoked or invalid token; 400 invalid_request for a missing token or a client with revocation disabled; 400 unsupported_token_type for an access or ID token; and 401 invalid_client with WWW-Authenticate: Basic for missing or bad client credentials, a client of another pool, or a token issued to another client. Unlike the token endpoint, a client secret is taken only from the Basic header. On a custom domain, the Cognito filter now answers a path under /oauth2/ that Cognito does not serve with AWS's JSON 404, and a served path called with another method with an empty 405, so neither reaches S3 as a key of a bucket named cognito-idp. |
||
|
|
b86268e459 |
fix(ec2): preserve original Spot instance user data (#5468)
* fix(ec2): preserve original Spot instance user data * fix(ec2): omit whitespace-only Spot user data * docs(ec2): clarify Spot user-data encoding * refactor(ec2): simplify Spot user-data handling |
||
|
|
4fd8df2b00 | fix(rds): reject malformed parameter reset flags (#5454) | ||
|
|
bfa9c2fbcc |
feat(cloudformation): provision Application Auto Scaling targets and policies (#5407)
* feat(cloudformation): provision Application Auto Scaling targets and policies AWS::ApplicationAutoScaling::ScalableTarget and ::ScalingPolicy had no provisioner, so a template that scales an ECS service failed on those two resources although the Application Auto Scaling service behind them, including the ECS capacity adjuster, was already there. This wires the two together. A scalable target has no name of its own: it is keyed by the triple of service namespace, resource id and scalable dimension, and CloudFormation's Ref is those three joined by a pipe. That composite is the physical id, which is also what a policy's ScalingTargetId carries when a template points one at the other with Ref, so the provisioner splits it back into the triple. A policy's Ref is its ARN rather than its name, so deleting one resolves the ARN through findPolicyByArn to recover the name and triple the service deletes by. Because the target's id is derived from the triple, changing any part of it replaces the target rather than updating it, so both types go through ReplacementCleanup to deregister what they displaced. Deletes tolerate only ObjectNotFoundException through CfnDeletes.safeDelete: a target takes its own policies with it, so a stack teardown reaches an already-deleted policy by ordinary ordering, while any other failure still surfaces as DELETE_FAILED. The properties each schema marks required are enforced rather than defaulted. MinCapacity and MaxCapacity on a target, and PolicyName and PolicyType on a policy, would otherwise register a target that never scales or accept a template CloudFormation itself rejects. The two scaling configuration blocks are parsed by the same code the PutScalingPolicy API path uses, extracted to ScalingConfigurationParser, since CloudFormation spells their members exactly as the API does. One parser means a template and an API call cannot disagree about what a policy means. ScheduledActions on a target is logged rather than dropped silently: Floci does not run scheduled scaling, and a template that scales on a clock should not look fully provisioned when nothing is scheduled. * fix(cloudformation): resolve intrinsics inside the scaling configuration blocks Review on #5407: the two scaling configuration blocks and SuspendedState reached the parser as raw template JSON, so an intrinsic inside one was never resolved. That is worse than it sounds, because an intrinsic is still a non-null node: hasNonNull passes and the value is read with asDouble, asText or asBoolean, which answer 0, "" and false. A policy written as TargetValue: !Ref TargetCpu registered as a policy targeting 0 percent rather than failing, a ResourceLabel built with Fn::Join arrived empty, and a flag behind Fn::If read false. Each block now goes through ctx.engine().resolveNode first, which is what AutoScalingScalingPolicyCfnProvisioner already does with its own block. Only nested objects were affected: the top-level properties were already read through ctx.resolveOptional, which resolves. A target's Tags were dropped as well, passed to the service as an empty map rather than read with ctx.resolveTags. ScheduledActions now carries a note in the generated resource-type table rather than only a warning in the log, so the gap is visible before someone wonders why their clock-based scaling never fires. * test(cloudformation): make the SuspendedState intrinsic test fail without its fix Review on #5407: anIntrinsicInsideSuspendedStateIsResolvedToo passed against the previous commit too. REFS had no Suspend entry, so the flag resolved to an empty string and read false either way, and assertNotNull held regardless because the raw block was already an object. The test pinned nothing. REFS now maps Suspend to true and the assertion is on isDynamicScalingInSuspended(), so it fails with expected: <true> but was: <false> when SuspendedState is read without resolveNode. The redundant copy of the properties node is gone. |
||
|
|
af3672ed0c | fix(rds): reject malformed proxy boolean flags (#5453) | ||
|
|
09a2d5c005 |
fix(s3): answer GetObject Range requests as S3 does (#5436)
GetObject answered 416 InvalidRange to any Range that was not one valid byte range: several ranges, a last byte before the first, or a malformed value such as bytes=-, bytes=-1- or bytes=0--1. S3 answers those as a GetObject without a Range, with the whole object and 200, as LocalStack's AWS-validated capture of GetObject over a dozen ranges (test_get_object_range) records it. Only a range that starts past the end of the object, or bytes=-0, gets 416. HeadObject and a CloudFront S3 origin already answered them with the whole object. Since every caller now treats a Range that is not one valid range as no Range at all, ByteRange.resolve reports it as WHOLE, and the separate INVALID outcome is gone. The same capture shows a 206 for a range covering the whole object (bytes=-15 and bytes=0-100 of 10 bytes) carrying the object's checksum, which Floci left out of every ranged response. The User Guide's "Checking object integrity" has GetObject and HeadObject return a part's checksum for "a part number or byte range that aligns with a single part", and an object stored in one request, or completed from one part, is that part. Such a range now gets the stored checksum, from GetObject and HeadObject, when the request asks for checksums and the checksum is a full-object one. A composite checksum is not that of any one part, nor is a checksum of an object of several parts, so their ranges still get none. |
||
|
|
013a9214b5 |
fix(s3): answer an expired session with ExpiredToken when verifying signatures (#5435)
When S3 verified a signature, it answered a request signed with temporary credentials past their expiry as if the key did not exist: 403 InvalidAccessKeyId for a header-signed request, and 403 SignatureDoesNotMatch for a presigned POST and, under validate-signatures alone, for a presigned URL. S3's error list has 400 ExpiredToken, "The provided token has expired.", for an expired token, and IAM enforcement already answers S3 with it. The secret-key lookup finds nothing for an expired session, so when it comes back empty the three placements (header, presigned URL, presigned POST) now ask IamService whether the key and token belong to a session that has expired on its clock and is still stored, and answer 400 ExpiredToken if so. The token has to match. Sent with another token or none, an expired session is still answered as a key that is not registered, so a caller that does not hold the credential learns nothing about it. Once Floci has removed an expired session it no longer knows the key, as with enforcement. IamServiceTest moves a session past its expiry and checks that the new lookup answers only to the session's own token, and the boundary test now holds it to the same instant as the other lookups. S3ValidateSignaturesIntegrationTest signs with Sign-In credentials through a header, a presigned URL and a presigned POST: each is accepted until the clock passes their expiry, then answered 400 ExpiredToken. An expired session sent with another token still gets InvalidAccessKeyId. Each placement's test fails without its part of the change, and the token tests fail when the token is not checked. S3RequestSigner can now write a presigned URL's query string, so the presigned URL test signs the way an SDK presigner does. |
||
|
|
d884d55c26 |
fix(iam): evaluate every IAM action against the resource it acts on (#5404)
Under enforcement, almost every IAM action reached the policy evaluator with
* as its resource, because ResourceArnBuilder named only the server-certificate
operations and everything else fell through to the wildcard. A statement naming
an IAM resource was therefore ignored, and wrongly in both directions, because
the evaluator globs the statement's pattern against the request's resource and
a resource of * is matched as that literal string. So a Deny on
arn:aws:iam::000000000000:user/bob did not stop DeleteUser for bob, while an
Allow scoped to that same user did not permit DeleteUser on anyone at all: a
least-privilege policy naming the resource it meant to grant refused the call.
Measured both ways by reverting this resolver to the wildcard, which turns the
permitted call in aResourceScopedAllowGrantsThatUserOnly into a 403 and the
refused call in aDenyNamingOneUserLeavesTheOthersAlone into a 200. Nothing
failed and nothing warned, which is the dangerous shape for an emulator people
test policies against.
The resource type each action is evaluated against now comes from AWS's own
authorization metadata for IAM, action by action. That is not the parameter an
action happens to take: AddUserToGroup and RemoveUserFromGroup are evaluated
against the group, AddRoleToInstanceProfile and RemoveRoleFromInstanceProfile
against the instance profile, and EnableMFADevice, DeactivateMFADevice and
ResyncMFADevice against the user rather than the device they name. Mapping those
from the request's parameters would have scoped them to the wrong resource and
let a deny on the right one pass.
An action acting on a resource that exists is checked against that resource's
stored ARN. The reference gives the formats as user/${UserNameWithPath},
group/${GroupNameWithPath} and so on, so the path is part of the ARN a policy
names, and only the store knows it; the stored ARN also carries the partition
the resource was created in, which re-minting from the caller's signing region
would get wrong. A create has nothing stored, so its ARN is minted from the
request's own Path: reading a stored path there would authorize a create into
/team/ against the root path.
A policy, MFA device, SAML provider, OIDC provider or principal is named by an
ARN the request already carries, so that is passed through rather than rebuilt
from parts. Only an ARN is: a hardware MFA device's SerialNumber is a bare
serial, and naming the request after it would produce a resource no policy could
be written against.
That table is read before the one keyed by resource type, so an action in both
would silently take its ARN parameter and the mistake would look like a resource
that never matches rather than like a bug. An attach is the case that makes it
worth pinning down: it carries both a user and a policy ARN, and the reference
gives it the user alone, so it stays out of that table and
iamNamesTheUserRatherThanThePolicyOnAnAttach is what holds it there.
UpdateUser and UpdateGroup join UpdateServerCertificate in naming both the old
resource and the one the request would produce. Both are documented, which the
certificate case was not: UpdateUser's reference says the requester "must have
appropriate permissions on both the source object and the target object", and
UpdateGroup's that a principal allowed to update the old group but not the new
one has the update fail.
Two actions name their role indirectly and are derived rather than looked up.
CreateServiceLinkedRole does not name the role it creates, so the check reads
the same ServiceLinkedRoles table the create reads and cannot name a different
role. GetServiceLinkedRoleDeletionStatus carries only a DeletionTaskId, and its
reference publishes that identifier's format as
task/aws-service-role/<service-principal-name>/<role-name>/<task-uuid>, which is
the role's own path and name with a prefix in front and a uuid behind; the role
is already deleted by the time the status is asked for, so there is no stored ARN
left to read either way. The /aws-service-role/ path moved to that class, so there is one copy of
it rather than a second in the builder. GetAccessKeyLastUsed names only a key,
and is evaluated against a user: the User Guide's own iam:*AccessKey* example
scopes exactly that set to user/${aws:username}, so the owner is resolved from
the key.
That covers all 130 of the IAM actions this emulator dispatches that AWS gives a
resource type, out of 164 in total. The remaining 34 have no resource type in the
reference, such as ListUsers, GetAccountSummary and SimulateCustomPolicy, so *
is the right answer for them. An action that names its target only by defaulting
to the calling user, such as GetUser or ChangePassword with no UserName, is
resolved from the credential instead, which the last paragraph here sets out.
Nine enforcement tests drive the whole path rather than the ARN the builder
returns, since the defect was invisible: a scoped statement was ignored, not
rejected. They cover a deny that must bind to one user and leave another alone,
the stored path being part of the ARN, the group and the instance profile being
the resource where two entities are named, a managed policy named by ARN, a
create authorized against the path it asks for, a rename refused on its
destination alone, and a scoped Allow granting one user only. Reverting the
mapping to the wildcard fails all nine.
The map is vendored rather than written out here, because a hand-written copy of
AWS's metadata is exactly what tools/aws exists to prevent.
regen_iam_action_resources.py generates src/main/resources/aws/iam-action-resources.json
from the same reference, 190 actions with the resource types each is authorized
against plus the ARN format of all 15 resource types, and it gates the file the
way regen_service_namespaces.py gates the namespace list: --check offline for
shape, --verify online against AWS. A type the file claims and AWS does not fails,
since that would authorize against a resource AWS does not use, which is the one
outcome worse than the wildcard. A type or an action AWS has added is reported
without failing, because being behind leaves that action on * and failing there
would break this build for someone else's launch. make
iam-action-resources-check runs per pull request beside the namespace check, and
make iam-action-resources-verify weekly in the drift workflow. Its unit tests need
no step of their own: make aws-data-test in that same job already runs every
generator's.
So no list of actions is written down here. What stays in code is the half that is
Floci's rather than AWS's: the parameter each resource type arrives in, the nine
creates and the name each spells, the actions whose request carries an ARN, the
three resolved from something other than a name, and the three resource types
that belong only to actions the handler does not dispatch. IamActionResourcesTest
checks the code against the data: every resource type AWS uses must be resolved
or declared unresolved, every create must have exactly one type to mint, and
every minted prefix must match the ARN format AWS publishes for that type. A
regeneration that brings in a new resource type then fails a test naming the
type, rather than quietly putting that action back on *, which is the permissive
answer and a silent one. The create check reads the resolver's own map rather
than restating it, so a create added there is checked too, and the minting falls
back to the wildcard instead of indexing an empty list: a create AWS authorizes
against no single type has no ARN to build, and a request should not fail on
what is a defect in this class.
The reason each declared-unresolved type gives is a claim about the handler, not
about the builder, so nothing inside the builder can check it, and getting it
wrong is silent and fail-open: dispatching such an action without teaching the
resolver its type leaves it evaluated against *, which is the gap this closes.
UnresolvedResourceTypesIntegrationTest therefore sends every action carrying one
of those types and holds it to answering UnsupportedOperation, naming the action
and what to do if it no longer does. No other vendored-data loader validates at class init
either, so the checks read the data the way AwsPartitions and
AwsServiceNamespaces do: parse, and let the gate and the tests have the opinion.
The nineteen user actions whose UserName the model marks optional act on the
user who signed the request, so that user is the resource they resolve to. The
access key id in the credential names the identity, which is the same lookup
GetAccessKeyLastUsed already makes on a key passed as a parameter, and the
stored ARN carries the path and partition as everywhere else here. The wildcard
still stands when the signer is not an IAM user, an account's root stand-in and
a session credential having no user record to name.
What stays at the wildcard is what AWS gives no resource type, 34 of the 164.
Closes #4979
The online gate verifies the ARN formats as well as the action mapping. A format
drifts invisibly otherwise: the offline check only asks whether it still looks
like an IAM ARN, and a changed one does, while the minting reads that string to
place the resource type. So a right-looking file could build a wrong ARN.
The resource types this class covers are worked out from its own tables rather
than restated in the test, so a type cannot be waved through by adding it to a
list in the test file. That is the check the earlier startup guard made.
The three actions whose resource the request carries in some other form hold
their own resolver, rather than being listed in one place and routed by name in
another. A list cannot then say an action is handled while the dispatch has
nothing for it, since adding a key means supplying the resolver that goes with
it.
The enforcement suite removes what it creates. The emulator is shared, so a user,
group, role, profile, policy or provider left behind turns up in the next class
to list one, and the shared fixture helper grew the prerequisites IAM enforces
before a delete: group memberships and attached policies for a user, inline and
managed policies for a role and a group. A rename leaves its destination name
behind rather than the name that was created, and the create test goes through
the enforced path, so both register their own removal.
The drift workflow stays one check, and make iam-data-verify is what keeps that
honest. Two sequential steps stop at the first failure: while the namespace list
was stale, the action resource check this change adds never ran at all, so the
gate arrived unexercised in CI. The target runs both regardless of the first
result and then fails, naming the file that drifted rather than leaving a reader
to guess from one message. The workflow file is renamed to match what it covers,
and the IAM targets it uses join .PHONY, which they should have done when they
were added.
That namespace check was red because AWS retired evidently and iotevents, and
the vendored list still claimed both. Regenerating it drops those two, picks up
end-user-messaging and startups, and leaves the count at 456. A retired
namespace only narrows wildcard expansion; a policy naming one literally is
still reported, since a namespace written out is kept whether or not the catalog
knows it.
|
||
|
|
9a7ec1c9d0 |
fix(dynamodb): mark time-to-live deletions on the stream as AWS does (#4930)
AWS writes a TTL deletion to the table's stream as a REMOVE record whose
userIdentity names the DynamoDB service. A DeleteItem removal has none.
The member names depend on where the record is read:
- The DynamoDB Streams API (GetRecords) capitalises them, as the SDK's
Identity shape expects:
{"PrincipalId": "dynamodb.amazonaws.com", "Type": "Service"}.
- The Lambda and EventBridge Pipes event record and the Kinesis Data
Streams destination payload use lowercase names,
{"type": "Service", "principalId": "dynamodb.amazonaws.com"}, the
shape the developer guide's TTL filter pattern matches.
With the DynamoDB Local engine, Floci passed Local's record through as
is: eventName UNKNOWN_TO_SDK_VERSION and no userIdentity.
DynamoDbLocalBackend now rewrites such records in a successful Streams
GetRecords reply to REMOVE with the Streams API identity, the one place
the public API, the Lambda poller, Pipes and the Redshift zero-ETL
consumer all read through.
The native engine wrote REMOVE but no identity, so a TTL deletion could
not be told from a DeleteItem. The sweep now marks its stream records
(a new in-memory DynamoDbStreamRecord flag) and its Kinesis CDC records.
GetRecords writes the Streams API identity, and the Kinesis record the
lowercase one.
The Lambda event source mapping poller and the Pipes poller rename the
Streams API identity to the event record shape before filtering and
delivery. DynamoDbTtlIdentity.Shape holds the member names of every
output. DeleteItem removals are unchanged.
|
||
|
|
04621d8444 |
fix(apigatewayv2): honor payload format 1.0 (#5338)
* fix(apigatewayv2): honor payload format 1.0 * fix(apigatewayv2): preserve v1 stage variables * fix(apigatewayv2): preserve v1 authorization header * docs(apigateway): document v1 IAM identity context |
||
|
|
80e8b7465d |
fix(ec2): preserve endpoint IP types across updates and templates (#5438)
* fix(ec2): preserve endpoint IP types across updates and templates * fix(ec2): honor omitted endpoint address types in templates |
||
|
|
f4bce30269 |
fix(ec2): preserve original user-data bytes in instance metadata (#5437)
* fix(ec2): preserve original user-data bytes in instance metadata * fix(ec2): recover malformed saved user data |
||
|
|
bac2c7cbf9 |
feat(elasticache): add serverless cache APIs (#5366)
* feat(elasticache): add serverless cache APIs Add CreateServerlessCache, DescribeServerlessCaches, ModifyServerlessCache and DeleteServerlessCache over the Query protocol. Each cache is backed by a hidden cluster that the ordinary cluster APIs do not list, with its own user-group authentication path in the proxy. * fix(elasticache): sua loi container rollback, validation tag, leak log stream va npipe hang - Thu hoi container va storage khi tao Memcached provisioning that bai - Format thong bao loi deleteCacheCluster chua cluster id - Validate tag key trong CreateServerlessCache khi co tag value - Chuan hoa case-insensitive cho userGroupId va region key cho nhom attachment - Giai phong dung logStream khi stop container trong ElastiCache va Memcached container manager - Tat validateAfterInactivity tren npipe trong FlociDockerHttpClient de tranh deadlock tren Windows * fix(elasticache): release serverless backing on reset and make delete and list tolerant - release backing clusters and user group attachments in clear() - let DeleteServerlessCache be retried after the backing cluster is already gone - keep DescribeServerlessCaches working when one cache has lost its backing - drop the unused replaceTags and document that tags are create-only * fix(core): drop the named-pipe stale-connection change, #5400 makes it |
||
|
|
47d1e10e5c |
fix(ec2): preserve VPC endpoint IP address types (#5427)
* fix(ec2): preserve SDK endpoint compatibility Return endpoint states that AWS SDK clients recognize and preserve the requested address family, so endpoint create and describe responses round-trip correctly. Keep documented state-filter values working. * fix(ec2): preserve saved endpoint states and reject invalid IP types * fix(ec2): reject unsupported endpoint IP types safely * fix(ec2): retain endpoint states and address-type metadata --------- Co-authored-by: Jason van Zyl <jason@vanzyl.ca> |
||
|
|
98100054a8 |
feat(core): make the Docker call timeout configurable (#5431)
* feat(core): make the Docker call timeout configurable Ordinary Docker calls failed after a hard-coded five minutes without a response. floci.docker.api-timeout-seconds (FLOCI_DOCKER_API_TIMEOUT_SECONDS) now sets it for both pools, defaulting to 300 so nothing changes by default; a shorter value bounds how long a hung daemon can hold a request. Like the connection request timeout, it must be at least 1, because httpclient5 reads 0 as no limit. Long-lived streams (container waits, exec and attach output, followed logs, streamed stats, events, image pulls and builds) stay exempt. Signed-off-by: Hector Ventura <hectorvent@gmail.com> * docs(core): say the Docker call timeout applies to each attempt The control-plane pool retries a request that is safe to repeat up to six times, and a response timeout is one of the failures it retries. The docs, the config Javadoc and the application.yml comment said the setting bounds a request; it bounds each attempt, so a silent daemon can hold a replayable request for about six times the limit, plus backoff. Signed-off-by: Hector Ventura <hectorvent@gmail.com> --------- Signed-off-by: Hector Ventura <hectorvent@gmail.com> |
||
|
|
61fe304619 |
feat(cloudformation): provision CloudFront public keys, key groups and functions (#5390)
* fix(cloudfront): reject CreateFunction when the name already exists * feat(cloudformation): provision CloudFront public keys, key groups and functions * fix(cloudformation): validate CloudFront function properties and always drop its tags on delete * fix(cloudformation): require the CloudFront function comment and reuse resolveOptional |
||
|
|
ff20750d91 |
fix(cloudfront): serve viewer Range GETs (#5377)
A distribution ignored a viewer's Range header: an S3 origin answered every GET with the whole object and 200, while advertising Accept-Ranges: bytes, and a custom origin behind a cache or origin request policy never saw the header, so seeking in a video or resuming a download read the object from the start. An S3 origin now serves the one byte range asked for as 206 with its Content-Range, read from the snapshot GetObject serves, and answers 416 when the range starts past the end of the object. Any other Range gets the whole object, as CloudFront answers a Range it does not accept and as S3 does not serve several ranges in one request. A custom origin gets the viewer's Range and If-Range on every GET or HEAD with a Range whatever the forwarding settings, as CloudFront forwards a range GET to the origin and a HEAD can then report the range's length, and its answer is passed on. A custom error page is served whole. A Range now applies only while the If-Range sent with it, if any, still describes the object: a strong ETag equal to the object's, or an HTTP-date equal to its Last-Modified, matched exactly as RFC 9110 section 13.1.5 requires. Otherwise the whole object is served. This holds for GetObject, HeadObject and the S3 origin. A presigned URL that signs Range must also sign an If-Range the request carries, as the S3 User Guide requires. HeadObject honors Range as the API Reference describes: a satisfiable range sets Content-Length to the length of the range, leaving out the whole-object checksum as a ranged GetObject does, and one past the end answers 416, while a Range that is not one valid range is ignored, as before. An S3 origin answers a HEAD the same way. A ranged GetObject is now recorded in CloudTrail like any other, with the bytes of the range sent, and a range past the end of the object, for GetObject or HeadObject, is recorded as InvalidRange. The range parsing GetObject did is now ByteRange, which both use, and UploadPartCopy's range stream becomes ByteRangeInputStream. GetObject now matches the range unit in any case, as RFC 9110 section 14.1 has it, and its InvalidRange error is the one S3 sends, as an AWS-validated LocalStack capture records it: the message "The requested range is not satisfiable", with no trailing period, and the RangeRequested and ActualObjectSize fields. |
||
|
|
b2b083ee91 |
fix(iam): validate RoleName in every role action (#5391)
Every action whose RoleName is roleNameType now answers a bad name with ValidationError instead of NoSuchEntity, as CreateRole does. Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com> |
||
|
|
58ac05433a |
fix(ses): return Easy DKIM signing hosted zone (#5068)
* fix(ses): expose DKIM signing hosted zone * fix(ses): keep DKIM signing hosted zone constant * fix(ses): align signing zone tests with review |
||
|
|
fb202cce6a |
fix(eks): accept a role ARN from another partition the way STS does (#5398)
* fix(eks): accept a role ARN from another partition the way STS does An account keeps one IAM namespace whichever partition a request is for (partitions.md, Known gaps). STS AssumeRole already resolved a role ARN from another partition to the account's role, while EKS Pod Identity and add-ons required the cluster's partition and an exact stored-ARN match. Move the STS role-ARN matcher to IamService.roleArnMatches and use it for the Pod Identity roleArn and the add-on role ARNs; targetRoleArn accepts any well-formed partition. The Pod Identity session names the stored role's ARN, as an STS session does. The EKS model sets no pattern on roleArn or targetRoleArn. * fix(eks): keep a role recreated under another path out of a pod identity session The credentials endpoint finds the association's role by name only. Since the session started naming the stored role's ARN, a role deleted and recreated under another path gave the session its ARN and role id through the old association. The found role now has to match the association's role ARN the way roleArnMatches does everywhere else; one that does not is treated as absent, as before this branch. The association test also checks that a rejected role update leaves the stored role ARN as it was. * fix(eks): refuse pod identity credentials when the association's role is gone EKS Auth assumes the association's role through STS, so a role that no longer exists gets no credentials. The endpoint still issued them, and since enforcement loads a session's policies by role name, a pod whose role was recreated under another path ran with the replacement's policies. A role that is missing, or that does not match the association's role ARN, is now a 400 AccessDeniedException and no session is registered. |
||
|
|
1082941bc2 |
feat(iot): search the supported fleet index subset (#4913)
Floci served the fleet indexing configuration but not SearchIndex, so an application that finds its things by name, type, group or attribute got "Unknown operation: POST /indices/search". SearchIndex now runs on POST /indices/search over the things of the caller's account and region, in thing name order. Its page token names the last thing returned, so a page continues after it even when things before it were deleted, as measured on AWS. Like AWS's, a token continues only the request that issued it: another queryString, or an indexName or queryVersion sent differently, is "nextToken was from a request with different parameters", and an empty, forged, edited or truncated token is "Invalid nextToken". A new parser, IotFleetIndexQuery, evaluates field:value terms with case-insensitive values, case-sensitive field names, * and ? wildcards, existence and match-all, quoted values, AND, OR and NOT with their symbolic forms, leading - negation and parentheses. Precedence is the one measured on AWS, where whitespace is an AND that binds looser than OR. The fields are thingName, thingId, thingTypeName, thingGroupNames and attributes.*. Requests are validated with the messages and in the order measured on AWS: a body that is not a JSON object and every member type, member constraints, index name, query version, a disabled index, the query, then the page token. Within the query a syntax error comes first, then the 12-term limit, in which each value of a field group counts and the field does not, then the first other error, where the field of a group is checked like any other field. A range counts as one term, and a malformed range or an unescaped bracket outside one is a syntax error. AWS's limits hold: a queryString of at most 1000 characters, at most 12 terms, at most two * wildcards in a value and no value starting with ?. maxResults takes any number, truncated toward zero and capped at the int range as on AWS. A classic shadow field needs REGISTRY_AND_SHADOW indexing, and a named shadow field named shadow indexing and a shadow in its filter, or it is AWS's invalid field name. Constructs AWS accepts but Floci does not evaluate, such as ranges, comparisons, free text, field grouping and shadow or Device Defender fields, are refused with InvalidQueryException instead of matching nothing, and so is a search of AWS_ThingGroups. Connectivity fields are refused like shadow and Device Defender fields: AWS's InvalidRequestException while connectivity indexing is off, InvalidQueryException once it is on. Documents leave out the members a thing lacks and never carry a shadow or a connectivity member, where AWS adds connectivity while connectivity indexing is on. |
||
|
|
2015d01864 |
fix(appconfig): support deleting environments (#5337)
* fix(appconfig): support deleting environments * fix(appconfig): cascade environment deletion * fix(appconfig): preserve deployment numbering * fix(appconfig): resolve delete identifiers |
||
|
|
c6068e8cf5 |
chore(iam): generate the managed-policy catalog from iam-dataset (#5403)
* chore(iam): generate the managed-policy catalog from iam-dataset The three managed-policy resources were hand-seeded in #2194, #3237 and #3275, so nothing noticed when AWS added or revised a policy. tools/aws/ regen_managed_policies.py now rebuilds them from the local/aws/iam-dataset checkout: names, paths, versions and update dates from aws/managed_policies.json, documents from aws/managedpolicies/. Deprecated policies leave the catalog except AWSLambdaFullAccess, which #2194 kept on purpose. createDate (from the AWS managed policy reference pages) and the curated descriptions are not in the dataset and are carried over. It joins make aws-data-sync and aws-data-check. CI has no iam-dataset, so there the check verifies the three files agree and keep their shape, the way regen_region_facts.py handles its missing corpus. This commit changes no data; only the catalog header gains a generated-by line. The files were taken from three dataset days, and the generator reproduces each from its own: the names from 2026-08-12 (f18cb038), the versions from 2026-09-08 (a52abe16), and the documents from 2026-09-08 too, except AWSCodeStarServiceRole, which matches 2026-09-07 (1c729479). * chore(iam): refresh the managed-policy catalog from iam-dataset 2026-09-19 make aws-data-sync against the local/aws/iam-dataset checkout (72d2a4f62, 2026-09-19). Catalog 1566 -> 1578 policies: - 12 added: AIDevOpsChannelAccessPolicy, AIDevOpsReleaseManagementVPCPolicy, AWSWellArchitectedAgentOrganizationsServiceRolePolicy, AmazonBioDiscoveryFullAccess, AmazonBioDiscoveryInAppFullAccess, AmazonODBAutonomousDatabaseAdmin, AmazonODBExadataVmClusterAdmin, AmazonODBExascaleStorageVaultAdmin, AmazonODBExascaleVmClusterAdmin, AmazonSageMakerHyperPodInferenceGatewayAccess, AssuranceServiceRolePolicy, NetworkSecurityManagerServiceRolePolicy. All are on v1, so their createDate is the dataset's date. - 0 removed. - 22 changed: 21 moved to a new default version with a new document and update date (among them ReadOnlyAccess and SecurityAudit), and AWSCodeStarServiceRole kept v12 but took the document and update date the dataset recorded on 2026-09-08. No path or description changed, and the service-linked role table still matches the documents (make slr-check). * chore(iam): make the managed-policy generator's date fetch and offline check stricter --fetch-create-dates now reads the reference page of every policy past v1 that has no creation date, not only of policies new to the catalog, so a policy first vendored without the flag can be dated by a later run. A page that cannot be read leaves that one policy undated with a warning instead of ending the run with nothing written. The offline check compares the catalog with a re-render of its parsed entries, so content outside the generated header and policy entries fails it instead of passing unnoticed. * chore(iam): refresh the managed-policy catalog from iam-dataset 2026-10-09 The dataset moved after the first refresh. Regenerated against 2244bd78a (2026-10-09) with --fetch-create-dates. Catalog 1578 -> 1586 policies: - 11 added. Ten are on v1 and take the dataset's date; AWSCloudWatchOmniServiceRolePolicy is on v2 and takes its creation date from its reference page. - 3 removed: the CloudWatch Evidently policies, which the dataset now marks deprecated. - 45 moved to a new default version, among them SecurityAudit (v94) and ReadOnlyAccess (v190). The generated header said createDate falls back to the dataset's date for a policy with no reference page. It does so only for a policy that entered the catalog on v1; one past v1 stays undated, and the header now says so. AWSConfigRole is still the only policy without a creation date. |
||
|
|
a1f90453fb |
fix(apigateway): refuse EDGE REST APIs outside the commercial partition (#5397)
Edge-optimized endpoints exist only in the commercial partition. CreateRestApi and an UpdateRestApi switch of /endpointConfiguration/types now run the same check custom domains already use, so an EDGE REST API in China, GovCloud, ISO or EUSC is a BadRequestException. REGIONAL APIs, and a move away from EDGE, are still accepted everywhere. |
||
|
|
475d230ebc |
feat(cloudformation): provision ElastiCache cache clusters and subnet groups (#5307)
* feat(cloudformation): provision ElastiCache cache clusters and subnet groups Add AWS::ElastiCache::CacheCluster and AWS::ElastiCache::SubnetGroup provisioners with Ref, Fn::GetAtt endpoint attributes, create-only replacement and update handling. Subnet group updates now carry tags through modifyCacheSubnetGroup, and Memcached clusters record their network type. * fix(elasticache): validate cluster name, rollback subnet groups and preserve memcached tags * fix(elasticache): align in-use error wire code and enforce schema required properties |
||
|
|
141fd747ee |
feat(redshift-serverless): add usage limit actions (#5378)
* feat(redshift-serverless): add usage limit actions Add CreateUsageLimit, GetUsageLimit, ListUsageLimits, UpdateUsageLimit and DeleteUsageLimit, following the botocore redshift-serverless model. Usage limits are stored and echoed, not enforced: Floci does not meter RPU consumption, so breachAction never fires. A limit belongs to a workgroup, at most one per usageType, and disappears with it. The service checks the workgroup on read instead of hooking deleteWorkgroup, so deletes through CloudFormation are covered too. * fix(redshift-serverless): reject malformed usage limit members and purge stale limits on read - Usage limit string members of another JSON type (a numeric period, breachAction, resourceArn, usageType, usageLimitId or nextToken) were read as absent, so a create took the defaults, an update ignored the action and a list dropped its filter. They are now a ValidationException. - maxResults accepted fractional and out-of-range numbers and truncated them. It must be an integer that fits an int. - GetUsageLimit and the other id lookups answered 404 for a limit whose workgroup was gone but left the record in storage; they now delete it. - Listing checked every limit with a full workgroup scan. It now takes one snapshot of the Region's workgroup ARNs per scan. - Add a paging test that deletes the limit behind the nextToken. * fix(redshift-serverless): permit multiple usage limits per type and return 400 on missing resources - Remove the one-limit-per-usageType check on CreateUsageLimit so a workgroup can have multiple limits for the same usage type with different periods (e.g. daily and monthly serverless-compute). - Align ResourceNotFoundException on usage limit actions with the AWS Redshift Serverless API specification by returning HTTP 400 instead of 404. - Update documentation and test assertions accordingly. |
||
|
|
8b83892dff |
fix(eks): mirror the cluster's own region and account in the registry config (#5399)
The k3s registries.yaml listed the default account across the regions of the deployment's partition, so a cluster in another account, or in a region of another partition served by the same process, could not pull from Floci's ECR through its own repository hostnames. Build the mirror from the cluster's account (then the default account) across every region of the cluster's partition. A commercial cluster in the default account gets the same file as before. |
||
|
|
3ff5529fad |
feat(codeartifact): add PutPackageOriginConfiguration (#5381)
Sets a package's publish/upstream origin-control restrictions, matching AWS's documented behavior that this operation can create the package (with no versions) when it doesn't exist yet, so a caller can lock a package down before anything is ever published to it. DescribePackage now reflects a stored configuration instead of the fixed ALLOW/BLOCK defaults it previously always returned, and PublishPackageVersion rejects a publish with ConflictException once a package's origin configuration sets publish to BLOCK, the one publish path this operation can actually gate since PublishPackageVersion only ever accepts the generic format. Maven/npm/pypi publish through their own native wire protocols and are not yet gated by this setting, documented as a known limitation. The format/namespace coordinate validation shared with DescribePackage is extracted into one helper instead of being duplicated a second time. clear() (the Resettable reset path) now also clears the new store; it previously left an origin-config-only package (no versions) visible to DescribePackage after a reset that wiped everything else. DescribePackage's existence check for an origin-config-only package now short-circuits before the sidecar/generic check runs at all: for a container-backed format that check would otherwise start the real Maven/npm/pypi sidecar container just to answer a describe for a package nothing was ever actually published to. DeletePackage now agrees with DescribePackage on all of this instead of drifting from it. Its deletedPackage.originConfiguration reports the restrictions that were actually stored, not a hard-coded ALLOW/BLOCK; it clears the stored configuration as part of the delete, so a deleted package cannot resurrect as a zero-version one on the next DescribePackage; and it now recognizes an origin-config-only package (no version ever published) as something it can delete, rather than 404ing on a package DescribePackage itself reports as existing. DeletePackage's own namespace/format validation, previously a second inline copy of the same rules, now goes through the shared helper too. A rejected PutPackageOriginConfiguration now also has a test asserting an invalid/missing upstream value alone is rejected (the prior tests only exercised publish) and that a rejection, on either a package that didn't exist yet or one with a prior configuration, changes nothing. deleteRepository now also removes any packageOriginConfigs entries under that repository: unlike sidecarContainerIds, which already gets a fresh id on every creation specifically so a repository recreated under the same name never inherits the previous one's sidecar content, packageOriginConfigs was keyed purely by name, so a recreated repository would otherwise inherit a prior package's restrictions, including a publish:BLOCK the new repository's owner never set. |
||
|
|
47dae887f9 |
fix(lambda): list $LATEST first, then versions in numeric order (#5376)
Sort stored versions numerically so ListVersionsByFunction is stable and matches AWS. * Fix #5121 Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com> |
||
|
|
517409a7aa |
fix(cloudcontrol): bound the worker queue and reject overflow (#4479)
Replace the unbounded fixed thread pool with a bounded worker queue, sized by floci.services.cloudcontrol.create-worker-threads (default 4) and create-queue-capacity (default 64). These are Floci limits, not AWS quotas. A new CreateResource past them is refused with ThrottlingException, HTTP 400, which is the status the Cloud Control API reference gives it on CreateResource and in Common Errors. The pending token is dropped so it is not left unfulfillable. Startup replay of persisted CREATE requests does not apply that bound. When the worker queue is full, an already-accepted request is parked and handed to the executor by a daemon drainer once a slot frees, instead of blocking the request that constructs Cloud Control until a provisioning task finishes. Shutdown interrupts the drainer; parked requests stay persisted and replay on the next start. A create that fails while Cloud Control is shutting down is no longer recorded as FAILED. Shutdown interrupts in-flight provisioning, so the failure is the shutdown's: the request stays IN_PROGRESS and replays on the next start, like the queued and parked ones. Worker threads are now numbered. Narrow the persisted-state parse catch so a submission failure is no longer misreported as invalid JSON. Document the limit and both settings. |
||
|
|
8502565287 |
fix(ec2): serve IMDS instance identity credentials (#5289)
Adds identity-credentials/ec2/info, ec2-instance credentials and listings. * Fix #5264 Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com> |
||
|
|
cb673802e0 |
fix(iam): validate RoleName in CreateRole (#5374)
Follow-up to #5289. Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com> |
||
|
|
477e3ef813 |
fix(iam): make the server certificate reference check atomic with the write (#5368)
DeleteServerCertificate checked the reference providers under its own lock, while a referring service validated the certificate and then saved the resource naming it. Nothing tied the two together, so a delete running between the check and the write saw no reference, removed the certificate, and left a live distribution or listener holding one that was gone. It reproduced in 233 of 400 trials. CloudFront and ELB Classic now perform that check and the write while holding the lock the delete takes, so only the two sensible orders remain: the delete loses and answers DeleteConflict, or it wins and the create is refused. The ordering runs one way only. deleteServerCertificate holds the lock while calling serverCertificateReferences() on each provider, and those are plain reads over the provider's own store that take no provider monitor, so IAM never waits on a provider while a provider waits on IAM. ELBv2 is untouched: it never validates certificate references, so a listener there can name a certificate that was never present, which is a separate gap. Removing a listener needs a lock too, for a different reason than adding one. deleteLoadBalancerListeners removed from the listener list with no lock at all, while the certificate delete walked that same ArrayList, and a structural change to a list being walked ends the walk in ConcurrentModificationException. No mapper covers that, so DeleteServerCertificate answered an unmapped 500 rather than 200 or DeleteConflict. A probe calling the scan exactly as the delete does, against a loop of listener removals, hit it within two seconds. That one is the list's problem rather than the lock's, so the listeners are held in a CopyOnWriteArrayList, as Stack.events and IamUser.groupNames already are, and the walk reads a snapshot of it. Removal then takes only this service's own monitor, which the add shares so that a removal cannot land between the add's look at the port and its decision, and a certificate delete no longer waits on either. A unit test runs the scan against a loop of listener writes: with a plain list it ends in ConcurrentModificationException inside a second, which is how the probe became a test. The two race tests keep their own fixtures and read their own failures. Each trial's certificate, and its load balancer or distribution, now come back out in a finally, so a trial that fails part way through leaves nothing behind in the application the other test classes share, which matters against a 20 certificate quota. The racing tasks' futures are read as well: each catches the AwsException its order expects, and anything else used to stay in the future, leaving the trial looking like the other order had won and the test passing green without the race ever having run. The load balancer name check moves inside the guard too. It was made before the write and nowhere else, so two creates of one name both passed it and both committed, and the first caller was told it had succeeded while holding a load balancer that had been replaced. The check above the guard stays as the fail-fast that keeps AWS's error precedence. Reverting the inner one has the new test report two winners where there should be one. That also showed the guard was not always a lock. Built without IAM, which is how this service's unit tests build it, it ran the action with nothing held, so a re-check there would have been worth no more than the first check. The name is settled by putIfAbsent instead, which holds whether or not IAM is present and needs no lock to carry it. Neither service takes the lock for a write that cannot record an IAM certificate. A distribution that names none, a listener with no certificate or one served by ACM, and a listener removal cannot leave a resource holding a deleted certificate, and the delete reads a copy of the distribution store and a snapshot of each listener list, so an unguarded write cannot disturb its walk either. Holding it for every write would instead have an unrelated load balancer, zone or health check write delay a certificate delete, and the other way round. The race tests stop accepting any AwsException as an order. Each task swallows only the code its own order produces, InvalidViewerCertificate for the create and DeleteConflict for the delete, and rethrows the rest into the future the trial now reads. The load balancer trials record both statuses, and the run asserts every one resolved as one order winning with the other told why, since two failures would otherwise pass as a clean trial with the race untested. The doc paragraph for this behaviour claimed the DeleteConflict refusal was what AWS does, and nothing sources that. DeleteConflict is modeled on the operation, but the API Reference describes it only as attached subordinate entities without saying what counts as one for a certificate, and the operation's own page warns that if Elastic Load Balancing does not detect the deletion of a bound certificate it may continue to use it, which reads as the delete going through. The refusal stays, being the more useful answer to a caller than a dangling reference, and is now recorded as the intentional deviation it is. The ELBv2 note carries its evidence too: CertificateNotFound is modeled on CreateListener, ModifyListener and AddListenerCertificates, and none of the three checks anything. Closes #5087 |
||
|
|
46f9c23c8b |
fix(iam): refuse inactive keys and unreadable credentials in enforcement (#5346)
With enforcement on, three kinds of request got past the filter's
credential checks, and an expired session was answered as a key that
exists nowhere.
A deactivated access key could still be used. Account routing skips an
inactive key, so its requests landed in the default account. A key of a
user there kept that user's permissions, since resolveCallerContext
reads the user's policies whatever the key's status. A key of another
account matched no user in the default account, and isKnownAccessKey,
which counts every key in every account, let the request through as a
credential the filter could not map, with no policy check at all.
Deactivating a key of a user allowed nothing let it create IAM users
and mint session tokens. The IAM User Guide ("Manage access keys for
IAM users") says that once deactivated a key "can no longer be used by
API calls" until it is activated again.
An Authorization header the filter could not read a credential from made
it return before any check. That covered a header naming no access key
at all (a Bearer token, SigV2, a Credential without the SigV4 scheme or
with the key left out) and a SigV4 scope missing a part, such as its
aws4_request terminator. Any caller could make any call that way,
including the management calls an unsigned request is refused. Such a
request is now refused as AWS refuses a header it cannot read:
IncompleteSignature for Query services and IncompleteSignatureException
for JSON and CBOR ones (the common errors, and the IAM User Guide's
SigV4 troubleshooting section), and S3's AuthorizationHeaderMalformed
with the wording S3HeaderSignatureFilter already uses, all 400. A
presigned S3 URL sends no header, and S3 answers a mal-formed
X-Amz-Credential with AuthorizationQueryParametersError, so that is
what it gets. Otherwise the request is treated as an unsigned one is: an
operation AWS serves without credentials is left alone, and a REST
request is refused only when the header claims SigV4 and its route maps
to an action, since AppSync, CodeArtifact's package endpoints, Identity
Store's SCIM endpoint and API Gateway's authorizers take Bearer and
Basic tokens of their own. An empty header with nothing else to read is
refused the same way, not as a missing one; next to a presigned URL's
X-Amz-Credential it still defers to that credential. Where the guide
gives the message, the refusal uses it: "Authorization header cannot be
empty." and, for a SigV4 header with no Credential, "Authorization
header requires 'Credential' parameter.". The other shapes get the
common errors' "The request signature does not conform to AWS
standards.".
sts:GetCallerIdentity answered a key that exists nowhere, as the
default account's root, because its exemption ran before the
unknown-key check. The exemption is about permissions only, so the key
checks now run first.
An expired session was refused with InvalidClientTokenId or
UnrecognizedClientException, because resolveCallerContext deletes it and
the known-key check then finds nothing. The common errors of the IAM,
STS, EC2, SNS, CloudFormation, Lambda and Step Functions API references
give ExpiredTokenException, 403, "The security token included in the
request has expired", and S3's error list gives ExpiredToken, 400. The
filter now asks isExpiredSession before resolving the caller, so it no
longer deletes the session, and later uses get the same answer. Both
lookups are asked about one moment: read apart, a session expiring
between them would be deleted and answered as unknown, or on the
presigned POST path below allowed with no policy check. Once Floci's own
sweep has removed the session (the first presigned URL it generates in a
process runs one), the key reads as unknown again, as
docs/services/iam.md says.
The inactive-key, expired-session and unknown-key checks run before the
action is used, on every Query, JSON and CBOR call and on every REST
request whose route maps to an action. A REST request no rule maps is
left alone, as an unsigned one already is: the filter cannot tell it
from the API Gateway execute path, Lambda function URLs and the other
paths it sees that are unsigned by design, and the execute path answers
a bad AWS_IAM signature in its own shape. Every refusal to a CBOR call,
AccessDenied included, now arrives CBOR-encoded, where only the
unsigned-call refusal did before; the others were JSON bodies the client
could not read. AccessDenied keeps its 403, the status the Kinesis and
CloudWatch common errors give it. The filter's JSON errors are now
written from AwsErrorResponse, as AwsExceptionMapper writes every other
JSON error, rather than built as strings. That gives a REST JSON
refusal, such as Lambda's, the X-Amzn-Errortype header the rest of
Floci's REST JSON errors carry.
A presigned POST carries its credential in the form body, which the
filter never sees, so authorizeAdditionalResource is the only IAM check
it gets. That evaluated an inactive key with its user's policies, and
resolved an expired session, which deleted it. Both are now refused
there as the filter refuses them, before the caller is resolved:
InvalidAccessKeyId, 403, and ExpiredToken, 400. A key that exists
nowhere, or a credential that cannot be read, is still left to S3's own
presigned-POST check, and uploads as an unsigned request would when that
check is off. docs/services/iam.md now says so.
isKnownAccessKey keeps counting inactive keys: GetSessionToken relies
on it, so a session minted with an inactive key has no issuer rather
than acting as the account root. resolveCallerContext keeps returning
an inactive key's user policies rather than null, which AppSync and RDS
read as allowed; both verify the signature first, which an inactive key
fails. isInactiveAccessKey looks in the request's account before
scanning the others, since routing sends an active key to its own
account.
Integration tests cover a same-account and another account's inactive
key (including GetCallerIdentity, GetSessionToken, S3, a JSON service,
a presigned POST, and reactivation); an expired session on Query (asked
twice), JSON (with its X-Amzn-Errortype header), S3 and presigned POST
calls; an unreadable credential on Query (eight header shapes, none of
which creates the user), JSON, CBOR and S3 calls, on a presigned S3 URL,
and with the guide's two messages; the cases left alone (a Cognito flow
AWS serves without credentials, a Bearer token on S3, a REST route no
rule maps); an unknown key on GetCallerIdentity and on a CBOR call; and
AccessDenied on a CBOR call. Every refusal fails without this change.
IamServiceTest and IamEnforcementFilterTest check that the expiry check
and the caller lookup are asked about one moment. The SDK compatibility
suite's IamEnforcementTest adds a deactivated key, refused by STS and S3
with the codes the SDK reads and accepted again once activated.
docs/services/iam.md lists the cases in both enforcement tables and
under unsigned requests.
|
||
|
|
ceab47e785 |
feat(codeartifact): add DeletePackage for all package formats (#5320)
DeletePackage deletes a package and every one of its versions, matching PackageSummary's own field name (package, not name, confirmed against the API reference) in the deletedPackage response. A nonexistent package answers ResourceNotFoundException instead of silently succeeding. Existence and deletion go where the package actually lives: stored generic-format versions and their asset bytes for generic, and each format's sidecar for maven, npm, and pypi. Validates package and namespace shape, and requires or rejects a namespace per format, the same boundary describePackage already enforces, before touching repository or sidecar state. Synchronized like every other mutating method on this service, so a publish and a delete racing the same generic package cannot interleave. Within one generic version's own delete, its metadata record is removed before its asset bytes are cleaned up, so a cleanup failure on one asset can never leave a surviving record pointing at bytes that are now gone; the failure is logged and the rest of the package's assets still get cleaned up. Verdaccio and Reposilite can each remove a whole package in one call, confirmed against live containers: Verdaccio needs the packument's own _rev appended as npm's real unpublish protocol does (a bare DELETE with no revision is not a route at all), Reposilite removes everything under the group/artifact directory in a single DELETE. pypiserver has no single whole-package route, but its own management endpoint (POST / with :action=remove_pkg) does delete a named version for real, confirmed live against the pinned v2.4.2 image: every version is listed first through the same image's PyPI JSON API endpoint, then each file removed under its own, unnormalized name (an sdist and a wheel of the same release can legitimately differ there, so deleting by one shared name alone could silently leave the other file behind). RepositorySidecarManager.deletePackage's default still throws UnsupportedOperationException for a sidecar that genuinely cannot do this, and the service turns that into a documented InternalServerException rather than claiming a success it cannot back up or leaving an unhandled 500. |
||
|
|
f413a667d0 |
feat(iot): indexing configuration (#4896)
AWS IoT fleet indexing had no routes in Floci, so a stack or script
calling UpdateIndexingConfiguration or GetIndexingConfiguration failed
with "Unknown operation: POST /indexing/config", and there was no
stored configuration for a later SearchIndex to consult.
A new IotFleetIndexingService and IotFleetIndexingController, wired
into the iot descriptor beside the domain configuration controller,
serve UpdateIndexingConfiguration and GetIndexingConfiguration on
/indexing/config and DescribeIndex on /indices/{indexName}. There is
one configuration per account and region, kept through StorageFactory;
a region never updated reports the OFF shape AWS returns.
The behaviour follows what real AWS returned when measured: an update
that carries only one of the thing and thing group configurations
keeps the other, turning thing indexing OFF clears the whole thing
configuration, and managedFields are derived from the modes rather
than stored. Client sent managedFields are only checked against the
fields AWS manages and their types. Validation uses AWS's messages for
a missing configuration, null and out of set enum values (the modes,
field types, filter socket information and geolocation order),
secondary modes without thing indexing, named shadow indexing without
shadow names, unknown managed fields, and a thing custom field named
after a managed field. A geolocation sent without an order is stored
with LatLon, the default AWS returns. DescribeIndex returns the
schema the modes select and is ACTIVE at once, a disabled index is
ResourceNotFoundException and an unknown name InvalidRequestException.
Thing group managedFields are checked the same way, also while group
indexing is OFF, and neither group managedFields nor customFields are
stored. A member of the wrong JSON type is a SerializationException,
as on AWS. The fleet indexing, domain configuration and authorizer
controllers now share one strict body reader, so a malformed body or
content after it is a SerializationException on all three, which is
what AWS returns there.
ListIndices, SearchIndex and the statistics APIs are not modeled.
|
||
|
|
9f224d9de6 |
fix(core): verify SigV4 header signatures for every service under validate-signatures (#5268)
* fix(core): verify SigV4 header signatures for every service under validate-signatures FLOCI_AUTH_VALIDATE_SIGNATURES verified signatures for S3 only, so SQS, KMS, IAM, Scheduler and every other service accepted a request signed with the wrong secret. SigV4HeaderSignatureFilter verifies the Authorization header of every request outside S3 and execute-api when the flag is on, rebuilding the canonical request from the request as it arrived and answering in the protocol the request used. Unsigned requests are left alone, and the default configuration is unchanged. The filter runs after matching so it can hash the body. The SQS queue-URL router now records the bytes it appends to a Query body, and the CBOR content type is read from the header that preserves it, so neither rewrite breaks a valid signature. With the flag on, an unknown or synthetic access key is now refused by every service, as S3 already refused it. Closes #5195 * fix(core): skip signature checks by matched resource, strip the spoofable content-type header The filter skipped any request whose credential scope named s3 or execute-api, so a caller could sign an SQS or KMS call under either and pass with the wrong secret, and S3 Control was never checked. It now steps aside only for the resources another verifier owns: S3Controller and the API Gateway execute controllers. AwsCborContentTypeFilter removes any client-sent X-Floci-Original-Content-Type, so a signed Content-Type cannot be swapped behind a forged copy. REST-XML services (Route 53, CloudFront, S3 Control) get XML errors. Header and scope parsing reuse SigV4AuthorizationHeader and CredentialScope, and the canonical request moves into SigV4Canonicalization, shared with ExecuteApiSigV4Authorizer. * fix(core): leave AppSync GraphQL signatures to AppSync's own check AppSync's GraphQL endpoint verifies IAM signatures itself and answers a failure with the UnauthorizedException envelope AppSync clients parse. With validate-signatures on, the header filter reached it first and answered with a JSON InvalidSignatureException. AppSyncExecutionController joins the resources the filter steps aside for. |
||
|
|
91c15be74a |
fix(rds): apply PostgreSQL startup parameters to IAM sessions as the token's role (#5304)
* fix(rds): apply PostgreSQL startup parameters to IAM sessions as the token's role * fix(rds): refuse a session_authorization change and match PostgreSQL's parsing for IAM startup parameters * test(rds): share the IAM integration tests' setup and document RESET for IAM startup parameters |
||
|
|
1a6f336e9f |
feat(redshift): run Data API statements from Step Functions and Scheduler (#5312)
* feat(redshift): run Data API statements from Step Functions and Scheduler Step Functions: add the arn:aws:states:::aws-sdk:redshiftdata:<action> Task integration. It reuses RedshiftDataJsonHandler, so every Data API action Floci implements works for provisioned clusters (ClusterIdentifier) and Serverless workgroups (WorkgroupName). Arguments and results keep the wire PascalCase names, CreatedAt and UpdatedAt are ISO-8601 at any depth, errors surface as RedshiftData.<Code>Exception, and the task fails when redshift or redshift-data is disabled. .sync resources are rejected, as AWS has no such variant. Scheduler: add the redshiftdata:executeStatement and redshiftdata:batchExecuteStatement universal targets. The call runs as the schedule's account and region, because the dispatcher thread carries no request account and cluster and statement storage is account-aware. A SQL error stays on the statement; a request the Data API rejects propagates so the existing retry and dead-letter handling applies. * fix(redshift-data): validate task input and isolate statement storage by account * fix(redshift): run scheduled Data API statements off the dispatcher thread Keep the request check on the dispatcher so a rejected request still retries, and run the SQL on its own thread under the schedule's account. Ask ServiceRegistry whether redshift-data is enabled instead of repeating the rule, keep the resolver and connection factory package-private, and cover the provisioned-cluster account in the resolver test. * fix(scheduler): await scheduled Redshift Data statement in docker test |
||
|
|
233d05eab1 |
docs(cloudformation): scope required AppSync resources (#4897)
The AppSync page did not say which AWS::AppSync resource types CloudFormation provisions, what Ref and Fn::GetAtt return for them, or what happens to the AppSync types Floci does not serve. A CDK app that deploys a GraphQL API had to read the provisioner to find out. The page now has a CloudFormation section. It lists the six provisioned types with their Ref value and Fn::GetAtt attributes, and the differences measured by deploying the same template to AWS and to Floci: Ref on GraphQLApi and ApiKey returns the id where AWS returns the ARN, GraphQLEndpointArn is not modeled, the URL and DNS attributes point at Floci, and AWS refuses Fn::GetAtt Id on a GraphQLSchema while Floci resolves it. It also states that a schema given only by S3 location and S3 code locations are refused, and that the remaining AppSync types are stubbed by default. The generated CloudFormation resource-type table gets a row note with the Ref difference and a link to that section. |
||
|
|
4f34a903fc |
feat(ssm): support UnlabelParameterVersion (#5339)
* feat(ssm): support UnlabelParameterVersion
Remove one or more labels from a parameter version. Labels attached to
the version are returned in RemovedLabels; labels that are not on that
version, including ones attached to a different version, are returned in
InvalidLabels and left in place. A missing parameter is ParameterNotFound,
a missing version ParameterVersionNotFound, and an omitted ParameterVersion
or an empty or oversized label list a ValidationException.
* fix(ssm): match AWS errors and ordering in UnlabelParameterVersion
Verified against real AWS (us-east-1):
- Report every missing or invalid member in one ValidationException, in
the order name, parameterVersion, labels, and render the label list
the way AWS does ('[prod, ]').
- Reject a string or boolean ParameterVersion and a non-string Name or
label with SerializationException; truncate a fractional version and
clamp one outside the range of a long, as AWS does.
- Reject an ARN, a malformed or ssm-prefixed name, and deny an
aws-prefixed one before the lookup; ignore surrounding whitespace in
the lookup but echo the name as sent in error messages.
- Word ParameterVersionNotFound as AWS does.
- Return RemovedLabels in the order the labels are stored on the
version, and InvalidLabels in request order.
LabelParameterVersion shares the label-list parsing, so its label
validation messages and non-string labels now match AWS too.
* fix(ssm): take the service monitor when deleting parameters
PutParameter, LabelParameterVersion and UnlabelParameterVersion already
run under the SsmService monitor, but DeleteParameter and
DeleteParameters did not. A delete landing between a label or unlabel
call's lookup and its history write left orphaned history that a later
PutParameter of the same name appended to.
Also pin LabelParameterVersion's AWS-verified label validation messages
and its SerializationException for a non-string label in its own
integration test, and share the parameter-name format rule between the
two reserved-name messages.
|
||
|
|
07ebc33d28 |
feat(scheduler): substitute schedule context attributes in target Input (#5194)
* feat(scheduler): substitute schedule context attributes in target Input Replace <aws.scheduler.schedule-arn>, <aws.scheduler.scheduled-time>, <aws.scheduler.execution-id> and <aws.scheduler.attempt-number> in the target Input for templated and universal targets, using the occurrence's scheduled time and the retry attempt the dispatcher tracks. * test(scheduler): share one harness between the scheduler integration tests SchedulerContextAttributesIntegrationTest copied its schedule creation, scoped dispatcher, unique names and cleanup from SchedulerStepFunctionsIntegrationTest. Both now use SchedulerTestHarness, which also builds the at() expression they each formatted by hand. * fix(scheduler): keep dead-letter context aligned with the last attempt Materialize the target request before every invocation so an exhausted occurrence's dead-letter body carries the same execution id and attempt number as its last attempted delivery. Preserve that request when the occurrence expires before another retry. Share scheduled-time formatting across context attributes, default events and dead-letter attributes. Cover retry-count and event-age exhaustion and remove the documented first-attempt body limitation. * style(scheduler): fix shared harness static import order Place ROLE_ARN before atExpression to satisfy the ImportOrder rule used by the PR's merged Checkstyle configuration. |