     [clojure.string :as str]
     [puppetlabs.ssl-utils.core :as ssl-utils]
     [puppetlabs.trapperkeeper.app :refer [get-service]]
+    [puppetlabs.trapperkeeper.authorization.rules :as rules]
     [puppetlabs.trapperkeeper.authorization.testutils :refer :all]
     [puppetlabs.trapperkeeper.services :refer [defservice]]
     [puppetlabs.trapperkeeper.services.authorization.authorization-service

            {:keys [status body]} (app req)]
        (is (= 403 status))
        (is (re-matches #"Forbidden.*" body))))))

(def unauthenticated-request
  "A basic unauthenticated request to feed into the tests"
  (request "/" :get "127.0.0.1"))

(defprotocol EchoReverseService
  (echo-reverse [this msg]))

;; A simple service using authorization via ring middleware
(defservice
  echo-reverse-service EchoReverseService
  [[:AuthorizationService wrap-with-authorization-check]]
  (echo-reverse
   [this msg]
   (let [handler (fn [req]
                   (-> req
                       (:body)
                       str
                       str/reverse
                       ((partial str msg))
                       response
                       (assoc :request req)))]
     (wrap-with-authorization-check handler))))

(defn build-ring-handler
  "Build a ring handler around the echo reverse service"
