From 57583357126497abd67f8c0f2505c9061922e964 Mon Sep 17 00:00:00 2001 From: vendethiel Date: Fri, 24 Nov 2023 10:15:57 +0100 Subject: [PATCH] Add an HasEndpoint instance for AuthProtect --- lib/Prometheus/Servant/Internal.hs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/Prometheus/Servant/Internal.hs b/lib/Prometheus/Servant/Internal.hs index 1c45979..7cbf7f9 100644 --- a/lib/Prometheus/Servant/Internal.hs +++ b/lib/Prometheus/Servant/Internal.hs @@ -175,6 +175,13 @@ instance ReflectMethod method => HasEndpoint (Verb method status cts a) where where method = reflectMethod (Proxy :: Proxy method) +#if MIN_VERSION_servant(0,5,0) +instance HasEndpoint (sub :: Type) => HasEndpoint (AuthProtect a :> sub) where + getEndpoint _ = getEndpoint (Proxy :: Proxy sub) + + enumerateEndpoints _ = enumerateEndpoints (Proxy :: Proxy sub) +#endif + #if MIN_VERSION_servant(0,17,0) instance ReflectMethod method => HasEndpoint (NoContentVerb method) where getEndpoint _ req = case pathInfo req of