Skip to content

Add "source" field to user-agent header#3394

Merged
xavdid merged 2 commits into
masterfrom
DEVSDK-3131
Jun 4, 2026
Merged

Add "source" field to user-agent header#3394
xavdid merged 2 commits into
masterfrom
DEVSDK-3131

Conversation

@xavdid

@xavdid xavdid commented Jun 3, 2026

Copy link
Copy Markdown
Member

Why?

Earlier this year, we removed the output of uname from the user-agent header for privacy reasons. It over-collected data we usually didn't need.

Since then, our tech support team has reached out asking us to re-add some of the information to help with complex debugging tasks: sometimes they need to help users identify exactly which machine produced an API call.

Rather than just revert the previous change and reintroduce the same privacy issues that caused its removal in the first place, we're taking a more privacy-focused approach. Rather than send all the PII in plaintext, we hash it first. This way it can still be used to confirm the source of an API call if a user generates the hashes themselves, but isn't sensitive in and of itself.

What?

  • add source key to user-agent hash. It's contents are an md5 hash of uname -a
  • add tests

See Also

@xavdid xavdid requested a review from a team as a code owner June 3, 2026 23:31
@xavdid xavdid requested review from jar-stripe and removed request for a team June 3, 2026 23:31

@jar-stripe jar-stripe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sanity check and one comment to fix, but otherwise looks good

Comment thread src/Stripe.net/Infrastructure/Public/SystemNetHttpClient.cs
Comment thread src/Stripe.net/Infrastructure/Public/SystemNetHttpClient.cs Outdated
@xavdid xavdid enabled auto-merge (squash) June 4, 2026 20:11
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.

2 participants