Skip to content

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

Merged
AaronAtDuo merged 2 commits into
masterfrom
user-agent-ca-pinning
Jul 9, 2026
Merged

Add CA bundle version and pinning status to the user agent string#311
AaronAtDuo merged 2 commits into
masterfrom
user-agent-ca-pinning

Conversation

@cisco-dmytro-hissa

@cisco-dmytro-hissa cisco-dmytro-hissa commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Description

  • Added CA_BUNDLE_VERSION = '1.0' constant in duo_client/client.py
  • Modified Client.__init__ to append ca_bundle/{version} and (ca_pinning={enabled|disabled}) to the user agent string based on the disable_ca_pinning runtime state
  • Empty/falsy user agent strings are left unmodified

How Has This Been Tested?

  • test_default_user_agent_includes_ca_bundle_version — verifies ca_bundle/1.0 is present in the default user agent
  • test_default_user_agent_includes_ca_pinning_enabled — verifies (ca_pinning=enabled) when pinning is not disabled
  • test_user_agent_includes_ca_pinning_disabled — verifies (ca_pinning=disabled) when disable_ca_pinning=True
  • test_default_user_agent_format — asserts the full expected user agent string format
  • test_custom_user_agent_includes_ca_fields — verifies CA fields are appended to custom user agent strings
  • test_empty_user_agent_not_modified — verifies an empty user agent is not modified

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 8, 2026 11:03
@AaronAtDuo
AaronAtDuo merged commit 4a40190 into master Jul 9, 2026
5 checks passed
@AaronAtDuo
AaronAtDuo deleted the user-agent-ca-pinning branch July 9, 2026 13:36
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