-
Notifications
You must be signed in to change notification settings - Fork 252
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
Enables passing credentials via environment variables instead of json file #28
Enables passing credentials via environment variables instead of json file #28
Conversation
The travis build is failing because of rubocop detected style failings. I think both the warnings are things that can be ignored, so I'm happy to have the style warnings resolved using by updating the .rubocop_todo.yml. Could you update that and add it to this PR please? |
Updated the .rubocop_todo.yml. Now the ruby 1.9.3 and jruby builds are failing because of keyword arguments in the initializers. Is this acceptable, or does this project require 1.9 compatibility? |
end | ||
|
||
# Reads the input json and determines which creds class to use. | ||
def self.determine_creds_class(json_key_io) | ||
json_key = MultiJson.load(json_key_io.read) | ||
fail "the json is missing the #{key} field" unless json_key.key?('type') | ||
key = 'type' | ||
fail "the json is missing the #{key} field" unless json_key.key?(key) | ||
type = json_key['type'] |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
1 similar comment
- ServiceAccountCredentials, ServiceAccountJwtHeaderCredentials and UserRefreshCredentials initializers now take keyword args via options hash. - In `credentials_loader.rb`, refactored env var checking into private methods - Updated tests & added new tests. - Fixed existing test for #from_well_known_path 'fails if the file is invalid', where `from_env` was called instead of `from_well_known_path`. - Fixed rubocop errors I introduced, but two existing ones remain. - Added entry to changelog. - Fixed rubocop errors from code containing parallel assignments - Updated rubocop_todo.yml to ignore parallel assignments and trailing underscore assignments.
@tbetbetbe Build is green. Anything left to address in this PR? |
@tbetbetbe Curious - why still require 1.9.3 support? It's officially past EOL as far as ruby-lang.org goes (expired back in Feb.) Is it for jruby which is still lagging on 2.0+ language support? |
Pinging @tbetbetbe. If there's more to be done, I have some time this weekend. |
sorry, I was out for much last week. I will look through this again and take action by wednesday - sorry about the delay. |
Enables passing credentials via environment variables instead of json file
thanks for the merge! |
One more question: when will the gem be version bumped? |
The environment variables in the 'fails if env vars are set' test were not actually being set because they used a nonexistent hash key (which has the effect of unsetting the environment variable).
Fix a failing test introduced in #28.
Addresses issue #27. I took it a step further than I originally proposed and made the necessary changes to allow
UserRefreshCredentials
to be initialized from environment variables, in addition toServiceAccountCredentials
andServiceAccountJwtHeaderCredentials
.