Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix imports for signed token example #1834

Merged
merged 2 commits into from
Oct 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions Guide/file-storage.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -923,10 +923,10 @@ openssl rsa -in ./Config/jwtRS256.key -pubout -outform PEM -out ./Config/jwtRS25

```haskell
-- Config/Config.hs
import Crypto.PubKey.RSA as RSA
import Control.Exception (catch)
import qualified Data.ByteString as BS
import Web.JWT
import "cryptonite" Crypto.PubKey.RSA as RSA

data RsaKeys = RsaKeys { publicKey :: RSA.PublicKey, privateKey :: RSA.PrivateKey }

Expand Down Expand Up @@ -961,10 +961,10 @@ module Application.Helper.Controller where

-- ...
import Config
import Crypto.PubKey.RSA as RSA
import Data.ByteString.Base64 as Base64
import Crypto.PubKey.RSA.PKCS15 as RSA.PKCS15
import Crypto.Hash.Algorithms as Hash.Algorithms
import "cryptonite" Crypto.PubKey.RSA as RSA
import "cryptonite" Crypto.PubKey.RSA.PKCS15 as RSA.PKCS15
import "cryptonite" Crypto.Hash.Algorithms as Hash.Algorithms


-- | The RSA public key, can be used to verify image style URLs that were signed.
Expand All @@ -988,10 +988,10 @@ And one for the View helper.
module Application.Helper.View where

import IHP.ViewPrelude
import Crypto.PubKey.RSA.PKCS15 as RSA
import Crypto.Hash.Algorithms as Hash.Algorithms
import Data.ByteString.Base64 as Base64
import Application.Helper.Controller
import Data.ByteString.Base64 as Base64
import "cryptonite" Crypto.PubKey.RSA.PKCS15 as RSA
import "cryptonite" Crypto.Hash.Algorithms as Hash.Algorithms

-- Here you can add functions which are available in all your views

Expand All @@ -1016,10 +1016,10 @@ import System.Directory (doesFileExist)
import qualified Data.Text as Text

-- Imports for the signed token.
import Crypto.PubKey.RSA.PKCS15 as RSA
import Crypto.Hash.Algorithms as Hash.Algorithms
import Config
import Data.ByteString.Base64 as Base64
import "cryptonite" Crypto.PubKey.RSA.PKCS15 as RSA
import "cryptonite" Crypto.Hash.Algorithms as Hash.Algorithms

instance Controller ImageStyleController where
action RenderImageStyleAction { width, height, originalImagePath, signed } = do
Expand Down