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

Fix Credentials.default #127

Merged
merged 2 commits into from
Nov 10, 2017
Merged

Conversation

blowmage
Copy link
Contributor

Credentials.default has a bug where it returns an empty array if no matches were found when looking up keyfile info in PATH_ENV_VARS, JSON_ENV_VARS, or DEFAULT_PATHS. This is because of how the implementation was changed when migrating from google-cloud-ruby. The fix is to return nil if no matches are found from the various lookup methods.

This allows us to focus on specs by changing it to fit.
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Nov 10, 2017
@coveralls
Copy link

coveralls commented Nov 10, 2017

Coverage Status

Coverage increased (+1.5%) to 97.167% when pulling 70565e6 on blowmage:credentials-default-fix into 328fed6 on google:master.

If no PATH_ENV_VARS were found Credentials.default would return an empty array.
Update each default lookup method to return nil if no match was found.
Fix call to from_default_paths method, was calling from_default_vars instead.
Add spec coverage for path, json, and default cases.
Add spec coverage for application_default case.
Fix spec coverage to check the return type from calling Credentials.default.
@coveralls
Copy link

coveralls commented Nov 10, 2017

Coverage Status

Coverage increased (+1.5%) to 97.167% when pulling 9f395a2 on blowmage:credentials-default-fix into 328fed6 on google:master.

@geigerj geigerj merged commit 18611aa into googleapis:master Nov 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants