Replace deprecated oauth2client with google-auth and unpin pyopenssl#510
Conversation
Co-authored-by: ogajduse <20440883+ogajduse@users.noreply.github.com>
|
Switching to ready state as I successfully tested the patch using the below script: from wrapanapi.systems.google import GoogleCloudSystem
gceclient = GoogleCloudSystem(
project="macgyver-project",
zone='us-east1-b',
file_path='secrets/gce_cert',
file_type='json',
)
gceclient.list_network()
# Out: ['default', 'test-network'] |
| requires-python = ">=3.9" | ||
| dependencies = [ | ||
| "pyopenssl==24.2.1", | ||
| "pyopenssl", |
There was a problem hiding this comment.
So we can remove this completely , right ?
There was a problem hiding this comment.
Yes, you're correct. The pyopenssl dependency has been completely removed as it's no longer needed with the google-auth library. Fixed in commit 2653dac.
lpramuk
left a comment
There was a problem hiding this comment.
Don't be explicit about pyopenssl dependency and remove it
@copilot can you please take a look at this? |
Co-authored-by: ogajduse <20440883+ogajduse@users.noreply.github.com>
Done! Removed the explicit pyopenssl dependency completely from pyproject.toml. The google-auth library handles its own cryptographic dependencies, so pyopenssl is no longer needed. Fixed in commit 2653dac. |
This PR modernizes Google Cloud Platform authentication by replacing the deprecated
oauth2clientlibrary with the officially recommendedgoogle-authlibrary, and removes thepyopensslversion pin that was causing compatibility issues.🔧 Changes Made
Dependencies (
pyproject.toml)oauth2client(deprecated and causing pyopenssl conflicts)google-auth(modern Google authentication library)pyopenssl(was pinned to==24.2.1, now allows latest compatible version)Authentication Implementation (
wrapanapi/systems/google.py)oauth2client.service_account.ServiceAccountCredentials→google.oauth2.service_account.CredentialsServiceAccountCredentials.from_json_keyfile_dict()withCredentials.from_service_account_info()ServiceAccountCredentials.from_json_keyfile_name()withCredentials.from_service_account_file()credentialsparameter✅ Backward Compatibility
All existing authentication methods continue to work:
🚫 Breaking Change
P12 keyfile format is no longer supported and will raise
NotImplementedErrorwith clear migration instructions. Users should generate new JSON service account keys from the Google Cloud Console or usinggcloudCLI.🎯 Benefits
🧪 Testing
Fixes #509.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.