-
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
Add simple credentials class. #122
Conversation
@landrito I think you are seeing failures because this library supports Ruby 1.9, which doesn't have keyword args. |
Yep let me make a fix. |
@dazuma Would either you or Heng be able do the review for this PR? |
I can do the review |
Thanks @dazuma! I'll add some context to this PR and get it working for 1.9.3 sometime tonight. |
@landrito Is this ready for review? |
Not yet. Will ping you when ready. Sometime today. |
Ready for a look! |
lib/googleauth/credentials.rb
Outdated
new client | ||
end | ||
|
||
def self.env(v) |
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.
end | ||
end | ||
|
||
# Obtains the default credentials implementation to use in this |
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.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
require 'stringio' | ||
|
||
require 'googleauth/credentials_loader' | ||
require 'googleauth/client_id' |
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.
TOKEN_CREDENTIAL_URI = 'https://accounts.google.com/o/oauth2/token'.freeze | ||
AUDIENCE = 'https://accounts.google.com/o/oauth2/token'.freeze | ||
SCOPE = [].freeze | ||
PATH_ENV_VARS = [].freeze |
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.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
# Module Auth provides classes that provide Google-specific authorization | ||
# used to access Google APIs. | ||
module Auth | ||
NOT_FOUND_ERROR = <<END.freeze |
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM now. Thanks!
I know we want to get a release out to unblock the new codegen, but can we wait a day or so more... I need to push out a new release of signet first, to fix compatibility issues with jwt 2.0.
@dazuma Do we have an approx ETA for the fixes that will unblock a new release? |
What
This introduces a class that allows for the following ways of instantiating an OAuth2 Signet.
This class is a direct port of the credentials class in the google-cloud-core gem.
Why
For the case of using multiple APIs within the same project, we needed a way for the user to default locations for their keyfiles on a per api basis. By extending this class, we can define api specific locations to store default credentials.
For context, we were going to have this class live in our general apis utilities library google-gax but it would introduce a dependency on grpc for http client libraries that would use this class.
cc @geigerj