Commit Graph

19 Commits

Author SHA1 Message Date
patrick brisbin
937ad572a3 Update to LTS-9.5 and hoauth2 1.3.0
The largest changes were around the hoauth2 interface:

The OAuth2 type replaced all of its ByteString fields with either Text
or URI. This is a huge improvement. The fields that are now Text are the
type we had them in anyway. The fields that are now URI are type safe
and easier to manipulate. For example, we were doing very unsafe query
string manipulations looking for raw ? or & values, but now we can work
with tuples in a well-typed property.

Additionally the AccessToken type was upgraded to OAuth2Token with an
accessToken field, and the simple Either ByteString a results were
replaced by a real OAuth2Error type. This required changes to our
InvalidProfileResponse mechanism to support.

To make working with uri-bytestring more convenient, an Extension
library was added with some useful instances and helper functions. This
library may be upstreamed at some point.
2017-10-18 17:21:47 -04:00
Jezen Thomas
327a85fd95
Rename creds key email -> public_email
Partial revert of 64b65ca where this was broken, causing a name
collision in the creds extra association list.
2016-07-06 18:32:46 -04:00
Andrew Darqui
64b65ca4c6
Properly handle empty credsExtra fields
Marks "location" as Maybe in GitHub responses. Without this, users could
experience an InvalidProfileResponse error when missing.

Also fixes cases where fields were Maybe, but the (.:?) combinator was
not being used in the parser.
2016-06-24 11:41:08 -04:00
patrick brisbin
f412b7c8f2
Include public_email key in credsExtra for Github 2016-02-10 09:49:57 -05:00
silky
631d9a3ca1 Use primary email as email, if one is set.
If we couldn't find a primary email, then use the first email returned from
the list. This fixes #51.
2016-01-26 16:50:19 -05:00
silky
c2794f4040
Add user location
Fixes #49.
2016-01-04 12:34:35 -05:00
patrick brisbin
2d3d1d2a8e
Add fromProfileResponse
Handles the common case of fetching profile information from a single
JSON endpoint. Throws InvalidProfileResponse if JSON parsing fails.
2015-04-13 17:09:06 -04:00
patrick brisbin
ad0e354b2b
Support GHC 7.10
- Conditionally import Control.Applicative
- Enable FlexibleContexts
2015-04-07 12:56:43 -04:00
patrick brisbin
0b0e6c179d
Use consistent style throughout project
- Alphabetize imports
- Place qualified imports separate and last
- BL for ByteString.Lazy
- Don't align tokens in tuple lists or record assignments
- Two-space indent for where keyword
- Use record syntax for Creds
- Break before operators in Applicative expressions
- Consistent whitespace throughout

Resolves #19
2015-03-25 16:30:15 -04:00
jprider63
bc320b1397
Move state token handling generic oauth2Plugin
Resolves #23
2015-03-24 17:26:35 -04:00
Florian Gilcher
81ece8072f Make Github name optional
The github API returns no name field if the user has given none (and
only goes by their user handle). For that reason, make the name field
optional.
2014-09-18 11:40:12 +02:00
Florian Gilcher
3eeae3293d Expose auth2GithubScoped
Expose auth2GithubScoped, allowing users to set the scopes themselves.
2014-09-17 22:31:39 +02:00
patrick brisbin
eb5f9488f8
Address compiler warnings
- user was defined by never used in the no mails case
- The result of apDispatch is discarded
2014-09-13 16:45:36 -04:00
Freiric Barral
8046f4d8cc hardcode the scope to user:email (if more info is needed the code will anyway have to be changed to include more queries) 2014-08-31 23:11:41 +02:00
Freiric Barral
a992fdb6fa fetch github email in a second query to https://api.github.com/user/emails (the query to https://api.github.com/user return a null in the email field) 2014-08-31 23:11:41 +02:00
Freiric Barral
4fdd311d4b correct typo in the authentication query to github 2014-08-31 23:11:36 +02:00
Freiric Barral
d6fe3090d7 remove redundant bracket 2014-08-29 21:04:45 +02:00
Freiric Barral
165713c350 use tls manager argument in fetchGithubProfile (introduced in 'Version upgrade (hoauth2 0.4.1)'.) 2014-08-29 21:04:21 +02:00
Calen Pennington
7c002e167c Add a github OAuth2 provider 2014-08-29 20:57:39 +02:00