Commit Graph
14 Commits
Author SHA1 Message Date
Niels Kootstra addee350ba fix(kinesis): expire shard records past the stream's retention period (#4224)
* fix(kinesis): expire shard records past the stream's retention period

Shards kept every record for the life of the stream, so memory grew without
bound and TRIM_HORIZON returned records older than the retention period.

Drop records older than the retention period when a shard is written or read,
including right after DecreaseStreamRetentionPeriod. Continuation and LATEST
iterators now resume by sequence number instead of by array index, so
trimming older records does not make a consumer skip data. Index-based
iterators issued by earlier versions, such as persisted Firehose checkpoints,
are offset by the number of records pruned since.

* fix(kinesis): read a shard's records and pruned count under one lock

A legacy index iterator is offset by the number of records pruned since
it was issued. The records and the count were read in two separate lock
acquisitions, so a prune between them left the count ahead of the
snapshot and the consumer resumed too early, replaying records it had
already read. Take both from one snapshot.

* chore: rerun CI

* test(kinesis): pin the service clock instead of stretching retention

The JSON handler timestamp tests raised retention to 8760 hours so a
fixed 2026 arrival timestamp survived pruning against the wall clock,
which would start failing a year later. Build those services with a
clock fixed just after the literal instead, and restore the fixed
2026-01-01 base in millisBehindLatestIsTimeDeltaWhenBatchLimitHit.
2026-09-23 14:05:10 -04:00
Daniël van Ziel 8e6faffcaf fix(kinesis): paginate ListShards with an opaque NextToken (#4098) 2026-09-22 13:38:28 -04:00
Matheus Oliveira e3766eac6f feat(kinesis): implement UpdateShardCount API (#3200)
Adds uniform-scaling reshard support via existing splitShard/mergeShards
machinery, with the documented double/half, 10000-shard, and 10-scales-per-24h
limits enforced as LimitExceededException/InvalidArgumentException/ValidationException.
The half-shard-count minimum rounds up for an odd current count, which is
Floci's own call since AWS documents only "below half" with no stated
rounding direction; the separate 10 TPS call-rate limit AWS documents on this
action is not simulated, matching Floci's lack of real-time request
throttling elsewhere. Both are now called out explicitly in the docs and code.

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>

* Fix #3064
2026-09-11 16:25:49 -04:00
Ben YounesandBen Younes a006b27694 fix: honor Kinesis ExplicitHashKey routing (#3069)
* fix: honor kinesis explicit hash keys

* fix(kinesis): reject numeric ExplicitHashKey and migrate legacy shard ranges (#3069)

Address the two review findings on explicit-hash-key routing:

- Reject a non-string ExplicitHashKey JSON node with SerializationException
  in PutRecord and PutRecords, instead of letting asText coerce a JSON number
  into an accepted decimal string, preserving AWS wire-protocol fidelity.
- Repartition legacy multi-shard streams whose open shards still carry the old
  full-span hash range into disjoint contiguous ranges before explicit-hash
  routing, so an explicit key no longer collapses onto the first shard after an
  upgrade. Already-disjoint (new/split/merged) streams are left untouched.

RED -> GREEN: 3 new tests failed on the prior HEAD
(putRecordRejectsNumericExplicitHashKey, putRecordsRejectNumericExplicitHashKey,
putRecordMigratesLegacyOverlappingShardRangesForExplicitHashKey), all green
after the fix. Kinesis suite: 118 run, 0 failures.

---------

Co-authored-by: Ben Younes <2910651+ousamabenyounes@users.noreply.github.com>
2026-09-05 12:35:06 -04:00
soreavis 353d9c842f feat(kinesis): add PutRecords request caps and a per-stream max record size (#2438)
PutRecords enforced only the per-record limit. AWS also caps a request at
500 records and 10 MiB including partition keys; both are now whole-request
rejections with InvalidArgumentException, since per-record ErrorCode only
carries throughput and internal failures. The count cap is checked upfront
and the byte cap as the loop goes, so neither an over-long batch nor an
oversized one is fully decoded before it is rejected. Undecodable or
non-string Data counts toward the cap at the UTF-8 bytes the caller sent,
so a batch of malformed records cannot slip past it.

The per-record maximum becomes per-stream state defaulting to 1024 KiB, set
by CreateStream's MaxRecordSizeInKiB or UpdateMaxRecordSize (1024-10240) and
reported by DescribeStreamSummary. UpdateMaxRecordSize documents
ValidationException for an out-of-range size. CreateStream doesn't, and
reserves ValidationException for the on-demand case, so it answers
InvalidArgumentException. Streams persisted before the field existed
deserialize to the default.
2026-08-21 16:15:25 -04:00
themark007 486be8f5b0 feat(kinesis): add local inspection endpoints for UI (#1880)
* feat(kinesis): add local inspection endpoints for UI

* fix(kinesis): limit local record inspection

* fix(kinesis): include shard id in inspected records

* fix(kinesis): address reviewer comments on inspection endpoint

- Comment 1 (fix): sort order for Limit — already using a min-heap
  PriorityQueue (oldestFirst comparator) that evicts the oldest record
  when size > resolvedLimit, so the queue retains the newest N records.
  Records are then re-sorted ascending before return. Limit=2 on
  [oldest, middle, newest] now returns [middle, newest], not
  [oldest, middle]. The previous ascending-sort+limit path was replaced
  in the prior commit; this commit pins the behaviour in the test.

- Comment 2 (minor): unify error shapes on the /records endpoint.
  Moved the Limit <= 0 guard from KinesisService into
  KinesisInspectionController next to the StreamName guard so both
  query-parameter validations use the same plain {"message": ...} shape
  instead of the AwsException {"__type": ...} shape.

- Comment 3 (minor): consistent clamping policy. Removed the throw for
  limit <= 0 from resolveInspectionRecordLimit; both bounds are now
  clamped silently via Math.max/min, matching the behaviour of the
  sibling getRecords / getRecordsForAccount methods. Added Javadoc
  noting the 1000-record hard ceiling with no pagination cursor.

- Test: strengthened recordsEndpointHonorsLimit to assert which two
  records are returned (pk-2 and pk-3, the newest), not just hasSize(2).
  Added recordsEndpointRejectsNonPositiveLimit to cover the controller-
  level Limit=0 validation.
2026-08-13 00:24:37 -04:00
Feyikemi Ogunsanya 3b760bd8e5 fix(kinesis): resolve LATEST shard iterator position at GetShardIterator time (#1901)
* fix(kinesis): resolve LATEST shard iterator position at GetShardIterator time

A LATEST iterator recomputed its start position as the shard tip on
every GetRecords call, so records written between obtaining the iterator
and the first poll were skipped forever. Snapshot the tip once when the
iterator is created (matching DynamoDbStreamService) and encode it in
the iterator's index slot. GetShardIterator now also fails fast with
ResourceNotFoundException for an unknown shard, as on AWS.

Fixes #1900

* test(kinesis): add regression tests for tailing with a LATEST iterator

Reproduce issue #1900: a record written after the iterator is obtained
must be returned, both on the first GetRecords call and when polling
via NextShardIterator.

* test(kinesis): cover unknown shard validation for LATEST iterators

GetShardIterator must return ResourceNotFoundException when the shard
does not exist instead of deferring the failure to GetRecords.

* docs(kinesis): document shard iterator semantics

Describe the supported iterator types and the LATEST tip-snapshot
behavior; remove a stray empty Examples heading.

* fix(kinesis): validate shard existence for all iterator types in GetShardIterator

AWS rejects an unknown shard at GetShardIterator time for every
iterator type, not just LATEST. Apply the shard lookup unconditionally
instead of deferring the failure to GetRecords.

Addresses review feedback on #1901.

* test(kinesis): cover unknown shard validation across all iterator types
2026-08-09 00:10:16 -05:00
TiM 7d70f64162 feat(docs): generate Supported Actions tables from handler source (#1641)
* feat(docs): generate Supported Actions tables from handler source

The "Supported Actions" tables in docs/services/*.md were hand-maintained and
drifted from the handlers. For example secrets-manager.md omitted RestoreSecret,
which SecretsManagerJsonHandler dispatches, and acm.md listed RenewCertificate,
which is not implemented anywhere in src/.

Derive the action list from handler source so it cannot drift, while keeping the
hand-written Description column:

- tools/docs/regen_action_docs.py extracts actions from `case "X" ->` switch arms
  (including multi-label arms) and JAX-RS REST controllers, and rewrites only the
  rows between the <!-- floci:actions --> markers. Descriptions are preserved by
  action name; new actions get a "-" placeholder. PascalCase-only matching avoids
  picking up SCREAMING_CASE labels from non-action switches.
- tools/docs/services.yaml registers 18 single-table switch services and lists the
  remaining switch handlers under deferred_handlers, so the new-service sentinel
  fires only on a genuinely unregistered handler.
- make docs-sync / docs-check / docs-test, plus a Python-only CI workflow that
  gates on handler, doc, and tooling changes.
- Migrate 18 service docs into marker blocks, reconciling real drift (adds
  RestoreSecret, ImportCertificate, and others; drops the unimplemented
  RenewCertificate).

Revives the parser and CI gate from #738 by @ericbsantana and completes the
description-preservation its spec described. REST-mode, mixed-mode, multi-table,
non-tabular, S3, and ecr docs are deferred and tracked in deferred_handlers.

* docs: drop standalone design spec from action-docs tooling

Remove ideas/auto-generated-action-tables.spec.md and the four references
to it (CONTRIBUTING.md, Makefile, regen_action_docs.py docstring,
services.yaml). It was a planning artifact; the operational docs live in
CONTRIBUTING.md and the tooling is self-documenting. The #738 / @ericbsantana
credit is preserved in the PR description.

* chore: address review on action-docs tooling

- pin actions/checkout to v7.0.0 in docs-actions workflow to match the
  repo-wide bump (#1690), so dependabot does not immediately flag the new file
- document in the generator docstring that a switch case label counts as
  supported purely by existing, so a per-action UnsupportedOperation stub
  would be a false positive (handlers here reject from the default arm)

* docs: regenerate action tables against current handler source

Resync the generated Supported Actions tables to handler source after
rebasing onto the latest main:

- cloudformation: add DescribeStackInstance and DescribeStackSetOperation
  now emitted by the handler, and keep the implemented StackSet descriptions
- cloudtrail: add LookupEvents
- firehose: add UpdateDestination
- step-functions: add PublishStateMachineVersion, ListStateMachineVersions,
  DeleteStateMachineVersion
- register the cloudcontrol handler in deferred_handlers so the strict
  unregistered-handler gate passes (no standalone action table yet)

* fix(docs): prevent action-table generator from silently dropping actions

Address the latest review pass on the action-docs tooling:

- switch extraction now captures case arms whose labels wrap across lines
  (valid Java 14+ syntax). The capture group excludes only `{ } ;` boundaries,
  so it spans newlines between labels but stops at the arm's `->`. A wrapped
  arm was previously missed, and docs-check would stay green because the doc
  and the generated output agreed on the omission, defeating the whole
  drift-prevention guarantee.
- REST extraction skips Javadoc / inline comments between a verb annotation
  and the method signature; such a line otherwise reset the lookahead and
  dropped the action.
- parse_marker_block raises a descriptive error when a marker is not on its
  own line, instead of a bare "substring not found".
- doc, source, and registry reads/writes are pinned to UTF-8 so generation is
  locale-independent (the docs contain non-ASCII text).
- the docs-actions push trigger watches Makefile and the workflow file,
  matching its pull_request trigger.

Adds regression tests for the multi-line arm and comment-skip paths (20 total).
2026-07-06 21:02:04 -05:00
Hector Ventura 9e35046647 Docs/enviroment instead yml (#764)
* docs: moving all config to env instead of yml
* docs: sync with main and new features
* docs: reverting docker-compose.yml
2026-05-10 11:53:31 -05:00
Hector Ventura c7152cef8a fix(kms): GetKeyRotationStatus returns false for asymmetric and HMAC keys (#618)
* fix(kms): return false for GetKeyRotationStatus on asymmetric/HMAC keys

AWS updated GetKeyRotationStatus behavior so asymmetric and HMAC keys
return { KeyRotationEnabled: false } instead of UnsupportedOperationException.
EnableKeyRotation and DisableKeyRotation still reject these key types.

* fix(kms): return false for GetKeyRotationStatus on asymmetric/HMAC keys

AWS updated GetKeyRotationStatus behavior so asymmetric and HMAC keys
return { KeyRotationEnabled: false } instead of UnsupportedOperationException.
EnableKeyRotation and DisableKeyRotation still reject these key types.
2026-04-27 22:50:49 -05:00
TiM a32b7f1f3b docs: comprehensive audit sweep + CHANGELOG backfill (1.1.0-1.5.2) (#326)
CHANGELOG.md was empty for the 1.1.0-1.5.2 release cycle and service docs
had drifted from code behaviour. This sweep reconciles docs against the
current codebase on upstream/main.

- Backfill CHANGELOG.md for 1.1.0 through 1.5.2 from git history
- Correct exact operation counts in docs/services/index.md: S3 (~30 -> 58),
  Lambda (~25 -> 30), API Gateway v1 (~24 -> 62). Counts now come from the
  actual dispatch handlers rather than @Path annotation counts.
- Rewrite README "Supported Services" table to drop per-service op counts
  (they drift too fast); point readers at docs/services/index.md
- Update 24 service docs for accuracy, add "Not Implemented" sections
  where relevant (s3.md, lambda.md, api-gateway.md)
- Refresh configuration and getting-started docs
- Add EventBridge Scheduler and AppConfig to mkdocs nav
- Add AppConfig / AppConfigData rows to README and services index
  following the 1.5.2 upstream release
2026-04-10 10:52:34 -05:00
TiM 202d6eb824 feat(kinesis): resolve stream name from StreamARN parameter (#304)
* feat(kinesis): resolve stream name from StreamARN parameter

Most Kinesis actions now accept StreamARN as an alternative to
StreamName, matching real AWS behavior. A shared resolveStreamName
helper extracts the stream name from the ARN (guarding against
malformed and consumer ARNs) and throws InvalidArgumentException
when neither field is valid. handleListShards inline logic replaced
with the shared helper. CreateStream excluded (no ARN at creation).

* fix(kinesis): use dedicated stream in ARN put/get test and renumber after rebase

The putAndGetRecordsByArn test read from shardId-000000000000 which was
split by an earlier test, so GetRecords returned 0 records. Use a
dedicated 1-shard stream and tighten assertions. Renumber ARN test
orders (20-23) to avoid collision with upstream retention period tests.
2026-04-09 21:45:24 -05:00
TiM a770b61a7b feat(kinesis): add IncreaseStreamRetentionPeriod and DecreaseStreamRetentionPeriod (#305)
Wire up the two retention period API actions that were missing despite
the model already having retentionPeriodHours with getter/setter.

Validation matches AWS behavior:
- Increase rejects values <= current or > 8760 (365 days)
- Decrease rejects values >= current or < 24 hours

Closes #291
2026-04-09 19:32:27 -05:00
Hector Ventura 61433f59ab firt commit 2026-03-15 17:43:56 -05:00