Skip to content

feat: add user agent header to API requests #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

btiernay
Copy link
Contributor

Changes

This PR adds a standardized User-Agent header to all requests made to the Auth0 Management API. The changes include:

  • Added a getUserAgent() function that generates a User-Agent string in the format: auth0-mcp-server/[version] (node.js/[node-version])
  • Updated the getManagementClient() function to include this User-Agent in API request headers
  • Added unit tests to verify the format and correctness of the User-Agent header

This change enables better tracking and identification of API requests made by auth0-mcp-server in server logs and monitoring tools.

Testing

  • This change adds unit test coverage for the User-Agent header generation
  • The new tests verify:
    • Correct User-Agent format
    • Proper inclusion of package version
    • Proper inclusion of Node.js version (without 'v' prefix)
    • Proper integration with the Management Client

Checklist

@btiernay btiernay force-pushed the feat/user-agent-header branch from 3f6e0f7 to 40b60d7 Compare April 27, 2025 12:20
- Added a standardized User-Agent header format to all Auth0 Management API requests
  and created automated tests to verify the formatting.
@btiernay btiernay force-pushed the feat/user-agent-header branch from b6f1931 to 5579303 Compare April 27, 2025 12:24
@btiernay btiernay force-pushed the feat/user-agent-header branch from f005ad1 to fdf7d90 Compare April 27, 2025 13:58
@btiernay btiernay closed this Apr 27, 2025
@btiernay btiernay deleted the feat/user-agent-header branch April 27, 2025 14:02
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