acme-client
Advanced tools
Comparing version 2.2.3 to 2.3.0
@@ -0,1 +1,8 @@ | ||
## v2.3.0 (2019-08-21) | ||
* `backport` Implemented `POST-as-GET` for all ACME API requests | ||
**Notice: [On November 1st, 2019 Let's Encrypt will remove support for unauthenticated GETs from the v2 API](https://community.letsencrypt.org/t/acme-v2-scheduled-deprecation-of-unauthenticated-resource-gets/74380). Please update to `acme-client >= v3.1.0` or `>= v2.3.0` before this date to avoid being affected by this API change.** | ||
## v2.2.3 (2019-01-25) | ||
@@ -2,0 +9,0 @@ |
@@ -72,7 +72,21 @@ /** | ||
/* Get authorizations and select challenges */ | ||
/** | ||
* authorizations / client.getAuthorizations(order); | ||
* An array with one item per DNS name in the certificate order. | ||
* All items require at least one satisfied challenge before order can be completed. | ||
*/ | ||
const authorizations = await client.getAuthorizations(order); | ||
const promises = authorizations.map(async (authz) => { | ||
const challenge = authz.challenges.pop(); | ||
/** | ||
* challenges / authz.challenges | ||
* An array of all available challenge types for a single DNS name. | ||
* One of these challenges needs to be satisfied. | ||
*/ | ||
const challenges = { authz }; | ||
/* Just select any challenge */ | ||
const challenge = challenges.pop(); | ||
const keyAuthorization = await client.getChallengeKeyAuthorization(challenge); | ||
@@ -79,0 +93,0 @@ |
@@ -27,3 +27,3 @@ /** | ||
if (challenge.type === 'http-01') { | ||
const filePath = `/var/www/html/.well-known/acme-challenges/${challenge.token}`; | ||
const filePath = `/var/www/html/.well-known/acme-challenge/${challenge.token}`; | ||
const fileContents = keyAuthorization; | ||
@@ -66,3 +66,3 @@ | ||
if (challenge.type === 'http-01') { | ||
const filePath = `/var/www/html/.well-known/acme-challenges/${challenge.token}`; | ||
const filePath = `/var/www/html/.well-known/acme-challenge/${challenge.token}`; | ||
@@ -69,0 +69,0 @@ log(`Removing challenge response for ${authz.identifier.value} at path: ${filePath}`); |
@@ -328,3 +328,3 @@ 'use strict'; | ||
value: function getAuthorization(url) { | ||
return this.get(url, [200]); | ||
return this.apiRequest('', null, 'post', [200], true, url); | ||
} | ||
@@ -331,0 +331,0 @@ |
@@ -749,3 +749,3 @@ 'use strict'; | ||
_context12.next = 2; | ||
return _this3.api.get(item.url, [200]); | ||
return _this3.api.apiRequest('', null, 'post', [200], true, item.url); | ||
@@ -856,3 +856,3 @@ case 2: | ||
_context14.next = 8; | ||
return this.http.request(order.certificate, 'get', { responseType: 'text' }); | ||
return this.api.apiRequest('', null, 'post', [200], true, order.certificate); | ||
@@ -859,0 +859,0 @@ case 8: |
@@ -320,2 +320,3 @@ 'use strict'; | ||
* @param {string} [nonce] Request nonce | ||
* @param {string} [kid] Request KID | ||
* @returns {Promise<object>} Signed HTTP request body | ||
@@ -327,3 +328,4 @@ */ | ||
value: function () { | ||
var _ref6 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee6(url, payload) { | ||
var _ref6 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee6(url) { | ||
var payload = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; | ||
var nonce = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; | ||
@@ -370,3 +372,3 @@ var kid = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; | ||
result = { | ||
payload: helper.b64encode((0, _stringify2.default)(payload)), | ||
payload: payload ? helper.b64encode((0, _stringify2.default)(payload)) : '', | ||
protected: helper.b64encode((0, _stringify2.default)(header)) | ||
@@ -391,3 +393,3 @@ }; | ||
function createSignedBody(_x7, _x8) { | ||
function createSignedBody(_x8) { | ||
return _ref6.apply(this, arguments); | ||
@@ -407,3 +409,3 @@ } | ||
* @param {object} payload Request payload | ||
* @param {string} [kid] KID | ||
* @param {string} [kid] Request KID | ||
* @returns {Promise<object>} HTTP response | ||
@@ -410,0 +412,0 @@ */ |
@@ -5,3 +5,3 @@ { | ||
"author": "nmorsman", | ||
"version": "2.2.3", | ||
"version": "2.3.0", | ||
"main": "lib/index.js", | ||
@@ -8,0 +8,0 @@ "license": "MIT", |
@@ -20,3 +20,5 @@ # acme-client [![CircleCI](https://circleci.com/gh/publishlab/node-acme-client.svg?style=svg)](https://circleci.com/gh/publishlab/node-acme-client) | ||
**Notice: [On November 1st, 2019 Let's Encrypt will remove support for unauthenticated GETs from the v2 API](https://community.letsencrypt.org/t/acme-v2-scheduled-deprecation-of-unauthenticated-resource-gets/74380). Please update to `acme-client >= v3.1.0` or `>= v2.3.0` before this date to avoid being affected by this API change.** | ||
## Installation | ||
@@ -23,0 +25,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
292946
3454
164