Draft
Conversation
When a cloud event's index key matches the new "single-<uuid>.json" format (introduced in DIS for events too large to batch into Parquet), skip the inline download and instead return a short-lived pre-signed S3 GET URL via the new `presignedUrl` GraphQL field. Changes: - `IsSingleEventRef(key)` detects keys with `single-` filename prefix - `ObjectGetter` interface gains `HeadObject` for bucket discovery - `Service.HeadObject` exposes bucket-scoped head checks - `Resolver` gains `Presigner` (*s3.PresignClient) and `PresignExpiry` - `presignSingleEvent` finds the correct bucket via HeadObject, then generates a presigned URL for the configured expiry (default 15m) - `LatestCloudEvent` and `CloudEvents` resolvers detect single refs and return header + presignedUrl with data/dataBase64 null - `PRESIGNED_URL_EXPIRY` setting controls URL lifetime (e.g. "15m") - GraphQL schema adds `presignedUrl: String` to CloudEvent type - generated.go updated to reflect new schema field https://claude.ai/code/session_01NBNBB4CaeL8t97oyiey4dJ
- TestIsSingleEventRef (12 cases): table-driven coverage of IsSingleEventRef
for positive keys (date-prefixed, bare, deep path, UUID-style), parquet
batch refs, legacy DID keys, wrong extensions, wrong basename prefixes,
and edge cases (empty key, bare slash)
- TestPresignedUrlResolver (3 cases): field resolver returns nil for nil
wrapper, nil for empty URL, and a pointer to the URL string when set
- TestHeaderResolverWithPresignedWrapper: confirms that Header, Data, and
DataBase64 field resolvers behave correctly when a wrapper carries a
presigned URL (header returns index header, data/dataBase64 are nil)
- TestPresignSingleEvent (6 cases): exercises presignSingleEvent with a
stubObjectGetter (no real S3 or network) and a fake-credentialed
PresignClient (presigning is pure HMAC — no network calls):
- first bucket hit → presigned URL contains bucket name and key
- first bucket miss, second hit → falls back correctly
- both buckets miss → error contains the key
- non-NoSuchKey error on first bucket → still skips to second
- configured expiry embedded in X-Amz-Expires query param
- no buckets configured → error
https://claude.ai/code/session_01NBNBB4CaeL8t97oyiey4dJ
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.
No description provided.