-
-
Notifications
You must be signed in to change notification settings - Fork 410
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
servant-auth-server: Support NamedRoutes
Trying to use `NamedRoutes` with `servant-auth-server` currently results in hideous error messages such as: ``` app/Main.hs:50:7: error: • No instance for (Servant.Auth.Server.Internal.AddSetCookie.AddSetCookies ('Servant.Auth.Server.Internal.AddSetCookie.S ('Servant.Auth.Server.Internal.AddSetCookie.S 'Servant.Auth.Server.Internal.AddSetCookie.Z)) (AdminRoutes (Servant.Server.Internal.AsServerT Handler)) (ServerT (Servant.Auth.Server.Internal.AddSetCookie.AddSetCookieApi (Servant.Auth.Server.Internal.AddSetCookie.AddSetCookieApi (NamedRoutes AdminRoutes))) Handler)) arising from a use of 'serveWithContext' • In the expression: serveWithContext (Proxy @API) ctx RootAPI {..} ``` This is because we didn't teach it how to recurse along `NamedRoutes` trees and sprinkle headers at the tip of each branch. This commit adds a test case and fixes the issue. In the process, it also implements `ThrowAll` for `NamedRoutes`, which was necessary for the test to run, and should also prove convenient for users.
- Loading branch information
Gaël Deest
committed
Feb 14, 2022
1 parent
cdd7c34
commit bd9151b
Showing
3 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters