Commit Graph

274 Commits

Author SHA1 Message Date
nbloomf
f4e57ab7c5 Replace call to fetchAccessToken with fetchAccessToken2
This comment comes from hoauth2:

-- OAuth2 spec allows `client_id` and `client_secret` to
-- either be sent in the header (as basic authentication)
-- OR as form/url params.
-- The OAuth server can choose to implement only one, or both.
-- Unfortunately, there is no way for the OAuth client (i.e. this library) to
-- know which method to use. Please take a look at the documentation of the
-- service that you are integrating with and either use `fetchAccessToken` or `fetchAccessToken2`

`fetchAccessToken2` is a drop-in replacement for `fetchAccessToken` that just adds `client_id` and `client_secret` to the body as form parameters, as permitted by [RFC 6749](https://tools.ietf.org/html/rfc6749#section-2.3.1). Some authorization server implementations only accept client credentials in this form.
2020-07-08 00:05:14 -05:00
nbloomf
ef7c422802 Bump version bounds for dependency hoauth2
We're about to replace the call to `fetchAccessToken` from hoauth2 by `fetchAccessToken2`, which was introduced in 1.7.0 and amended in 1.11.0, to allow for oauth2 implementations that expect POST token payloads. Either the initial or the amended version of `fetchAccessToken2` would work for this, but here we've chosen the most conservative working version bump.
2020-07-07 23:50:23 -05:00
patrick brisbin
036458c7a8 Build Cabal in -j 1 step
Un-cached builds cannot succeed without exhausting memory. Doing fewer
packages concurrently can sometimes resolve this. This is trial and
error.

https://app.circleci.com/jobs/github/thoughtbot/yesod-auth-oauth2/1022
2020-01-27 10:38:32 -05:00
patrick brisbin
b998e03067 Brittany 2019-12-03 20:27:15 -05:00
patrick brisbin
48277d9b8e Compile on nightly/ghc-8.8 2019-12-03 20:27:15 -05:00
patrick brisbin
5528bb9d07
Version bump 2019-08-29 17:23:21 -04:00
patrick brisbin
8436c8ff27 Don't handle unexpected errors with Unknown
This was lazy and resulted in a confusing error experience where a
JSONDecodingError fetching credentials appeared as an Unknown OAuth2
ErrorResponse, making it appear like the OAuth2 provider was indicating
this error to us, instead of it being a simple incorrect parser in our
own code.

ErrorResponse is specifically meant to parse error parameters sent to us
by the OAuth2 provider. They may be user-actionable and can be safely
displayed. This is a very narrow use-case. The Unknown constructor is
required for us to be exhaustive on our string error names, but it
should not be hijacked to store our own errors.

This commit separates and documents the two error scenarios.
2019-08-29 17:21:28 -04:00
patrick brisbin
9c6ac9b59d Fix for weeder and stack-2 2019-08-29 17:21:28 -04:00
patrick brisbin
6fa9748de8 Commit stack.yaml.lock
In version 2, Stack creates this file and it should be checked into
version control to ensure consistent builds across the team, just like a
yarn.lock or Gemfile.lock.
2019-08-29 17:21:28 -04:00
patrick brisbin
4f1de3eb85
Version bump 2019-03-09 09:16:17 -05:00
Chris Beavers
208f497a5a Add AzureAD provider 2019-03-09 09:14:50 -05:00
patrick brisbin
276407071e
Update CHANGELOG 2019-01-09 16:52:07 -05:00
patrick brisbin
653e1f4db6 Upgrade to GHC 8.6.3
No code changes required; only CI:

- Drop 8.2 build
- Add 8.6.3 build
- Update default build to 8.6.3
2019-01-09 16:51:31 -05:00
patrick brisbin
2110b29669
Version bump 2019-01-09 14:00:30 -05:00
patrick brisbin
b775a9c18b
Allow http-client-0.6 2019-01-09 13:59:31 -05:00
patrick brisbin
965d35793d
Version bump, add other-source-files 2018-11-24 14:14:41 -05:00
patrick brisbin
c25fea0e6f
Update CHANGELOG 2018-11-24 14:13:35 -05:00
patrick brisbin
b8befc4811
Remove deprecated Github module 2018-11-24 14:11:44 -05:00
patrick brisbin
b1caafbe24
Version bump 2018-11-24 14:10:33 -05:00
patrick brisbin
644f02d027
Update nightly build 2018-11-24 14:10:33 -05:00
patrick brisbin
7445bccb8a
Relax upper bounds 2018-11-24 14:10:33 -05:00
chromezh
57c767d04e Fix a link in package.yaml
The `.git` is redundant because on hackage the link of Bug tracker would be `https://github.com/thoughtbot/yesod-auth-oauth2.git/issues` and it is not a valid link.
2018-11-12 09:14:10 -05:00
patrick brisbin
77eaa8eb96
Update stack-nightly.yaml
Most of the things are back in now, it seems.
2018-10-24 09:15:54 -04:00
patrick brisbin
e20891c072
Tweak make targets and CI steps 2018-10-24 09:15:45 -04:00
patrick brisbin
d93594bf97
Typos and grammar in README 2018-10-24 08:54:34 -04:00
patrick brisbin
c0a6f11a87
Update GitHub module in README 2018-10-24 08:52:02 -04:00
patrick brisbin
569a85429a
Fix nightly build 2018-10-08 09:36:55 -04:00
patrick brisbin
46dfc1232a
Version bump 2018-09-19 08:02:27 -04:00
patrick brisbin
1411bb5858 Implement different exceptions for different cases
I had hoped to get away from this entirely, to an Either-based
interface, but that seems to be stalling as an initiative. So in the
meantime, let's at least make our exceptions more meaningful.
2018-09-19 07:55:38 -04:00
patrick brisbin
e3c61789ba Ensure we rescue our exceptions too
For some reason, I thought tryIO would catch our own exception is we
threw them via throwIO, but that's incorrect. Our own exceptions are not
IOExceptions, so they squeak by. This fixes that.
2018-09-18 17:25:00 -04:00
patrick brisbin
dc033e1331 Move Exception to its own module
This will avoid cycles later.
2018-09-18 17:25:00 -04:00
patrick brisbin
37343fa533 Redirect on OAuth2 errors, not permissionDenied 2018-09-18 17:25:00 -04:00
patrick brisbin
92beb4b4b4 Brittany 2018-09-18 17:25:00 -04:00
patrick brisbin
4fd868e3ae Ensure stack version and stack-yaml are in digest 2018-09-11 08:00:30 -04:00
patrick brisbin
f1cf1d82ab Disable linting on nightly 2018-09-11 08:00:30 -04:00
patrick brisbin
2f0c6ed4dd Always upgrade Stack 2018-09-11 08:00:30 -04:00
patrick brisbin
17cbf543ae Use a more minimal build image 2018-09-11 08:00:30 -04:00
patrick brisbin
f46d3bc956 Tweak CI environment variables
- Always use STACK_YAML, because we sometimes do
- Pass --no-terminal for better output
2018-09-11 08:00:30 -04:00
patrick brisbin
a8687be4f0 Build haskell-src-exts single-threaded first
Letting all dependencies build at once can lead to out of memory on CI.
2018-09-11 08:00:30 -04:00
patrick brisbin
fbbf455678
Version bump 2018-07-30 11:50:24 -04:00
patrick brisbin
6d0077a534 Deprecate improperly-cased Github module 2018-07-30 11:46:02 -04:00
patrick brisbin
c86fa6de13 Create properly-named GitHub module 2018-07-30 11:46:02 -04:00
patrick brisbin
44c05d7a2d Store refreshToken in credsExtra, if available 2018-07-30 09:10:37 -04:00
patrick brisbin
d9eeb787d6 Make comments clearer 2018-07-30 09:10:37 -04:00
patrick brisbin
dacc71f008 Add GitLab support 2018-07-29 09:45:00 -04:00
patrick brisbin
9142acd1ab Configure non-latest CI build via STACK_YAML
So weeder will respect it as well.
2018-07-29 09:07:19 -04:00
patrick brisbin
555b91f953 Use STACK_ARGUMENTS in make lint 2018-07-29 09:07:19 -04:00
patrick brisbin
262267dcba Configure nightly to build nightly 2018-07-29 09:07:19 -04:00
patrick brisbin
a83bd6a2d5 Update default stack resolver 2018-07-29 09:07:19 -04:00
patrick brisbin
cd0ea5d855 Update nightly stack settings 2018-07-29 09:07:19 -04:00