Skip to content
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
2 changes: 1 addition & 1 deletion dev/bootstrap.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ puppetlabs.services.request-handler.request-handler-service/request-handler-serv
puppetlabs.services.jruby.jruby-puppet-service/jruby-puppet-pooled-service
puppetlabs.services.jruby-pool-manager.jruby-pool-manager-service/jruby-pool-manager-service
puppetlabs.services.puppet-profiler.puppet-profiler-service/puppet-profiler-service
puppetlabs.trapperkeeper.services.webserver.jetty10-service/jetty10-service
puppetlabs.trapperkeeper.services.webserver.jetty12-service/jetty12-service
puppetlabs.trapperkeeper.services.webrouting.webrouting-service/webrouting-service
puppetlabs.services.config.puppet-server-config-service/puppet-server-config-service
puppetlabs.services.master.master-service/master-service
Expand Down
2 changes: 1 addition & 1 deletion dev/dev_tools.clj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(ns dev-tools
(:require [puppetlabs.trapperkeeper.services.webserver.jetty10-service :refer [jetty10-service]]
(:require [puppetlabs.trapperkeeper.services.webserver.jetty12-service :refer [jetty12-service]]

[puppetlabs.trapperkeeper.services.webrouting.webrouting-service :refer [webrouting-service]]
[puppetlabs.services.master.master-service :refer [master-service]]
Expand Down
2 changes: 1 addition & 1 deletion ext/thread_test/bootstrap.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ puppetlabs.services.request-handler.request-handler-service/request-handler-serv
puppetlabs.services.jruby.jruby-puppet-service/jruby-puppet-pooled-service
puppetlabs.services.jruby-pool-manager.jruby-pool-manager-service/jruby-pool-manager-service
puppetlabs.services.puppet-profiler.puppet-profiler-service/puppet-profiler-service
puppetlabs.trapperkeeper.services.webserver.jetty10-service/jetty10-service
puppetlabs.trapperkeeper.services.webserver.jetty12-service/jetty12-service
puppetlabs.trapperkeeper.services.webrouting.webrouting-service/webrouting-service
puppetlabs.services.config.puppet-server-config-service/puppet-server-config-service
puppetlabs.services.master.master-service/master-service
Expand Down
2 changes: 1 addition & 1 deletion ezbake/system-config/services.d/bootstrap.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ puppetlabs.services.request-handler.request-handler-service/request-handler-serv
puppetlabs.services.jruby.jruby-puppet-service/jruby-puppet-pooled-service
puppetlabs.services.jruby-pool-manager.jruby-pool-manager-service/jruby-pool-manager-service
puppetlabs.services.puppet-profiler.puppet-profiler-service/puppet-profiler-service
puppetlabs.trapperkeeper.services.webserver.jetty10-service/jetty10-service
puppetlabs.trapperkeeper.services.webserver.jetty12-service/jetty12-service
puppetlabs.trapperkeeper.services.webrouting.webrouting-service/webrouting-service
puppetlabs.services.config.puppet-server-config-service/puppet-server-config-service
puppetlabs.services.master.master-service/master-service
Expand Down
43 changes: 15 additions & 28 deletions project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,9 @@

(def slf4j-version "2.0.17")
(def i18n-version "1.0.3")
(def logback-version "1.3.16")
(def logback-version "1.5.32")
(def jackson-version "2.21.1")

(require '[clojure.string :as str]
'[leiningen.core.main :as main])
(defn fail-if-logback->1-3!
"Fails the build if logback-version is > 1.3.x."
[logback-version]
(let [[x y] (->> (str/split (str logback-version) #"\.")
(take 2)
(map #(Integer/parseInt %)))]
(when (or (> x 1)
(and (= x 1) (> y 3)))
(main/abort (format "logback-version %s is not supported by Jetty 10. Must be 1.3.x until we update to Jetty 12." logback-version)))))

(fail-if-logback->1-3! logback-version)

;; If you modify the version manually, run scripts/sync_ezbake_dep.rb to keep
;; the ezbake dependency in sync.
(defproject org.openvoxproject/puppetserver "8.13.0-SNAPSHOT"
Expand All @@ -50,7 +36,8 @@
[org.clojure/tools.namespace "0.3.1"]
[org.clojure/tools.reader "1.6.0"]
[beckon "0.1.1"]
[ch.qos.logback/logback-access ~logback-version]
[ch.qos.logback.access/logback-access-common "2.0.12"]
[ch.qos.logback.access/logback-access-jetty12 "2.0.12"]
[ch.qos.logback/logback-classic ~logback-version]
[ch.qos.logback/logback-core ~logback-version]
[cheshire "5.13.0"]
Expand Down Expand Up @@ -89,14 +76,14 @@
[org.openvoxproject/trapperkeeper "4.3.2"]
[org.openvoxproject/trapperkeeper "4.3.2" :classifier "test"]
[org.openvoxproject/trapperkeeper-comidi-metrics "1.0.4"]
[org.openvoxproject/trapperkeeper-authorization "2.1.6"]
[org.openvoxproject/trapperkeeper-authorization "2.1.7-SNAPSHOT"]
[org.openvoxproject/trapperkeeper-filesystem-watcher "1.5.1"]
[org.openvoxproject/trapperkeeper-metrics "2.1.7"]
[org.openvoxproject/trapperkeeper-metrics "2.1.7" :classifier "test"]
[org.openvoxproject/trapperkeeper-metrics "3.0.0-SNAPSHOT"]
[org.openvoxproject/trapperkeeper-metrics "3.0.0-SNAPSHOT" :classifier "test"]
[org.openvoxproject/trapperkeeper-scheduler "1.3.1"]
[org.openvoxproject/trapperkeeper-status "1.3.2"]
[org.openvoxproject/trapperkeeper-webserver-jetty10 "1.1.4"]
[org.openvoxproject/trapperkeeper-webserver-jetty10 "1.1.4" :classifier "test"]
[org.openvoxproject/trapperkeeper-status "1.3.3-SNAPSHOT"]
[org.openvoxproject/trapperkeeper-webserver-jetty12 "1.0.0-SNAPSHOT"]
[org.openvoxproject/trapperkeeper-webserver-jetty12 "1.0.0-SNAPSHOT" :classifier "test"]
[org.ow2.asm/asm "9.9.1"]
[org.slf4j/jul-to-slf4j ~slf4j-version]
[org.slf4j/log4j-over-slf4j ~slf4j-version]
Expand Down Expand Up @@ -144,7 +131,7 @@
[org.openvoxproject/trapperkeeper-metrics]
[org.openvoxproject/trapperkeeper-scheduler]
[org.openvoxproject/trapperkeeper-status]
[org.openvoxproject/trapperkeeper-webserver-jetty10]
[org.openvoxproject/trapperkeeper-webserver-jetty12]
[org.yaml/snakeyaml]
[prismatic/schema]
[slingshot]]
Expand Down Expand Up @@ -197,7 +184,7 @@

:profiles {:defaults {:source-paths ["dev"]
:dependencies [[org.clojure/tools.namespace]
[org.openvoxproject/trapperkeeper-webserver-jetty10 :classifier "test"]
[org.openvoxproject/trapperkeeper-webserver-jetty12 :classifier "test"]
[org.openvoxproject/trapperkeeper :classifier "test" :scope "test"]
[org.openvoxproject/trapperkeeper-metrics :classifier "test" :scope "test"]
[org.openvoxproject/kitchensink :classifier "test" :scope "test"]
Expand Down Expand Up @@ -269,7 +256,7 @@
;; Do not modify this line. It is managed by the release process
;; via the scripts/sync_ezbake_dep.rb script.
[org.openvoxproject/puppetserver "8.13.0-SNAPSHOT"]
[org.openvoxproject/trapperkeeper-webserver-jetty10]
[org.openvoxproject/trapperkeeper-webserver-jetty12]
[org.openvoxproject/trapperkeeper-metrics]]
:plugins [[org.openvoxproject/lein-ezbake ~(or (System/getenv "EZBAKE_VERSION") "2.7.3")]]
:name "puppetserver"}
Expand All @@ -285,18 +272,18 @@
;; Do not modify this line. It is managed by the release process
;; via the scripts/sync_ezbake_dep.rb script.
[org.openvoxproject/puppetserver "8.13.0-SNAPSHOT"]
[org.openvoxproject/trapperkeeper-webserver-jetty10]
[org.openvoxproject/trapperkeeper-webserver-jetty12]
[org.openvoxproject/trapperkeeper-metrics]]
:uberjar-exclusions [#"^org/bouncycastle/.*"]
:plugins [[org.openvoxproject/lein-ezbake ~(or (System/getenv "EZBAKE_VERSION") "2.7.3")]]
:name "puppetserver"}
:uberjar {:dependencies [[org.openvoxproject/trapperkeeper-webserver-jetty10]]
:uberjar {:dependencies [[org.openvoxproject/trapperkeeper-webserver-jetty12]]
:aot [puppetlabs.trapperkeeper.main
puppetlabs.trapperkeeper.services.status.status-service
puppetlabs.trapperkeeper.services.metrics.metrics-service
puppetlabs.services.protocols.jruby-puppet
puppetlabs.trapperkeeper.services.watcher.filesystem-watch-service
puppetlabs.trapperkeeper.services.webserver.jetty10-service
puppetlabs.trapperkeeper.services.webserver.jetty12-service
puppetlabs.trapperkeeper.services.webrouting.webrouting-service
puppetlabs.services.legacy-routes.legacy-routes-core
puppetlabs.services.protocols.jruby-metrics
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[puppetlabs.puppetserver.testutils :as testutils]
[puppetlabs.trapperkeeper.app :as tk-app]
[puppetlabs.trapperkeeper.testutils.bootstrap :as tk-bootstrap-testutils]
[puppetlabs.trapperkeeper.testutils.webserver :as jetty10]
[puppetlabs.trapperkeeper.testutils.webserver :as jetty]
[puppetlabs.services.master.master-core :as master-core]
[puppetlabs.services.protocols.jruby-puppet :as jruby-protocol]
[cheshire.core :as cheshire]
Expand Down Expand Up @@ -617,7 +617,7 @@
(apply str (repeat body-length "a"))
expected-etag))
(master-core/wrap-with-cache-check jruby-service))]
(jetty10/with-test-webserver
(jetty/with-test-webserver
app
port
(let [request-url (str "http://localhost:" port)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[puppetlabs.puppetserver.bootstrap-testutils :as bootstrap]
[puppetlabs.puppetserver.testutils :as testutils]
[puppetlabs.trapperkeeper.testutils.bootstrap :as tk-bootstrap-testutils]
[puppetlabs.trapperkeeper.testutils.webserver :as jetty10]
[puppetlabs.trapperkeeper.testutils.webserver :as jetty]
[puppetlabs.services.master.master-core :as master-core]
[puppetlabs.services.protocols.jruby-puppet :as jruby-protocol]
[cheshire.core :as json]
Expand Down Expand Up @@ -487,7 +487,7 @@ Puppet::ResourceApi.register_transport(
(apply str (repeat body-length "a"))
expected-etag))
(master-core/wrap-with-cache-check jruby-service))]
(jetty10/with-test-webserver
(jetty/with-test-webserver
app
port
(let [request-url (str "http://localhost:" port)
Expand Down
26 changes: 13 additions & 13 deletions test/unit/puppetlabs/puppetserver/ruby/http_client_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
(java.util.zip GZIPInputStream))
(:require [clojure.test :refer [deftest is testing use-fixtures]]
[puppetlabs.trapperkeeper.testutils.logging :as logutils]
[puppetlabs.trapperkeeper.testutils.webserver :as jetty10]
[puppetlabs.trapperkeeper.testutils.webserver :as jetty]
[puppetlabs.services.jruby.jruby-puppet-testutils :as jruby-puppet-testutils]
[ring.middleware.basic-authentication :as auth]
[schema.core :as schema]
Expand Down Expand Up @@ -170,7 +170,7 @@
(use-fixtures :once http-client-scripting-container-fixture)

(deftest test-ruby-http-client
(jetty10/with-test-webserver ring-app port
(jetty/with-test-webserver ring-app port
(with-scripting-container sc
(with-http-client sc {}
(let [url (str "http://localhost:" port)]
Expand All @@ -180,7 +180,7 @@
(is (= "hi" (.runScriptlet sc (format "$c.post(URI('%s'), 'foo').body" url))))))))))

(deftest http-escaped-urls-test
(jetty10/with-test-webserver ring-app port
(jetty/with-test-webserver ring-app port
(with-scripting-container sc
(with-http-client sc {}
(let [url (str "http://localhost:" port)]
Expand All @@ -190,7 +190,7 @@
(is (= (str url "/a%20b%3Fc?foo=bar") (.runScriptlet sc "$response.url.to_s")))))))))

(deftest http-basic-auth
(jetty10/with-test-webserver ring-app-with-auth port
(jetty/with-test-webserver ring-app-with-auth port
(with-scripting-container sc
(with-http-client sc {}
(let [url (str "http://localhost:" port)]
Expand All @@ -213,7 +213,7 @@
(is (= "access denied" (.runScriptlet sc "$response.body")))))))))

(deftest http-compressed-requests
(jetty10/with-test-webserver ring-app-decompressing-gzipped-request port
(jetty/with-test-webserver ring-app-decompressing-gzipped-request port
(with-scripting-container sc
(with-http-client sc {}
(let [url (str "http://localhost:" port)]
Expand Down Expand Up @@ -244,7 +244,7 @@

(defmacro with-webserver-with-protocols
[protocols cipher-suites & body]
`(jetty10/with-test-webserver-and-config ring-app port#
`(jetty/with-test-webserver-and-config ring-app port#
(merge {:ssl-host "localhost"
:ssl-port 10080
:ssl-ca-cert ca-pem
Expand Down Expand Up @@ -304,7 +304,7 @@
(deftest clients-persist
(testing "client persists when making HTTP requests"
(logutils/with-test-logging
(jetty10/with-test-webserver ring-app port
(jetty/with-test-webserver ring-app port
(with-scripting-container sc
(with-http-client sc {}
(let [url (str "http://localhost:" port)
Expand All @@ -313,7 +313,7 @@
(is (= client1 client2))))))))
(testing "all instances of HttpClient have the same underlying client object"
(logutils/with-test-logging
(jetty10/with-test-webserver ring-app port
(jetty/with-test-webserver ring-app port
(with-scripting-container sc
(with-http-client sc {}
(let [client1 (.runScriptlet sc "$c.class.client")
Expand All @@ -324,23 +324,23 @@
(deftest connections-closed
(testing "connection header always set to close on get"
(logutils/with-test-logging
(jetty10/with-test-webserver ring-app-connection-closed port
(jetty/with-test-webserver ring-app-connection-closed port
(with-scripting-container sc
(with-http-client sc {}
(let [url (str "http://localhost:" port)]
(is (= "The Connection header has value close"
(.runScriptlet sc (format "$c.get(URI('%s')).body" url))))))))))
(testing "connection header always set to close on post"
(logutils/with-test-logging
(jetty10/with-test-webserver ring-app-connection-closed port
(jetty/with-test-webserver ring-app-connection-closed port
(with-scripting-container sc
(with-http-client sc {}
(let [url (str "http://localhost:" port)]
(is (= "The Connection header has value close"
(.runScriptlet sc (format "$c.post(URI('%s'), 'foo').body" url))))))))))
(testing "client's terminate function closes the client"
(logutils/with-test-logging
(jetty10/with-test-webserver ring-app-connection-closed port
(jetty/with-test-webserver ring-app-connection-closed port
(with-scripting-container sc
(with-http-client sc {}
(let [url (str "http://localhost:" port)]
Expand All @@ -358,7 +358,7 @@
(deftest http-and-https
(testing "can make http calls after https calls without a new scripting container"
(logutils/with-test-logging
(jetty10/with-test-webserver ring-app-alternate port
(jetty/with-test-webserver ring-app-alternate port
(with-webserver-with-protocols nil nil
(with-scripting-container sc
(with-http-client sc {}
Expand All @@ -373,7 +373,7 @@

(testing "can make https calls after http calls without a new scripting container"
(logutils/with-test-logging
(jetty10/with-test-webserver ring-app-alternate port
(jetty/with-test-webserver ring-app-alternate port
(with-webserver-with-protocols nil nil
(with-scripting-container sc
(with-http-client sc {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
[puppetlabs.trapperkeeper.services.metrics.metrics-service :as metrics]
[puppetlabs.services.jruby.jruby-puppet-service :as jruby-puppet]
[puppetlabs.services.puppet-profiler.puppet-profiler-service :as profiler]
[puppetlabs.trapperkeeper.services.webserver.jetty10-service :as jetty10-service]
[puppetlabs.trapperkeeper.services.webserver.jetty12-service :as jetty12-service]
[puppetlabs.services.jruby-pool-manager.jruby-pool-manager-service :as jruby-pool-manager]
[puppetlabs.trapperkeeper.services.scheduler.scheduler-service :as scheduler-service]
[puppetlabs.trapperkeeper.services.status.status-service :as status-service]
Expand Down Expand Up @@ -46,7 +46,7 @@
metrics/metrics-service
scheduler-service/scheduler-service
status-service/status-service
jetty10-service/jetty10-service
jetty12-service/jetty12-service
webrouting-service/webrouting-service])

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
(:import (com.puppetlabs.puppetserver PuppetProfiler))
(:require [clojure.test :refer [deftest is testing]]
[puppetlabs.services.puppet-profiler.puppet-profiler-service :refer [puppet-profiler-service]]
[puppetlabs.trapperkeeper.services.webserver.jetty10-service :as jetty10-service]
[puppetlabs.trapperkeeper.services.webserver.jetty12-service :as jetty12-service]
[puppetlabs.trapperkeeper.services.metrics.metrics-service :as metrics-service]
[puppetlabs.trapperkeeper.services.scheduler.scheduler-service :as scheduler-service]
[puppetlabs.trapperkeeper.services.status.status-service :as status-service]
Expand All @@ -16,7 +16,7 @@
(bootstrap/with-app-with-config
app
[puppet-profiler-service
jetty10-service/jetty10-service
jetty12-service/jetty12-service
metrics-service/metrics-service
scheduler-service/scheduler-service
status-service/status-service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
[puppetlabs.puppetserver.bootstrap-testutils :as jruby-bootstrap]
[puppetlabs.services.protocols.versioned-code :as vc]
[puppetlabs.services.puppet-profiler.puppet-profiler-service :as profiler]
[puppetlabs.trapperkeeper.services.webserver.jetty10-service :as jetty10]
[puppetlabs.trapperkeeper.services.webserver.jetty12-service :as jetty12]
[puppetlabs.trapperkeeper.services.scheduler.scheduler-service :as tk-scheduler]
[puppetlabs.services.request-handler.request-handler-service :as handler-service]
[puppetlabs.services.config.puppet-server-config-service :as ps-config]
Expand Down Expand Up @@ -324,7 +324,7 @@
profiler/puppet-profiler-service
handler-service/request-handler-service
ps-config/puppet-server-config-service
jetty10/jetty10-service
jetty12/jetty12-service
ca-service/certificate-authority-service
authorization-service/authorization-service
routing-service/webrouting-service
Expand Down
Loading