Skip to content

Conversation

@ykitamura-mdsol
Copy link
Contributor

also, update requests_mauth and httpx_mauth to support reading configuration from environment variables

Copilot AI review requested due to automatic review settings December 16, 2025 15:01
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new utility function to normalize private keys into RSA format and updates the authentication clients to support reading configuration from environment variables. The changes improve flexibility by allowing credentials to be provided via multiple environment variable names and ensuring private keys are properly formatted.

Key changes:

  • New to_rsa_format utility function handles private keys with various formatting (missing newlines, spaces instead of newlines, or no formatting)
  • Both MAuthHttpx and MAuth clients now accept default values from environment variables via Config
  • Environment variable support expanded to include MAUTH_APP_UUID and MAUTH_PRIVATE_KEY as alternatives

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
mauth_client/utils.py Implements to_rsa_format function to normalize private key formatting with proper headers, footers, and newlines
mauth_client/config.py Updates environment variable loading to use to_rsa_format and support alternative variable names
mauth_client/requests_mauth/client.py Changes constructor to accept default values from Config for app_uuid and private_key_data
mauth_client/httpx_mauth/client.py Changes constructor parameters to use Config defaults for app_uuid and private_key_data
tests/utils_test.py Adds comprehensive test coverage for the new to_rsa_format function
tests/httpx_mauth/client_test.py Refactors tests to use shared key loading utility instead of inline file reading
README.md Documents new environment variable options and fixes table formatting
CHANGELOG.md Documents the new features in version 1.8.0
pyproject.toml Bumps version to 1.8.0

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

ykitamura-mdsol and others added 3 commits December 17, 2025 00:20
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

@cmcinnes-mdsol cmcinnes-mdsol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

@cmcinnes-mdsol cmcinnes-mdsol merged commit ba9de87 into main Dec 16, 2025
17 checks passed
@ykitamura-mdsol ykitamura-mdsol deleted the feat/a-set-of-refinements branch December 17, 2025 02:37
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.

3 participants