summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNCrashed <>2018-09-13 17:39:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2018-09-13 17:39:00 (GMT)
commit0d1b0a10303aa793dbbeb089dcec91bf0fa3c157 (patch)
tree4907e8d4a4e464d14c0510980d3741ad92006dc8
parent7283bb28f136ec34ddf5e2010a79af165208a46a (diff)
version 0.5.4.00.5.4.0
-rw-r--r--CHANGELOG.md5
-rw-r--r--example/acid/servant-auth-token-example-acid.cabal8
-rw-r--r--example/acid/src/API.hs14
-rw-r--r--example/acid/src/Server.hs16
-rw-r--r--example/leveldb/servant-auth-token-example-leveldb.cabal10
-rw-r--r--example/persistent/servant-auth-token-example-persistent.cabal14
-rw-r--r--servant-auth-token.cabal6
-rw-r--r--stack.yaml23
8 files changed, 59 insertions, 37 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 474f383..632c717 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,8 @@
+0.5.4.0
+=======
+
+* Bump versions for `lts-12.9`.
+
0.5.3.0
=======
diff --git a/example/acid/servant-auth-token-example-acid.cabal b/example/acid/servant-auth-token-example-acid.cabal
index bde4850..66469d2 100644
--- a/example/acid/servant-auth-token-example-acid.cabal
+++ b/example/acid/servant-auth-token-example-acid.cabal
@@ -25,21 +25,21 @@ executable servant-auth-token-example-acid
build-depends:
base >= 4.7 && < 5
, acid-state >= 0.14 && < 0.15
- , aeson >= 0.11 && < 1.3
+ , aeson >= 0.11 && < 1.4
, aeson-injector >= 1.1 && < 1.2
, bytestring >= 0.10 && < 0.11
- , exceptions >= 0.8 && < 0.9
+ , exceptions >= 0.8 && < 0.11
, http-types >= 0.9 && < 0.13
, monad-control >= 1.0 && < 1.1
, monad-logger >= 0.3 && < 0.4
, mtl >= 2.2 && < 2.3
, optparse-applicative >= 0.12 && < 0.15
, safecopy >= 0.9 && < 0.10
- , servant >= 0.9 && < 0.14
+ , servant >= 0.9 && < 0.15
, servant-auth-token >= 0.5 && < 0.6
, servant-auth-token-acid >= 0.5 && < 0.6
, servant-auth-token-api >= 0.5 && < 0.6
- , servant-server >= 0.12 && < 0.14
+ , servant-server >= 0.12 && < 0.15
, text >= 1.2 && < 1.3
, time >= 1.6 && < 1.9
, transformers-base >= 0.4 && < 0.5
diff --git a/example/acid/src/API.hs b/example/acid/src/API.hs
index 33faeb0..96f09a8 100644
--- a/example/acid/src/API.hs
+++ b/example/acid/src/API.hs
@@ -5,6 +5,14 @@ module API(
import Servant.API
import Servant.API.Auth.Token
-type ExampleAPI = "test"
- :> TokenHeader' '["test-permission"]
- :> Get '[JSON] ()
+-- Your application endpoints
+type ExampleEndpoint = "test"
+ :> TokenHeader' '["test-permission"]
+ :> Get '[JSON] ()
+
+type ExampleAPI =
+ ExampleEndpoint
+ -- This is required for actual testing
+ :<|> AuthSigninPostMethod
+ :<|> AuthTouchMethod
+ :<|> AuthSignoutMethod
diff --git a/example/acid/src/Server.hs b/example/acid/src/Server.hs
index 1c4a84b..b171633 100644
--- a/example/acid/src/Server.hs
+++ b/example/acid/src/Server.hs
@@ -12,10 +12,13 @@ module Server(
import Control.Monad.IO.Class
import Control.Monad.Logger
+import Data.Aeson.Unit
+import Data.Aeson.WithField
import Data.Proxy
import Network.Wai
import Network.Wai.Handler.Warp
import Network.Wai.Middleware.RequestLogger
+import Servant.API
import Servant.API.Auth.Token
import Servant.Server
import Servant.Server.Auth.Token
@@ -42,9 +45,22 @@ exampleServerApp e = serve api apiImpl
-- | Implementation of main server API
exampleServer :: ServerT ExampleAPI ServerM
exampleServer = testEndpoint
+ -- Pass though requests directly to the library in these endpoints
+ :<|> authSigninPostProxy
+ :<|> authTouchProxy
+ :<|> authSignoutProxy
testEndpoint :: MToken' '["test-permission"] -> ServerM ()
testEndpoint token = do
runAuth $ guardAuthToken token
$logInfo "testEndpoint"
return ()
+
+authSigninPostProxy :: AuthSigninPostBody -> ServerM (OnlyField "token" SimpleToken)
+authSigninPostProxy AuthSigninPostBody{..} = runAuth $ authSignin (Just authSigninBodyLogin) (Just authSigninBodyPassword) authSigninBodySeconds
+
+authTouchProxy :: Maybe Seconds -> MToken' '[] -> ServerM Unit
+authTouchProxy mexpire token = runAuth $ authTouch mexpire token
+
+authSignoutProxy :: MToken' '[] -> ServerM Unit
+authSignoutProxy mtoken = runAuth $ authSignout mtoken
diff --git a/example/leveldb/servant-auth-token-example-leveldb.cabal b/example/leveldb/servant-auth-token-example-leveldb.cabal
index e18d401..8ce07b8 100644
--- a/example/leveldb/servant-auth-token-example-leveldb.cabal
+++ b/example/leveldb/servant-auth-token-example-leveldb.cabal
@@ -24,10 +24,10 @@ executable servant-auth-token-example-leveldb
build-depends:
base >= 4.7 && < 5
, acid-state >= 0.14 && < 0.15
- , aeson >= 0.11 && < 1.3
+ , aeson >= 0.11 && < 1.4
, aeson-injector >= 1.1 && < 1.2
, bytestring >= 0.10 && < 0.11
- , exceptions >= 0.8 && < 0.9
+ , exceptions >= 0.8 && < 0.11
, http-types >= 0.9 && < 0.13
, leveldb-haskell >= 0.6 && < 0.7
, monad-control >= 1.0 && < 1.1
@@ -35,11 +35,11 @@ executable servant-auth-token-example-leveldb
, mtl >= 2.2 && < 2.3
, optparse-applicative >= 0.12 && < 0.15
, safecopy >= 0.9 && < 0.10
- , servant >= 0.12 && < 0.14
+ , servant >= 0.12 && < 0.15
, servant-auth-token >= 0.5 && < 0.6
, servant-auth-token-api >= 0.5 && < 0.6
- , servant-auth-token-leveldb >= 0.5 && < 0.6
- , servant-server >= 0.12 && < 0.14
+ , servant-auth-token-leveldb >= 0.6 && < 0.7
+ , servant-server >= 0.12 && < 0.15
, text >= 1.2 && < 1.3
, time >= 1.6 && < 1.9
, transformers-base >= 0.4 && < 0.5
diff --git a/example/persistent/servant-auth-token-example-persistent.cabal b/example/persistent/servant-auth-token-example-persistent.cabal
index fe6f965..37fecb4 100644
--- a/example/persistent/servant-auth-token-example-persistent.cabal
+++ b/example/persistent/servant-auth-token-example-persistent.cabal
@@ -23,22 +23,22 @@ executable servant-auth-token-example-persistent
default-language: Haskell2010
build-depends:
base >= 4.7 && < 5
- , aeson >= 0.11 && < 1.3
+ , aeson >= 0.11 && < 1.4
, aeson-injector >= 1.1 && < 1.2
, bytestring >= 0.10 && < 0.11
- , exceptions >= 0.8 && < 0.9
+ , exceptions >= 0.8 && < 0.11
, http-types >= 0.9 && < 0.13
, monad-control >= 1.0 && < 1.1
, monad-logger >= 0.3 && < 0.4
, mtl >= 2.2 && < 2.3
, optparse-applicative >= 0.12 && < 0.15
- , persistent >= 2.6 && < 2.8
- , persistent-postgresql >= 2.6 && < 2.8
- , servant >= 0.12 && < 0.14
+ , persistent >= 2.6 && < 2.9
+ , persistent-postgresql >= 2.6 && < 2.9
+ , servant >= 0.12 && < 0.15
, servant-auth-token >= 0.5 && < 0.6
, servant-auth-token-api >= 0.5 && < 0.6
- , servant-auth-token-persistent >= 0.6 && < 0.7
- , servant-server >= 0.12 && < 0.14
+ , servant-auth-token-persistent >= 0.7 && < 0.8
+ , servant-server >= 0.12 && < 0.15
, text >= 1.2 && < 1.3
, time >= 1.6 && < 1.9
, transformers-base >= 0.4 && < 0.5
diff --git a/servant-auth-token.cabal b/servant-auth-token.cabal
index d715b0c..3a0a898 100644
--- a/servant-auth-token.cabal
+++ b/servant-auth-token.cabal
@@ -1,5 +1,5 @@
name: servant-auth-token
-version: 0.5.3.0
+version: 0.5.4.0
synopsis: Servant based API and server for token based authorisation
description: Please see README.md
homepage: https://github.com/ncrashed/servant-auth-token#readme
@@ -67,9 +67,9 @@ library
, http-api-data >= 0.3.5 && < 0.4
, mtl >= 2.2 && < 2.3
, pwstore-fast >= 2.4 && < 2.5
- , servant >= 0.11 && < 0.14
+ , servant >= 0.11 && < 0.15
, servant-auth-token-api >= 0.5 && < 0.6
- , servant-server >= 0.11 && < 0.14
+ , servant-server >= 0.11 && < 0.15
, text >= 1.2 && < 1.3
, time >= 1.5 && < 1.9
, transformers >= 0.4 && < 0.6
diff --git a/stack.yaml b/stack.yaml
index 0959eff..299deac 100644
--- a/stack.yaml
+++ b/stack.yaml
@@ -15,7 +15,7 @@
# resolver:
# name: custom-snapshot
# location: "./custom-snapshot.yaml"
-resolver: lts-10.5
+resolver: lts-12.9
# User packages to be built.
# Various formats can be used as shown in the example below.
@@ -40,11 +40,10 @@ packages:
- 'servant-auth-token-acid'
- 'servant-auth-token-persistent'
- 'servant-auth-token-leveldb'
-- 'servant-auth-token-rocksdb'
+#- 'servant-auth-token-rocksdb'
- 'example/acid'
- 'example/persistent'
-- 'example/leveldb'
-#- '../safecopy'
+#- 'example/leveldb'
#- '../servant-auth-token-api'
# - location:
# git: https://github.com/NCrashed/servant-auth-token-api.git
@@ -60,17 +59,10 @@ packages:
# (e.g., acme-missiles-0.3)
extra-deps:
- acid-state-0.14.3
-- http-types-0.12.1
+- aeson-injector-1.1.1.0
+- pwstore-fast-2.4.4
- rocksdb-haskell-1.0.1
-- safecopy-store-0.9.6
-- servant-0.13
-- servant-auth-token-api-0.5.2.0
-- servant-client-0.13
-- servant-docs-0.11.2
-- servant-server-0.13
-- servant-swagger-1.1.5
-- singleton-bool-0.1.3
-- text-1.2.3.0
+- servant-auth-token-api-0.5.3.0
# Override default flag values for local packages and extra-deps
flags: {}
@@ -79,12 +71,13 @@ flags: {}
extra-package-dbs: []
nix:
- enable: false
packages:
- zlib
- postgresql96
- rocksdb
- leveldb
+#nix:
+# shell-file: shell.nix
# Control whether we use the GHC we find on the path
# system-ghc: true