Commit Graph

350 Commits

Author SHA1 Message Date
patrick brisbin
cc136ec4cd
Fix release.yml 2021-05-13 14:45:35 -04:00
patrick brisbin
10215d4c14
Remove dependencies upper bounds, version bump 2021-05-13 14:44:25 -04:00
patrick brisbin
3026e1e70d
Tweak release.yml 2021-05-13 14:43:29 -04:00
patrick brisbin
f892fa472d
Move haskell-tag to Release Workflow
Workflows that use the default GITHUB_TOKEN cannot trigger other
Workflows. This is a security thing (thanks crypto-bros) that prevents
us from pushing a tag in an attempt to trigger a Release.

Instead, we move that tagging to the Release Workflow itself and allow
that to run on pushes to main in addition to pushes of tags. This way,
pushes of tags continue to upload as before, but also pushes of changed
versions will now create a tag and upload, as desired.
2021-05-10 17:10:57 -04:00
patrick brisbin
7ec5c15e94
Fix haskell-tag action name 2021-05-10 16:41:22 -04:00
patrick brisbin
192c7c9b4a Version bump
Relax dependencies bounds

- https://github.com/commercialhaskell/stackage/issues/6006
- https://github.com/commercialhaskell/stackage/issues/6007
2021-05-10 15:53:16 -04:00
patrick brisbin
e71027270f Add tag Job to CI 2021-05-10 15:53:16 -04:00
patrick brisbin
a57718e9b8 Use stack-cache-action 2021-05-10 15:53:16 -04:00
patrick brisbin
b002c74da2 Correct key in Release Workflow 2021-05-10 15:53:16 -04:00
patrick brisbin
3bd05fa714 Name CI Workflow 2021-05-10 15:53:16 -04:00
Michael Gilliland
9f0fad7c5b
Add release action (#152) 2021-04-09 11:58:03 -04:00
Michael "Gilli" Gilliland
d8011561b8 Generate downstream cabal file 2021-04-09 11:47:39 -04:00
Michael Gilliland
e4c2ea72d2
Expose onDispatchError and generic error message (#150)
* Expose `onDispatchError` and generic `OtherDispatchError`

* Update changelog and version

* Restyled by prettier-markdown (#151)

Co-authored-by: Restyled.io <commits@restyled.io>

Co-authored-by: restyled-io[bot] <32688539+restyled-io[bot]@users.noreply.github.com>
Co-authored-by: Restyled.io <commits@restyled.io>
2021-04-09 11:46:24 -04:00
patrick brisbin
709805e8ee
Update CHANGELOG.md 2021-03-08 09:41:30 -05:00
Joseph Morag
c4d6a5d28d Expose custom widgets for google oauth 2021-03-08 09:40:26 -05:00
patrick brisbin
c3337b39ab
Update CHANGELOG.md 2021-03-05 11:58:04 -05:00
Restyled.io
e0bcb43207 Restyled by stylish-haskell 2021-03-05 11:41:29 -05:00
patrick brisbin
62dff1dd18 Tighten up callback expression 2021-03-05 11:41:29 -05:00
patrick brisbin
9dafb18923 Use (<$) 2021-03-05 11:41:29 -05:00
patrick brisbin
80552b399c Clean up maybe 2021-03-05 11:41:29 -05:00
patrick brisbin
0f09dd1d05 In-line errLeft 2021-03-05 11:41:29 -05:00
patrick brisbin
65694e10d7 In-line tryFetchCreds 2021-03-05 11:41:29 -05:00
patrick brisbin
b71ae8f60d Check for ErrorResponse before CSRF
It's possible there's an error that explains why the state token isn't
as expected. It should be fine to report those details before verifying
CSRF.
2021-03-05 11:41:29 -05:00
patrick brisbin
ab17f214eb Consolidate all errors, use onErrorHtml
Prior to this commit, some errors would be thrown (missing parameter,
invalid state, incorrect approot) while others would be handled via the
set-message-redirect approach (handshake failure, fetch-token failure,
etc).

This commit consolidates all of these cases into a single DispatchError
type, and then uses MonadError (concretely ExceptT) to capture them all
and handle them in one place ourselves.

It then updates that handling to:

- Use onErrorHtml

  onErrorHtml will, by default, set-message-redirect. That make this
  behavior neutral for users running defaults. For users that have
  customized this, it will be an improvement that all our error cases
  now respect it.

- Provided a JSON representation of errors
- Attach a random correlation identifier

The last two were just nice-to-haves that were cheap to add once the
code was in this state.

Note that the use of MonadError requires a potentially "bad" orphan
MonadUnliftIO instance for ExceptT, but I'd like to see that instance
become a reality and think it needs some real-world experimentation to
get there, so here I am.
2021-03-05 11:41:29 -05:00
Restyled.io
16aad54338 Restyled by prettier-yaml 2021-03-01 10:44:56 -05:00
Restyled.io
0ab9dc507f Restyled by prettier-markdown 2021-03-01 10:44:56 -05:00
patrick brisbin
62550b4ff3 Version bump 2021-03-01 10:44:56 -05:00
patrick brisbin
6f05c042b2 Relax dependency bounds 2021-03-01 10:44:56 -05:00
patrick brisbin
cdb8432248 Update default resolver, explicit GHC-8.10 CI 2021-03-01 10:44:56 -05:00
patrick brisbin
ffd7f85587 Update licensing and package metadata
And commit .cabal file.
2021-03-01 10:44:56 -05:00
patrick brisbin
766cb40d41 Migrate to GitHub Actions 2021-03-01 08:50:43 -05:00
patrick brisbin
cfcd8c5210
Version bump 2021-02-03 11:58:31 -05:00
patrick brisbin
2f71fc497e
Version bump 2021-01-15 09:11:58 -05:00
patrick brisbin
10867e4819
Re-relax lower bound on cryptonite 2021-01-15 09:11:20 -05:00
patrick brisbin
c245341c9f
Version bump 2021-01-15 08:35:27 -05:00
patrick brisbin
a09528a07f Exclude + from state tokens
When the state token is sent to an OAuth2 provider, it undergoes
%-encoding as a URL parameter. Presumably, the OAuth2 provider decodes
it as part of handling things (because it would take work to prevent
their own web frameworks from doing so), and then re-%-encodes it coming
back to us again as a callback parameter.

For us, and all existing providers, + is not a %-encoded character, so
it's sent as-is and sent back as-is. So far so good.

ClassLink, though, chooses to decode + to space. I'm not aware of the
actual spec or if this is a reasonable thing to do, but they do. This
results in them sending %20 back to us, which doesn't match and we fail.

We can't predict or prescribe what providers do in this area, so our
options are:

- Look for a match in our Session as-is OR with spaces replaced by +

  This is harder than it sounds: a token could contain +'s or spaces,
  and we'd be getting back only spaces. To succeed, we'd actually have
  to check every permutation of space/+ substitution.

- Filter + from our tokens

  The only downside is we may generate slightly fewer than 30
  characters, and so produce slightly less secure tokens.

  I chose this option.

- Generate tokens without + to begin with

  This would be ideal, but I'm just not familiar enough with
  Crypto.Random. I would happily accept a PR to use this option.
2021-01-14 10:21:46 -05:00
patrick brisbin
20ff7feaac Add ClassLink plugin 2021-01-14 10:21:46 -05:00
patrick brisbin
2b88d736f1 Lint 2021-01-14 10:21:46 -05:00
patrick brisbin
7c8d3eac49
Version bump 2020-12-21 08:56:05 -05:00
patrick brisbin
2bf1bf7f21 Bump LTS, bump dependencies upper-bounds 2020-12-21 08:40:43 -05:00
patrick brisbin
8b0ad2c222 Update nightly CI 2020-12-21 08:40:43 -05:00
patrick brisbin
92bd62e051
Remove weeder from Makefile 2020-12-10 15:22:50 -05:00
patrick brisbin
3cf4a3e87b
Version bump 2020-12-10 15:22:02 -05:00
patrick brisbin
bbda0d2f47 Support injecting fetchAccessToken
hoauth2's fetchAccessToken provides credentials in the Authorization
header, while fetchAccessToken2 provides them in that header but also
the POST body.

It was discovered that some providers only support one or the other, so
using fetchAccessToken2 would be preferred since it should work with
either. This happened in #129.

However, we discovered at least one provider (Okta) that actively
rejects requests unless they're supplying credentials in exactly one
place:

    Cannot supply multiple client credentials. Use one of the following:
    credentials in the Authorization header, credentials in the post
    body, or a client_assertion in the post body."

This patch reverts back to fetchAccessToken, but makes it possible to
for client to use fetchAccessToken2 if necessary via alternative
functions.
2020-12-10 15:20:31 -05:00
patrick brisbin
1f6d08dc8b Brittany 2020-12-10 15:20:31 -05:00
patrick brisbin
5d78b889b0
Version bump 2020-09-04 16:57:47 -04:00
patrick brisbin
bfc4c7d469 Update CHANGELOG 2020-08-24 10:49:14 -04:00
patrick brisbin
c607417c99 Drop CI support for ghc-8.4
It seems newer hoauth2 uses newer Cabal, which doesn't work in the
resolver for ghc-8.4. It may build, and you're welcome to try, but we're
dropping formal (e.g. CI-backed) support here.
2020-08-24 10:49:14 -04:00
patrick brisbin
537c03796d Disable weeder on CI
Something funky going on with version and we seem to get weeder-2 in
some Jobs, but not others.
2020-08-24 10:49:14 -04:00
patrick brisbin
ebc12e49ff Lint ErrorResponse 2020-08-24 10:49:14 -04:00