From a428940f86815498e4ea2f38b88ede5412335a59 Mon Sep 17 00:00:00 2001 From: Adam Fowler Date: Mon, 29 Apr 2024 12:41:41 +0100 Subject: [PATCH] Update sessions and webauthn --- sessions/Dockerfile | 2 +- sessions/Sources/App/Application+build.swift | 6 +++++- sessions/session-persist-async-test.paw | Bin 7480 -> 7618 bytes webauthn/Sources/App/Application+build.swift | 2 +- .../{ => resources}/templates/home.mustache | 0 5 files changed, 7 insertions(+), 3 deletions(-) rename webauthn/{ => resources}/templates/home.mustache (100%) diff --git a/sessions/Dockerfile b/sessions/Dockerfile index c3bdfc9c..c4279518 100644 --- a/sessions/Dockerfile +++ b/sessions/Dockerfile @@ -83,4 +83,4 @@ EXPOSE 8080 # Start the Hummingbird service when the image is run, default to listening on 8080 in production environment ENTRYPOINT ["./App"] -CMD ["--hostname", "0.0.0.0", "--port", "8080"] +CMD ["--hostname", "0.0.0.0", "--port", "8080", "--in-memory-database"] diff --git a/sessions/Sources/App/Application+build.swift b/sessions/Sources/App/Application+build.swift index e721f047..9c6a61be 100644 --- a/sessions/Sources/App/Application+build.swift +++ b/sessions/Sources/App/Application+build.swift @@ -52,7 +52,11 @@ func buildApplication(_ arguments: AppArguments, configuration: ApplicationConfi let userController = UserController(fluent: fluent, sessionStorage: sessionStorage) userController.addRoutes(to: router.group("user")) - var application = Application(router: router, server: .http1()) + var application = Application( + router: router, + server: .http1(), + configuration: configuration + ) application.addServices(fluent, persist) return application } diff --git a/sessions/session-persist-async-test.paw b/sessions/session-persist-async-test.paw index 217833de758ae81a8e0833facaa9e6c75953136c..e184b9ef8eaac48d5ad559db07334f0caebde6ce 100644 GIT binary patch delta 3776 zcmZu!33L=i8vd(mx;ss}lS$`J2m}a8$VEafLP#K)gq)Lvgxn!vNG5k?U^0^s)SY4x z10rHv#M7&ro6_I6GcXi$8>aOnko{Qjabx#6upHr`^r@QNQeg9YA z|JT>A&N-d_n1A4Rp#8Xut~1Pco&63D#oL^1;0_{0KqSn7D2Rp_h=n+q3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0t`t{^+r*c|SH#!Eed6olQSoE(qf&@` zb>np7brW>Sx>TPoU6-MIRJUFCgzg>v=lbjVpY=B+Bykdv%uB`Vz}-67p2t(ESP?vvI@_e&2->!pXKjnXD*tF%kn zBONoO8lE;BG`wjzWO&PP)Ns~t#qh1+dxP%>!%v1^2ry1&AQ2>%j3MzPfuxg6l0|Yz zJ}D+8q>R`|1*sx6q>XeDH+h8YCVR=#fAk^hh%$$!aDsv&r|6qfKM7t=HQUfFjoIL%2N#$SOOBCjIcyTMUNQCia;Qv zoQz&FW|_b!f_yw|p8&$os>`@kz-ksq&@pcwb6dI%AT4-Zn%jB}2xf zzDycK^^L?dRGuqY%4Zxh=U7s5PVR4PG$*|>zg;1gjifqz?($_BO>>qno!wpJs#=!g zs_L$`=G&H+Ri;&^c~(x$=*h^Ql+oMdwUws13vz5N%S-Lftg6DwWi?sL+VfXBi?e2D z)D)KWlrAW&n9*s=T5j)5Ph6IlXXHOs0Gc+xYR~i;`7;Y<&7M;@cOEqa%gM7pi zDPOaUm20D7MwgJ7T?aLro421iRoJ<6^12Ptn-k7O>UIPy;$pvf{Om_Bet1xBihNEU z897=Gj+&`q7`eI>3T|hIXL0(fjBV^cngAUB^7u zV-pU>p)AQJ;dGqKQfvXkSe__e=4SW#4i4Wnoy!a^o2%o?w@hN;7 zpT(cD{Q3p{5?{jq#$RzkTnx*r`CKVi$1UM*<<@gsxo5az-1mGqKbddf*RT|Mh`*@O fYf?3tn)#X%O}(Z;)9eohj0S?DXD~SYqo(y&n(5zW diff --git a/webauthn/Sources/App/Application+build.swift b/webauthn/Sources/App/Application+build.swift index 9650ef3d..52b2ce88 100644 --- a/webauthn/Sources/App/Application+build.swift +++ b/webauthn/Sources/App/Application+build.swift @@ -53,7 +53,7 @@ func buildApplication(_ arguments: AppArguments) async throws -> some Applicatio let sessionStorage = SessionStorage(memoryPersist) // load mustache template library - let library = try await MustacheLibrary(directory: "templates") + let library = try await MustacheLibrary(directory: "resources/templates") assert(library.getTemplate(named: "home") != nil, "Set your working directory to the root folder of this example to get it to work") let router = RouterBuilder(context: WebAuthnRequestContext.self) { diff --git a/webauthn/templates/home.mustache b/webauthn/resources/templates/home.mustache similarity index 100% rename from webauthn/templates/home.mustache rename to webauthn/resources/templates/home.mustache