add common parameters to generic get API

Honestly this was just done to make the documentation correct. There's
no point in using these parameters. And they're optional.
This commit is contained in:
Joey Hess 2024-07-24 20:55:58 -04:00
parent ab22938c0b
commit 6a3f755bfa
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
3 changed files with 10 additions and 3 deletions

View file

@ -64,6 +64,8 @@ p2pHttpAPI = Proxy
type GetGenericAPI type GetGenericAPI
= CaptureKey = CaptureKey
:> CU Optional
:> BypassUUIDs
:> IsSecure :> IsSecure
:> AuthHeader :> AuthHeader
:> StreamGet NoFraming OctetStream :> StreamGet NoFraming OctetStream

View file

@ -83,16 +83,18 @@ serveGetGeneric
:: P2PHttpServerState :: P2PHttpServerState
-> B64UUID ServerSide -> B64UUID ServerSide
-> B64Key -> B64Key
-> Maybe (B64UUID ClientSide)
-> [B64UUID Bypass]
-> IsSecure -> IsSecure
-> Maybe Auth -> Maybe Auth
-> Handler (Headers '[DataLengthHeader] (S.SourceT IO B.ByteString)) -> 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 -- Use V0 because it does not alter the returned data to indicate
-- Invalid content. -- Invalid content.
serveGet st su V0 k cu [] Nothing Nothing serveGet st su V0 k (fromMaybe scu mcu) bypass Nothing Nothing
where where
-- Reuse server UUID as client UUID. -- Reuse server UUID as client UUID.
cu = B64UUID u :: B64UUID ClientSide scu = B64UUID u :: B64UUID ClientSide
serveGet serveGet
:: APIVersion v :: APIVersion v

View file

@ -97,6 +97,9 @@ http server.
When the key is not present on the server, it will respond When the key is not present on the server, it will respond
with 404 Not Found. 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 /git-annex/$uuid/v3/key/$key
Get the content of a key from the repository with the specified uuid. Get the content of a key from the repository with the specified uuid.