Commit Graph

299 Commits

Author SHA1 Message Date
patrick brisbin
845d8e654e Add setup.tools to Makefile 2020-08-24 10:49:14 -04:00
patrick brisbin
b95eddf84c fixup! Update to latest GHC, Stackage resolver, hoauth2 2020-08-24 10:49:14 -04:00
patrick brisbin
28d2113674 Update to latest GHC, Stackage resolver, hoauth2
- Update to ghc-8.8 / lts-16.0
- Update to hoauth2 >= 1.11.0

  - authGetBS has pre-encoded errors a v1.9
  - oauthClientSecret is Maybe at v1.11

- Tweak non-default Resolvers as required
2020-08-24 10:49:14 -04:00
patrick brisbin
2e3529cfdb Add watch target in Makefile 2020-08-24 10:49:14 -04:00
patrick brisbin
c939633a96 Reformat with Brittany 2020-08-24 10:49:14 -04:00
patrick brisbin
236d0f4b10 Tighten upper bound on hauth2
We need to avoid 1.9, where authGetBS changes type. This was the case
until 0036d5f, where it was changed unintentionally.

Fixes #135.
2020-08-23 13:47:10 -04:00
patrick brisbin
27cad251ab
Version bump 2020-08-20 12:12:30 -04:00
patrick brisbin
3cac6e2c34
Add example Makefile target 2020-08-20 12:11:23 -04:00
patrick brisbin
ce2a31e529
Add --fast to Makefile targets 2020-08-20 12:11:10 -04:00
patrick brisbin
46c5faf808 Update CHANGELOG 2020-08-20 11:38:20 -04:00
patrick brisbin
cd3875b797 Strengthen random state token generation
Previously:

- System.Random, which seeds from system time (possible attack)
- 30 characters, a-z (low entropy)

Now:

- Crypto.Random, accepted as "cryptographically secure"
- 64 random bytes, Base64-encoded

cryptonite was already a transitive dependency, so there is really no
downside to this.

Fixes #132.
2020-08-20 11:38:20 -04:00
patrick brisbin
e46da4cafb
Document bounds change 2020-08-19 11:18:19 -04:00
patrick brisbin
60c0f68d5a
Cleanup WordPress plugin
- Explicit exports
- Fixup Haddock formatting
- Brittany & Stylish
- CHANGELOG attribution
2020-08-19 11:17:22 -04:00
nbloomf
40119bd1f3 Update changelog 2020-08-19 10:57:14 -04:00
nbloomf
cc961a0288 Add WordPress.com to .env.example 2020-08-19 10:57:14 -04:00
nbloomf
13b84a8724 Add WordPress.com as an auth provider
Documentation at https://developer.wordpress.com/docs/wpcc/
2020-08-19 10:57:14 -04:00
patrick brisbin
e483abcbc0 Disable nightly builds for now 2020-08-19 10:56:37 -04:00
patrick brisbin
a635a51e8c Fix nightly build 2020-08-19 10:56:37 -04:00
patrick brisbin
0c53b2fcb8 Add nightly target to Makefile 2020-08-19 10:56:37 -04:00
patrick brisbin
e57f90bc2c Simplify Makefile, now that it's not used on CI 2020-08-19 10:56:37 -04:00
patrick brisbin
79c2ab3e93 Include examples in CI builds 2020-08-19 10:56:37 -04:00
patrick brisbin
b1e31e9623 Use stack-nightly in nightly CI build 2020-08-19 10:56:37 -04:00
patrick brisbin
96492707b9 Rewrite CI using stack-build Orb 2020-08-19 10:56:37 -04:00
nbloomf
1576af3fa5 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 10:15:40 -04:00
nbloomf
0036d5f4e0 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-08 10:15:40 -04:00
nbloomf
b49ccb13aa Add AzureAD to example app 2020-07-08 05:45:27 -04:00
nbloomf
f6b9a28c29 Add GitLab to .env.example 2020-07-08 05:45:27 -04: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