From cfb0a97c7c55d950ef12e783ed8a12df75fde16a Mon Sep 17 00:00:00 2001 From: Amitai Burstein Date: Mon, 2 Oct 2023 17:46:40 +0300 Subject: [PATCH] Fix imports for signed token example (#1834) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix imports for signed token example Othweise we get the error: Ambiguous module name ‘Crypto.PubKey.RSA’: it was found in multiple packages: crypton-0.32 cryptonite-0.30 * Move import around --- Guide/file-storage.markdown | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Guide/file-storage.markdown b/Guide/file-storage.markdown index e6f663997..f7adcb9f7 100644 --- a/Guide/file-storage.markdown +++ b/Guide/file-storage.markdown @@ -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 } @@ -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. @@ -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 @@ -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