Skip to content

Conversation

@ayeshurun
Copy link
Collaborator

@ayeshurun ayeshurun commented Dec 25, 2025

📥 Pull Request

Adding a HostApp identifier to the User-Agent string for all API requests.

✨ Description of new changes

  • User-Agent Enrichment: The User-Agent string now includes a host-app suffix (e.g., host-app/vscode-extension) if the FAB_HOST_APP environment variable is set to a valid, whitelisted value.
  • If the FAB_HOST_APP_VERSION environment variable is set to a valid version format, the host-app value in User-Agent header will be resulted in 'host-app//'
  • Removed from user-agent details the machine type.
  • Centralized Logic: The logic for building the User-Agent is now in a dedicated _build_user_agent function in src/fabric_cli/client/fab_api_client.py.
  • Allowlist: A new constant, ALLOWED_FAB_HOST_APP_VALUES, has been added to src/fabric_cli/core/fab_constant.py to maintain a list of approved HostApp values.
  • Robust Testing: Comprehensive tests have been added in tests/test_core/test_fab_api_client.py to validate the new functionality, including case-insensitivity and handling of invalid values.

🛡️ Security

To ensure that only approved applications can be identified, the value of the environment variable is checked against the ALLOWED_FAB_HOST_APP_VALUES list.

ayeshurun and others added 30 commits September 17, 2025 17:11
chore: Introduce release workflowc
@ayeshurun ayeshurun requested a review from a team as a code owner December 25, 2025 09:37
@ayeshurun ayeshurun changed the title feat: Add HostApp to User-Agent feat: Update User-Agent Dec 25, 2025
@ayeshurun ayeshurun changed the title feat: Update User-Agent refactor: Update User-Agent Dec 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants