* @param {string} apiKey Cloudflare API key * @param {string | undefined} accountEmail Cloudflare account email * @returns {Object. }
(apiKey, accountEmail)
| 13 | * @returns {Object.<string, string>} |
| 14 | */ |
| 15 | function buildAuthHeaders(apiKey, accountEmail) { |
| 16 | return accountEmail |
| 17 | ? { |
| 18 | 'X-Auth-Email': accountEmail, |
| 19 | 'X-Auth-Key': apiKey |
| 20 | } |
| 21 | : { |
| 22 | Authorization: 'Bearer ' + apiKey |
| 23 | }; |
| 24 | } |
| 25 | |
| 26 | /** |
| 27 | * @param {string} accountId Cloudflare account id |
no outgoing calls
no test coverage detected