|
243 | 243 | 400 (g/rref :error-400)
|
244 | 244 | 401 (g/rref :error-401)}})})
|
245 | 245 |
|
| 246 | +(defn admin-csv-routes |
| 247 | + [common-interceptors-no-auth |
| 248 | + common-interceptors jwt-secret jwt-exp jwt-leeway no-val-opts] |
| 249 | + #{["/admin/csv/auth" :get (conj common-interceptors |
| 250 | + (ji/validate-jwt |
| 251 | + jwt-secret jwt-leeway no-val-opts) |
| 252 | + ji/validate-jwt-account |
| 253 | + (lm/generate-one-time-jwt jwt-secret jwt-exp)) |
| 254 | + :route-name :lrsql.lrs-management/download-csv-auth] |
| 255 | + ["/admin/csv" :get (conj common-interceptors-no-auth |
| 256 | + lm/validate-property-paths |
| 257 | + lm/validate-query-params |
| 258 | + (ji/validate-one-time-jwt jwt-secret jwt-leeway) |
| 259 | + lm/download-statement-csv) |
| 260 | + :route-name :lrsql.lrs-management/download-csv]}) |
| 261 | + |
246 | 262 | (defn admin-status-routes
|
247 | 263 | [common-interceptors jwt-secret jwt-leeway no-val-opts]
|
248 | 264 | #{;; Return LRS Status information
|
|
309 | 325 | :route-name :lrsql.admin.reaction/delete]})
|
310 | 326 |
|
311 | 327 | (defn admin-lrs-management-routes
|
312 |
| - [common-interceptors-no-auth |
313 |
| - common-interceptors jwt-secret jwt-exp jwt-leeway no-val-opts] |
| 328 | + [common-interceptors jwt-secret jwt-leeway no-val-opts] |
314 | 329 | #{["/admin/agents" :delete (conj common-interceptors
|
315 | 330 | lm/validate-delete-actor-params
|
316 | 331 | (ji/validate-jwt jwt-secret jwt-leeway no-val-opts)
|
317 | 332 | ji/validate-jwt-account
|
318 | 333 | lm/delete-actor)
|
319 |
| - :route-name :lrsql.lrs-management/delete-actor] |
320 |
| - ["/admin/csv/auth" :get (conj common-interceptors |
321 |
| - (ji/validate-jwt |
322 |
| - jwt-secret jwt-leeway no-val-opts) |
323 |
| - ji/validate-jwt-account |
324 |
| - (lm/generate-one-time-jwt jwt-secret jwt-exp)) |
325 |
| - :route-name :lrsql.lrs-management/download-csv-auth] |
326 |
| - ["/admin/csv" :get (conj common-interceptors-no-auth |
327 |
| - lm/validate-property-paths |
328 |
| - lm/validate-query-params |
329 |
| - (ji/validate-one-time-jwt jwt-secret jwt-leeway) |
330 |
| - lm/download-statement-csv) |
331 |
| - :route-name :lrsql.lrs-management/download-csv]}) |
| 334 | + :route-name :lrsql.lrs-management/delete-actor]}) |
332 | 335 |
|
333 | 336 | (defn add-admin-routes
|
334 | 337 | "Given a set of routes `routes` for a default LRS implementation,
|
|
375 | 378 | common-interceptors-oidc secret exp ref leeway no-val-opts))
|
376 | 379 | (admin-cred-routes
|
377 | 380 | common-interceptors-oidc secret leeway no-val-opts)
|
| 381 | + (admin-csv-routes |
| 382 | + common-interceptors common-interceptors-oidc secret exp leeway no-val-opts) |
378 | 383 | (when enable-admin-ui
|
379 | 384 | (admin-ui-routes
|
380 | 385 | (into common-interceptors
|
|
397 | 402 | common-interceptors-oidc secret leeway no-val-opts))
|
398 | 403 | (when enable-admin-delete-actor
|
399 | 404 | (admin-lrs-management-routes
|
400 |
| - common-interceptors common-interceptors-oidc secret exp leeway no-val-opts))))) |
| 405 | + common-interceptors-oidc secret leeway no-val-opts))))) |
401 | 406 |
|
402 | 407 | (defn add-openapi-route [{:keys [lrs head-opts version]} routes]
|
403 | 408 | (let [common-interceptors (make-common-interceptors lrs head-opts)]
|
|
0 commit comments