Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[acme] sync upgrade [trident-sync] #53

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions packages/core/acme-client/.eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,8 @@ env:
rules:
indent: [2, 4, { SwitchCase: 1, VariableDeclarator: 1 }]
brace-style: [2, 'stroustrup', { allowSingleLine: true }]
space-before-function-paren: [2, { anonymous: 'never', named: 'never' }]
func-names: 0
prefer-destructuring: 0
object-curly-newline: 0
class-methods-use-this: 0
wrap-iife: [2, 'inside']
no-param-reassign: 0
comma-dangle: [2, 'never']
max-len: [1, 200, 2, { ignoreUrls: true, ignoreComments: false }]
no-multiple-empty-lines: [2, { max: 2, maxBOF: 0, maxEOF: 0 }]
prefer-object-spread: 0
import/no-useless-path-segments: 0
3 changes: 0 additions & 3 deletions packages/core/acme-client/.github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
name: test
on: [push, pull_request]

Expand All @@ -12,7 +11,6 @@ jobs:
node: [16, 18, 20, 22]
eab: [0, 1]


#
# Environment
#
Expand Down Expand Up @@ -41,7 +39,6 @@ jobs:
ACME_HTTP_PORT: 5002
ACME_HTTPS_PORT: 5003


#
# Pipeline
#
Expand Down
4 changes: 2 additions & 2 deletions packages/core/acme-client/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## v5.3.1
## v5.3.1 (2024-05-22)

* `fixed` Allow `client.auto()` being called with an empty CSR common name
* `fixed` Bug when calling `updateAccountKey()` with external account binding
Expand Down Expand Up @@ -37,7 +37,7 @@
* `fixed` Upgrade `axios@0.26.1`
* `fixed` Upgrade `node-forge@1.3.0` - [CVE-2022-24771](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-24771), [CVE-2022-24772](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-24772), [CVE-2022-24773](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-24773)

## 4.2.4 (2022-03-19)
## v4.2.4 (2022-03-19)

* `fixed` Use SHA-256 when signing CSRs

Expand Down
39 changes: 19 additions & 20 deletions packages/core/acme-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ This module is written to handle communication with a Boulder/Let's Encrypt-styl

## Compatibility

| acme-client | Node.js | |
| ------------- | --------- | ----------------------------------------- |
| v5.x | >= v16 | [Upgrade guide](docs/upgrade-v5.md) |
| v4.x | >= v10 | [Changelog](CHANGELOG.md#v400-2020-05-29) |
| v3.x | >= v8 | [Changelog](CHANGELOG.md#v300-2019-07-13) |
| v2.x | >= v4 | [Changelog](CHANGELOG.md#v200-2018-04-02) |
| v1.x | >= v4 | [Changelog](CHANGELOG.md#v100-2017-10-20) |
| acme-client | Node.js | |
| ----------- | ------- | ----------------------------------------- |
| v5.x | >= v16 | [Upgrade guide](docs/upgrade-v5.md) |
| v4.x | >= v10 | [Changelog](CHANGELOG.md#v400-2020-05-29) |
| v3.x | >= v8 | [Changelog](CHANGELOG.md#v300-2019-07-13) |
| v2.x | >= v4 | [Changelog](CHANGELOG.md#v200-2018-04-02) |
| v1.x | >= v4 | [Changelog](CHANGELOG.md#v100-2017-10-20) |

## Table of contents

Expand Down Expand Up @@ -49,7 +49,7 @@ const accountPrivateKey = '<PEM encoded private key>';

const client = new acme.Client({
directoryUrl: acme.directory.letsencrypt.staging,
accountKey: accountPrivateKey
accountKey: accountPrivateKey,
});
```

Expand All @@ -75,8 +75,8 @@ const client = new acme.Client({
accountKey: accountPrivateKey,
externalAccountBinding: {
kid: 'YOUR-EAB-KID',
hmacKey: 'YOUR-EAB-HMAC-KEY'
}
hmacKey: 'YOUR-EAB-HMAC-KEY',
},
});
```

Expand All @@ -90,7 +90,7 @@ In some cases, for example with some EAB providers, this account creation step m
const client = new acme.Client({
directoryUrl: acme.directory.letsencrypt.staging,
accountKey: accountPrivateKey,
accountUrl: 'https://acme-v02.api.letsencrypt.org/acme/acct/12345678'
accountUrl: 'https://acme-v02.api.letsencrypt.org/acme/acct/12345678',
});
```

Expand All @@ -113,8 +113,7 @@ const privateRsaKey = await acme.crypto.createPrivateRsaKey();
const privateEcdsaKey = await acme.crypto.createPrivateEcdsaKey();

const [certificateKey, certificateCsr] = await acme.crypto.createCsr({
commonName: '*.example.com',
altNames: ['example.com']
altNames: ['example.com', '*.example.com'],
});
```

Expand All @@ -139,7 +138,7 @@ const autoOpts = {
email: 'test@example.com',
termsOfServiceAgreed: true,
challengeCreateFn: async (authz, challenge, keyAuthorization) => {},
challengeRemoveFn: async (authz, challenge, keyAuthorization) => {}
challengeRemoveFn: async (authz, challenge, keyAuthorization) => {},
};

const certificate = await client.auto(autoOpts);
Expand All @@ -156,7 +155,7 @@ To modify challenge priority, provide a list of challenge types in `challengePri
```js
await client.auto({
...,
challengePriority: ['http-01', 'dns-01']
challengePriority: ['http-01', 'dns-01'],
});
```

Expand All @@ -171,7 +170,7 @@ To completely disable `acme-client`s internal challenge verification, enable `sk
```js
await client.auto({
...,
skipChallengeVerification: true
skipChallengeVerification: true,
});
```

Expand All @@ -185,14 +184,14 @@ For more fine-grained control you can interact with the ACME API using the metho
```js
const account = await client.createAccount({
termsOfServiceAgreed: true,
contact: ['mailto:test@example.com']
contact: ['mailto:test@example.com'],
});

const order = await client.createOrder({
identifiers: [
{ type: 'dns', value: 'example.com' },
{ type: 'dns', value: '*.example.com' }
]
{ type: 'dns', value: '*.example.com' },
],
});
```

Expand All @@ -207,7 +206,7 @@ const acme = require('acme-client');

acme.axios.defaults.proxy = {
host: '127.0.0.1',
port: 9000
port: 9000,
};
```

Expand Down
28 changes: 14 additions & 14 deletions packages/core/acme-client/docs/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Create ACME client instance
```js
const client = new acme.Client({
directoryUrl: acme.directory.letsencrypt.staging,
accountKey: 'Private key goes here'
accountKey: 'Private key goes here',
});
```
**Example**
Expand All @@ -75,7 +75,7 @@ const client = new acme.Client({
accountUrl: 'Optional account URL goes here',
backoffAttempts: 10,
backoffMin: 5000,
backoffMax: 30000
backoffMax: 30000,
});
```
**Example**
Expand All @@ -86,8 +86,8 @@ const client = new acme.Client({
accountKey: 'Private key goes here',
externalAccountBinding: {
kid: 'YOUR-EAB-KID',
hmacKey: 'YOUR-EAB-HMAC-KEY'
}
hmacKey: 'YOUR-EAB-HMAC-KEY',
},
});
```
<a name="AcmeClient+getTermsOfServiceUrl"></a>
Expand Down Expand Up @@ -145,15 +145,15 @@ https://datatracker.ietf.org/doc/html/rfc8555#section-7.3
Create a new account
```js
const account = await client.createAccount({
termsOfServiceAgreed: true
termsOfServiceAgreed: true,
});
```
**Example**
Create a new account with contact info
```js
const account = await client.createAccount({
termsOfServiceAgreed: true,
contact: ['mailto:test@example.com']
contact: ['mailto:test@example.com'],
});
```
<a name="AcmeClient+updateAccount"></a>
Expand All @@ -174,7 +174,7 @@ https://datatracker.ietf.org/doc/html/rfc8555#section-7.3.2
Update existing account
```js
const account = await client.updateAccount({
contact: ['mailto:foo@example.com']
contact: ['mailto:foo@example.com'],
});
```
<a name="AcmeClient+updateAccountKey"></a>
Expand Down Expand Up @@ -218,8 +218,8 @@ Create a new order
const order = await client.createOrder({
identifiers: [
{ type: 'dns', value: 'example.com' },
{ type: 'dns', value: 'test.example.com' }
]
{ type: 'dns', value: 'test.example.com' },
],
});
```
<a name="AcmeClient+getOrder"></a>
Expand Down Expand Up @@ -452,7 +452,7 @@ Revoke certificate with reason
```js
const certificate = { ... }; // Previously created certificate
const result = await client.revokeCertificate(certificate, {
reason: 4
reason: 4,
});
```
<a name="AcmeClient+auto"></a>
Expand All @@ -479,7 +479,7 @@ Auto mode
Order a certificate using auto mode
```js
const [certificateKey, certificateRequest] = await acme.crypto.createCsr({
commonName: 'test.example.com'
altNames: ['test.example.com'],
});

const certificate = await client.auto({
Expand All @@ -491,14 +491,14 @@ const certificate = await client.auto({
},
challengeRemoveFn: async (authz, challenge, keyAuthorization) => {
// Clean up challenge here
}
},
});
```
**Example**
Order a certificate using auto mode with preferred chain
```js
const [certificateKey, certificateRequest] = await acme.crypto.createCsr({
commonName: 'test.example.com'
altNames: ['test.example.com'],
});

const certificate = await client.auto({
Expand All @@ -507,7 +507,7 @@ const certificate = await client.auto({
termsOfServiceAgreed: true,
preferredChain: 'DST Root CA X3',
challengeCreateFn: async () => {},
challengeRemoveFn: async () => {}
challengeRemoveFn: async () => {},
});
```
<a name="Client"></a>
Expand Down
13 changes: 8 additions & 5 deletions packages/core/acme-client/docs/crypto.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,29 +239,30 @@ Create a Certificate Signing Request
Create a Certificate Signing Request
```js
const [certificateKey, certificateRequest] = await acme.crypto.createCsr({
commonName: 'test.example.com'
altNames: ['test.example.com'],
});
```
**Example**
Certificate Signing Request with both common and alternative names
> *Warning*: Certificate subject common name has been [deprecated](https://letsencrypt.org/docs/glossary/#def-CN) and its use is [discouraged](https://cabforum.org/uploads/BRv1.2.3.pdf).
```js
const [certificateKey, certificateRequest] = await acme.crypto.createCsr({
keySize: 4096,
commonName: 'test.example.com',
altNames: ['foo.example.com', 'bar.example.com']
altNames: ['foo.example.com', 'bar.example.com'],
});
```
**Example**
Certificate Signing Request with additional information
```js
const [certificateKey, certificateRequest] = await acme.crypto.createCsr({
commonName: 'test.example.com',
altNames: ['test.example.com'],
country: 'US',
state: 'California',
locality: 'Los Angeles',
organization: 'The Company Inc.',
organizationUnit: 'IT Department',
emailAddress: 'contact@example.com'
emailAddress: 'contact@example.com',
});
```
**Example**
Expand All @@ -270,8 +271,9 @@ Certificate Signing Request with ECDSA private key
const certificateKey = await acme.crypto.createPrivateEcdsaKey();

const [, certificateRequest] = await acme.crypto.createCsr({
commonName: 'test.example.com'
altNames: ['test.example.com'],
}, certificateKey);
```
<a name="createAlpnCertificate"></a>

## createAlpnCertificate(authz, keyAuthorization, [keyPem]) ⇒ <code>Promise.&lt;Array.&lt;buffer&gt;&gt;</code>
Expand All @@ -298,6 +300,7 @@ Create a ALPN certificate with ECDSA private key
```js
const alpnKey = await acme.crypto.createPrivateEcdsaKey();
const [, alpnCertificate] = await acme.crypto.createAlpnCertificate(authz, keyAuthorization, alpnKey);
```
<a name="isAlpnCertificateAuthorizationValid"></a>

## isAlpnCertificateAuthorizationValid(certPem, keyAuthorization) ⇒ <code>boolean</code>
Expand Down
11 changes: 6 additions & 5 deletions packages/core/acme-client/docs/forge.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,29 +222,30 @@ Create a Certificate Signing Request
Create a Certificate Signing Request
```js
const [certificateKey, certificateRequest] = await acme.forge.createCsr({
commonName: 'test.example.com'
altNames: ['test.example.com'],
});
```
**Example**
Certificate Signing Request with both common and alternative names
> *Warning*: Certificate subject common name has been [deprecated](https://letsencrypt.org/docs/glossary/#def-CN) and its use is [discouraged](https://cabforum.org/uploads/BRv1.2.3.pdf).
```js
const [certificateKey, certificateRequest] = await acme.forge.createCsr({
keySize: 4096,
commonName: 'test.example.com',
altNames: ['foo.example.com', 'bar.example.com']
altNames: ['foo.example.com', 'bar.example.com'],
});
```
**Example**
Certificate Signing Request with additional information
```js
const [certificateKey, certificateRequest] = await acme.forge.createCsr({
commonName: 'test.example.com',
altNames: ['test.example.com'],
country: 'US',
state: 'California',
locality: 'Los Angeles',
organization: 'The Company Inc.',
organizationUnit: 'IT Department',
emailAddress: 'contact@example.com'
emailAddress: 'contact@example.com',
});
```
**Example**
Expand All @@ -253,5 +254,5 @@ Certificate Signing Request with predefined private key
const certificateKey = await acme.forge.createPrivateKey();

const [, certificateRequest] = await acme.forge.createCsr({
commonName: 'test.example.com'
altNames: ['test.example.com'],
}, certificateKey);
Loading