|
9 | 9 |
|
10 | 10 | //! Contains bLIP-55 / LSPS5 event types |
11 | 11 |
|
12 | | -use crate::lsps0::ser::LSPSDateTime; |
13 | 12 | use crate::lsps0::ser::LSPSRequestId; |
14 | 13 | use alloc::string::String; |
15 | 14 | use alloc::vec::Vec; |
16 | 15 | use bitcoin::secp256k1::PublicKey; |
| 16 | +use lightning::util::hash_tables::HashMap; |
17 | 17 |
|
18 | 18 | use super::msgs::LSPS5AppName; |
19 | 19 | use super::msgs::LSPS5Error; |
@@ -143,7 +143,7 @@ pub enum LSPS5ServiceEvent { |
143 | 143 | /// |
144 | 144 | /// When this event occurs, the LSP should: |
145 | 145 | /// 1. Send an HTTP POST request to the specified webhook URL |
146 | | - /// 2. Include all provided headers, especially the timestamp and signature headers |
| 146 | + /// 2. Include all provided headers in the request |
147 | 147 | /// 3. Send the JSON-serialized notification as the request body |
148 | 148 | /// 4. Handle any HTTP errors according to the LSP's retry policy |
149 | 149 | /// |
@@ -181,22 +181,14 @@ pub enum LSPS5ServiceEvent { |
181 | 181 | /// |
182 | 182 | /// This contains the type of notification and any associated data to be sent to the client. |
183 | 183 | notification: WebhookNotification, |
184 | | - /// Timestamp of the notification. |
185 | | - /// |
186 | | - /// This timestamp is used for signing the notification and must be within 10 minutes |
187 | | - /// of the client's local time for the signature to be accepted. |
188 | | - timestamp: LSPSDateTime, |
189 | | - /// Signature of the notification using the LSP's node ID. |
190 | | - /// |
191 | | - /// This signature helps the client verify that the notification was sent by the LSP. |
192 | | - signature: String, |
193 | 184 | /// Headers to be included in the HTTP POST request. |
194 | 185 | /// |
195 | | - /// Headers should include: |
196 | | - /// - Content-Type (application/json) |
197 | | - /// - x-lsps5-timestamp (timestamp in RFC3339 format, e.g., "YYYY-MM-DDThh:mm:ss.uuuZ") |
198 | | - /// - x-lsps5-signature (signature of the notification using the LSP's node ID) |
199 | | - headers: Vec<(String, String)>, |
| 186 | + /// This is a map of HTTP header key-value pairs. It will include: |
| 187 | + /// - `"Content-Type"`: with a value like `"application/json"`. |
| 188 | + /// - `"x-lsps5-timestamp"`: with the timestamp in RFC3339 format (`"YYYY-MM-DDThh:mm:ss.uuuZ"`). |
| 189 | + /// - `"x-lsps5-signature"`: with the signature of the notification payload, signed using the LSP's node ID. |
| 190 | + /// Other custom headers may also be included as needed. |
| 191 | + headers: HashMap<String, String>, |
200 | 192 | }, |
201 | 193 | } |
202 | 194 |
|
|
0 commit comments