]> dgit.raspbian.org Git - git-annex.git/commitdiff
add common parameters to generic get API
authorJoey Hess <joeyh@joeyh.name>
Thu, 25 Jul 2024 00:55:58 +0000 (20:55 -0400)
committerJoey Hess <joeyh@joeyh.name>
Thu, 25 Jul 2024 00:55:58 +0000 (20:55 -0400)
Honestly this was just done to make the documentation correct. There's
no point in using these parameters. And they're optional.

P2P/Http.hs
P2P/Http/Server.hs
doc/design/p2p_protocol_over_http.mdwn

index a98994c49183d5eb87fe3169620ec679cfead9de..a096422415a1d72593f240c3ff64d932b66baddf 100644 (file)
@@ -64,6 +64,8 @@ p2pHttpAPI = Proxy
 
 type GetGenericAPI
        = CaptureKey
+       :> CU Optional
+       :> BypassUUIDs
        :> IsSecure
        :> AuthHeader
        :> StreamGet NoFraming OctetStream
index bc19ced1dac2cb7af4e5b80ad69ff7a0f2a772e2..a6c3cbde56186abae319128fc91344257c11572e 100644 (file)
@@ -83,16 +83,18 @@ serveGetGeneric
        :: P2PHttpServerState
        -> B64UUID ServerSide
        -> B64Key
+       -> Maybe (B64UUID ClientSide)
+       -> [B64UUID Bypass]
        -> IsSecure
        -> Maybe Auth
        -> Handler (Headers '[DataLengthHeader] (S.SourceT IO B.ByteString))
-serveGetGeneric st su@(B64UUID u) k =
+serveGetGeneric st su@(B64UUID u) k mcu bypass =
        -- Use V0 because it does not alter the returned data to indicate
        -- Invalid content.
-       serveGet st su V0 k cu [] Nothing Nothing
+       serveGet st su V0 k (fromMaybe scu mcu) bypass Nothing Nothing
   where
        -- Reuse server UUID as client UUID.
-       cu = B64UUID u :: B64UUID ClientSide
+       scu = B64UUID u :: B64UUID ClientSide
 
 serveGet
        :: APIVersion v
index f24d3a6038027a20c16ef3a95186eb47d1a25a55..6037656472330ae5d291c7ea17a50e46e34f5d14 100644 (file)
@@ -97,6 +97,9 @@ http server.
 When the key is not present on the server, it will respond
 with 404 Not Found.
 
+Note that the common parameters bypass and clientuuid, while
+accepted, have no effect. Both are optional for this request.
+
 ### GET /git-annex/$uuid/v3/key/$key
 
 Get the content of a key from the repository with the specified uuid.