Shared helpers used by [[metabase.api.routes/routes]] as well as premium-only routes like [[metabase-enterprise.sandbox.api.routes/routes]]. | (ns metabase.api.routes.common (:require [metabase.api.open-api :as open-api] [metabase.server.core :as server])) |
these use vars rather than plain functions so changes to the underlying functions get propagated during REPL usage. | |
Wrap Ring middleware so the resulting function supports [[open-api/open-api-spec]]. | (defn wrap-middleware-for-open-api-spec-generation [middleware] (fn [handler] (open-api/handler-with-open-api-spec (middleware handler) (fn [prefix] (open-api/open-api-spec handler prefix))))) |
Wrap | (def ^{:arglists '([handler])} +public-exceptions (wrap-middleware-for-open-api-spec-generation server/public-exceptions)) |
Wrap | (def ^{:arglists '([handler])} +message-only-exceptions (wrap-middleware-for-open-api-spec-generation server/message-only-exceptions)) |
Wrap | (def ^{:arglists '([handler])} +static-apikey (wrap-middleware-for-open-api-spec-generation server/enforce-static-api-key)) |
Wrap | (def ^{:arglists '([handler])} +auth (wrap-middleware-for-open-api-spec-generation server/enforce-authentication)) |