Skip to content

Commit 94e00d3

Browse files
authored
Merge pull request #1171 from haskell-servant/issue-1088-squash
Adding OIDC Cookbook
2 parents 3c9af80 + 53b97dd commit 94e00d3

File tree

7 files changed

+529
-3
lines changed

7 files changed

+529
-3
lines changed

.travis.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# For more information, see https://github.com/haskell-CI/haskell-ci
66
#
7-
# version: 0.3.20190326
7+
# version: 0.3.20190413
88
#
99
language: c
1010
dist: xenial
@@ -122,6 +122,7 @@ install:
122122
if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "doc/cookbook/structuring-apis"' >> cabal.project ; fi
123123
if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "doc/cookbook/using-custom-monad"' >> cabal.project ; fi
124124
if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "doc/cookbook/using-free-client"' >> cabal.project ; fi
125+
if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "doc/cookbook/open-id-connect"' >> cabal.project ; fi
125126
- |
126127
echo "constraints: foundation >=0.0.14" >> cabal.project
127128
echo "constraints: memory <0.14.12 || >0.14.12" >> cabal.project
@@ -132,7 +133,7 @@ install:
132133
echo "allow-newer: servant-quickcheck:http-client" >> cabal.project
133134
echo "optimization: False" >> cabal.project
134135
echo "write-ghc-environment-files: always" >> cabal.project
135-
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | grep -vE -- '^(cookbook-basic-auth|cookbook-basic-streaming|cookbook-curl-mock|cookbook-db-postgres-pool|cookbook-db-sqlite-simple|cookbook-file-upload|cookbook-generic|cookbook-https|cookbook-pagination|cookbook-structuring-apis|cookbook-testing|cookbook-using-custom-monad|cookbook-using-free-client|servant|servant-client|servant-client-core|servant-conduit|servant-docs|servant-foreign|servant-http-streams|servant-machines|servant-pipes|servant-server|tutorial)$' | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
136+
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | grep -vE -- '^(cookbook-basic-auth|cookbook-basic-streaming|cookbook-curl-mock|cookbook-db-postgres-pool|cookbook-db-sqlite-simple|cookbook-file-upload|cookbook-generic|cookbook-https|cookbook-pagination|cookbook-structuring-apis|cookbook-testing|cookbook-using-custom-monad|cookbook-using-free-client|open-id-connect|servant|servant-client|servant-client-core|servant-conduit|servant-docs|servant-foreign|servant-http-streams|servant-machines|servant-pipes|servant-server|tutorial)$' | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
136137
- cat cabal.project || true
137138
- cat cabal.project.local || true
138139
- if [ -f "servant/configure.ac" ]; then (cd "servant" && autoreconf -i); fi
@@ -159,6 +160,10 @@ install:
159160
- if [ -f "doc/cookbook/structuring-apis/configure.ac" ]; then (cd "doc/cookbook/structuring-apis" && autoreconf -i); fi
160161
- if [ -f "doc/cookbook/using-custom-monad/configure.ac" ]; then (cd "doc/cookbook/using-custom-monad" && autoreconf -i); fi
161162
- if [ -f "doc/cookbook/using-free-client/configure.ac" ]; then (cd "doc/cookbook/using-free-client" && autoreconf -i); fi
163+
- if [ -f "doc/cookbook/open-id-connect/configure.ac" ]; then (cd "doc/cookbook/open-id-connect" && autoreconf -i); fi
164+
- ${CABAL} v2-freeze -w ${HC} ${TEST} ${BENCH} | color_cabal_output
165+
- "cat cabal.project.freeze | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'"
166+
- rm cabal.project.freeze
162167
script:
163168
- DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
164169
# Packaging...
@@ -198,6 +203,7 @@ script:
198203
if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "cookbook-structuring-apis-*/*.cabal"' >> cabal.project ; fi
199204
if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "cookbook-using-custom-monad-*/*.cabal"' >> cabal.project ; fi
200205
if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "cookbook-using-free-client-*/*.cabal"' >> cabal.project ; fi
206+
if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "open-id-connect-*/*.cabal"' >> cabal.project ; fi
201207
- |
202208
echo "constraints: foundation >=0.0.14" >> cabal.project
203209
echo "constraints: memory <0.14.12 || >0.14.12" >> cabal.project
@@ -208,7 +214,7 @@ script:
208214
echo "allow-newer: servant-quickcheck:http-client" >> cabal.project
209215
echo "optimization: False" >> cabal.project
210216
echo "write-ghc-environment-files: always" >> cabal.project
211-
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | grep -vE -- '^(cookbook-basic-auth|cookbook-basic-streaming|cookbook-curl-mock|cookbook-db-postgres-pool|cookbook-db-sqlite-simple|cookbook-file-upload|cookbook-generic|cookbook-https|cookbook-pagination|cookbook-structuring-apis|cookbook-testing|cookbook-using-custom-monad|cookbook-using-free-client|servant|servant-client|servant-client-core|servant-conduit|servant-docs|servant-foreign|servant-http-streams|servant-machines|servant-pipes|servant-server|tutorial)$' | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
217+
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | grep -vE -- '^(cookbook-basic-auth|cookbook-basic-streaming|cookbook-curl-mock|cookbook-db-postgres-pool|cookbook-db-sqlite-simple|cookbook-file-upload|cookbook-generic|cookbook-https|cookbook-pagination|cookbook-structuring-apis|cookbook-testing|cookbook-using-custom-monad|cookbook-using-free-client|open-id-connect|servant|servant-client|servant-client-core|servant-conduit|servant-docs|servant-foreign|servant-http-streams|servant-machines|servant-pipes|servant-server|tutorial)$' | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
212218
- cat cabal.project || true
213219
- cat cabal.project.local || true
214220
- echo -en 'travis_fold:end:unpack\\r'

cabal.project

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ packages:
3030
doc/cookbook/structuring-apis
3131
doc/cookbook/using-custom-monad
3232
doc/cookbook/using-free-client
33+
doc/cookbook/open-id-connect
3334

3435
tests: True
3536
optimization: False

doc/cookbook/cabal.project

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ packages:
1212
pagination/
1313
sentry/
1414
testing/
15+
open-id-connect/
1516
../../servant
1617
../../servant-server
1718
../../servant-client-core

doc/cookbook/cabal.project.local

Whitespace-only changes.

doc/cookbook/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,4 @@ you name it!
3232
curl-mock/CurlMock.lhs
3333
sentry/Sentry.lhs
3434
testing/Testing.lhs
35+
open-id-connect/OpenIdConnect.lhs
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: open-id-connect
2+
version: 0.1
3+
synopsis: OpenId Connect with Servant example
4+
homepage: http://haskell-servant.readthedocs.org/
5+
license: BSD3
6+
license-file: ../../../servant/LICENSE
7+
author: Servant Contributors
8+
maintainer: [email protected]
9+
build-type: Simple
10+
cabal-version: >= 1.10
11+
tested-with: GHC==8.4.4, GHC==8.6.4
12+
13+
executable cookbook-openidconnect
14+
main-is: OpenIdConnect.lhs
15+
build-depends: base ==4.*
16+
, aeson
17+
, aeson-pretty
18+
, binary
19+
, blaze-html
20+
, blaze-markup
21+
, bytestring
22+
, case-insensitive
23+
, cereal
24+
, containers
25+
, generic-lens
26+
, http-client
27+
, http-client-tls
28+
, http-types
29+
, jose-jwt
30+
, lens
31+
, lens-aeson
32+
, oidc-client
33+
, protolude
34+
, random
35+
, servant
36+
, servant-blaze
37+
, servant-server
38+
, text
39+
, time
40+
, vector
41+
, wai
42+
, warp >= 3.2
43+
default-language: Haskell2010
44+
ghc-options: -Wall -Wcompat -Wincomplete-uni-patterns -Wredundant-constraints -Wnoncanonical-monad-instances -pgmL markdown-unlit
45+
build-tool-depends: markdown-unlit:markdown-unlit >= 0.4

0 commit comments

Comments
 (0)