Skip to content

Upgrade ghc #14

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
FROM haskell:8.8.3
FROM haskell:9.2.7

### Install libpq-dev for postgres haskell lib to be built & entr for detecting changes and restarting stack
# Install libpq-dev for postgres haskell lib to be built & entr for detecting
# changes and restarting stack
RUN apt-get update \
&& apt-get -y install libpq-dev entr \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /root/

## Prebuild dependencies
# Prebuild dependencies
COPY stack.* package.yaml /root/
RUN stack build --only-dependencies


COPY ./entrypoint.sh /opt/entrypoint.sh
RUN chmod +x /opt/entrypoint.sh

Expand Down
6 changes: 3 additions & 3 deletions package.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: web-haskell
version: 0.1.0.0
github: ""
github: "dandoh/web-haskell-graphql-postgres-boilerplate"
license: BSD3
author: "dandoh (Nhan Thai)"
maintainer: "dandoh (Nhan Thai)"
Expand All @@ -10,7 +10,7 @@ extra-source-files:
- README.md
- ChangeLog.md

description: Please see the README on GitHub at <https://github.com/dandoh/web-haskell>
description: Please see the README on GitHub at <https://github.com/dandoh/web-haskell-graphql-postgres-boilerplate>

default-extensions:
- OverloadedStrings
Expand All @@ -36,7 +36,7 @@ default-extensions:


dependencies:
- base
- base
- transformers
- text
- mtl
Expand Down
2 changes: 1 addition & 1 deletion src/Authentication/JWT.hs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ verifyJWT :: UTCTime -> SecretKey -> Token -> Maybe Int
verifyJWT currentTime secret token = do
let signer = hmacSecret secret
unverifiedJWT <- decode token
verifiedJWT <- verify signer unverifiedJWT
verifiedJWT <- verify (toVerify signer) unverifiedJWT
expTime <- exp . claims $ verifiedJWT
now <- numericDate $ utcTimeToPOSIXSeconds currentTime
guard (now < expTime)
Expand Down
2 changes: 1 addition & 1 deletion src/Graphql/Resolver/Root.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ rootResolver =
where
queryResolver = Query {login = loginResolver, myUserInfo = myUserInfoResolver, allUsers = allUsersResolver}
mutationResolver = Mutation {register = registerResolver, changePassword = changePasswordResolver}
subscriptionResolver = Undefined
subscriptionResolver = undefined
2 changes: 1 addition & 1 deletion src/Graphql/Resolver/User.hs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ loginResolver LoginArgs {email, password} = do
case res of
[user] | validateHashedPassword (DB.userPasswordHash . record $ user) password -> do
time <- liftIO getCurrentTime
secret <- lift $ asks (jwtSecret . config)
secret <- lift $ asks (jwtSecret . Graphql.config)
let jwt = makeJWT time secret (DB.userId . record $ user)
return Session {token = pure jwt, user = userResolver user}
_ -> fail "Wrong email or password"
Expand Down
12 changes: 9 additions & 3 deletions stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#
# resolver: ./custom-snapshot.yaml
# resolver: https://example.com/snapshots/2018-01-01.yaml
resolver: lts-15.12
resolver: lts-20.16

# User packages to be built.
# Various formats can be used as shown in the example below.
Expand All @@ -36,8 +36,14 @@ packages:
# forks / in-progress versions pinned to a git hash. For example:
#
extra-deps:
- morpheus-graphql-core-0.13.0
- morpheus-graphql-0.13.0
- morpheus-graphql-0.27.0
- morpheus-graphql-core-0.27.0
- morpheus-graphql-app-0.27.0
- morpheus-graphql-code-gen-0.27.0
- morpheus-graphql-code-gen-utils-0.27.0
- morpheus-graphql-server-0.27.0
- morpheus-graphql-client-0.27.0
- morpheus-graphql-subscriptions-0.27.0
- postgresql-simple-url-0.2.1.0

# Override default flag values for local packages and extra-deps
Expand Down
70 changes: 56 additions & 14 deletions stack.yaml.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,71 @@

packages:
- completed:
hackage: morpheus-graphql-core-0.13.0@sha256:af4c0cc0f5c84cbcb85486329574f2ced98326be4fedd8a7fa116bf783d5a8b6,6774
hackage: morpheus-graphql-0.27.0@sha256:59affb5bd9db118dc2efbb8803cc8f408856c9f32232e1bd32d015658070334d,17690
pantry-tree:
size: 8516
sha256: f0155c18930d61ebb6b1f5d81321bdf49f41dffbab3f9b07a6cc3785c540ac9b
sha256: dca811cf391d2fe330614933e9f1ce9a4bf4c51b010ad85d38e8e04a8f611092
size: 22603
original:
hackage: morpheus-graphql-core-0.13.0
hackage: morpheus-graphql-0.27.0
- completed:
hackage: morpheus-graphql-0.13.0@sha256:d8173116f630ecf264747bf31a823126452f144e1802d236b64efcf8677289cb,28007
hackage: morpheus-graphql-core-0.27.0@sha256:00c12d8a32f98cc88648d187e5e8d791e60990f984eecc9d0f84d3d3c88bb60b,14192
pantry-tree:
size: 40014
sha256: 5b390bba65d00644b0c99d7cbda308d1ff0706a33c90523d6cfcdd5005cab90d
sha256: 23cd72c4aba5deb823582b2d822c38d0745b14b973e4616964376583a510c586
size: 19536
original:
hackage: morpheus-graphql-0.13.0
hackage: morpheus-graphql-core-0.27.0
- completed:
hackage: postgresql-simple-url-0.2.1.0@sha256:25aa9dca3c05b2c66b9336907d9300f1312fbdfa54e0d395b52d1a1e6579810a,1837
hackage: morpheus-graphql-app-0.27.0@sha256:1848f8e77745466b5ee69d9805f553b1c7c296a03387f95f8471f22f9b7ff3d8,8344
pantry-tree:
sha256: 6b1db074a5772f3e54b1a599fd06129971703711f4e89f69338c7383716a0a7f
size: 10092
original:
hackage: morpheus-graphql-app-0.27.0
- completed:
hackage: morpheus-graphql-code-gen-0.27.0@sha256:4a445c9f561b4d2aaba6fcacf4dd4d1476b95089bd617d799c9dfd8a0c299dc1,2700
pantry-tree:
sha256: d7cc8a21c6ede9ef53c2a219a0feefb712b39eb281be3353d295af9f5c6fd533
size: 1124
original:
hackage: morpheus-graphql-code-gen-0.27.0
- completed:
hackage: morpheus-graphql-code-gen-utils-0.27.0@sha256:3a10ce1c0de9ff874006a63c3686c3089a11042ecea7e3fa808a3e446656caf1,1571
pantry-tree:
sha256: 65a4f46453d8bdf7ca47fa6aecf12ce90b9ad0945f76b3ce6dc9b9e03c67cbc3
size: 700
original:
hackage: morpheus-graphql-code-gen-utils-0.27.0
- completed:
hackage: morpheus-graphql-server-0.27.0@sha256:adcad6f6272a73d930d30e1c097c51286393f72e9dedde1ca40047c20ff2931e,24247
pantry-tree:
sha256: 165553392f19ad258a99c605699d998db02f4dadf97fe4ef709bdfee8ace1be5
size: 34528
original:
hackage: morpheus-graphql-server-0.27.0
- completed:
hackage: morpheus-graphql-client-0.27.0@sha256:050f929015020610e3db679c9ed87a086e408672e329c6cdecae5c3f22240bd9,5236
pantry-tree:
sha256: b700b236d31993434b14db638d89b4273e6faf9fd31ccf10b967d6b973bc2fa5
size: 5123
original:
hackage: morpheus-graphql-client-0.27.0
- completed:
hackage: morpheus-graphql-subscriptions-0.27.0@sha256:5607dac935b0c4be92e90af8a699838452fc2c7f195f27b52c69cd41f2b996bc,1784
pantry-tree:
sha256: 31bfb58d786a923556930a164ec24c744e92b79568b46dd8cc0eec03952c7379
size: 813
original:
hackage: morpheus-graphql-subscriptions-0.27.0
- completed:
hackage: postgresql-simple-url-0.2.1.0@sha256:1edaa34667cb3fa39b8c796988e69aeb9296bb721869ad9a311a15ed83596edf,1879
pantry-tree:
sha256: 49317eacc94080724815bd993c02e84801f77eb31d11d6b84d3c501295050db6
size: 397
sha256: fcd1457d9463ac9d2261d538c42a283761eb253c9bb230f6df450209348a38f8
original:
hackage: postgresql-simple-url-0.2.1.0
snapshots:
- completed:
size: 494635
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/15/12.yaml
sha256: a71c4293d8f461f455ff0d9815dfe4ab2f1adacd7e0bbc9a218f46ced8c4929a
original: lts-15.12
sha256: dad15e2ec0c09280a5c2e07190fb18710fc54472f029f34f861f686540824d81
size: 649592
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/20/16.yaml
original: lts-20.16