From 905bad35c71eefd3bed186dd5e4921aac3674c45 Mon Sep 17 00:00:00 2001 From: Derek Troy-West Date: Tue, 7 Jun 2022 15:22:35 +1000 Subject: [PATCH 1/6] minor: fix jetty contextpath warning --- slipway-jetty10/src/slipway/server.clj | 2 +- slipway-jetty9/src/slipway/server.clj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/slipway-jetty10/src/slipway/server.clj b/slipway-jetty10/src/slipway/server.clj index c42c07d2..4d38bb27 100644 --- a/slipway-jetty10/src/slipway/server.clj +++ b/slipway-jetty10/src/slipway/server.clj @@ -25,7 +25,7 @@ (defn wrap-proxy-handler [jetty-handler] (doto (ServletContextHandler.) - (.setContextPath "/*") + (.setContextPath "/") (.setAllowNullPathInfo true) (JettyWebSocketServletContainerInitializer/configure nil) (.setServletHandler jetty-handler))) diff --git a/slipway-jetty9/src/slipway/server.clj b/slipway-jetty9/src/slipway/server.clj index 15aafe1e..c339c7c8 100644 --- a/slipway-jetty9/src/slipway/server.clj +++ b/slipway-jetty9/src/slipway/server.clj @@ -76,7 +76,7 @@ (let [server (server/create-server options) ring-app-handler (proxy-handler handler options) ws-handler (doto (ContextHandler.) - (.setContextPath "/*") + (.setContextPath "/") (.setAllowNullPathInfo true) (.setHandler (jetty9.websockets/proxy-ws-handler handler options))) contexts (doto (HandlerList.) From 983d3919724dce99ec2d2f08ddf890a0675d185e Mon Sep 17 00:00:00 2001 From: Derek Troy-West Date: Tue, 7 Jun 2022 15:47:07 +1000 Subject: [PATCH 2/6] bump deps --- slipway-core/project.clj | 6 +++--- slipway-jetty10/project.clj | 8 ++++---- slipway-jetty9/project.clj | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/slipway-core/project.clj b/slipway-core/project.clj index a5b6ec13..6a56a851 100644 --- a/slipway-core/project.clj +++ b/slipway-core/project.clj @@ -3,9 +3,9 @@ :url "https://github.com/operatr-io/slipway" :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} - :profiles {:dev {:dependencies [[clj-kondo "2022.03.09"]] + :profiles {:dev {:dependencies [[clj-kondo "2022.05.31"]] :plugins [[lein-cljfmt "0.8.0"]]} - :kaocha {:dependencies [[lambdaisland/kaocha "1.64.1010" :exclusions [org.clojure/tools.reader]]]} + :kaocha {:dependencies [[lambdaisland/kaocha "1.66.1034" :exclusions [org.clojure/tools.reader]]]} :smoke {:pedantic? :abort}} :aliases {"check" ["with-profile" "+smoke" "check"] "kaocha" ["with-profile" "+kaocha,+smoke" "run" "-m" "kaocha.runner"] @@ -13,7 +13,7 @@ "fmt" ["with-profile" "+smoke" "cljfmt" "check"] "fmtfix" ["with-profile" "+smoke" "cljfmt" "fix"]} - :dependencies [[org.clojure/clojure "1.11.0"] + :dependencies [[org.clojure/clojure "1.11.1"] [org.clojure/tools.logging "1.2.4"] [com.taoensso/sente "1.16.2" :scope "provided"] [org.eclipse.jetty.websocket/websocket-jetty-server "10.0.9" :scope "provided"] diff --git a/slipway-jetty10/project.clj b/slipway-jetty10/project.clj index 00603446..ac573d12 100644 --- a/slipway-jetty10/project.clj +++ b/slipway-jetty10/project.clj @@ -3,12 +3,12 @@ :url "https://github.com/operatr-io/slipway" :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} - :profiles {:dev {:dependencies [[clj-kondo "2022.03.09"] + :profiles {:dev {:dependencies [[clj-kondo "2022.05.31"] [clj-http "3.12.3"] - [commons-io "2.10.0"]] + [commons-io "2.11.0"]] :resource-paths ["dev-resources"] :plugins [[lein-cljfmt "0.8.0"]]} - :kaocha {:dependencies [[lambdaisland/kaocha "1.64.1010"]]} + :kaocha {:dependencies [[lambdaisland/kaocha "1.66.1034"]]} :smoke {:pedantic? :abort}} :aliases {"check" ["with-profile" "+smoke" "check"] "kaocha" ["with-profile" "+kaocha,+smoke" "run" "-m" "kaocha.runner"] @@ -16,7 +16,7 @@ "fmt" ["with-profile" "+smoke" "cljfmt" "check"] "fmtfix" ["with-profile" "+smoke" "cljfmt" "fix"]} - :dependencies [[org.clojure/clojure "1.11.0"] + :dependencies [[org.clojure/clojure "1.11.1"] [org.clojure/tools.logging "1.2.4"] [ring/ring-servlet "1.9.5"] [io.operatr/slipway-core "1.0.5"] diff --git a/slipway-jetty9/project.clj b/slipway-jetty9/project.clj index e2f2d88c..e36be2f7 100644 --- a/slipway-jetty9/project.clj +++ b/slipway-jetty9/project.clj @@ -3,12 +3,12 @@ :url "https://github.com/operatr-io/slipway" :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} - :profiles {:dev {:dependencies [[clj-kondo "2022.03.09"] + :profiles {:dev {:dependencies [[clj-kondo "2022.05.31"] [clj-http "3.12.3"] - [commons-io "2.10.0"]] + [commons-io "2.11.0"]] :resource-paths ["dev-resources"] :plugins [[lein-cljfmt "0.8.0"]]} - :kaocha {:dependencies [[lambdaisland/kaocha "1.64.1010"]]} + :kaocha {:dependencies [[lambdaisland/kaocha "1.66.1034"]]} :smoke {:pedantic? :abort}} :aliases {"check" ["with-profile" "+smoke" "check"] "kaocha" ["with-profile" "+kaocha,+smoke" "run" "-m" "kaocha.runner"] @@ -16,7 +16,7 @@ "fmt" ["with-profile" "+smoke" "cljfmt" "check"] "fmtfix" ["with-profile" "+smoke" "cljfmt" "fix"]} - :dependencies [[org.clojure/clojure "1.11.0"] + :dependencies [[org.clojure/clojure "1.11.1"] [ring/ring-servlet "1.9.5"] [io.operatr/slipway-core "1.0.5"] [org.eclipse.jetty/jetty-server "9.4.46.v20220331"] From c63099bb434b25b26dbdc475e84ab0e5bce9c007 Mon Sep 17 00:00:00 2001 From: Derek Troy-West Date: Tue, 7 Jun 2022 15:52:57 +1000 Subject: [PATCH 3/6] fix kondo / formatting --- slipway-core/src/slipway/auth.clj | 16 ++++---- slipway-core/src/slipway/auth/constraints.clj | 4 +- slipway-core/src/slipway/impl/server.clj | 40 +++++++++---------- slipway-core/src/slipway/util.clj | 4 +- .../src/slipway/jetty10/websockets.clj | 20 +++++----- slipway-jetty10/src/slipway/server.clj | 22 +++++----- .../src/slipway/jetty9/websockets.clj | 12 +++--- slipway-jetty9/src/slipway/server.clj | 28 ++++++------- 8 files changed, 73 insertions(+), 73 deletions(-) diff --git a/slipway-core/src/slipway/auth.clj b/slipway-core/src/slipway/auth.clj index 1653a8d5..2ba1e3ca 100644 --- a/slipway-core/src/slipway/auth.clj +++ b/slipway-core/src/slipway/auth.clj @@ -1,17 +1,17 @@ (ns slipway.auth - (:require [clojure.tools.logging :as log] - [clojure.core.protocols :as p]) + (:require [clojure.core.protocols :as p] + [clojure.tools.logging :as log]) (:import (org.eclipse.jetty.server Authentication$User) - (org.eclipse.jetty.server Authentication$User Request Handler Server) + (java.util List) (javax.security.auth.login Configuration) + (javax.servlet SessionTrackingMode) + (org.eclipse.jetty.http HttpCookie$SameSite) (org.eclipse.jetty.jaas JAASLoginService) - (org.eclipse.jetty.security HashLoginService ConstraintSecurityHandler) - (java.util List) + (org.eclipse.jetty.security ConstraintSecurityHandler HashLoginService) (org.eclipse.jetty.security.authentication BasicAuthenticator FormAuthenticator) - (javax.servlet SessionTrackingMode) - (org.eclipse.jetty.server.session SessionHandler) + (org.eclipse.jetty.server Authentication$User Handler Request Server) (org.eclipse.jetty.server.handler HandlerCollection) - (org.eclipse.jetty.http HttpCookie$SameSite))) + (org.eclipse.jetty.server.session SessionHandler))) (defn user "Derive user credentials (name + roles) from a base jetty request" diff --git a/slipway-core/src/slipway/auth/constraints.clj b/slipway-core/src/slipway/auth/constraints.clj index 29a7ae1f..bac92769 100644 --- a/slipway-core/src/slipway/auth/constraints.clj +++ b/slipway-core/src/slipway/auth/constraints.clj @@ -1,6 +1,6 @@ (ns slipway.auth.constraints - (:import (org.eclipse.jetty.util.security Constraint) - (org.eclipse.jetty.security ConstraintMapping))) + (:import (org.eclipse.jetty.security ConstraintMapping) + (org.eclipse.jetty.util.security Constraint))) (defn ^Constraint basic-auth-any-constraint [] (doto (Constraint. Constraint/__BASIC_AUTH Constraint/ANY_AUTH) ;; == allow any authenticated user diff --git a/slipway-core/src/slipway/impl/server.clj b/slipway-core/src/slipway/impl/server.clj index a232cf94..22e314d9 100644 --- a/slipway-core/src/slipway/impl/server.clj +++ b/slipway-core/src/slipway/impl/server.clj @@ -5,12 +5,12 @@ * https://github.com/sunng87/ring-jetty9-adapter/blob/master/src/ring/adapter/jetty9.clj * https://github.com/ring-clojure/ring/blob/master/ring-jetty-adapter/src/ring/adapter/jetty.clj" (:require [clojure.tools.logging :as log]) - (:import (org.eclipse.jetty.server Server ServerConnector HttpConfiguration HttpConnectionFactory - ConnectionFactory SecureRequestCustomizer ProxyConnectionFactory Connector ForwardedRequestCustomizer) - (org.eclipse.jetty.util.thread QueuedThreadPool ScheduledExecutorScheduler ThreadPool) + (:import (java.security KeyStore) + (org.eclipse.jetty.server ConnectionFactory Connector ForwardedRequestCustomizer HttpConfiguration + HttpConnectionFactory ProxyConnectionFactory SecureRequestCustomizer Server ServerConnector) + (org.eclipse.jetty.server.handler.gzip GzipHandler) (org.eclipse.jetty.util.ssl SslContextFactory SslContextFactory$Server) - (java.security KeyStore) - (org.eclipse.jetty.server.handler.gzip GzipHandler))) + (org.eclipse.jetty.util.thread QueuedThreadPool ScheduledExecutorScheduler ThreadPool))) (defn http-config [{:keys [ssl-port secure-scheme output-buffer-size request-header-size @@ -127,21 +127,21 @@ (log/infof "Enabling gzip compression on the following content types: %s" content-types) (.setHandler server gzip-handler))) -(defn ^Server create-server - [{:as options - :keys [port max-threads min-threads threadpool-idle-timeout job-queue - daemon? max-idle-time host ssl? ssl-port http? proxy? - thread-pool] - :or {port 3000 - max-threads 50 - min-threads 8 - threadpool-idle-timeout 60000 - job-queue nil - daemon? false - max-idle-time 200000 - ssl? false - http? true - proxy? false}}] +(defn create-server + ^Server [{:as options + :keys [port max-threads min-threads threadpool-idle-timeout job-queue + daemon? max-idle-time host ssl? ssl-port http? proxy? + thread-pool] + :or {port 3000 + max-threads 50 + min-threads 8 + threadpool-idle-timeout 60000 + job-queue nil + daemon? false + max-idle-time 200000 + ssl? false + http? true + proxy? false}}] {:pre [(or http? ssl? ssl-port)]} (let [pool (or thread-pool (doto (QueuedThreadPool. (int max-threads) diff --git a/slipway-core/src/slipway/util.clj b/slipway-core/src/slipway/util.clj index 6df8444c..9608eb89 100644 --- a/slipway-core/src/slipway/util.clj +++ b/slipway-core/src/slipway/util.clj @@ -4,8 +4,8 @@ Derived from: * https://github.com/sunng87/ring-jetty9-adapter/blob/master/src/ring/adapter/jetty9.clj" (:require [clojure.string :as string]) - (:import (javax.servlet.http HttpServletRequest HttpServletResponse) - (java.util Locale))) + (:import (java.util Locale) + (javax.servlet.http HttpServletRequest HttpServletResponse))) (defprotocol RequestMapDecoder (build-request-map [r])) diff --git a/slipway-jetty10/src/slipway/jetty10/websockets.clj b/slipway-jetty10/src/slipway/jetty10/websockets.clj index 5b3b751d..ed72c766 100644 --- a/slipway-jetty10/src/slipway/jetty10/websockets.clj +++ b/slipway-jetty10/src/slipway/jetty10/websockets.clj @@ -3,18 +3,18 @@ Dervied from: * https://github.com/sunng87/ring-jetty9-adapter/blob/master/src/ring/adapter/jetty9/websocket.clj" - (:require [slipway.websockets :as ws] - [slipway.util :as util]) - (:import (org.eclipse.jetty.websocket.api WebSocketAdapter Session RemoteEndpoint WriteCallback - WebSocketPingPongListener) - (org.eclipse.jetty.websocket.server JettyWebSocketServerContainer JettyWebSocketCreator - JettyServerUpgradeRequest) - (javax.servlet AsyncContext) - (javax.servlet.http HttpServletRequest HttpServletResponse) - (clojure.lang IFn) + (:require [slipway.util :as util] + [slipway.websockets :as ws]) + (:import (clojure.lang IFn) (java.nio ByteBuffer) + (java.time Duration) (java.util Locale) - (java.time Duration))) + (javax.servlet AsyncContext) + (javax.servlet.http HttpServletRequest HttpServletResponse) + (org.eclipse.jetty.websocket.api RemoteEndpoint Session WebSocketAdapter WebSocketPingPongListener + WriteCallback) + (org.eclipse.jetty.websocket.server JettyServerUpgradeRequest JettyWebSocketCreator + JettyWebSocketServerContainer))) (def ^:private no-op (constantly nil)) diff --git a/slipway-jetty10/src/slipway/server.clj b/slipway-jetty10/src/slipway/server.clj index 4d38bb27..6bf1ab65 100644 --- a/slipway-jetty10/src/slipway/server.clj +++ b/slipway-jetty10/src/slipway/server.clj @@ -7,14 +7,14 @@ (:require [clojure.tools.logging :as log] [ring.util.servlet :as servlet] [slipway.auth :as auth] - [slipway.jetty10.websockets :as jetty10.ws] + [slipway.impl.server :as server] [slipway.jetty10.auth] + [slipway.jetty10.websockets :as jetty10.ws] [slipway.util :as util] - [slipway.websockets :as ws] - [slipway.impl.server :as server]) - (:import (org.eclipse.jetty.server Server Request) - (org.eclipse.jetty.servlet ServletHandler ServletContextHandler) - (javax.servlet.http HttpServletRequest HttpServletResponse) + [slipway.websockets :as ws]) + (:import (javax.servlet.http HttpServletRequest HttpServletResponse) + (org.eclipse.jetty.server Request Server) + (org.eclipse.jetty.servlet ServletContextHandler ServletHandler) (org.eclipse.jetty.websocket.server.config JettyWebSocketServletContainerInitializer))) (extend-protocol util/RequestMapDecoder @@ -62,13 +62,13 @@ "application/javascript" "image/svg+xml"]) -(defn ^Server run-jetty +(defn run-jetty "Starts a Jetty server. See https://github.com/operatr-io/slipway#usage for list of options" - [handler {:as options - :keys [configurator join? auth gzip? gzip-content-types gzip-min-size http-forwarded? error-handler] - :or {gzip-content-types default-gzip-content-types - gzip-min-size 1024}}] + ^Server [handler {:as options + :keys [configurator join? auth gzip? gzip-content-types gzip-min-size http-forwarded? error-handler] + :or {gzip-content-types default-gzip-content-types + gzip-min-size 1024}}] (let [server (server/create-server options) ring-app-handler (proxy-handler handler options)] (.setHandler server ring-app-handler) diff --git a/slipway-jetty9/src/slipway/jetty9/websockets.clj b/slipway-jetty9/src/slipway/jetty9/websockets.clj index ee153a39..6ef53fb0 100644 --- a/slipway-jetty9/src/slipway/jetty9/websockets.clj +++ b/slipway-jetty9/src/slipway/jetty9/websockets.clj @@ -5,14 +5,14 @@ * https://github.com/sunng87/ring-jetty9-adapter/blob/master/src/ring/adapter/jetty9/websocket.clj" (:require [slipway.util :as util] [slipway.websockets :as ws]) - (:import (org.eclipse.jetty.server Request Response) - (org.eclipse.jetty.websocket.api WebSocketAdapter Session RemoteEndpoint WriteCallback) + (:import (clojure.lang IFn) + (java.nio ByteBuffer) + (java.util Locale) + (org.eclipse.jetty.server Request Response) + (org.eclipse.jetty.websocket.api RemoteEndpoint Session WebSocketAdapter WriteCallback) (org.eclipse.jetty.websocket.api.extensions ExtensionConfig) (org.eclipse.jetty.websocket.server WebSocketHandler) - (org.eclipse.jetty.websocket.servlet WebSocketServletFactory WebSocketCreator ServletUpgradeRequest) - (clojure.lang IFn) - (java.nio ByteBuffer) - (java.util Locale))) + (org.eclipse.jetty.websocket.servlet ServletUpgradeRequest WebSocketCreator WebSocketServletFactory))) (def ^:private no-op (constantly nil)) diff --git a/slipway-jetty9/src/slipway/server.clj b/slipway-jetty9/src/slipway/server.clj index c339c7c8..398c98df 100644 --- a/slipway-jetty9/src/slipway/server.clj +++ b/slipway-jetty9/src/slipway/server.clj @@ -4,17 +4,17 @@ Derived from: * https://github.com/sunng87/ring-jetty9-adapter/blob/master/src/ring/adapter/jetty9.clj * https://github.com/ring-clojure/ring/blob/master/ring-jetty-adapter/src/ring/adapter/jetty.clj" - (:require [ring.util.servlet :as servlet] - [slipway.util :as util] - [slipway.jetty9.websockets :as jetty9.websockets] + (:require [clojure.tools.logging :as log] + [ring.util.servlet :as servlet] [slipway.auth :as auth] - [slipway.jetty9.auth] - [slipway.websockets :as ws] [slipway.impl.server :as server] - [clojure.tools.logging :as log]) - (:import (org.eclipse.jetty.server Handler Server Request) - (org.eclipse.jetty.server.handler AbstractHandler HandlerList ContextHandler) - (javax.servlet.http HttpServletRequest HttpServletResponse))) + [slipway.jetty9.auth] + [slipway.jetty9.websockets :as jetty9.websockets] + [slipway.util :as util] + [slipway.websockets :as ws]) + (:import (javax.servlet.http HttpServletRequest HttpServletResponse) + (org.eclipse.jetty.server Handler Request Server) + (org.eclipse.jetty.server.handler AbstractHandler ContextHandler HandlerList))) (extend-protocol util/RequestMapDecoder HttpServletRequest @@ -66,13 +66,13 @@ "application/javascript" "image/svg+xml"]) -(defn ^Server run-jetty +(defn run-jetty "Starts a Jetty server. See https://github.com/operatr-io/slipway#usage for list of options" - [handler {:as options - :keys [configurator join? auth gzip? gzip-content-types gzip-min-size http-forwarded? error-handler] - :or {gzip-content-types default-gzip-content-types - gzip-min-size 1024}}] + ^Server [handler {:as options + :keys [configurator join? auth gzip? gzip-content-types gzip-min-size http-forwarded? error-handler] + :or {gzip-content-types default-gzip-content-types + gzip-min-size 1024}}] (let [server (server/create-server options) ring-app-handler (proxy-handler handler options) ws-handler (doto (ContextHandler.) From 40381ce45bb5b22018ffc8d6fe765ddaf99dec3c Mon Sep 17 00:00:00 2001 From: Derek Troy-West Date: Tue, 7 Jun 2022 16:03:01 +1000 Subject: [PATCH 4/6] fix kondo --- slipway-core/src/slipway/auth.clj | 2 +- slipway-core/src/slipway/auth/constraints.clj | 8 ++--- slipway-core/src/slipway/impl/server.clj | 30 +++++++++---------- slipway-jetty10/src/slipway/server.clj | 10 +++---- slipway-jetty9/src/slipway/server.clj | 10 +++---- 5 files changed, 30 insertions(+), 30 deletions(-) diff --git a/slipway-core/src/slipway/auth.clj b/slipway-core/src/slipway/auth.clj index 2ba1e3ca..7736cc77 100644 --- a/slipway-core/src/slipway/auth.clj +++ b/slipway-core/src/slipway/auth.clj @@ -89,7 +89,7 @@ :lax HttpCookie$SameSite/LAX :strict HttpCookie$SameSite/STRICT)) -(defn ^SessionHandler session-handler +(defn session-handler ^SessionHandler ;; Apply sensible defaults in-line with ring-defaults: ;; https://github.com/ring-clojure/ring-defaults/blob/master/src/ring/middleware/defaults.clj#L44 [{:keys [secure-request-only? http-only? same-site max-inactive-interval tracking-modes cookie-name] diff --git a/slipway-core/src/slipway/auth/constraints.clj b/slipway-core/src/slipway/auth/constraints.clj index bac92769..ce321c51 100644 --- a/slipway-core/src/slipway/auth/constraints.clj +++ b/slipway-core/src/slipway/auth/constraints.clj @@ -2,21 +2,21 @@ (:import (org.eclipse.jetty.security ConstraintMapping) (org.eclipse.jetty.util.security Constraint))) -(defn ^Constraint basic-auth-any-constraint [] +(defn basic-auth-any-constraint ^Constraint [] (doto (Constraint. Constraint/__BASIC_AUTH Constraint/ANY_AUTH) ;; == allow any authenticated user (.setName "auth") (.setAuthenticate true))) -(defn ^Constraint form-auth-any-constraint [] +(defn form-auth-any-constraint ^Constraint [] (doto (Constraint. Constraint/__FORM_AUTH Constraint/ANY_AUTH) ;; == allow any authenticated user (.setName "auth") (.setAuthenticate true))) -(defn ^Constraint no-auth [] +(defn no-auth ^Constraint [] (doto (Constraint.) (.setName "no-auth"))) -(defn ^ConstraintMapping constraint-mapping +(defn constraint-mapping ^ConstraintMapping [^String path ^Constraint constraint] (doto (ConstraintMapping.) (.setConstraint constraint) diff --git a/slipway-core/src/slipway/impl/server.clj b/slipway-core/src/slipway/impl/server.clj index 22e314d9..1638e65b 100644 --- a/slipway-core/src/slipway/impl/server.clj +++ b/slipway-core/src/slipway/impl/server.clj @@ -127,21 +127,21 @@ (log/infof "Enabling gzip compression on the following content types: %s" content-types) (.setHandler server gzip-handler))) -(defn create-server - ^Server [{:as options - :keys [port max-threads min-threads threadpool-idle-timeout job-queue - daemon? max-idle-time host ssl? ssl-port http? proxy? - thread-pool] - :or {port 3000 - max-threads 50 - min-threads 8 - threadpool-idle-timeout 60000 - job-queue nil - daemon? false - max-idle-time 200000 - ssl? false - http? true - proxy? false}}] +(defn create-server ^Server + [{:as options + :keys [port max-threads min-threads threadpool-idle-timeout job-queue + daemon? max-idle-time host ssl? ssl-port http? proxy? + thread-pool] + :or {port 3000 + max-threads 50 + min-threads 8 + threadpool-idle-timeout 60000 + job-queue nil + daemon? false + max-idle-time 200000 + ssl? false + http? true + proxy? false}}] {:pre [(or http? ssl? ssl-port)]} (let [pool (or thread-pool (doto (QueuedThreadPool. (int max-threads) diff --git a/slipway-jetty10/src/slipway/server.clj b/slipway-jetty10/src/slipway/server.clj index 6bf1ab65..aa925d34 100644 --- a/slipway-jetty10/src/slipway/server.clj +++ b/slipway-jetty10/src/slipway/server.clj @@ -62,13 +62,13 @@ "application/javascript" "image/svg+xml"]) -(defn run-jetty +(defn run-jetty ^Server "Starts a Jetty server. See https://github.com/operatr-io/slipway#usage for list of options" - ^Server [handler {:as options - :keys [configurator join? auth gzip? gzip-content-types gzip-min-size http-forwarded? error-handler] - :or {gzip-content-types default-gzip-content-types - gzip-min-size 1024}}] + [handler {:as options + :keys [configurator join? auth gzip? gzip-content-types gzip-min-size http-forwarded? error-handler] + :or {gzip-content-types default-gzip-content-types + gzip-min-size 1024}}] (let [server (server/create-server options) ring-app-handler (proxy-handler handler options)] (.setHandler server ring-app-handler) diff --git a/slipway-jetty9/src/slipway/server.clj b/slipway-jetty9/src/slipway/server.clj index 398c98df..8fec35e9 100644 --- a/slipway-jetty9/src/slipway/server.clj +++ b/slipway-jetty9/src/slipway/server.clj @@ -66,13 +66,13 @@ "application/javascript" "image/svg+xml"]) -(defn run-jetty +(defn run-jetty ^Server "Starts a Jetty server. See https://github.com/operatr-io/slipway#usage for list of options" - ^Server [handler {:as options - :keys [configurator join? auth gzip? gzip-content-types gzip-min-size http-forwarded? error-handler] - :or {gzip-content-types default-gzip-content-types - gzip-min-size 1024}}] + [handler {:as options + :keys [configurator join? auth gzip? gzip-content-types gzip-min-size http-forwarded? error-handler] + :or {gzip-content-types default-gzip-content-types + gzip-min-size 1024}}] (let [server (server/create-server options) ring-app-handler (proxy-handler handler options) ws-handler (doto (ContextHandler.) From cf32ebe6f7f895122e9e881e516008da34f1707f Mon Sep 17 00:00:00 2001 From: Derek Troy-West Date: Tue, 7 Jun 2022 16:09:55 +1000 Subject: [PATCH 5/6] fix kondo --- slipway-core/src/slipway/impl/server.clj | 2 +- slipway-jetty10/src/slipway/server.clj | 10 +++++----- slipway-jetty9/src/slipway/server.clj | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/slipway-core/src/slipway/impl/server.clj b/slipway-core/src/slipway/impl/server.clj index 1638e65b..a7ddc008 100644 --- a/slipway-core/src/slipway/impl/server.clj +++ b/slipway-core/src/slipway/impl/server.clj @@ -40,7 +40,7 @@ (.setHeaderCacheSize header-cache-size) (.addCustomizer secure-customizer)))) -(defn ^SslContextFactory$Server ssl-context-factory +(defn ssl-context-factory ^SslContextFactory$Server [{:keys [keystore keystore-type key-password client-auth key-manager-password truststore trust-password truststore-type ssl-protocols ssl-provider exclude-ciphers replace-exclude-ciphers? exclude-protocols replace-exclude-protocols? diff --git a/slipway-jetty10/src/slipway/server.clj b/slipway-jetty10/src/slipway/server.clj index aa925d34..6bf1ab65 100644 --- a/slipway-jetty10/src/slipway/server.clj +++ b/slipway-jetty10/src/slipway/server.clj @@ -62,13 +62,13 @@ "application/javascript" "image/svg+xml"]) -(defn run-jetty ^Server +(defn run-jetty "Starts a Jetty server. See https://github.com/operatr-io/slipway#usage for list of options" - [handler {:as options - :keys [configurator join? auth gzip? gzip-content-types gzip-min-size http-forwarded? error-handler] - :or {gzip-content-types default-gzip-content-types - gzip-min-size 1024}}] + ^Server [handler {:as options + :keys [configurator join? auth gzip? gzip-content-types gzip-min-size http-forwarded? error-handler] + :or {gzip-content-types default-gzip-content-types + gzip-min-size 1024}}] (let [server (server/create-server options) ring-app-handler (proxy-handler handler options)] (.setHandler server ring-app-handler) diff --git a/slipway-jetty9/src/slipway/server.clj b/slipway-jetty9/src/slipway/server.clj index 8fec35e9..398c98df 100644 --- a/slipway-jetty9/src/slipway/server.clj +++ b/slipway-jetty9/src/slipway/server.clj @@ -66,13 +66,13 @@ "application/javascript" "image/svg+xml"]) -(defn run-jetty ^Server +(defn run-jetty "Starts a Jetty server. See https://github.com/operatr-io/slipway#usage for list of options" - [handler {:as options - :keys [configurator join? auth gzip? gzip-content-types gzip-min-size http-forwarded? error-handler] - :or {gzip-content-types default-gzip-content-types - gzip-min-size 1024}}] + ^Server [handler {:as options + :keys [configurator join? auth gzip? gzip-content-types gzip-min-size http-forwarded? error-handler] + :or {gzip-content-types default-gzip-content-types + gzip-min-size 1024}}] (let [server (server/create-server options) ring-app-handler (proxy-handler handler options) ws-handler (doto (ContextHandler.) From 8a4c3a2a2e77b357ddd84c39621874095a495f5d Mon Sep 17 00:00:00 2001 From: Derek Troy-West Date: Tue, 7 Jun 2022 16:30:44 +1000 Subject: [PATCH 6/6] suppress incorrect NVD DVE --- slipway-core/dependency-check-suppressions.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/slipway-core/dependency-check-suppressions.xml b/slipway-core/dependency-check-suppressions.xml index fbf9371b..500f64fe 100644 --- a/slipway-core/dependency-check-suppressions.xml +++ b/slipway-core/dependency-check-suppressions.xml @@ -1,3 +1,10 @@ + + + ^pkg:maven/org\.clojure/core\.async@.*$ + CVE-2021-43138 +