feat(kinesis): resolve stream name from StreamARN parameter#304
Merged
hectorvent merged 2 commits intofloci-io:mainfrom Apr 10, 2026
Merged
Conversation
hectorvent
approved these changes
Apr 9, 2026
Collaborator
hectorvent
left a comment
There was a problem hiding this comment.
Thank you @hampsterx
Collaborator
|
Hi @hampsterx, Please check internal test failure: |
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).
…fter 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.
85a093c to
8190130
Compare
Contributor
Author
|
fixed, tests failing due to #317 i think |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Most Kinesis actions now accept
StreamARNas an alternative toStreamName, matching real AWS SDK behavior. When a client sends a full ARN (e.g.arn:aws:kinesis:us-east-1:123456789012:stream/my-stream), Floci extracts the stream name and resolves it normally.resolveStreamNamehelper toKinesisJsonHandlerthat checksStreamNamefirst, falls back to parsingStreamARNCreateStreamwhich only acceptsStreamNameper AWS API)handleListShardsfrom inline ARN logic to the shared helper:stream/segment, trailing slash, consumer ARNs)InvalidArgumentExceptionwhen neither field is validMotivation
AWS SDKs send
StreamARNwhen the user passes an ARN-format identifier. Libraries like async-kinesis detect thearn:prefix and useStreamARNautomatically. Without this, Floci treats the entire ARN as a literal stream name and returns "Stream does not exist".Test plan
KinesisJsonHandlerTest) covering: StreamName resolution, StreamARN resolution, empty/whitespace name fallback, missing fields, malformed ARN, ARN ending in slash, consumer ARN extraction, StreamName precedenceKinesisIntegrationTest): DescribeStream by ARN, PutRecord+GetShardIterator+GetRecords by ARN, missing field returns 400, malformed ARN returns 400Changes