Develop#12
Open
ImmoStanke wants to merge 8 commits into
Open
Conversation
…redirect-uri and access-type to google-ctx
…-auth-map and refresh-google-token
…returned auth-map
Contributor
|
Hey, this is an ridiculously late response but I want to thank you for putting together this very reasonable PR. We completely dropped the ball on maintaining this library; we're sorry for that and understand how annoying it is to get radio silence after putting work into a PR. We're currently undergoing a review of our open source policies w/ legal and, for what it's worth, should be able to respond to PRs on this project soon |
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.
I rewrote the get-auth-map function to use Google REST API (instead of Java interop) and added a new type for AuthMap, which is returned by that function now. This also converts the json returned by google with keys like "access_token" to a proper clojure map with the key :access-token, which is what is expected in GoogleCtx. I'm using HTTPkit to send the requests and clojure.data.json to parse the json response. HTTPkit can easily be replaced by whatever other library you'd prefer to send HTTP requests, but it works pretty well.
Furthermore, I added a function to refresh an existing google token, which also returns an AuthMap containing the new token.
Users can also specify their own redirect-url, instead of always using copy paste, this enables you to have google send the auth-code directly to your web app. Consequently, you may also now specify your access-type as "online" or "offline". Both values are read from the google-context, defaulting to the previous functionality if none are given.
PS: Sorry for the messy commits, I worked on the master branch and then merged to develop. If you want you can also merge the master branch directly.