mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 22:11:36 -05:00
7dc514b52f2c96bdd1ea32ae64a02703f85be2aa
178
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
7dc514b52f |
feat(emr): ListReleaseLabels, DescribeReleaseLabel and ListSupportedInstanceTypes (#5748)
* feat(emr): ListReleaseLabels, DescribeReleaseLabel and ListSupportedInstanceTypes None was served, so Terraform's aws_emr_release_labels and aws_emr_supported_instance_types data sources failed against Floci. A curated catalogue of EMR releases (emr-7.5.0, Floci's default, and emr-7.4.0, emr-6.15.0, emr-6.14.0 and emr-5.36.2) carries each release's applications and versions from the EMR Release Guide and its recent Amazon Linux releases, with common instance types and their EC2 sizes. The three actions filter and page it as the API documents, and answer InvalidRequestException for an unknown release, a bad token or an out-of-range MaxResults. A configured default release outside the catalogue is still listed. Closes #5734 * fix(emr): report EMR architecture values and match application versions without regard to case ListSupportedInstanceTypes returned the EC2 spellings x86_64 and arm64; the EMR model gives X86_64 and AARCH64 for Architecture. The ListReleaseLabels application filter matched the name without regard to case but not the version, so phoenix@4.14.3-hbase-1.4 missed emr-5.36.2. * refactor(emr): page the release catalogue with the shared Pagination ListReleaseLabels and ListSupportedInstanceTypes now page through core.common.Pagination, with the filters in the token namespace so a token replayed with other filters, or altered, is refused. DescribeReleaseLabel answers every application, as AWS reserves its MaxResults and NextToken. The EMR integration tests share one request helper. |
||
|
|
e3e06a1122 |
feat(iot): add RegisterCertificateWithoutCA and the V2 principal lists (#5772)
* feat(iot): add RegisterCertificateWithoutCA and the V2 principal lists RegisterCertificateWithoutCA registers a certificate from any issuer in SNI_ONLY mode. ListThingPrincipalsV2 and ListPrincipalThingsV2 page the thing principal attachments and report each one as NON_EXCLUSIVE_THING, because Floci does not model exclusive attachment. * fix(iot): validate the principal and page size of the V2 principal lists ListPrincipalThingsV2 requires a principal, and both V2 lists accept 1 to 250 results per page, as on AWS. Tests cover these checks and the RegisterCertificateWithoutCA rejection of a missing PEM and an unknown status. * fix(iot): refuse a device certificate registered in more than one account AWS selects the account from the server name, which Floci does not do yet. The MQTT TLS listener therefore refuses a certificate that more than one account registers, instead of admitting it under the lowest account ID. RegisterCertificateWithoutCA drops the cached location, and the lookup runs under compute, so a connect cannot cache a stale account. * fix(iot): make the RegisterCertificateWithoutCA duplicate check atomic A lock holds the duplicate check and the store write together, as CreateAuthorizer does, so two identical registrations at the same moment store one certificate and the other caller gets the 409. The 409 carries resourceId and resourceArn, as AWS lists for this call. |
||
|
|
66fce77bdc |
feat(iam): generate, claim and answer delegation requests (#5797)
IAM temporary delegation lets an AWS Partner ask a customer for scoped, time-limited access to the customer's account: the partner files a request, the customer claims and answers it, and an accepted request releases an exchange token the partner trades for credentials. Floci dispatched none of it, so all seven lifecycle operations answered UnsupportedOperation 400. The family was filed as a non-goal on the strength of CreateDelegationRequest stating "This API is not available for general use. In order to use this API, a caller first need to go through an onboarding process described in the partner onboarding documentation". That sentence appears exactly once in the whole API reference, and the partner user guide describes a generally available feature with a published lifecycle. The gate is an AWS-side account allowlist for ISV Accelerate partners, "Enable API access for your specified accounts", not a protocol behaviour, and an emulator has no allowlist. Answering NoSuchEntity because nothing can exist would emulate the feature's absence rather than the feature. This is the lifecycle half: Create, Associate, Accept, Reject, Update, Get and List. SendDelegationToken and STS GetDelegatedAccessToken are the token exchange and come next, so no request reaches FINALIZED yet, and GetHumanReadableSummary stays undispatched because its summary is LLM- generated on AWS. A delegation request is the one IAM record two accounts share, which decides how it is stored: keyed by id under the creating account and resolved across accounts on read, because the reference makes the id globally resolvable and decides access from the request's own owner fields. A request nobody owns "can be called by any account"; one naming a target account is readable only from there, which is why a partner loses sight of its own filing once it is aimed. Floci decides that at account granularity, there being no per- identity permission on a request to consult. ListDelegationRequests leaves out a request with no owner even when it names the listing account, as the reference states, so a partner does not list its own filings at all, which matches the guide telling partners to track state from the notifications. Expiry is applied when a request is next read rather than swept by a worker. Each state carries the window AWS publishes, a day for UNASSIGNED and a week for every other state including the terminal ones, and a request past its window reads back as EXPIRED. That needs no scheduler to be correct and no clock to be mocked globally, so the service takes its own Clock and the unit test advances that rather than the shared test clock. Two answers had to be chosen rather than read off. An operation asked to move a request out of a state it no longer holds answers ConcurrentModification: no modeled error says "wrong state", and AcceptDelegationRequest models only NoSuchEntity, ServiceFailure and ConcurrentModification, so the conflict is the closest of the three and is used on all four writers rather than a different code each. PermissionCheckResult answers UNSURE when the check is asked for, which the enum models, because a delegation request carries no permission to evaluate. A member that breaks the format or constraints it declares answers ValidationError. The reference publishes that as a common error, "the input doesn't meet the required format or constraints", for every IAM operation while listing it on no operation at all, which is why it appears in no error table and in none of these; the rest of IAM answers it in the same shape and wording, so these operations do too. The InvalidInput they do model is kept for a value that cannot be read as the member's type, which is where the shared pagination already puts a MaxItems that is not a number. A lifecycle call reads a request, checks its state and writes it back, so all of them take one lock, as the sibling IAM services do with theirs. Without it two callers could both claim the same unassigned request and the later write would decide the owner, and two creates could both pass the workflow-id uniqueness check. Each call also takes a single clock reading, threaded from the lookup into the transition, so a request cannot be expired on the way in and moved on anyway. Two shape details come from the pinned botocore model rather than the reference PDF, which omits both: GetDelegationRequest also takes DelegationPermissionCheck and answers PermissionCheckStatus and PermissionCheckResult, and ListDelegationRequests spells its flag isTruncated in lower case where every other IAM list spells it IsTruncated. The model names the member, so the wire follows the model. SessionDuration's 300 to 43200 range, PolicyParameter's shape and the 100-default, 1000-maximum page size come from there too. The CLI reference supplies the constraints the PDF leaves hard to read: the redirect URL's whole pattern, which the PDF breaks across a line, the character class the free-text members carry, and the printable-ASCII class on a policy parameter's name and values. Each is enforced. It also settles that the Permissions structure is required while both of its members are optional, marking neither. Reading it is what caught an empty required member being treated as an omission: Description is required and its pattern permits an empty string, so Description= is a value and only an absent member is missing, which is a distinction that exists on the wire and is tested there. Notes and RejectionReason both exist on the shape and each gets exactly one writer: an update carries notes for an administrator and a rejection carries the explanation the reference describes for it. An indexed member is read from the keys the request carries rather than counted up from one, so Parameters.member.2 without a member.1 keeps its entry instead of being dropped at the gap, and a boolean member has to carry true or false rather than being read as false for anything else. delegation-request leaves ResourceArnBuilder.UNRESOLVED_TYPES, since that entry claimed the type belongs only to actions nothing dispatches. The four by-id actions mint arn:<partition>:iam::<account>:delegation-request/<id> from the request, the same way the ARN-carrying actions pass an ARN through, one step earlier. CreateDelegationRequest stays at the wildcard because IAM assigns the id, and UpdateDelegationRequest stays there because AWS publishes no authorizable action for it at all. UnresolvedResourceTypesIntegrationTest would have failed until this was done, which is that test working as intended. The console deep link follows the partition too. CreateDelegationRequest answers the URL the partner redirects the customer to, and a caller in China or GovCloud was handed a console their account cannot reach. The host now comes from the region's partition, the way the CodePipeline approval links already resolve theirs, keeping the commercial console's path because that is the only path any partition publishes. The account-root stand-in behind an owner ARN is minted through RegionResolver for the same reason rather than concatenated, which is also the shape IamEnforcementFilter synthesizes. Nothing is enforced that AWS does not publish. LimitExceeded is modeled with no quota behind it, so none is invented. NotificationChannel is validated and stored and nothing reads it, there being no notification to send yet. PolicyTemplateArn is kept as given and resolved against nothing, templates being registered by email with no API. All four new model types are registered for reflection, the state enum included: it is reachable from a stored request, and a native image that cannot read it back loses every delegation request on restart, which is what the persistence guard checks. Twenty-seven unit tests drive the state machine, both expiry windows, the two races and the deep link in each partition, with a clock the test owns, and fifteen integration tests drive the lifecycle over the wire across two accounts, the access key id being the account id as the rest of the suite does it. Routing needs nothing added: #5879 has the Query router read each service's actions from its botocore model, which names all seven already, so the matrix row in docs/services/index.md moving 167 to 174 is the only count this changes. |
||
|
|
faf344afd1 |
feat(codeartifact): add CopyPackageVersions for the generic format (#5854)
Copies one or more versions of a package between repositories in the same domain, matching AWS's documented all-or-nothing batch semantics: a version missing from the source fails NOT_FOUND, a version already identical at the destination is a silent no-op, a differing one fails ALREADY_EXISTS unless allowOverwrite is set, and any one failure reports every other requested version as SKIPPED rather than performing a partial copy. versionRevisions is checked against the source's actual revision (MISMATCHED_REVISION on a mismatch). Maven, npm, pypi, and nuget are not yet bridged, the same restriction PublishPackageVersion already has for those formats, and are documented as a known limitation. |
||
|
|
fa2a49e771 |
feat(redshift-serverless): add scheduled action actions (#5852)
Add CreateScheduledAction, GetScheduledAction, ListScheduledActions, UpdateScheduledAction and DeleteScheduledAction. An action is recorded and echoed, never run, and a cron schedule reports no upcoming invocations. It is tied to the namespace by the namespace's generated id, so a namespace recreated under the same name does not inherit it. Required members, name patterns, the snapshot name prefix length and the tag shape come from the AWS model through RedshiftServerlessRequestShapes. Only what the model cannot express stays in the service: the schedule union, the time window, the retention range and the namespaces that must exist. |
||
|
|
2a012cf9a4 |
feat(redshift-serverless): add snapshot copy configuration actions (#5798)
* feat(redshift-serverless): add snapshot copy configuration actions Add CreateSnapshotCopyConfiguration, ListSnapshotCopyConfigurations, UpdateSnapshotCopyConfiguration and DeleteSnapshotCopyConfiguration. A configuration is recorded and echoed; Floci copies no snapshot. A namespace has one configuration at a time and the destination Region must differ from its own. The configuration is tied to the namespace by the namespace's generated id, so a namespace recreated under the same name does not inherit it. Required members come from the AWS model through RedshiftServerlessRequestShapes. The destination Region name and the retention range are checked by hand because the model leaves them unconstrained. * fix(redshift-serverless): validate boundary inputs and scope snapshot copy pagination tokens * refactor(redshift-serverless): share maxResults range check and invalidPagination helper |
||
|
|
7cab804d22 |
feat(redshift-serverless): add custom domain association actions (#5766)
* feat(redshift-serverless): add custom domain association actions Add CreateCustomDomainAssociation, GetCustomDomainAssociation, ListCustomDomainAssociations, UpdateCustomDomainAssociation and DeleteCustomDomainAssociation. An association is recorded and echoed; Floci serves no traffic on the domain and reads no ACM certificate. It is tied to the workgroup by the workgroup's generated id, so a workgroup recreated under the same name does not inherit it. The domain name and certificate ARN patterns, lengths and the required members come from the AWS model through RedshiftServerlessRequestShapes, so the service carries no validation of its own. * fix(redshift-serverless): address review findings for custom domains - Expose custom domain name and certificate ARN in workgroup responses. - Ensure custom domain names are unique across workgroups in a region. - Remove ambiguous Pagination.paginate overload in favor of paginateNamespaced. - Add domain name and certificate ARN validation patterns and length checks. - Enforce validation for required parameters in custom domain operations. * fix(redshift-serverless): enforce single custom domain per workgroup and populate certificate expiry * fix(redshift-serverless): read certificate expiry dynamically and share custom domain serialization |
||
|
|
c67a5afbc3 |
feat(redshift-serverless): add endpoint access actions (#5742)
* feat(redshift-serverless): add endpoint access actions Add CreateEndpointAccess, GetEndpointAccess, ListEndpointAccess, UpdateEndpointAccess and DeleteEndpointAccess. Floci creates no VPC endpoint, so an endpoint is recorded and echoed with the workgroup's own address and port. It is tied to the workgroup by the workgroup's generated id, so a workgroup recreated under the same name does not inherit its predecessor's endpoints. Required members and the ownerAccount pattern come from the AWS model through RedshiftServerlessRequestShapes. The endpoint name rule is checked by hand because the model documents it but does not encode it. * fix(redshift-serverless): validate boundary inputs and scope endpoint pagination tokens Validate policy is not null or blank in requireJsonObject before Jackson parsing to avoid unchecked IllegalArgumentException. Validate required endpointName, workgroupName, and subnetIds at create boundary. Validate non-null vpcSecurityGroupIds on endpoint updates. Add namespaced paginate overload with limit validation, scope ListEndpointAccess tokens to endpoint-access, and report pagination errors as ValidationException. * fix(redshift-serverless): allow optional vpcSecurityGroupIds on update and reuse existing pagination overload Allow omitting or passing null vpcSecurityGroupIds in UpdateEndpointAccess to leave existing security groups unchanged. Validate maxResults in the service and call the existing namespaced Pagination.paginate overload instead of adding core overloads. Omit the snapshot policy null check which belongs to #5730. |
||
|
|
772ec8d0c9 |
feat(rds): add the snapshot export task API (#5787)
* feat(rds): add StartExportTask, DescribeExportTasks and CancelExportTask with the export task lifecycle * docs(rds): document the snapshot export task API * fix(rds): route the export task actions to RDS when a request has no signing scope * fix(rds): refuse an export to a bucket outside the snapshot's region * fix(rds): answer export task calls with a copy of the task taken under the lock * fix(rds): refuse an unknown DescribeExportTasks filter name before matching any task * fix(rds): fail an export to a bucket in another region as a task, as RDS does, rather than refuse it * docs(rds): say that a bucket in another region fails an export in mock mode too |
||
|
|
4353e4232b |
feat(rds): DescribeDBLogFiles and DownloadDBLogFilePortion (#5741)
* feat(rds): DescribeDBLogFiles and DownloadDBLogFilePortion Both answered UnsupportedOperation, so an instance's log could only be read with docker logs, outside the AWS API. An instance's log is now read from its database container and cut into files the way RDS names them: hourly error/postgresql.log.* files for PostgreSQL, error/mysql-error.log for MySQL and MariaDB, and log/ERROR for SQL Server. DescribeDBLogFiles filters and pages them, and DownloadDBLogFilePortion follows the API reference's marker rules with a 1 MB block cap. Control characters XML cannot carry come back as U+FFFD. In mock RDS mode an instance has no log files. Closes #5733 * fix(rds): bound and validate log file reads A log read now takes the most recent 100,000 lines instead of the whole history, fails when Docker does not finish in time instead of returning part of the log, and, when Docker no longer knows the container, finds or starts the backend once before answering DBInstanceNotReady rather than an empty log. A single line over 1 MB is cut at 1 MB like the rest of the block. Negative FileSize, FileLastWritten and Marker values are InvalidParameterValue; the shared offset paging refuses a negative marker instead of starting over. * fix(rds): close the Docker log stream when a log read times out A timed-out read now closes its callback before failing, so the stream stops and nothing writes into the buffer after the read gives up; the buffer is also written and read under one lock. * refactor(rds): keep portion's Javadoc on portion truncateUtf8 had landed between portion's comment and portion itself. It now follows portion. * test(rds): read log files on the first call, and import class names CreateDBInstance returns once the database accepts connections, so the startup log is already in the container's output. The Docker and SDK log tests now assert on the first DescribeDBLogFiles and DownloadDBLogFilePortion call instead of polling. The timeout test and RdsLogFilesTest import the classes they had written out in full. |
||
|
|
a68e6bc768 |
feat(redshift-serverless): add resource policy actions for snapshots (#5730)
* feat(redshift-serverless): add resource policy actions for snapshots Add PutResourcePolicy, GetResourcePolicy and DeleteResourcePolicy. A policy is stored per account and Region and echoed in the shape of the API model, not evaluated. It is tied to the snapshot it was put on by the snapshot's creation time, so a snapshot recreated under the same name does not inherit it. Required members come from the AWS model through RedshiftServerlessRequestShapes. * fix(redshift-serverless): validate resource ARN before policy lookup and add account isolation tests Validate resourceArn with snapshotNameFromArn at the start of require() so that foreign-account or non-snapshot ARNs return ValidationException on GetResourcePolicy and DeleteResourcePolicy even when no policy is stored. Parameterize snapshotNameFromArn so error messages reference resourceArn. Add regression tests covering missing resourceArn on PutResourcePolicy and foreign ARN reads/deletes. Add integration test verifying policy isolation across accounts under real request contexts. |
||
|
|
9174147cb6 |
fix(account): implement DeleteAlternateContact (#5560)
* fix(account): implement DeleteAlternateContact Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com> * docs(account): document DeleteAlternateContact Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com> --------- Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com> |
||
|
|
9cd9002e73 |
feat(rds): EnableHttpEndpoint, DisableHttpEndpoint and HttpEndpointEnabled (#5736)
* feat(rds): EnableHttpEndpoint, DisableHttpEndpoint and HttpEndpointEnabled EnableHttpEndpoint and DisableHttpEndpoint answered UnsupportedOperation and DBCluster carried no HttpEndpointEnabled, so Terraform's enable_http_endpoint and CDK's enableDataApi never read back what they set. Clusters now record the flag and report it. The two actions take the cluster's ARN and raise ResourceNotFoundFault and InvalidResourceStateFault as the model lists them; CreateDBCluster, ModifyDBCluster and the AWS::RDS::DBCluster EnableHttpEndpoint property set it too. Turning it on is refused for engines other than Aurora PostgreSQL and Aurora MySQL. The Data API itself does not check the flag, so existing callers keep working. Closes #5732 * refactor(rds): one cluster ARN parser, and stricter Data API inputs clusterForResourceArn repeated the ARN parsing, cluster: prefix and account and Region check of clusterIdentifierFromArnOrName; both now call clusterIdFromArn, each raising the error its API documents. The Data API engine check takes aurora-postgresql, aurora-mysql and the older aurora name exactly instead of any name starting with aurora, and the AWS::RDS::DBCluster EnableHttpEndpoint property accepts true or false only, so a malformed value fails instead of turning the endpoint off. * fix(rds): take only aurora-mysql and aurora-postgresql for the Data API The API reference lists those two engines, and new clusters cannot carry the bare aurora name, so the check no longer accepts it. |
||
|
|
a37c27516a |
feat(route53resolver): implement ListResolverEndpointIpAddresses (#5731)
* feat(route53resolver): implement ListResolverEndpointIpAddresses The Terraform provider lists an endpoint's IP addresses right after CreateResolverEndpoint, so the missing operation (UnknownOperationException) failed every aws_route53_resolver_endpoint create. Built from the IpAddresses recorded at create time: one ATTACHED entry per request with a deterministic rni- IpId. Unknown endpoint ids raise ResourceNotFoundException. Not paginated, like the sibling List operations. * docs(route53resolver): update service matrix operation count * refactor(route53resolver): add endpoint IP addresses with a single addAll * fix(route53resolver): distinct IpIds for repeated entries; fail on missing IP record ListResolverEndpointIpAddresses hashed only the endpoint id and the entry, so two identical entries (two addresses in one subnet, both left for AWS to pick, which IpAddressesRequest allows) shared an IpId. Include the entry's position in the recorded list, which is normalised once at create and so stable across reads. An endpoint whose recorded IP requests are missing returned an empty list beside a nonzero IpAddressCount. Throw the modeled InternalServiceErrorException instead. * test(route53resolver): import List/HashSet instead of fully qualifying (checkstyle NoFqcn) * fix(route53resolver): return InternalServiceErrorException as HTTP 400 The Route 53 Resolver model gives InternalServiceErrorException no httpStatusCode, so clients expect the awsJson default of 400, as with every other Resolver error. |
||
|
|
d3fce14256 |
feat(redshift-serverless): add release track, managed workgroup and reservation reads (#5691)
* feat(redshift-serverless): add release track, managed workgroup and reservation reads Add GetTrack, ListTracks, ListManagedWorkgroups, ListReservations, ListReservationOfferings, GetReservation, GetReservationOffering and CreateReservation so SDK, CLI and IaC clients no longer get an unknown operation error. Floci models no zero-ETL managed workgroups and sells no reservations, so the lists are empty and the reservation lookups answer ResourceNotFoundException. The two release tracks are current and trailing. Required members, patterns and lengths come from the AWS model through RedshiftServerlessRequestShapes; only the track names, which the model leaves unenumerated, are checked by hand. * refactor(redshift-serverless): reuse Pagination.paginate and remove unused admin handle method Rely on Pagination.paginate for maxResults and nextToken validation in listTracks and listWithoutItems, matching the other Redshift Serverless lists. Remove the unused handle method and its duplicate unknown-operation response in RedshiftServerlessAdminJsonHandler. |
||
|
|
6f78083080 |
feat(lambdaweb): Lambda Web Functions control plane (#5706)
* feat(lambdaweb): Lambda Web Functions control plane The lambda-web service model (apiVersion 2025-03-07) signs as lambda, so it is served under the lambda service at /2025-03-07/... with the AWS wire shapes, state words and error wording of the 20 operations on web functions, revisions, endpoints, tags and the resource policy. Revisions and endpoints converge at once. They are stored Active and an endpoint update is stored Successful, while the create and update responses report the transitional state AWS reports, so a CLI waiter settles on its first poll. Code comes from an S3 object that must exist. IamAuth, the resource policy and the endpoint domain are stored but not served yet. Part of #5699 * fix(lambdaweb): carry the page position in the token The nextToken of a list operation was a UUID keyed into an in-memory anchor map that only grew and was not scoped to the account. The token is now a core Pagination cursor that encodes the request (operation, region, account, function, filters and page size) and the cursor of the item the page ended on. A token reused with other parameters gets the AWS "does not match the request" error and any other token the AWS "invalid or has expired" error. AWS issues UUID tokens and rejects any other shape, so Floci no longer reproduces the pattern error for a malformed token. * fix(iam): resolve a Lambda Web revision or endpoint named by its ARN The route resource for IAM enforcement took the path segment after revisions or endpoints as the id. A revision or endpoint ARN in that position carries slashes, so the resource ARN ended in the ARN's first segment and a policy scoped to the revision or endpoint did not apply. The id is now the last segment of such an ARN. * fix(lambdaweb): add the values of a repeated state filter AWS lists a function when any state filter in the request names its state. A later state filter replaced the earlier one, so a request with state=Active followed by state=Failed listed nothing. * fix(lambdaweb): refuse empty arrays in a resource policy AWS answers an empty Action or Resource array with the policy syntax error and an empty principal array with the invalid principal error, which wins when all three are empty. Floci stored such a policy. * fix(lambdaweb): judge a wildcard principal by the operator and value of its condition A trusted condition key alone kept an Allow for every principal out of the public check. AWS blocks the policy unless a positive operator pins the key: StringNotEquals and the IfExists forms do not count, nor does a wildcard in an account value or in the account field of an ARN value, while a wildcard elsewhere in an ARN and a literal * under StringEquals do. |
||
|
|
8f907023b2 |
feat(codeartifact): implement GetPackageVersionReadme (#5644)
Supports npm, pypi, and nuget, matching AWS's own documented restriction for this action (not maven, Swift, generic, Ruby, or Cargo, which carry no readme in real CodeArtifact). Neither npm nor pypi can answer this live after the fact. A real Verdaccio packument GET hoists readme to the top level only, for the single most-recently-published version, and drops the per-version field from its own response entirely, even though a real npm client's publish envelope genuinely sends one per version (confirmed against a live Verdaccio 6.10.4 container with a captured real npm-publish fixture). pypiserver has no description field anywhere in its model or its RPC2 route (confirmed by reading pypiserver's own source at the pinned version), so it never had a live path to begin with. Both formats are therefore captured at publish/upload time instead: npm's per-version readme field is read off the real publish envelope by NpmPublishEnvelopeScanner and recorded after a successful forward to the Verdaccio sidecar, and pypi's is read off the upload form's description field the same way it already was. Both go through the same recordPublishedPackageVersionReadme method and the same packageVersionReadmes account-scoped store, cleaned up on DeleteRepository and DeletePackage the same way packageOriginConfigs already is. nuget is accepted as a valid format but always 404s, since nothing in Floci implements the real NuGet wire protocol and no nuget package version can ever exist here. Refactors validatePackageToken to delegate to a new non-throwing isValidPackageToken, reused by the readme capture path (fed raw publish/upload input, never through the JSON API's own validation) to guard the same escape-collision invariant escapeKeySegment depends on. Extracts the container-backed revision synthesis already used by GetPackageVersionAsset into a shared helper so GetPackageVersionReadme reports a consistent revision for the same version coordinate. |
||
|
|
988991033f |
fix(accessanalyzer): route GetAnalyzer through GET /analyzer/<name> (#5534)
* fix(accessanalyzer): route GetAnalyzer through GET /analyzer/<name>
Adds getAnalyzer service method and GET /analyzer/{analyzerName} endpoint
in AccessAnalyzerController to return analyzer details. Returns
ResourceNotFoundException (404) when analyzer does not exist. Adds
integration tests for retrieval and not found cases.
Fixes #5353
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
* docs(accessanalyzer): sync the action table for GetAnalyzer
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
* fix(accessanalyzer): share not-found helper and align docs/service matrix
Extract a shared analyzerNotFound helper that returns ResourceNotFoundException
with resourceId/resourceType (analyzer) for both get/delete. Remove trailing
blank lines from the controller. Update docs/services/index.md to list 4
operations. Run make docs-sync to keep action tables in sync.
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
* fix(accessanalyzer): reuse getAnalyzer in deleteAnalyzer and assert not-found fields
deleteAnalyzer repeated getAnalyzer's validate-and-lookup; it now calls
getAnalyzer before deleting, so the lookup and the not-found error live in
one place. The 404 test now checks the resourceId and resourceType the
shared helper adds, and the stray blank line before the class's closing
brace is gone.
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
---------
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
|
||
|
|
60d4d6b7a5 |
fix(servicequotas): implement GetRequestedServiceQuotaChange (#5561)
* fix(servicequotas): implement GetRequestedServiceQuotaChange RequestServiceQuotaIncrease now persists the requested change so GetRequestedServiceQuotaChange can read it back by id. An unknown request id returns NoSuchResourceException, matching AWS. Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com> * fix(servicequotas): unique id, region-scoped storage, history reads store; tests and docs Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com> * fix(servicequotas): update consumer test for UUID ids and distinct requests Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com> * fix(servicequotas): refuse a second open increase request per quota AWS allows only one open service quota increase request per quota, so a repeat for the same quota in the same region must return ResourceAlreadyExistsException. Since every request stays PENDING, the duplicate check and the store are now one atomic unit under a lock, closed over the per-region store. Tests that asserted distinct ids now assert the exception, and the two @QuarkusTest classes reset emulator state before each test so an open request left by one test cannot refuse the next. Move the service test's private in-memory StorageFactory into io.github.hectorvent.floci.testing as a shared helper; migrating the other copies is a follow-up. Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com> --------- Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com> |
||
|
|
c4a809f47f | feat(cloudformation): refuse updates after a failed rollback and add ContinueUpdateRollback (#4949) | ||
|
|
a95b01020b |
feat(redshift-serverless): add UpdateSnapshot (#5537)
Change a snapshot's retentionPeriod (-1 for indefinite) with the same validation as CreateSnapshot; an omitted period leaves the snapshot unchanged. |
||
|
|
b7a1bde2dc |
feat(sns): add topic permissions, the SMS sandbox and SMS opt-out (#5570)
SNS's Query routing set listed ten names that neither SNS handler dispatched, so a request for any of them was answered UnsupportedOperation. All ten are real SNS operations, and both the Query and JSON protocols now serve them. AddPermission and RemovePermission edit the topic's Policy attribute the way AWS does, going by LocalStack's recordings of the same calls against a live account: the label becomes the statement's Sid, each account its root principal, and a single account or action is written as a string. A duplicate label, an action outside SNS and a missing topic get AWS's errors. A label the policy does not hold leaves it unchanged, since no source shows what AWS answers there. Floci stores topic policies but does not evaluate them under enforcement, so the grant only shows in GetTopicAttributes. The default topic policy now matches what AWS returns for a new topic: Version 2008-10-17 with an AWS:SourceOwner condition, where Floci has had 2012-10-17 and AWS:SourceAccount since the first commit. AddPermission builds on it. GetSMSSandboxAccountStatus reports the account outside the sandbox, because Floci delivers SMS to any number. The sandbox numbers still work per account and region, without the limits AWS lifts outside the sandbox. CreateSMSSandboxPhoneNumber texts a six-digit code through the same path as Publish, so a test reads it from /_aws/sns, and VerifySMSSandboxPhoneNumber checks it. No number is ever opted out. AWS opts a number out when its owner replies STOP, and nothing reaches Floci that way, so CheckIfPhoneNumberIsOptedOut answers false, ListPhoneNumbersOptedOut is empty, and OptInPhoneNumber checks only the E.164 format, with AWS's error for a malformed number. AddPermission takes only twelve-digit account IDs, so a malformed one cannot end up as a principal in the stored policy. Each of these edits reads a record, changes it and writes it back. AddPermission, RemovePermission and SetTopicAttributes, which writes the same Policy attribute, are synchronized, as are the sandbox's create, verify and delete, so overlapping requests cannot lose a grant or bring back a deleted number. A number whose verification text cannot be recorded is put back as it was. The tests park the first of two edits inside that window and check the second waits. testing.ThreadStates holds the wait they use, which several other test classes still carry their own copies of. With SNS dispatching AddPermission and RemovePermission, the last two rows of the Query routing gap file, SQS's two names reaching SNS without a Version, are gone, leaving 171. The SNS row in docs/services/index.md now counts 39 operations, up from a stale 17. Refs #5549 |
||
|
|
5e48cbb80b |
feat(rds): IAM role associations for DB clusters and instances (#5367)
* feat(rds): IAM role associations for DB clusters and instances AddRoleToDBCluster, RemoveRoleFromDBCluster, AddRoleToDBInstance and RemoveRoleFromDBInstance answered UnsupportedOperation, and DBCluster and DBInstance carried no AssociatedRoles, so Terraform's aws_rds_cluster_role_association and aws_db_instance_role_association could not apply. Clusters and instances now keep their associated roles and report them as AssociatedRoles, ACTIVE as soon as they are added. The four actions raise the faults the API model lists, and CreateDBCluster accepts AssociatedRoles, checked before the cluster is created. Feature names are not yet validated against the engine. Closes #5343 * fix(rds): route the instance role actions, and refuse only a repeated cluster role AddRoleToDBInstance and RemoveRoleFromDBInstance were missing from RDS_ACTIONS, so a request with no credential scope reached SQS. DBClusterRoleAlreadyExists covers the role ARN only, so a cluster now takes a second role for a feature that already has one. Instances keep refusing a repeated role or feature, as their fault documents. CreateDBCluster reads every AssociatedRoles index, gaps included, and refuses an entry without a RoleArn. It associates the roles in one step and deletes the new cluster if that is refused. * refactor(rds): import the types parseAssociatedRoles uses The regex and sorted-set types were written with their packages inline; AGENTS.md asks for imports. The role association compat test gains a DisplayName like the others in its class. * docs(rds): count the role association actions alongside the catalogue reads #5196 and this branch each added four RDS actions, so the service matrix count is 98. |
||
|
|
1acedaf068 |
feat(apigateway): export deployed REST APIs as OpenAPI (#5131)
* feat(apigateway): export deployed REST APIs as OpenAPI * fix(apigateway): reject lossy export round trips * fix(apigateway): preserve native export round trips --------- Co-authored-by: Vamsi Akavarapu <16164447+vamsiak@users.noreply.github.com> |
||
|
|
daef71ca76 |
feat(guardduty): add Malware Protection plans and AWS::GuardDuty::MalwareProtectionPlan (#5373)
* feat(guardduty): add Malware Protection plans and AWS::GuardDuty::MalwareProtectionPlan Adds CreateMalwareProtectionPlan, GetMalwareProtectionPlan, UpdateMalwareProtectionPlan, DeleteMalwareProtectionPlan and ListMalwareProtectionPlans, and routes plan ARNs through the shared tag operations. Adds a CloudFormation provisioner for AWS::GuardDuty::MalwareProtectionPlan. Ref and Fn::GetAtt MalwareProtectionPlanId return the plan id, and Arn, CreatedAt, Status and StatusReasons are set. Role, object prefixes, the tagging action and tags update in place; a different BucketName is rejected because the update API cannot change the bucket. Management plane only: no scan runs, so a plan stays ACTIVE. Closes #4657 * fix(guardduty): address review findings on Malware Protection plans - Apply a plan update all-or-nothing: validate every supplied field before storing any, so a rejected request no longer changes the role. - Page ListMalwareProtectionPlans by the last returned id instead of an offset, so deleting a plan between pages neither fails nor skips, and use the documented default page size of 100. - Restore a plan on a failed CloudFormation stack update from a snapshot taken before the first change, and delete a plan an update created in place of one deleted out of band. - Clear ObjectPrefixes and Actions on a stack update that drops them. - Apply the creation tag rules to the shared tag routes. - Require the role to be an IAM role ARN. - Use explicit types instead of var. * style(guardduty): import ArrayList instead of fully qualified name * test(cloudformation): wire GuardDuty into CfnProvisionerFixture CfnProvisionerFixtureTest requires every provisioner to be reachable through a public Builder setter. Add a guardDuty(...) setter that registers GuardDutyMalwareProtectionPlanCfnProvisioner. * fix(guardduty): address second review round on Malware Protection plans - Rolling back a stack update that recreated a plan deleted out of band now restores the prior plan's Arn, CreatedAt, Status and StatusReasons, not only its id, so Fn::GetAtt no longer names the deleted replacement. The out-of-band test now changes the plan's properties: unchanged resources are skipped on update, so it never reached the create before. - Plan tag keys are checked against GuardDuty's documented TagKey pattern (^(?!aws:)[a-zA-Z+-=._:/]+$) on creation and on TagResource. - The tag routes require the supplied ARN to equal the stored plan's ARN, so a matching plan id under another account, service or partition is ResourceNotFoundException. - The /malware-protection-plan routes move behind a @PreMatching filter that rewrites only guardduty-signed requests to /_guardduty, as DlmRouteFilter does, so path-style S3 requests for a bucket of that name reach S3. * style(guardduty): import Instant and List, drop em-dash, document the plan route Review on #5373: GuardDutyController used an inline java.time.Instant and its Javadoc carried an em-dash, which AGENTS.md rules out. The Javadoc's routing paragraph now names /malware-protection-plan next to /detector and /admin and says GuardDutyRouteFilter keeps a same-named S3 bucket reachable. The CloudFormation and plan integration tests import List and nullValue instead of spelling them out. * refactor(core): share signed-service route rewriting across DLM, GuardDuty and Resource Explorer 2 DlmRouteFilter, GuardDutyRouteFilter and ResourceExplorer2PathRewriteFilter each repeated the same path test, credential-scope check and rewrite. They now delegate to SignedServiceRoute in core.common. The helper also reads the signing service from the X-Amz-Credential query parameter when there is no Authorization header, as ServiceEnabledFilter does (which now uses the same lookup), so a query-signed plan request reaches GuardDuty instead of S3. A request sent straight to an internal prefix that is not signed for the service is refused as S3 refuses that bucket name, rather than reaching the service's routes. Resource Explorer 2's prefix moves from /re2 to /_re2, since re2 is a valid bucket name. |
||
|
|
63b48342d6 |
feat(redshift): add snapshot copy and snapshot schedule operations (#5574)
* feat(redshift): add snapshot copy and snapshot schedule operations Terraform's aws_redshift_snapshot_copy, aws_redshift_snapshot_schedule and aws_redshift_snapshot_schedule_association failed with InvalidAction because the Query handler had no arms for these actions. - EnableSnapshotCopy / DisableSnapshotCopy / ModifySnapshotCopyRetentionPeriod store the copy settings on the cluster, and DescribeClusters reports ClusterSnapshotCopyStatus while copy is enabled. RetentionPeriod defaults to 7 and ManualSnapshotRetentionPeriod to -1. Faults follow the Redshift model: SnapshotCopyAlreadyEnabledFault, SnapshotCopyAlreadyDisabledFault, SnapshotCopyDisabledFault (modify), InvalidRetentionPeriodFault and SnapshotCopyGrantNotFoundFault. - Create/Describe/Modify/DeleteSnapshotSchedule and ModifyClusterSnapshotSchedule. The association lives on the cluster, so DescribeSnapshotSchedules derives AssociatedClusters (state ACTIVE) and filters by ClusterIdentifier from it, and a deleted cluster cannot leave a stale association. Deleting a schedule in use is refused with InvalidClusterSnapshotScheduleState. - Snapshot schedules take part in CreateTags/DeleteTags/DescribeTags as resource type snapshotschedule. No snapshot is copied to another region or taken on a schedule; the docs say so. * fix(redshift): reject malformed snapshot schedules and in-use copy grant deletion * fix(redshift): validate snapshot copy region and snapshot schedule identifier EnableSnapshotCopy now refuses a DestinationRegion that is not a published AWS region with UnknownSnapshotCopyRegionFault (404), as the model lists. CreateSnapshotSchedule now refuses a ScheduleIdentifier containing anything but letters, digits and hyphens with InvalidParameterValue (400). The API reference allows alphanumerics; the management guide's example uses a hyphen. |
||
|
|
890b8eca51 |
feat(rds): engine versions, engine defaults and valid modifications (#5196)
* feat(rds): engine versions, engine defaults and valid modifications Serve DescribeDBEngineVersions, DescribeEngineDefaultParameters, DescribeEngineDefaultClusterParameters and DescribeValidDBInstanceModifications. A curated engine catalogue lists one representative version per major version Floci knows through its managed parameter and option groups. Each version carries the parameter group family the create path computes for it, its major version and its upgrade targets; each engine's default is the version Floci creates when a request names none. DescribeDBEngineVersions serves it with Engine, EngineVersion (exact or major), DBParameterGroupFamily, DefaultOnly, the documented filters and paging, and DescribeOrderableDBInstanceOptions now reads the same catalogue. The engine default calls check the family against the catalogue and return an empty list, as Floci's default parameter groups hold no parameters. DescribeValidDBInstanceModifications reports the instance's storage type with a range from its current allocation to the engine's maximum, and nothing for an Aurora instance. Closes #5186 * feat(rds): one source for engine defaults, and engine version capabilities Create paths, the cluster parameter group family check and global clusters each kept their own default engine version, and Aurora MySQL's disagreed with the catalogue: 8.0.36 against 8.0.mysql_aurora.3.05.2. All four now read the catalogue's default, so a create that names no version gets what DescribeDBEngineVersions reports with DefaultOnly. DescribeDBEngineVersions and DescribeDBClusterEndpoints share one offset paging helper and one MaxRecords check, which DescribeEventSubscriptions also uses. Each engine version now reports ExportableLogTypes, SupportsLogExportsToCloudwatchLogs, SupportsReadReplica, SupportedFeatureNames, SupportsParallelQuery, SupportsGlobalDatabases and SupportsBabelfish, following what Floci supports. * fix(rds): route the catalogue reads to RDS without a credential scope DescribeDBEngineVersions, DescribeEngineDefaultParameters, DescribeEngineDefaultClusterParameters and DescribeValidDBInstanceModifications were missing from RDS_ACTIONS, so a request with no credential scope reached SQS. |
||
|
|
5ea632cc13 |
feat(iam): change the calling user's console password (#5546)
ChangePassword was the last IAM operation held back for a reason that turned out not to hold. It was tracked as blocked on disambiguating a shared Query action name by Version, because Cognito publishes the name too. In fact IAM sits second in inferServiceFromAction's chain and Cognito ninth, and Cognito's form path answers UnsupportedOperation to every request, so adding the name to IAM_ACTIONS routes it to IAM and costs Cognito nothing. A request carrying a credential scope never reaches that chain at all. The operation takes no UserName. The API reference says it changes the password of the IAM user who is calling, and the CLI reference adds that it "can be called by IAM users only. If this command is called using AWS account (root) credentials, the command returns an InvalidUserType error", so a signing key with no stored user behind it, which is Floci's stand-in for that caller, answers InvalidUserType rather than reporting the key as missing. The resource the request is evaluated against needed nothing new: ResourceArnBuilder already resolves the signing user for an action whose UserName is absent, and the vendored action map already authorizes ChangePassword against a user. OldPassword is checked against the stored login profile before the new password is held to the account password policy, so a caller who cannot prove the current password learns nothing about what that policy requires. A mismatch is the one refusal the reference leaves unnamed: every error it publishes for this operation describes something else, so this answers InvalidParameterValue, the common error type AWS publishes for a parameter value a service cannot accept. A successful change clears PasswordResetRequired, which is what lets a user whose password an administrator reset restore their own console access programmatically, and it moves the password_last_changed the credential report reads. The passwordType shape check is now shared and names the member that failed, because this operation has two password members and a caller told that 'password' failed would have to guess which. An absent member and an empty one stay different answers. Two things the login profile needed before a self-service change could be trusted. The comparison and the write are one step under a new loginProfileLock, which every login-profile writer takes: read apart from the write, two requests presenting the same valid old password both pass the comparison and both are told they set the password, while only the later write survives, and a guard one writer skipped would leave a racing UpdateLoginProfile free to overwrite a password a ChangePassword had just promised. And PasswordReusePrevention is now enforced, on UpdateLoginProfile as well, the two sharing one bounded history per profile: the reference defines the value as "the number of previous passwords that IAM users are prevented from reusing" and makes no window mean no prevention. The password the profile holds is refused alongside the superseded ones, which the reference leaves open; read the other way the smallest window the policy accepts would allow setting a password to the value it already has, and would not refuse the change away and straight back that the setting is for. Twelve unit tests, one concurrency test and six integration tests, with each guard probed by reverting it alone: dropping the old-password comparison, the reset-flag clear, the policy check or the check order is caught by the test written for it, and dropping the routing entry leaves the unsigned request answered by Cognito, which is what the routing parity test says too. Dropping the lock leaves five of twenty-four racing requests all told they succeeded with one password stored, neutering the reuse check leaves both refusals silent, and widening the window by one lets it reach a password that has left it. 1668 tests across all 98 IAM and query-routing classes pass at this commit. docs/services/iam.md documents the operation, the judgements, and the one thing Floci still does not model. AllowUsersToChangePassword is accepted and reported but grants nothing: the user guide says the option gives all users in the account access to iam:ChangePassword for only their user and to iam:GetAccountPasswordPolicy, applied at the account level rather than by attaching a policy, while Floci authorizes both from identity policies alone, so under enforcement a caller needs a policy naming their own user however the flag is set. The matrix row moves 166 to 167. |
||
|
|
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.
|
||
|
|
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 |
||
|
|
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. |
||
|
|
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. |
||
|
|
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. |
||
|
|
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.
|
||
|
|
e452ce8671 |
feat(codeartifact): add DescribePackage for all package formats (#5308)
DescribePackage returns a package's format, namespace, name, and origin controls, and answers ResourceNotFoundException for a package that does not exist. Existence is checked where the package actually lives: stored generic-format package versions for generic, and each format's sidecar for maven, npm, and pypi. A package whose name merely starts with another's name does not match it. Origin controls are reported as publish ALLOW and upstream BLOCK, the default CodeArtifact assigns to a package whose first version was published directly. Floci never ingests packages from upstream and does not store origin controls, so these values are fixed. For maven, npm, and pypi the existence check starts that repository's sidecar if it is not already running, the same side effect the asset bridge has. RepositorySidecarManager gains packageExists, implemented by each sidecar client. |
||
|
|
0848fa6a48 |
feat(elasticache): add user groups and associate them with replication groups (#4435)
CreateUserGroup, DescribeUserGroups, ModifyUserGroup and DeleteUserGroup returned UnsupportedOperation, and ModifyReplicationGroup read UserGroupIdsToAdd as user ids, so RBAC could not be set up the way AWS and Terraform (aws_elasticache_user_group, user_group_ids) do it. User groups are now stored resources. CreateReplicationGroup takes UserGroupIds and ModifyReplicationGroup adds and removes user groups; the proxy authenticates the members of a replication group's user groups, read at AUTH time so a ModifyUserGroup applies at once, each by its own authentication mode. A replication group with a user group associated admits only its members, even while the group is empty. An id in UserGroupIdsToAdd that names no user group but names a user still associates that user directly, so existing setups keep working. A cache uses either its AUTH token or user groups, as on AWS: while a user group is attached the token is not accepted and AuthTokenEnabled reads false. ModifyReplicationGroup takes AuthTokenUpdateStrategy DELETE, which removes the token and is only allowed together with a user group, and RemoveUserGroups. Removing the last user group leaves the cache without access control, still encrypted in transit; a token that was never deleted applies again. The proxy reads the cache's auth mode per connection, so these changes take effect without a restart. Validation follows the RBAC rules: a redis user group needs a user named default (DefaultUserRequired), members cannot share a user name (DuplicateUserName), valkey users only join valkey groups, a valkey group cannot hold a no-password user or serve a redis cache, association needs in-transit encryption, and a user group in use cannot be deleted (InvalidUserGroupState). ModifyUser refuses an engine or authentication change that a user group holding the user would reject. Deleting a user removes it from its user groups. |
||
|
|
9934b39a42 |
feat(redshiftserverless): add snapshot and restore operations (#5184)
* feat(redshiftserverless): add snapshot and restore operations Adds CreateSnapshot, GetSnapshot (by name or ARN), ListSnapshots (filterable by namespace), DeleteSnapshot and RestoreFromSnapshot on top of the existing workgroup support. A snapshot is AVAILABLE as soon as it is created, so a snapshot created in a standby region stands in for a cross-region copy. RestoreFromSnapshot restores into an existing namespace and workgroup and never creates either. * docs(redshiftserverless): document snapshot and restore actions * docs(redshiftserverless): update service matrix operation count * fix(redshiftserverless): validate snapshot restore and ARN lookup Reject a RestoreFromSnapshot workgroup that belongs to another namespace, resolve snapshotArn only for this account and Region, and register the snapshot model for reflection so persisted snapshots survive a native restart. * fix(redshiftserverless): harden snapshot restore and add lifecycle tests Validate namespaceName and snapshot names, accept snapshotArn on RestoreFromSnapshot, read the snapshot once during restore, and cover the handler with an integration lifecycle test and a Java SDK compatibility test. * feat(redshiftserverless): dump and restore snapshot data and model retention, tags and filters CreateSnapshot dumps a running workgroup with pg_dump and RestoreFromSnapshot empties the public schema and replays the dump, reusing the provisioned Redshift container manager. Snapshots now report adminUsername, kmsKeyId and retention, accept tags (taggable by ARN), ListSnapshots filters by namespaceArn, ownerAccount and a time window, and RestoreFromSnapshot rejects snapshotName and snapshotArn together. * fix(redshiftserverless): make snapshot restore atomic and strict Dump the current contents before a restore and put them back when the replay fails, drop every user schema rather than only public, run psql with ON_ERROR_STOP so a failing statement fails the restore, and fail a restore whose recorded dump file is missing. * fix(redshiftserverless): keep the catalog bootstrap schema out of snapshot restore The reset dropped floci_internal and with it the pg_catalog svv_external_* views, so the strict replay failed. Leave that schema out of the reset and out of the dump. * fix(redshiftserverless): drop large objects when resetting before a restore * refactor(redshift): share container lookup and defaults in the container manager * docs(redshiftserverless): document the bootstrap schema left out of snapshots * style(redshiftserverless): order imports in the runtime test --------- Co-authored-by: yarammanasa2001-max <271440416+yarammanasa2001-max@users.noreply.github.com> |
||
|
|
04a3b97346 |
feat(iam): model account properties and outbound web identity federation (#5177)
Adds GetAccountProperties, PutAccountProperties, SetSecurityTokenServicePreferences, EnableOutboundWebIdentityFederation, DisableOutboundWebIdentityFederation and GetOutboundWebIdentityFederationInfo, which completes step 9f of the IAM gap plan. A property key is Namespace/PropertyName with exactly one forward slash and neither a leading nor a trailing one, and every key in one request must share a namespace, which AWS states directly. A request mixing namespaces is rejected whole rather than partly applied. Enabling federation twice is FeatureEnabled 409 and disabling it twice is FeatureDisabled 404, an asymmetry AWS documents. The getter answers FeatureDisabled too when the feature is off, reusing the disable operation's own wording, which is matched rather than improved. The issuer URL is derived from the request's partition rather than the literal in the API Reference's example: api.aws is only the commercial partition's dual-stack suffix. It is minted once per account and survives a disable, since a relying party verifying tokens will have pinned it. AWS documents neither that nor JwtVendingEnabled's source, so both are recorded in the docs as choices. The OIDC discovery endpoints the issuer is documented to host, and the GetWebIdentityToken API the feature references, are not modelled: these six are the management operations only. |
||
|
|
a33eea05cd |
feat(iot): enforce custom authorizer decisions on MQTT connections (#4835)
* test(iot): cover custom authorizer invocation and enforcement against AWS * feat(iot): enforce custom authorizer decisions on MQTT connections Serve TestInvokeAuthorizer and invoke an authorizer's function on an MQTT CONNECT that names it, on the plaintext listener and the /mqtt WebSocket bridge. The event, the request and answer checks, signed-token verification and the refusal per MQTT version follow what was measured against AWS IoT Core. The bridge hands the upgrade's headers, query and server name to the broker keyed by its connection's local address. Closes #4823 * fix(iot): evaluate WebSocket custom authorizer policies against the client's address * docs(iot): note that a non-UTF-8 MQTT password reaches the authorizer altered * test(iot): cover custom authorizer CONNECTs on the plain MQTT listener * fix(iot): refuse TestInvokeAuthorizer tokens and signatures outside their length bounds * fix(iot): refuse authorizer JSON with trailing content TestInvokeAuthorizer, CreateAuthorizer and UpdateAuthorizer bodies, a custom authorizer's answer and each policy document it returns are now read with FAIL_ON_TRAILING_TOKENS, as the shared JSON controllers do, so a valid prefix followed by junk is refused instead of half-read. * fix(iot): keep address literals out of the WebSocket server name Over WSS without SNI the bridge fell back to the Host header unfiltered, so a client dialing an IP got that IP as tls.serverName in the authorizer event and as iot:DomainName in policy evaluation. Apply the same address literal filter SNI already uses. Also name the context validation ceiling in TestInvokeAuthorizer's ponytail note. |
||
|
|
9c0102559d |
feat(iam): model service-specific credentials (#5084)
Adds CreateServiceSpecificCredential, ListServiceSpecificCredentials, UpdateServiceSpecificCredential, ResetServiceSpecificCredential and DeleteServiceSpecificCredential, the five the wire model defines. A credential takes one of two shapes, decided by the service: CodeCommit and Keyspaces get a ServiceUserName and a ServicePassword, while the long-term API key services get a ServiceCredentialAlias and a ServiceCredentialSecret and accept CredentialAgeDays. The quota is two per service rather than two per user, and the version behind a service user name's +n suffix is the lowest one free rather than a count, so deleting out of order cannot mint a name already in use. A credential blocks DeleteUser until it is removed, the last item on AWS's list of what to delete first, and follows the user across an UpdateUser rename. |
||
|
|
f157d354f2 |
feat(rds): Aurora custom cluster endpoints (#5090)
Serve CreateDBClusterEndpoint, DescribeDBClusterEndpoints, ModifyDBClusterEndpoint and DeleteDBClusterEndpoint. A custom endpoint is stored per Region with the rules from the API reference and the Aurora user guide: type READER or ANY, a static or an exclusion member list but not both, members that are instances of the cluster, no writer in a READER endpoint, an RDS identifier stored lower case and unique in the Region, and at most five per cluster. Its ARN (cluster-endpoint:<id>) works with the tagging actions. DescribeDBClusterEndpoints lists each cluster's built-in WRITER and READER endpoints with its custom ones, and supports the cluster and endpoint identifiers, the four documented filters and paging. Deleting a cluster deletes its custom endpoints, and a deleted instance drops out of the member lists. Custom endpoints are modelled, not routed: one reports the cluster's own endpoint host, so connections through it go where the cluster endpoint sends them. Closes #5072 |
||
|
|
e7ca2ece22 |
feat(dms): add endpoint, replication instance and replication task lifecycles (#5001)
* feat(dms): add endpoint, replication instance and replication task lifecycles DMS dispatched only replication subnet groups and tagging, so CreateEndpoint, CreateReplicationInstance, CreateReplicationTask and their siblings answered UnknownOperationException and no aws_dms_endpoint, aws_dms_s3_endpoint, aws_dms_replication_instance or aws_dms_replication_task could be applied. Adds Create/Describe/Modify/Delete for endpoints, replication instances and replication tasks, plus Start/StopReplicationTask, which the provider calls for start_replication_task and before modifying or deleting a running task. - Resources are ARN-addressed (endpoint:, rep:, task:) with a 26-character generated id or the caller's ResourceIdentifier, and tagged through the existing tagging operations. - Instances are available and tasks ready from creation, the states the provider's waiters target; describe filters follow the API reference and a filter that matches nothing is ResourceNotFoundFault. - Endpoint settings structures round-trip, minus every SecretString member; ModifyEndpoint merges them unless ExactSettings is true. - Deleting an endpoint or instance a task uses, a subnet group an instance uses, or a running task is InvalidResourceStateFault. The unsupported-operation test now uses CreateReplicationConfig, which is still unimplemented. * style(dms): order DmsService imports alphabetically * docs(dms): list CdcStartTime and the missing describe actions as unimplemented * test(dms): cover tag add and remove on endpoint, instance and task ARNs * fix(dms): runtime-init DmsService, resolve the default subnet group, reject reversed task endpoints - Register DmsService under --initialize-at-run-time: its static SecureRandom otherwise lands in the native image heap (guard test and native builds). - Store only the three members KerberosAuthenticationSettings models instead of a deep copy of whatever the caller sent. - An instance created without a subnet group now describes the "default" group in full (VPC, subnets, status) from the region's default-VPC subnets. - CreateReplicationTask rejects a source ARN that is not a SOURCE endpoint and a target ARN that is not a TARGET endpoint. * fix(dms): name the swallowed default-subnet exception, sync the DMS matrix count The default-subnet fallback deliberately swallows AwsException; name it `ignored` and say why that is safe, per AGENTS.md. docs/services/index.md listed DMS at 6 operations; the handler dispatches 20. Add the reverse of the reversed-endpoints test: a source endpoint passed as TargetEndpointArn, which is the only test reaching the TARGET type check. |
||
|
|
a1ed65c51d |
feat(lambda): durable function callbacks (#5100)
* feat(lambda): durable function callbacks
A CALLBACK operation started at checkpoint gets a callback id that
SendDurableExecutionCallbackSuccess, Failure and Heartbeat complete or
keep alive, after which the function is invoked again to see it.
TimeoutSeconds and HeartbeatTimeoutSeconds time it out with
Callback.Timeout or Callback.Heartbeat. A completed, timed out or
stopped callback answers CallbackTimeoutException, an unreadable id
"Invalid callback id". The callback id carries the execution ARN, which
IAM authorizes the callback actions against.
Option range errors now name the update, as AWS does
("updates.1.member.waitOptions.waitSeconds").
* fix(lambda): name a repeated durable update as AWS does
AWS rejects two updates of one operation in a batch, other than a START
closed by its STEP or CONTEXT action, with "Cannot update the same
operation twice in a single request."
* fix(lambda): leave a durable execution waiting after a body-less callback failure
AWS marks a callback failed with an empty request body as FAILED but does
not invoke the function again, so the execution keeps waiting. The SDKs
send {} when Error is omitted, which does invoke it.
* fix(lambda): bound a durable callback failure's error at 1 MB
AWS rejects an Error over 1048576 bytes, measured as compact JSON, with
InvalidParameterValueException "Error object size must be less than or
equal to 1048576 bytes."
* test(lambda): keep a pending durable callback across a restart
* fix(lambda): reject a durable callback failure body that is not a JSON object
AWS treats only an empty body as a failure with no Error. Whitespace,
null or broken JSON get 400 SerializationException and leave the
callback open.
* docs(lambda): note the durable callback result limit AWS enforces
|
||
|
|
8ea033d9fd | feat(cognito): implement DeleteUser self-service API action (#4493) | ||
|
|
6a3bc12769 |
feat(lambda): run durable functions with checkpoints, waits and step retries (#5047)
* feat(lambda): run durable functions with checkpoints, waits and step retries
Invoking a durable function starts a durable execution, through Invoke or through an ARN (EventBridge, Scheduler, function URLs, destinations). The function checkpoints through CheckpointDurableExecution and GetDurableExecutionState, and Floci re-invokes it when a wait or a step retry comes due. GetDurableExecution, GetDurableExecutionHistory, ListDurableExecutionsByFunction and StopDurableExecution read and stop executions. Timers are persisted deadlines fired by a background sweep, so an execution survives a restart. Callbacks and chained invokes are rejected at checkpoint time.
* fix(iam): authorize durable execution actions against the owning function
A durable execution route has no /functions/ segment, so its resource fell back to *. The function name now comes from the execution ARN in the path.
* fix(lambda): keep durable executions inside their account
The execution APIs took the account from the ARN in the path, so another account could read or stop an execution. An ARN of another account is now ResourceNotFoundException.
* fix(lambda): limit the error size of an EXECUTION checkpoint too
* fix(lambda): reject an EXECUTION close that carries the other result kind
AWS rejects SUCCEED with an Error and FAIL with a Payload on the EXECUTION operation, as it does for steps.
* fix(lambda): spend a durable wake-up when a failed invocation schedules its retry
* fix(lambda): keep a durable crash retry's backoff across a restart
* fix(lambda): bound the durable execution locks
A lock per execution ARN was kept forever, even for an ARN that did not exist. A fixed set of striped locks replaces it. Locks are never nested, so a shared stripe cannot deadlock.
* fix(lambda): accept PAUSED, PAUSING and DELETING as durable status filters
AWS accepts them and answers an empty list, since Floci never puts an execution in those states.
* fix(lambda): reject a non-finite durable list timestamp
* test(lambda): resume a durable execution from its JSON file after a restart
* fix(lambda): keep durable executions inside their region
An execution ARN of another region now answers ResourceNotFoundException "Function not found", as AWS does, instead of reaching the execution past the IAM check of the request region.
* fix(lambda): validate durable list parameters before an empty status filter answers
Statuses of only PAUSED, PAUSING or DELETING still checks MaxItems and Marker, as AWS does. The bad Marker message is "Invalid Marker".
* perf(lambda): skip the execution scan for a status filter that matches nothing
Statuses of only PAUSED, PAUSING or DELETING now checks MaxItems and Marker without listing the account's executions.
* test(lambda): drop durable tests that repeat other coverage
The in-memory restart test repeats the persistence test, and the Docker success case repeats the compat suite's checkpoint loop. The Docker test keeps the failure case.
* fix(lambda): re-attach a durable execution name only on the same version
AWS keeps execution names unique per function across versions. A sync Invoke of another version with the same name and payload is DurableExecutionAlreadyStartedException, not the existing execution.
* chore(lambda): simplify the durable execution engine
Drop stored fields nothing reads, share the unseen-operations and
page-cursor helpers, skip the name scan for a generated name, and save
an execution once per invocation instead of twice.
* fix(lambda): reject a non-integer durable MaxItems as AWS does
AWS answers MaxItems=x on the durable execution APIs with
SerializationException "'x' can not be converted to Integer".
* docs(lambda): list the durable execution size limits as not emulated
* fix(iam): authorize durable execution actions against the execution ARN
The durable execution actions take the durable execution resource,
function:name:version/durable-execution/name/id. A role allowed on
function:name:* may checkpoint, one allowed only on the unqualified
function ARN is denied.
* fix(lambda): answer an unknown durable execution on checkpoint as a bad token
CheckpointDurableExecution and GetDurableExecutionState do not model
ResourceNotFoundException. AWS answers InvalidParameterValueException:
"Checkpoint token is not valid for the durable execution ARN" for a
token minted for another execution, "Invalid checkpoint token" otherwise.
* fix(lambda): replay a durable checkpoint retried with the same ClientToken
AWS answers a retry of the last checkpoint with the same ClientToken
with the same state and a usable next token, even though the request
token is spent. A different ClientToken, a retry after the next
checkpoint, or a retry of the checkpoint that closed the execution is
still an invalid checkpoint token.
* fix(lambda): validate durable list filters as AWS does
ListDurableExecutionsByFunction takes one status at most and answers
more with InvalidParameterValueException "Cannot filter by more than one
status". An unreadable StartedAfter or StartedBefore is
SerializationException "'<value>' can not be converted to Date", and a
plain date is accepted. Type errors come first, then MaxItems and status
values, then the single-status rule, then the function lookup.
* docs(lambda): note the history IncludeExecutionData default
* fix(lambda): report durable MaxItems and Statuses errors as AWS does
AWS puts an invalid MaxItems and an invalid Statuses into one
ValidationException ("2 validation errors detected: ...; ..."), MaxItems
first. A negative MaxItems must be greater than or equal to 0. MaxItems
is checked before the execution or function is looked up.
* refactor(lambda): share one durable execution ARN pattern with IAM
IAM and the durable execution service now recognize an execution ARN
with the same pattern, the one AWS validates it with.
* fix(lambda): replay a durable checkpoint answer as it was sent
On AWS a retry with the same ClientToken returns the operations as the
first answer had them: a WAIT stays STARTED in the retry even after it
has elapsed, while a fresh checkpoint reports it SUCCEEDED.
|
||
|
|
108f2b54bf |
feat(eventbridge): add ApiDestination target support (#4702) (#5009)
* feat(eventbridge): add ApiDestination target support (#4702) - Add ApiDestination, ApiDestinationState, and HttpParameters models - Implement CRUD operations for API destinations in EventBridgeService - Add CreateApiDestination, DescribeApiDestination, UpdateApiDestination, DeleteApiDestination, ListApiDestinations actions in EventBridgeHandler - Support HttpParameters on targets in PutTargets and ListTargetsByRule - Implement HTTP delivery to API destinations in EventBridgeInvoker with connection auth and SSRF protection - Add CloudFormation provisioning for AWS::Events::ApiDestination in EventsCfnProvisioner - Update docs and tests * fix(eventbridge): harden ApiDestination delivery and CloudFormation lifecycle - Throw on delivery failure so TargetDispatcher retries 429/5xx and connection errors and dead-letters permanent failures - Enforce InvocationRateLimitPerSecond per destination - Run the OAuth client-credentials exchange for OAUTH_CLIENT_CREDENTIALS connections - Reject non-http(s) endpoints and wildcard hosts, encode path parameter values, keep the query before any fragment, and stop logging URLs that may carry secrets - Resolve destination and connection ARNs only when they match the stored ARN - Validate every UpdateApiDestination field before applying any of them - Paginate ListApiDestinations with Limit and NextToken - Keep HttpParameters on AWS::Events::Rule targets and roll back AWS::Events::ApiDestination updates from a snapshot * fix(eventbridge): keep connection credentials authoritative and require a valid endpoint host - Apply target headers and query parameters before the connection's so a target cannot override its credentials, and replace header names that differ only by case - Reject endpoints without a parsed host (for example https://:8080/path) - Sweep stale rate-limit windows once the map grows * fix(eventbridge): make the ApiDestination rate limit check atomic Count permits inside ConcurrentHashMap.compute on an immutable window so the stale-window sweep can no longer remove a window another delivery is using, which let concurrent deliveries exceed InvocationRateLimitPerSecond. * refactor(eventbridge): drop the in-service InMemoryStorage constructor and tidy tests - Remove the compatibility constructor that instantiated InMemoryStorage inside EventBridgeService; tests pass the ApiDestination store explicitly - Import classes instead of qualifying them inline in the ApiDestination integration test - Surface worker failures in the concurrent rate limit test by checking each Future * docs: correct the EventBridge and IAM operation counts in the service matrix |
||
|
|
fabcd6baf8 |
feat(iot): manage custom authorizers (#4826)
* test(iot): cover custom authorizer management against AWS * feat(iot): manage custom authorizers Serve CreateAuthorizer, DescribeAuthorizer, UpdateAuthorizer, DeleteAuthorizer, ListAuthorizers, SetDefaultAuthorizer, DescribeDefaultAuthorizer and ClearDefaultAuthorizer on the AWS REST-JSON paths, with the validation, messages, defaults, key merge, delete rules, ordering and paging measured against AWS. Authorizer ARNs are tagged through the existing IoT tag routes. Authorizers are stored, not evaluated. Closes #4821 * fix(iot): read authorizer public key PEM line by line like AWS A key without its PEM header line, or with an indented or inline header, is not a valid RSA key, a header without its end line cannot convert, and text before the header is skipped, as measured on AWS. * fix(iot): validate authorizer names like AWS, SetDefaultAuthorizer included A name member reports every violated constraint in one message, the pattern first, and a missing one must not be null. SetDefaultAuthorizer validates authorizerName before the lookup, as measured on AWS. * fix(iot): validate the authorizer name on describe, update and delete like AWS DescribeAuthorizer, UpdateAuthorizer and DeleteAuthorizer now reject a malformed or overlong authorizerName path member with AWS's 400 InvalidRequestException messages instead of a 404, measured on eu-west-1. * fix(iot): route tag calls to the authorizer service on the ARN resource IotTagHandler matched ":authorizer/" anywhere in the ARN, so an ARN with that text outside the resource field reached the authorizer service and failed with a 500. It now routes on the parsed resource prefix, and any other IoT ARN goes through IotService as before. |
||
|
|
99a6b4050c |
feat(redshift-serverless): add running workgroups and Data API WorkgroupName support (#5012)
* feat(redshift-serverless): add running workgroups and Data API WorkgroupName support Redshift Serverless workgroups get full CRUD (Create/Get/List/Update/Delete), tagging by ARN, and the AWS::RedshiftServerless::Namespace and ::Workgroup CloudFormation types with dotted Fn::GetAtt keys taken from the registry schema. A namespace has at most one workgroup, and DeleteNamespace is refused while one is attached. Each workgroup runs a PostgreSQL container behind an authenticating proxy, sharing the managers and the proxy port pool with provisioned Redshift. Add GetCredentials, accept WorkgroupName (name or ARN) in the Redshift Data API, and push a changed namespace adminUserPassword down to the running backend. The runtime is re-attached when Floci restarts. Not covered: snapshots, usage limits, endpoint access, and COPY/UNLOAD/Spectrum on workgroups. * fix(redshift-serverless): stop the runtime when workgroup creation fails after it started If persisting the workgroup record failed after the container and proxy were already running, the runtime was left behind with no record. createWorkgroup now stops it (best effort) and releases the endpoint on the failure path. Fix the CloudFormation error for a NamespaceName change: suggesting a new WorkgroupName can never succeed because a namespace holds only one workgroup. * fix(redshift-serverless): reset omitted CloudFormation properties and order startup observers When UpdateStack drops a property from the template, the provisioner now sends its default (BaseCapacity, EnhancedVpcRouting, PubliclyAccessible, Port, TrackName, PricePerformanceTarget) instead of keeping the stored value, which matches CloudFormation semantics. MaxCapacity has no default and keeps its stored value. Give the workgroup StartupEvent observer a @Priority after RedshiftService so every persisted cluster has reserved its proxy port before workgroups restore theirs. Also remove an unused import and move DEFAULT_DATABASE to the top of RedshiftContainerManager. * fix(redshift-serverless): address review findings on password rotation and namespace updates - Roll the backend password back when a rotation cannot be completed or stored, and apply it last so validation failures never leave the backend ahead of the stored namespace. - Keep a workgroup endpoint reserved when its runtime cannot be stopped during clear(). - Reject an in-place DbName change in CloudFormation, since it is fixed at creation. - Reset an omitted KmsKeyId and DefaultIamRoleArn on CloudFormation updates. * fix(redshift-serverless): keep rollback failures from masking errors and drop stale GetAtt role - Do not reset the proxy password when the role restore fails, and attach restore failures to the original exception instead of replacing it. - Remove Namespace.DefaultIamRoleArn from the stack resource when an update no longer declares a default role. * docs: correct the Redshift Serverless operation count in the service matrix * fix(redshift-serverless): expose Workgroup.ConfigParameters through Fn::GetAtt * fix(redshift-serverless): parse ConfigParameters resolved from a GetAtt attribute * docs(redshift-serverless): list every unsupported operation group |
||
|
|
665603e8f4 |
feat(ram): add ListResourceSharePermissions (#5073)
Returns the default AWS managed permission per resource type in a share. * Fix #4883 Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com> |