Commit Graph

4889 Commits

Author SHA1 Message Date
Maximilian Tagher
5c33dcb518 .. 2020-05-31 16:56:09 -04:00
Maximilian Tagher
8e89ec0e40 .. 2020-05-31 16:38:48 -04:00
Maximilian Tagher
ab8a994a34 .. 2020-05-31 16:38:09 -04:00
Maximilian Tagher
c3fa2adddd Add more documentation to yesod-test
This adds high-level documentation to yesod-test, plus some function documentation
2020-05-31 16:35:27 -04:00
Michael Snoyman
074865bca9
Merge pull request #1674 from ericdeansanchez/fix-typo
Fix small typo in documentation
2020-05-23 21:37:16 +03:00
eric
d382d67769
Fix small typo in documentation
This PR seeks to correct a small typo in the word _continuously_.
2020-05-23 11:29:06 -07:00
Michael Snoyman
2b5bf7b9b9
Merge pull request #1672 from amkhlv/master
increase the size of CSRF token
2020-05-01 13:35:16 +03:00
Andrei Mikhailov
c39b165ff3 increase the size of CSRF token 2020-05-01 00:40:11 -03:00
Michael Snoyman
7f37d2b6fa
Merge pull request #1664 from RyanGlScott/master
Use DeriveLift to generate yesod-core's Lift instances
2020-03-31 16:21:23 +03:00
Ryan Scott
29a08425e9 Use DeriveLift to generate yesod-core's Lift instances
GHC 8.0 and later come with the `DeriveLift` extension for deriving
instances of `Language.Haskell.TH.Syntax.Lift`. `yesod-core` supports
GHC 8.2 and up, so it is able to make use of this. Not only does
`DeriveLift` make for much shorter code, but it also fixes warnings
that you get when compiling `yesod-core` with GHC 8.10 or later:

```
[20 of 31] Compiling Yesod.Routes.TH.Types ( src/Yesod/Routes/TH/Types.hs, interpreted )

src/Yesod/Routes/TH/Types.hs:34:10: warning: [-Wmissing-methods]
    • No explicit implementation for
        ‘liftTyped’
    • In the instance declaration for ‘Lift (ResourceTree t)’
   |
34 | instance Lift t => Lift (ResourceTree t) where
   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Yesod/Routes/TH/Types.hs:49:10: warning: [-Wmissing-methods]
    • No explicit implementation for
        ‘liftTyped’
    • In the instance declaration for ‘Lift (Resource t)’
   |
49 | instance Lift t => Lift (Resource t) where
   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Yesod/Routes/TH/Types.hs:59:10: warning: [-Wmissing-methods]
    • No explicit implementation for
        ‘liftTyped’
    • In the instance declaration for ‘Lift (Piece t)’
   |
59 | instance Lift t => Lift (Piece t) where
   |          ^^^^^^^^^^^^^^^^^^^^^^^^

src/Yesod/Routes/TH/Types.hs:78:10: warning: [-Wmissing-methods]
    • No explicit implementation for
        ‘liftTyped’
    • In the instance declaration for ‘Lift (Dispatch t)’
   |
78 | instance Lift t => Lift (Dispatch t) where
   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
```

This is because `DeriveLift` fills in implementations of `liftTyped`,
a method that was introduced to `Lift` in `template-haskell-2.16.0.0`
(bundled with GHC 8.10).
2020-03-31 08:41:00 -04:00
Jezen Thomas
59f601a34c
Add functions for setting description and OG meta (#1663)
* Add functions for setting description and OG meta

It's common that a website author will want to add a specific
description and Open Graph image to a given page in their website. These
functions are simple conveniences to add these meta tags to the document
head.

I decided against simply adding all possible meta tags, because not all
of them are useful, and even in the case of Open Graph tags, many of
them should be set only once and they should use the same value for the
entire website. In those cases, it's probably better for the website
author to add those tags in their layout template.

Closes https://github.com/yesodweb/yesod/issues/1659
2020-03-30 19:00:24 +07:00
Michael Snoyman
4a4dd06df8
Azure matrix/stack.yaml update 2020-03-24 12:20:19 +02:00
Michael Snoyman
179296c568
Merge pull request #1662 from charukiewicz/master
Yesod.Auth.Email: Fixed incorrect confirmation message, enabled customizing 'forgot password' email
2020-03-24 07:15:56 +02:00
charukiewicz
c5e76faf4d adjusted indentation of if/then/else to be more compact 2020-03-21 12:49:18 -05:00
charukiewicz
ff8ad9717f added link to PR in changelog entry 2020-03-21 02:27:52 -05:00
charukiewicz
cef6fc42ef bumped yesod-auth to 1.6.10 and updated ChangeLog 2020-03-21 02:16:40 -05:00
charukiewicz
61f1e5eeae added sendForgotPasswordEmail to YesodAuthEmail typeclass and incorporated into defaultRegisterHelper 2020-03-21 02:15:27 -05:00
charukiewicz
f80ec711ff updated AuthMessage to accommodate user registration flow with password: added EmailVerified and EmailVerifiedChangePass, deprecated AddressVerified 2020-03-20 22:22:13 -05:00
Michael Snoyman
9d0c9180b9
unliftio-core 0.2 2020-03-01 11:00:36 +02:00
Michael Snoyman
b4c613f766
Merge pull request #1660 from charukiewicz/register-helper
Add methods to YesodAuthEmail that allow custom flow after registration/password reset
2020-02-11 08:44:30 +02:00
charukiewicz
4f62e39fb1 added pull request link to ChangeLog entry 2020-02-09 17:03:51 -06:00
charukiewicz
16bf146887 version bump to 1.6.9 and changelog update 2020-02-05 23:49:16 -06:00
charukiewicz
c35c2fddc2 added passwordResetHelper method, exposed defaultRegisterHelper 2020-02-05 23:45:02 -06:00
charukiewicz
abdd844279 added registerHandler method to YesodAuthEmail class to enable override 2020-02-05 01:21:56 -06:00
Michael Snoyman
5943ee527d
Version bump 2020-01-27 17:52:24 +02:00
Michael Snoyman
6c9279c146
Merge pull request #1657 from simonmichael/master
support template-haskell 2.16, build with GHC 8.10
2020-01-27 17:51:35 +02:00
Simon Michael
dd649bf238 support template-haskell 2.16, build with GHC 8.10 2020-01-27 06:11:48 -08:00
Maximilian Tagher
873bee0cfa
Merge pull request #1654 from juanpaucar/remove_typeable
Remove unnecessary Typeable deriving, Solves #1653
2020-01-25 14:03:07 -08:00
Juan Paucar
6e38a3b99d Bump version properly 2020-01-20 11:06:35 -05:00
Juan Paucar
eb159b6fd5 Bump versions 2020-01-17 14:03:59 -05:00
Juan Paucar
c279547962 Remove unnecesary Typeable deriving 2020-01-17 11:48:58 -05:00
Michael Snoyman
804b114d91
Drop LTS 9 2020-01-07 13:36:58 +02:00
Michael Snoyman
dc16761492
Merge pull request #1649 from yesodweb/yesodPersistentCompatibility
Add extensions for yesod-persistent tests to be compatible with lates…
2020-01-03 07:38:07 +02:00
Maximilian Tagher
a8a7b6c7a5 .. 2020-01-02 22:51:54 -05:00
Maximilian Tagher
367d77a8c3 .. 2020-01-02 22:00:13 -05:00
Maximilian Tagher
cf365d18a2 Add extensions for yesod-persistent tests to be compatible with latest persistent-template
The upcoming version of persistent-template will require these yesodweb/persistent#1002
2020-01-02 21:57:00 -05:00
Maximilian Tagher
4f51153b09 Require latest yesod-core for yesod-test
(This was missing from #1646)
2019-12-01 08:06:10 -05:00
Maximilian Tagher
3fac351583
Merge pull request #1646 from yesodweb/requireJSONResponse
[yesod-test] Adds requireJSONResponse function
2019-12-01 08:04:21 -05:00
Maximilian Tagher
8ee771896c .. 2019-11-29 10:46:25 -05:00
Maximilian Tagher
561adc2e17 .. 2019-11-29 10:44:49 -05:00
Maximilian Tagher
42d41f77de .. 2019-11-29 10:43:11 -05:00
Maximilian Tagher
0025226af6 Print preview of JSON body in case of parse failure 2019-11-28 22:33:00 -05:00
Maximilian Tagher
91b75741dd .. 2019-11-24 16:11:50 -05:00
Maximilian Tagher
92afb1150a .. 2019-11-24 15:56:42 -05:00
Maximilian Tagher
596db81d7a .. 2019-11-24 15:55:58 -05:00
Maximilian Tagher
6d0b723eb1 [yesod-test] Adds requireJSONResponse function
This function checks that a response body is JSON, and parses it into a Haskell value. Having something like this function is pretty essential to using Yesod as a JSON API server, so I think it's a good addition. You can use it to parse a Haskell record directly (usually by adding FromJSON classes to your response types), or parse a Value and pull out individual fields, maybe using something like `aeson-lens` (though probably a testing-specific library would be better).

I debated over these things:

1. The name. I was thinking of something like [assert/require/decode/parse]JSON[Response/Body]. I ultimately went with requireJSONResponse:
	- decode/parse sound like the aeson functions that return Either or Maybe, and I wanted this function to throw an error if it failed
	- I'm open to using `assertJSONResponse`—it matches the other functions (`assertEq`) better—but I think it reads less like English.
	- I chose Response over Body because (a) It also checks the content-type header, which is not in the body (b) "Body" felt slightly in-the-weeds of HTTP; I think "response" is more approachable.
2. Should it require the JSON content type? You can definitely have a server that returns JSON without JSON content types, but I think that's a such a bad idea, it's more likely requiring it helps people if they accidentally don't add the header.
3. Should it take a String parameter to add to the error message? This would match `assertEq`, but other functions like `statusIs` don't take a message. Ultimately I went without it, because the messages felt like I was repeating myself: `(comment :: Comment) <- requireJSONResponse "the response has a comment"`
2019-11-24 15:31:05 -05:00
Michael Snoyman
463fd54c5a
Drop rio dep (fixes #1645) 2019-11-22 09:16:52 +02:00
Maximilian Tagher
d5f6fbba8b
Merge pull request #1642 from yesodweb/testModifySite
Add testModifySite
2019-11-20 08:41:08 -08:00
Maximilian Tagher
b0c07ea3cd .. 2019-11-19 23:13:11 -08:00
Maximilian Tagher
cbef19fae9 [yesod-test] Add testModifySite 2019-11-19 23:11:13 -08:00