Switch to Google API client#9
Open
mbirman wants to merge 10 commits intocaffo:masterfrom
mbirman:google-api-client
Open
Switch to Google API client#9mbirman wants to merge 10 commits intocaffo:masterfrom mbirman:google-api-client
mbirman wants to merge 10 commits intocaffo:masterfrom
mbirman:google-api-client
Conversation
caffo
reviewed
May 29, 2019
Owner
caffo
left a comment
There was a problem hiding this comment.
Finally had time to start checking this. Please check my comment.
|
|
||
| class << self | ||
| def call(user_id) | ||
| raise "Google Client ID or Google Client Secret are invalid." if invalid_keys? |
Owner
There was a problem hiding this comment.
When I try to run bin/baconmail authorize I get the following error:
baconmail/lib/baconmail/authorizer.rb:12:in `call': Google Client ID or Google Client Secret are invalid. (RuntimeError)
I think you are checking if the keys are invalid before we fetch them?
Contributor
Author
There was a problem hiding this comment.
@caffo hmm, did you add the keys to .baconmail? See an example in README: https://github.com/mbirman/baconmail/tree/google-api-client#setup-instructions
Owner
|
Wouldn't authorize add the keys there for me?
…--
Rodrigo Franco
http://rodrigofranco.com/
On Tue, Jun 04, 2019 at 7:30 AM, Mark < ***@***.*** > wrote:
***@***.**** commented on this pull request.
In lib/ baconmail/ authorizer. rb (
#9 (comment) ) :
> @@ -0,0 +1,56 @@ +# require 'google/api_client/client_secrets' +require
'googleauth/stores/file_token_store' + +# encoding: UTF-8 +module
Baconmail + class Authorizer + OOB_URI = 'urn:ietf:wg:oauth:2.0:oob' +
SCOPE = Google::Apis::GmailV1::AUTH_SCOPE + + class << self + def
call(user_id) + raise "Google Client ID or Google Client Secret are
invalid." if invalid_keys?
@ caffo ( https://github.com/caffo ) hmm, did you add the keys to.baconmail
? See an example in README: https:/ / github. com/ mbirman/ baconmail/ tree/
google-api-client#setup-instructions (
https://github.com/mbirman/baconmail/tree/google-api-client#setup-instructions
)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub (
#9?email_source=notifications&email_token=AAAADSHFQ2R6W7BIGQRYMBLPYY74JA5CNFSM4HIQNLE2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOB2P6SCY#discussion_r290230864
) , or mute the thread (
https://github.com/notifications/unsubscribe-auth/AAAADSCOX2HQ5E436G6L4BLPYY74JANCNFSM4HIQNLEQ
).
|
Contributor
Author
|
@caffo no, it can't :( You have to add client id and secret to |
Owner
|
Can you update the read explaining where one would get these keys? Just for sake of clarification :)
…--
Rodrigo Franco
http://rodrigofranco.com/
On Thu, Jun 6 2019 at 6:24 AM, < ***@***.*** > wrote:
@caffo ( https://github.com/caffo ) no, it can't :( You have to add client
id and secret to.baconmail file manually, the script will fetch
authorization key and store it with credentials for future use.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub (
#9?email_source=notifications&email_token=AAAADSD25NOTLYWT657JYDTPZDJUJA5CNFSM4HIQNLE2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXCIRBI#issuecomment-499419269
) , or mute the thread (
https://github.com/notifications/unsubscribe-auth/AAAADSGHUSNWJGQ3KY7ZZW3PZDJUJANCNFSM4HIQNLEQ
).
|
Contributor
Author
|
Yeah, good idea! I've added a link to Google API wizard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is a work in progress.
gmailgem removed,google-api-ruby-clientinstalled.Authorizerclass created that fetches credentials and stores them in the configuration file.