@@ -377,7 +377,7 @@ type ActivePoll = {pubkey: PubkeyHex, startedAt: Timestamp}
377-- ============================================
377-- ============================================
378-- Public HTTP surface, grouped by audience:
378-- Public HTTP surface, grouped by audience:
379-- AuthApi -- challenge/verify (client identity)
379-- AuthApi -- challenge/verify (client identity)
380−-- ClientApi -- /poll, /messages (send), /messages/status, presence lookup
380+-- ClientApi -- /poll, /messages (send), presence lookup
381-- FederationApi -- inter-server gossip, forward (single + batch)
381-- FederationApi -- inter-server gossip, forward (single + batch)
382-- FederationPubkey -- exposes this server's federation Ed25519 public key
382-- FederationPubkey -- exposes this server's federation Ed25519 public key
383-- MaintenanceApi -- operator endpoints (prune, peer allow/block, admin)
383-- MaintenanceApi -- operator endpoints (prune, peer allow/block, admin)
@@ -392,7 +392,6 @@ route AuthApi where
392route ClientApi where
392route ClientApi where
393 POST {cursor: Timestamp, generation: Int} /poll headers {authorization: Text, clientIp: Text} -> {events: [PollEvent], cursor: Timestamp, authorized: Bool, rateLimited: Bool, generation: Int, heartbeat: Bool, retryAfterMs: Int, cursorReset: Bool, hasMore: Bool, cursorStale: Bool, loadPct: Int} = Poll
393 POST {cursor: Timestamp, generation: Int} /poll headers {authorization: Text, clientIp: Text} -> {events: [PollEvent], cursor: Timestamp, authorized: Bool, rateLimited: Bool, generation: Int, heartbeat: Bool, retryAfterMs: Int, cursorReset: Bool, hasMore: Bool, cursorStale: Bool, loadPct: Int} = Poll
394 POST {messages: [{to: PubkeyHex, encryptedBlob: BlobHex}]} /messages headers {authorization: Text, clientIp: Text} -> {results: [{messageId: MessageIdHex, error: Text}], error: Text, retryAfterMs: Int} = SendMessages
394 POST {messages: [{to: PubkeyHex, encryptedBlob: BlobHex}]} /messages headers {authorization: Text, clientIp: Text} -> {results: [{messageId: MessageIdHex, error: Text}], error: Text, retryAfterMs: Int} = SendMessages
395− POST {to: PubkeyHex, messageId: MessageIdHex} /messages/status headers {authorization: Text, clientIp: Text} -> {status: Text, authorized: Bool} = MessageStatus
396 GET /lookup/{pubkey: PubkeyHex} headers {authorization: Text, clientIp: Text} -> {server: ServerName, authorized: Bool, error: Text} = LookupPresence
395 GET /lookup/{pubkey: PubkeyHex} headers {authorization: Text, clientIp: Text} -> {server: ServerName, authorized: Bool, error: Text} = LookupPresence
397 POST {pubkeys: [PubkeyHex]} /lookup/batch headers {authorization: Text, clientIp: Text} -> {results: [{pubkey: PubkeyHex, server: ServerName}], authorized: Bool, error: Text} = BatchLookupPresence
396 POST {pubkeys: [PubkeyHex]} /lookup/batch headers {authorization: Text, clientIp: Text} -> {results: [{pubkey: PubkeyHex, server: ServerName}], authorized: Bool, error: Text} = BatchLookupPresence
@@ -1454,23 +1453,6 @@ handleBatchLookupPresence = \pubkeys authorization clientIp -> do
1454 let results = pluck (takeRelation 50 pubkeys) (\k -> {pubkey: k, server: maskedServer pres k t})
1453 let results = pluck (takeRelation 50 pubkeys) (\k -> {pubkey: k, server: maskedServer pres k t})
1455 yield {results, authorized: True {}, error: ""})
1454 yield {results, authorized: True {}, error: ""})
1457−-- POST /messages/status: classify a message as
1458−-- pending (in mailbox), forwarding (en-route to a peer), or unknown.
1459−-- A message that has been polled and removed returns "unknown"; the server
1460−-- keeps no post-delivery record, so the client must track delivery itself.
1461−handleMessageStatus : PubkeyHex -> MessageIdHex -> Text -> Text -> IO {rw *globalRateCount, rw *globalRateWindowStart, r *sessions, clock} {authorized: Bool, status: Text}
1462−handleMessageStatus = \to messageId authorization clientIp -> do
1464− let mkErr = \_ -> {status: "", authorized: False {}}
1465− gateAuth authorization clientIp t mkErr (\_ -> do
1468− let blobMatches = \x -> messageIdOf x.encryptedBlob == messageId && x.toKey == to
1469− let s = if any msgs blobMatches
1471− else if any fwds blobMatches then "forwarding" else "unknown"
1472− yield {status: s, authorized: True {}})
1474-- ============================================
1456-- ============================================
1475-- Handler: federation receive
1457-- Handler: federation receive
1476-- ============================================
1458-- ============================================
@@ -2178,7 +2160,6 @@ api = serve Api where
2178 VerifyAuth = \{pubkey, challenge, signature, revokeOthers, clientIp} -> handleVerifyAuth pubkey challenge signature revokeOthers clientIp
2160 VerifyAuth = \{pubkey, challenge, signature, revokeOthers, clientIp} -> handleVerifyAuth pubkey challenge signature revokeOthers clientIp
2179 Poll = \{cursor, generation, authorization, clientIp} -> handlePoll cursor generation authorization clientIp
2161 Poll = \{cursor, generation, authorization, clientIp} -> handlePoll cursor generation authorization clientIp
2180 SendMessages = \{messages, authorization, clientIp} -> handleSendMessages messages authorization clientIp
2162 SendMessages = \{messages, authorization, clientIp} -> handleSendMessages messages authorization clientIp
2181− MessageStatus = \{to, messageId, authorization, clientIp} -> handleMessageStatus to messageId authorization clientIp
2182 LookupPresence = \{pubkey, authorization, clientIp} -> handleLookupPresence pubkey authorization clientIp
2163 LookupPresence = \{pubkey, authorization, clientIp} -> handleLookupPresence pubkey authorization clientIp
2183 BatchLookupPresence = \{pubkeys, authorization, clientIp} -> handleBatchLookupPresence pubkeys authorization clientIp
2164 BatchLookupPresence = \{pubkeys, authorization, clientIp} -> handleBatchLookupPresence pubkeys authorization clientIp
2184 RecvGossip = \{events, fromServer, requestTimestamp, authorization} -> handleRecvGossip events fromServer requestTimestamp authorization
2165 RecvGossip = \{events, fromServer, requestTimestamp, authorization} -> handleRecvGossip events fromServer requestTimestamp authorization