File tree Expand file tree Collapse file tree 3 files changed +18
-6
lines changed Expand file tree Collapse file tree 3 files changed +18
-6
lines changed Original file line number Diff line number Diff line change 75
75
(handler req)
76
76
{:status 403 :body " Forbidden." })))
77
77
78
+ (defn wrap-with-certname-as-compiler
79
+ " Function that returns middleware that add X-Puppet-Compiler-Name to the response"
80
+ [handler name]
81
+ (fn [request]
82
+ (ring/header (handler request) " X-Puppet-Compiler-Name" name)))
83
+
78
84
(defn wrap-with-puppet-version-header
79
85
" Function that returns a middleware that adds an
80
86
X-Puppet-Version header to the response."
Original file line number Diff line number Diff line change 1313
1313
wrap-middleware :- IFn
1314
1314
[handler :- IFn
1315
1315
authorization-fn :- IFn
1316
- puppet-version :- schema/Str]
1316
+ puppet-version :- schema/Str
1317
+ certname :- schema/Str]
1317
1318
(-> handler
1318
1319
authorization-fn
1319
1320
(middleware/wrap-uncaught-errors :plain )
1320
1321
middleware/wrap-request-logging
1321
1322
i18n/locale-negotiator
1322
1323
middleware/wrap-response-logging
1323
- (ringutils/wrap-with-puppet-version-header puppet-version)))
1324
+ (ringutils/wrap-with-puppet-version-header puppet-version)
1325
+ (ringutils/wrap-with-certname-as-compiler certname)))
1324
1326
1325
1327
(schema/defn ^:always-validate get-master-route-config
1326
1328
" Get the webserver route configuration for the master service"
1366
1368
environment-class-cache-enabled :- schema/Bool
1367
1369
boltlib-path :- (schema/maybe [schema/Str])
1368
1370
bolt-builtin-content-dir :- (schema/maybe [schema/Str])
1369
- bolt-projects-dir :- (schema/maybe schema/Str)]
1371
+ bolt-projects-dir :- (schema/maybe schema/Str)
1372
+ certname :- schema/Str]
1370
1373
(let [ruby-request-handler (wrap-middleware handle-request
1371
1374
wrap-with-authorization-check
1372
- puppet-version)
1375
+ puppet-version
1376
+ certname)
1373
1377
clojure-request-wrapper (fn [handler]
1374
1378
(wrap-middleware
1375
1379
(ring/wrap-params handler)
1376
1380
wrap-with-authorization-check
1377
- puppet-version))]
1381
+ puppet-version
1382
+ certname))]
1378
1383
(root-routes ruby-request-handler
1379
1384
clojure-request-wrapper
1380
1385
jruby-service
Original file line number Diff line number Diff line change 149
149
environment-class-cache-enabled
150
150
boltlib-path
151
151
bolt-builtin-content-dir
152
- bolt-projects-dir))
152
+ bolt-projects-dir
153
+ certname))
153
154
routes (comidi/context path ring-app)
154
155
route-metadata (comidi/route-metadata routes)
155
156
comidi-handler (comidi/routes->handler routes)
You can’t perform that action at this time.
0 commit comments