Skip to content

Add CA bundle version and pinning status to the user agent string#23

Open
cisco-dmytro-hissa wants to merge 1 commit into
mainfrom
user-agent-ca-pinning
Open

Add CA bundle version and pinning status to the user agent string#23
cisco-dmytro-hissa wants to merge 1 commit into
mainfrom
user-agent-ca-pinning

Conversation

@cisco-dmytro-hissa

Copy link
Copy Markdown

Description

  • Added a caBundleVersion = "1.0" constant.
  • Added a userAgent() method on *Client that builds the User-Agent string and appends ca_bundle/1.0 plus (ca_pinning=enabled|disabled) based on the client's caPinning field.
  • Replaced the inline fmt.Sprintf User-Agent construction at the token request call site with a call to client.userAgent().

How Has This Been Tested?

  • Updated TestSendUserAgent to expect the new User-Agent format including ca_bundle and (ca_pinning=enabled).
  • Added TestUserAgentCAPinningEnabled — verifies the string ends with (ca_pinning=enabled) when pinning is on.
  • Added TestUserAgentCAPinningDisabled — verifies the string ends with (ca_pinning=disabled) when pinning is off.

Types of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

@cisco-dmytro-hissa
cisco-dmytro-hissa marked this pull request as ready for review July 17, 2026 11:45
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