-
Notifications
You must be signed in to change notification settings - Fork 3
Switch to Google API client #9
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
base: master
Are you sure you want to change the base?
Conversation
caffo
left a 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.
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? |
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.
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?
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.
@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
|
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
).
|
|
@caffo no, it can't :( You have to add client id and secret to |
|
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
).
|
|
Yeah, good idea! I've added a link to Google API wizard. |
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.