Skip to content

Conversation

@rikvanduijn
Copy link
Contributor

Summary

This PR adds support for custom HTTP headers in ROADtools authentication flows. Users can now specify custom headers that will be included in all HTTP requests made during authentication and API operations.

Changes

roadlib (roadtools/roadlib/auth.py):

  • Added custom_headers attribute to the Authentication class to store custom headers
  • Added set_custom_headers() method to configure custom headers from a dictionary
  • Added --headers command-line argument that accepts JSON-formatted headers
  • Modified all HTTP request methods (requests_get, requests_post, requests_put, requests_patch, requests_delete) to include custom headers in their requests
  • Added JSON parsing logic in parse_args() to handle the --headers argument with error handling for invalid JSON

roadtx (roadtools/roadtx/main.py):

  • Added --headers argument to the refreshtokento subcommand
  • Added --headers argument to the interactiveauth subcommand

Use Case

This feature enables users to pass custom HTTP headers like X-AnchorMailbox used by for example PIM authentication flow.

Usage Example
roadtx gettokens --headers '{"X-AnchorMailbox": "Oid:objectid@tenantid"}'

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