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.
- Nylas now requires additional parameters for authentication to succeed
- We remove oauth2NylasScoped because it wasn't exported, and Nylas does
not support any scopes other than "email"
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.
We do lose some coverage here. Rather than confirming we build across a
slew of GHC versions, the sdist succeeds, etc, we just run the test
suite against the Stackage snapshot configured. Stackage snapshots is
the direction Haskell is moving, so I think this is an acceptable
simplification.
If the endpoint URL doesn't yet have any query parameters, this code
would construct an invalid URL by appending `&state=` rather than
`?state=`. We now correctly append `?state=` or `&state=` depending on
the URL already containing a `?` character.
Fixes#44
This is a "good enough" solution for the moment, done for ease of
implementation and speed of delivery. An eventual better solution would
be to use a URL-parsing and constructing library to parse the existing
endpoint, append parameter tuples, and re-construct a new URL.
Restructuring the data types so we start handling real URL and
QueryParam values instead of ByteStrings would also be an option, though
we're a little cornered by the Yesod.Auth.OAuth interface.