Skip to content
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

Change exceptions used to catch failed GCE authentication #334

Merged
merged 1 commit into from
Jan 8, 2024

Conversation

mxr576
Copy link
Contributor

@mxr576 mxr576 commented Dec 14, 2023

Closes #333

Copy link

codecov bot commented Dec 14, 2023

Codecov Report

Merging #334 (7577a3f) into 3.x (a882b50) will not change coverage.
The diff coverage is 0.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##                3.x     #334   +/-   ##
=========================================
  Coverage     87.60%   87.60%           
  Complexity     1750     1750           
=========================================
  Files           349      349           
  Lines          4704     4704           
=========================================
  Hits           4121     4121           
  Misses          583      583           
Flag Coverage Δ
unittests 87.60% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...Client/Plugin/Authentication/GceServiceAccount.php 0.00% <0.00%> (ø)

@mxr576
Copy link
Contributor Author

mxr576 commented Dec 14, 2023

Alternative considering, but it feels an overkill to me, catch \Psr\Http\Client\ClientExceptionInterface

Maybe this approach combines best from both worlds, isAvailable() should only fail with NetworkExceptionInterface, when the project is not hosted on GCE -- right? However getAccessToken() can also fail when the service account is not configured properly. so the host was reachable and it returned an HTTP >= 400 code.

mxr576 added a commit to mxr576/apigee-edge-drupal that referenced this pull request Jan 3, 2024
Add missing try-catch block around GCE authentication availability check.
Copy link
Collaborator

@shishir-intelli shishir-intelli left a comment

Choose a reason for hiding this comment

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

LGTM

@shishir-intelli shishir-intelli added this to the 3.0.4 milestone Jan 4, 2024
mxr576 added a commit to mxr576/apigee-edge-drupal that referenced this pull request Jan 5, 2024
Add missing try-catch block around GCE authentication availability check.
@shishir-intelli shishir-intelli merged commit 60b423c into apigee:3.x Jan 8, 2024
6 checks passed
shishir-intelli pushed a commit to apigee/apigee-edge-drupal that referenced this pull request Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
2 participants