Repository navigation
feat: hardening sdk on participant_context - #69
Merged
Merged
Conversation
jimmarino
approved these changes
Sep 28, 2026
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.
Problem
Flow operations on an existing flow (
terminate,started,completed,suspend,resume,status, and thenotify_*callbacks) received the caller's participant context as_ctxand ignored it. Flows were loaded withWHERE id = $1, so a participant authenticated for its own context could read or change another participant's flow just by knowing its flow id. That includes overwriting the flow's data address viastarted/resume. Flow ids were also globally unique, sostart/preparewith another tenant's id returned 409, revealing that the id exists.Changes
DataFlowRepo:fetch_by_idanddeletenow takeparticipant_context_id, andupdatekeys on(flow.participant_context_id, flow.id). A flow owned by another context is reported as not found.participant_context_id.data_flowsprimary key to(participant_context_id, id), so flow ids are unique per participant context.DataPlaneSdkInternal: every flow operation andsend_callbackpasses the caller's context through. The publicfetch_by_idgains actxparameter.Url::path_segments_mut, so the caller-supplied flow id is always a single percent-encoded segment. NewSdkError::InvalidCallbackUrl.Breaking changes
DataFlowRepoandDataPlaneSdkInternal::fetch_by_idsignatures changed. Custom repo implementations need updating.data_flows.Tests
NotFoundfor another context's flow, and the handler is never called.