-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: remove caching empty JWT in Auth header
- Loading branch information
1 parent
c9a625c
commit 0c14ef7
Showing
7 changed files
with
62 additions
and
6 deletions.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
module Feature.Auth.JwtCacheSpec where | ||
|
||
import Network.Wai (Application) | ||
|
||
import Test.Hspec | ||
import Test.Hspec.Wai | ||
import Test.Hspec.Wai.JSON | ||
|
||
import Protolude hiding (get) | ||
|
||
spec :: SpecWith ((), Application) | ||
spec = describe "jwt cache enabled" $ do | ||
it "denies access to tables that anonymous does not own" $ | ||
get "/authors_only" `shouldRespondWith` | ||
[json| { | ||
"hint":null, | ||
"details":null, | ||
"code":"42501", | ||
"message":"permission denied for table authors_only"} |] | ||
{ matchStatus = 401 | ||
, matchHeaders = ["WWW-Authenticate" <:> "Bearer"] | ||
} |
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