feat: Add C bindings for DynamoDB LazyLoad source#576
Open
beekld wants to merge 1 commit into
Open
Conversation
2ce9c92 to
e06f24a
Compare
b4c4558 to
00c3ce9
Compare
e06f24a to
c0acca8
Compare
00c3ce9 to
d4251b7
Compare
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
Introduces DynamoDB C bindings. Before this PR, none of the DynamoDB integration was reachable from C -- neither LazyLoad source nor Big Segments store. This PR covers the LazyLoad source and the shared
DynamoDBClientOptionssurface; the Big Segments store follow-on will reuse the options builder introduced here.New public surface:
LDServerDynamoDBClientOptionsBuilderopaque handle for AWS DynamoDB client configuration.LDServerDynamoDBClientOptionsBuilder_New/_Free, and setters for_Region,_Endpoint,_AccessKeyId,_SecretAccessKey,_SessionToken.LDServerLazyLoadDynamoDBSourceopaque handle.struct LDServerLazyLoadDynamoDBResultwithsourceanderror_messagefields, plusLDSERVER_LAZYLOAD_DYNAMODBSOURCE_ERROR_MESSAGE_SIZE.LDServerLazyLoadDynamoDBSource_New(table_name, prefix, options, out_result)factory andLDServerLazyLoadDynamoDBSource_Free(source).Tests:
PrefixedDynamoDBClientfixture, wires the source through the C API, and verifiesLDServerSDK_AllFlagsStatereads the flags back. Mirrors the Redis LazyLoad e2e.Design decisions worth flagging: the source type name uses config-section-first word order (
LazyLoad+DynamoDB+Source) to match the existing Redis LazyLoad bindingLDServerLazyLoadRedisSource. The client options type is namedLDServerDynamoDBClientOptionsBuilder(withBuildersuffix) even though the C++ side is a plain struct rather than a builder -- the C surface is builder-like from the caller's perspective (_New+ setters + consumed by a factory), which matches the siblingLDServerHttpPropertiesTlsBuilderprecedent in the same shape.Stacked on #574 (Redis Big Segments store). Please review that PR first.
Note
Medium Risk
New public C surface and AWS client credential configuration; behavior is read-only against Relay-populated tables but misconfiguration could affect flag loading in production.
Overview
Exposes the DynamoDB Lazy Load data source to C callers, matching the existing Redis LazyLoad binding pattern (
LDServerLazyLoadRedisSource).New C API:
LDServerDynamoDBClientOptionsBuilder(region, endpoint, static/session credentials; unset fields use the AWS SDK default chain) andLDServerLazyLoadDynamoDBSourceviaLDServerLazyLoadDynamoDBSource_New(table, prefix, options, &result)with stack-allocatedLDServerLazyLoadDynamoDBResultfor success or a fixed-sizeerror_message. Factories consume the options builder; callers free the source only if they do not hand it toLDServerLazyLoadBuilder_SourcePtr.Implementation: Thin C shims in
bindings/dynamodb/delegate toDynamoDBDataSource::CreateandDynamoDBClientOptions; CMake wires the new translation units intoserver-sdk-dynamodb-source.Tests: Options builder lifecycle, source creation with options and with
NULLoptions, plus a DynamoDB Local e2e that configures LazyLoad through the C API and assertsLDServerSDK_AllFlagsStatereads seeded flags.Reviewed by Cursor Bugbot for commit d4251b7. Bugbot is set up for automated code reviews on this repo. Configure here.