Skip to content

Omit API keys from StripeObject pickles and add explicit key rebinding 🪿✨ - #1959

Open
zacchua-stripe wants to merge 8 commits into
masterfrom
fix/pickle-credentials
Open

zacchua-stripe wants to merge 8 commits into
masterfrom
fix/pickle-credentials

Conversation

@zacchua-stripe

Copy link
Copy Markdown
Contributor

Why?

Pickling StripeObjects currently persists API keys in. This PR removes api key from pickling and provides consumers making requests through restored objects a helper method to supply a key.

What?

  • replace api_key with None in StripeObject reduce method
  • Create a set_api_key() to bind credentials in place across nested StripeObjects

See Also

http://go/j/RUN_DEVSDK-3639

Configuration

  • skip-changefile: This PR is not a user-facing change, so there's no changefile.

Prevent credentials from leaking into pickle-backed caches and queues.
Add graph-wide set_api_key() binding so consumers can supply their own
credentials while preserving routing and destination-global fallback.

Include regression tests and v16 migration guidance. Existing stored
pickles remain sensitive and are not sanitized by this change.

Committed-By-Agent: goose
Orbit-Session-Id: 6c16ab70-1263-4d0e-a050-72c9b9f30280
Consolidate overlapping pickle round-trip and credential-rebinding tests to remove duplicate setup and serialization. Retain coverage for supported pickle protocols, destination-global fallback, nested rebinding, routing preservation, and credential-free re-pickling without changing implementation behavior.

Verified 172 targeted tests pass, along with formatting, linting, and git diff whitespace checks.

Committed-By-Agent: goose
Orbit-Session-Id: 6c16ab70-1263-4d0e-a050-72c9b9f30280
Document global fallback and explicit recursive key rebinding. Strengthen
nested requestor preservation coverage and remove task-specific README edits.

Committed-By-Agent: goose
Orbit-Session-Id: 6c16ab70-1263-4d0e-a050-72c9b9f30280
Remove redundant nested-resource serialization and assertions already covered by payload equality and credential-absence checks on re-pickled bytes. Recursive rebinding, cycle handling, routing preservation, standalone metadata serialization, and request-boundary coverage remain intact.

Validated with 101 passing StripeObject tests, formatting, linting, and git diff --check.

Committed-By-Agent: goose
Orbit-Session-Id: 6c16ab70-1263-4d0e-a050-72c9b9f30280
Fix the workflow security check failing on GHSA-5xjx-3w67-w9x9.
Pin the patched release to its verified commit SHA.

https: //github.com/advisories/GHSA-5xjx-3w67-w9x9
Committed-By-Agent: goose
Orbit-Session-Id: 6c16ab70-1263-4d0e-a050-72c9b9f30280
Keep CI configuration unchanged to scope this branch to pickle credentials.

Committed-By-Agent: goose
Orbit-Session-Id: 6c16ab70-1263-4d0e-a050-72c9b9f30280
Use concise examples to explain explicit API-key rebinding and global fallback.
Clarify that rebinding preserves current requestor configuration, not the
producer's custom HTTP client.
@zacchua-stripe
zacchua-stripe marked this pull request as ready for review October 30, 2026 23:34
@zacchua-stripe
zacchua-stripe requested a review from a team as a code owner October 30, 2026 23:34
@zacchua-stripe
zacchua-stripe requested review from jar-stripe and removed request for a team October 30, 2026 23:34

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant