@distilled.cloud/acme 0.0.0-placeholder → 1.0.0-rc.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +75 -0
- package/lib/credentials.d.ts +50 -0
- package/lib/credentials.d.ts.map +1 -0
- package/lib/credentials.js +57 -0
- package/lib/credentials.js.map +1 -0
- package/lib/errors.d.ts +73 -0
- package/lib/errors.d.ts.map +1 -0
- package/lib/errors.js +50 -0
- package/lib/errors.js.map +1 -0
- package/lib/index.d.ts +30 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +30 -0
- package/lib/index.js.map +1 -0
- package/lib/jose.d.ts +66 -0
- package/lib/jose.d.ts.map +1 -0
- package/lib/jose.js +121 -0
- package/lib/jose.js.map +1 -0
- package/lib/protocol.d.ts +27 -0
- package/lib/protocol.d.ts.map +1 -0
- package/lib/protocol.js +404 -0
- package/lib/protocol.js.map +1 -0
- package/lib/protocol.test.d.ts +2 -0
- package/lib/protocol.test.d.ts.map +1 -0
- package/lib/protocol.test.js +533 -0
- package/lib/protocol.test.js.map +1 -0
- package/lib/retry.d.ts +33 -0
- package/lib/retry.d.ts.map +1 -0
- package/lib/retry.js +33 -0
- package/lib/retry.js.map +1 -0
- package/lib/services/acme.d.ts +509 -0
- package/lib/services/acme.d.ts.map +1 -0
- package/lib/services/acme.js +539 -0
- package/lib/services/acme.js.map +1 -0
- package/lib/services/index.d.ts +2 -0
- package/lib/services/index.d.ts.map +1 -0
- package/lib/services/index.js +3 -0
- package/lib/services/index.js.map +1 -0
- package/lib/traits.d.ts +13 -0
- package/lib/traits.d.ts.map +1 -0
- package/lib/traits.js +13 -0
- package/lib/traits.js.map +1 -0
- package/package.json +79 -6
- package/src/credentials.ts +100 -0
- package/src/errors.ts +91 -0
- package/src/index.ts +29 -0
- package/src/jose.ts +207 -0
- package/src/protocol.test.ts +806 -0
- package/src/protocol.ts +533 -0
- package/src/retry.ts +49 -0
- package/src/services/acme.ts +1096 -0
- package/src/services/index.ts +2 -0
- package/src/traits.ts +46 -0
|
@@ -0,0 +1,1096 @@
|
|
|
1
|
+
import * as API from "@distilled.cloud/core/api";
|
|
2
|
+
import * as C from "@distilled.cloud/core/category";
|
|
3
|
+
// AUTO-GENERATED by scripts/generate.ts from .generated-specs/acme.json (from RFC 8555). Do not edit.
|
|
4
|
+
import * as S from "@distilled.cloud/core/schema";
|
|
5
|
+
import { AcmeProtocol, type AcmeOpError, type AcmeOpContext } from "../protocol.ts";
|
|
6
|
+
import * as Retry from "../retry.ts";
|
|
7
|
+
import * as T from "../traits.ts";
|
|
8
|
+
|
|
9
|
+
export type { AcmeOpError, AcmeOpContext };
|
|
10
|
+
|
|
11
|
+
/** The request specified an account that does not exist. */
|
|
12
|
+
export class AcmeAccountDoesNotExist
|
|
13
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
14
|
+
/*@__PURE__*/ S.TaggedError<AcmeAccountDoesNotExist>()("AcmeAccountDoesNotExist", {
|
|
15
|
+
code: S.Number,
|
|
16
|
+
message: S.String,
|
|
17
|
+
type: S.String,
|
|
18
|
+
detail: S.optional(S.String),
|
|
19
|
+
}),
|
|
20
|
+
[{ message: { matches: "^urn:ietf:params:acme:error:accountDoesNotExist$" } }],
|
|
21
|
+
) {}
|
|
22
|
+
|
|
23
|
+
/** The request specified a certificate to be revoked that has already been revoked. */
|
|
24
|
+
export class AcmeAlreadyRevoked
|
|
25
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
26
|
+
/*@__PURE__*/ S.TaggedError<AcmeAlreadyRevoked>()("AcmeAlreadyRevoked", {
|
|
27
|
+
code: S.Number,
|
|
28
|
+
message: S.String,
|
|
29
|
+
type: S.String,
|
|
30
|
+
detail: S.optional(S.String),
|
|
31
|
+
}),
|
|
32
|
+
[{ message: { matches: "^urn:ietf:params:acme:error:alreadyRevoked$" } }],
|
|
33
|
+
) {}
|
|
34
|
+
|
|
35
|
+
/** The CSR is unacceptable (e.g., due to a short key). */
|
|
36
|
+
export class AcmeBadCsr
|
|
37
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
38
|
+
/*@__PURE__*/ S.TaggedError<AcmeBadCsr>()("AcmeBadCsr", {
|
|
39
|
+
code: S.Number,
|
|
40
|
+
message: S.String,
|
|
41
|
+
type: S.String,
|
|
42
|
+
detail: S.optional(S.String),
|
|
43
|
+
}),
|
|
44
|
+
[{ message: { matches: "^urn:ietf:params:acme:error:badCSR$" } }],
|
|
45
|
+
) {}
|
|
46
|
+
|
|
47
|
+
/** The client sent an unacceptable anti-replay nonce. */
|
|
48
|
+
export class AcmeBadNonce
|
|
49
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
50
|
+
/*@__PURE__*/ S.TaggedError<AcmeBadNonce>()("AcmeBadNonce", {
|
|
51
|
+
code: S.Number,
|
|
52
|
+
message: S.String,
|
|
53
|
+
type: S.String,
|
|
54
|
+
detail: S.optional(S.String),
|
|
55
|
+
}),
|
|
56
|
+
[{ message: { matches: "^urn:ietf:params:acme:error:badNonce$" } }],
|
|
57
|
+
) {}
|
|
58
|
+
|
|
59
|
+
/** The JWS was signed by a public key the server does not support. */
|
|
60
|
+
export class AcmeBadPublicKey
|
|
61
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
62
|
+
/*@__PURE__*/ S.TaggedError<AcmeBadPublicKey>()("AcmeBadPublicKey", {
|
|
63
|
+
code: S.Number,
|
|
64
|
+
message: S.String,
|
|
65
|
+
type: S.String,
|
|
66
|
+
detail: S.optional(S.String),
|
|
67
|
+
}),
|
|
68
|
+
[{ message: { matches: "^urn:ietf:params:acme:error:badPublicKey$" } }],
|
|
69
|
+
) {}
|
|
70
|
+
|
|
71
|
+
/** The revocation reason provided is not allowed by the server. */
|
|
72
|
+
export class AcmeBadRevocationReason
|
|
73
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
74
|
+
/*@__PURE__*/ S.TaggedError<AcmeBadRevocationReason>()("AcmeBadRevocationReason", {
|
|
75
|
+
code: S.Number,
|
|
76
|
+
message: S.String,
|
|
77
|
+
type: S.String,
|
|
78
|
+
detail: S.optional(S.String),
|
|
79
|
+
}),
|
|
80
|
+
[{ message: { matches: "^urn:ietf:params:acme:error:badRevocationReason$" } }],
|
|
81
|
+
) {}
|
|
82
|
+
|
|
83
|
+
/** The JWS was signed with an algorithm the server does not support. */
|
|
84
|
+
export class AcmeBadSignatureAlgorithm
|
|
85
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
86
|
+
/*@__PURE__*/ S.TaggedError<AcmeBadSignatureAlgorithm>()("AcmeBadSignatureAlgorithm", {
|
|
87
|
+
code: S.Number,
|
|
88
|
+
message: S.String,
|
|
89
|
+
type: S.String,
|
|
90
|
+
detail: S.optional(S.String),
|
|
91
|
+
}),
|
|
92
|
+
[{ message: { matches: "^urn:ietf:params:acme:error:badSignatureAlgorithm$" } }],
|
|
93
|
+
) {}
|
|
94
|
+
|
|
95
|
+
/** Certification Authority Authorization (CAA) records forbid the CA from issuing a certificate. */
|
|
96
|
+
export class AcmeCaa
|
|
97
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
98
|
+
/*@__PURE__*/ S.TaggedError<AcmeCaa>()("AcmeCaa", {
|
|
99
|
+
code: S.Number,
|
|
100
|
+
message: S.String,
|
|
101
|
+
type: S.String,
|
|
102
|
+
detail: S.optional(S.String),
|
|
103
|
+
}),
|
|
104
|
+
[{ message: { matches: "^urn:ietf:params:acme:error:caa$" } }],
|
|
105
|
+
) {}
|
|
106
|
+
|
|
107
|
+
/** The server could not connect to validation target. */
|
|
108
|
+
export class AcmeConnection
|
|
109
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
110
|
+
/*@__PURE__*/ S.TaggedError<AcmeConnection>()("AcmeConnection", {
|
|
111
|
+
code: S.Number,
|
|
112
|
+
message: S.String,
|
|
113
|
+
type: S.String,
|
|
114
|
+
detail: S.optional(S.String),
|
|
115
|
+
}),
|
|
116
|
+
[{ message: { matches: "^urn:ietf:params:acme:error:connection$" } }],
|
|
117
|
+
) {}
|
|
118
|
+
|
|
119
|
+
/** There was a problem with a DNS query during identifier validation. */
|
|
120
|
+
export class AcmeDns
|
|
121
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
122
|
+
/*@__PURE__*/ S.TaggedError<AcmeDns>()("AcmeDns", {
|
|
123
|
+
code: S.Number,
|
|
124
|
+
message: S.String,
|
|
125
|
+
type: S.String,
|
|
126
|
+
detail: S.optional(S.String),
|
|
127
|
+
}),
|
|
128
|
+
[{ message: { matches: "^urn:ietf:params:acme:error:dns$" } }],
|
|
129
|
+
) {}
|
|
130
|
+
|
|
131
|
+
/** The request must include a value for the "externalAccountBinding" field. */
|
|
132
|
+
export class AcmeExternalAccountRequired
|
|
133
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
134
|
+
/*@__PURE__*/ S.TaggedError<AcmeExternalAccountRequired>()("AcmeExternalAccountRequired", {
|
|
135
|
+
code: S.Number,
|
|
136
|
+
message: S.String,
|
|
137
|
+
type: S.String,
|
|
138
|
+
detail: S.optional(S.String),
|
|
139
|
+
}),
|
|
140
|
+
[{ message: { matches: "^urn:ietf:params:acme:error:externalAccountRequired$" } }],
|
|
141
|
+
) {}
|
|
142
|
+
|
|
143
|
+
/** Response received didn't match the challenge's requirements. */
|
|
144
|
+
export class AcmeIncorrectResponse
|
|
145
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
146
|
+
/*@__PURE__*/ S.TaggedError<AcmeIncorrectResponse>()("AcmeIncorrectResponse", {
|
|
147
|
+
code: S.Number,
|
|
148
|
+
message: S.String,
|
|
149
|
+
type: S.String,
|
|
150
|
+
detail: S.optional(S.String),
|
|
151
|
+
}),
|
|
152
|
+
[{ message: { matches: "^urn:ietf:params:acme:error:incorrectResponse$" } }],
|
|
153
|
+
) {}
|
|
154
|
+
|
|
155
|
+
/** A contact URL for an account was invalid. */
|
|
156
|
+
export class AcmeInvalidContact
|
|
157
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
158
|
+
/*@__PURE__*/ S.TaggedError<AcmeInvalidContact>()("AcmeInvalidContact", {
|
|
159
|
+
code: S.Number,
|
|
160
|
+
message: S.String,
|
|
161
|
+
type: S.String,
|
|
162
|
+
detail: S.optional(S.String),
|
|
163
|
+
}),
|
|
164
|
+
[{ message: { matches: "^urn:ietf:params:acme:error:invalidContact$" } }],
|
|
165
|
+
) {}
|
|
166
|
+
|
|
167
|
+
/** The request message was malformed. */
|
|
168
|
+
export class AcmeMalformed
|
|
169
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
170
|
+
/*@__PURE__*/ S.TaggedError<AcmeMalformed>()("AcmeMalformed", {
|
|
171
|
+
code: S.Number,
|
|
172
|
+
message: S.String,
|
|
173
|
+
type: S.String,
|
|
174
|
+
detail: S.optional(S.String),
|
|
175
|
+
}),
|
|
176
|
+
[{ message: { matches: "^urn:ietf:params:acme:error:malformed$" } }],
|
|
177
|
+
) {}
|
|
178
|
+
|
|
179
|
+
/** The request attempted to finalize an order that is not ready to be finalized. */
|
|
180
|
+
export class AcmeOrderNotReady
|
|
181
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
182
|
+
/*@__PURE__*/ S.TaggedError<AcmeOrderNotReady>()("AcmeOrderNotReady", {
|
|
183
|
+
code: S.Number,
|
|
184
|
+
message: S.String,
|
|
185
|
+
type: S.String,
|
|
186
|
+
detail: S.optional(S.String),
|
|
187
|
+
}),
|
|
188
|
+
[{ message: { matches: "^urn:ietf:params:acme:error:orderNotReady$" } }],
|
|
189
|
+
) {}
|
|
190
|
+
|
|
191
|
+
/** The request exceeds a rate limit. */
|
|
192
|
+
export class AcmeRateLimited
|
|
193
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
194
|
+
/*@__PURE__*/ S.TaggedError<AcmeRateLimited>()("AcmeRateLimited", {
|
|
195
|
+
retryAfter: S.optional(S.Duration),
|
|
196
|
+
code: S.Number,
|
|
197
|
+
message: S.String,
|
|
198
|
+
type: S.String,
|
|
199
|
+
detail: S.optional(S.String),
|
|
200
|
+
}).pipe(C.withThrottlingError, C.withRetryableError),
|
|
201
|
+
[{ message: { matches: "^urn:ietf:params:acme:error:rateLimited$" } }],
|
|
202
|
+
) {}
|
|
203
|
+
|
|
204
|
+
/** The server will not issue certificates for the identifier. */
|
|
205
|
+
export class AcmeRejectedIdentifier
|
|
206
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
207
|
+
/*@__PURE__*/ S.TaggedError<AcmeRejectedIdentifier>()("AcmeRejectedIdentifier", {
|
|
208
|
+
code: S.Number,
|
|
209
|
+
message: S.String,
|
|
210
|
+
type: S.String,
|
|
211
|
+
detail: S.optional(S.String),
|
|
212
|
+
}),
|
|
213
|
+
[{ message: { matches: "^urn:ietf:params:acme:error:rejectedIdentifier$" } }],
|
|
214
|
+
) {}
|
|
215
|
+
|
|
216
|
+
/** The server experienced an internal error. */
|
|
217
|
+
export class AcmeServerInternal
|
|
218
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
219
|
+
/*@__PURE__*/ S.TaggedError<AcmeServerInternal>()("AcmeServerInternal", {
|
|
220
|
+
code: S.Number,
|
|
221
|
+
message: S.String,
|
|
222
|
+
type: S.String,
|
|
223
|
+
detail: S.optional(S.String),
|
|
224
|
+
}).pipe(C.withRetryableError),
|
|
225
|
+
[{ message: { matches: "^urn:ietf:params:acme:error:serverInternal$" } }],
|
|
226
|
+
) {}
|
|
227
|
+
|
|
228
|
+
/** The server received a TLS error during validation. */
|
|
229
|
+
export class AcmeTls
|
|
230
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
231
|
+
/*@__PURE__*/ S.TaggedError<AcmeTls>()("AcmeTls", {
|
|
232
|
+
code: S.Number,
|
|
233
|
+
message: S.String,
|
|
234
|
+
type: S.String,
|
|
235
|
+
detail: S.optional(S.String),
|
|
236
|
+
}),
|
|
237
|
+
[{ message: { matches: "^urn:ietf:params:acme:error:tls$" } }],
|
|
238
|
+
) {}
|
|
239
|
+
|
|
240
|
+
/** The client lacks sufficient authorization. */
|
|
241
|
+
export class AcmeUnauthorized
|
|
242
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
243
|
+
/*@__PURE__*/ S.TaggedError<AcmeUnauthorized>()("AcmeUnauthorized", {
|
|
244
|
+
code: S.Number,
|
|
245
|
+
message: S.String,
|
|
246
|
+
type: S.String,
|
|
247
|
+
detail: S.optional(S.String),
|
|
248
|
+
}),
|
|
249
|
+
[{ message: { matches: "^urn:ietf:params:acme:error:unauthorized$" } }],
|
|
250
|
+
) {}
|
|
251
|
+
|
|
252
|
+
/** A contact URL for an account used an unsupported protocol scheme. */
|
|
253
|
+
export class AcmeUnsupportedContact
|
|
254
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
255
|
+
/*@__PURE__*/ S.TaggedError<AcmeUnsupportedContact>()("AcmeUnsupportedContact", {
|
|
256
|
+
code: S.Number,
|
|
257
|
+
message: S.String,
|
|
258
|
+
type: S.String,
|
|
259
|
+
detail: S.optional(S.String),
|
|
260
|
+
}),
|
|
261
|
+
[{ message: { matches: "^urn:ietf:params:acme:error:unsupportedContact$" } }],
|
|
262
|
+
) {}
|
|
263
|
+
|
|
264
|
+
/** An identifier is of an unsupported type. */
|
|
265
|
+
export class AcmeUnsupportedIdentifier
|
|
266
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
267
|
+
/*@__PURE__*/ S.TaggedError<AcmeUnsupportedIdentifier>()("AcmeUnsupportedIdentifier", {
|
|
268
|
+
code: S.Number,
|
|
269
|
+
message: S.String,
|
|
270
|
+
type: S.String,
|
|
271
|
+
detail: S.optional(S.String),
|
|
272
|
+
}),
|
|
273
|
+
[{ message: { matches: "^urn:ietf:params:acme:error:unsupportedIdentifier$" } }],
|
|
274
|
+
) {}
|
|
275
|
+
|
|
276
|
+
/** Visit the "instance" URL and take actions specified there. */
|
|
277
|
+
export class AcmeUserActionRequired
|
|
278
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
279
|
+
/*@__PURE__*/ S.TaggedError<AcmeUserActionRequired>()("AcmeUserActionRequired", {
|
|
280
|
+
code: S.Number,
|
|
281
|
+
message: S.String,
|
|
282
|
+
type: S.String,
|
|
283
|
+
detail: S.optional(S.String),
|
|
284
|
+
}),
|
|
285
|
+
[{ message: { matches: "^urn:ietf:params:acme:error:userActionRequired$" } }],
|
|
286
|
+
) {}
|
|
287
|
+
|
|
288
|
+
export interface DeactivateAuthorizationRequest {
|
|
289
|
+
/** Absolute URL of the resource, as returned by the CA. */
|
|
290
|
+
url: string;
|
|
291
|
+
/** Always `deactivated`. */
|
|
292
|
+
status: string;
|
|
293
|
+
}
|
|
294
|
+
export const DeactivateAuthorizationRequest = /*@__PURE__*/ S.suspend(() =>
|
|
295
|
+
S.Struct({
|
|
296
|
+
url: S.String.pipe(T.Label()),
|
|
297
|
+
status: S.String,
|
|
298
|
+
}).pipe(T.Http({ method: "POST", uri: "/authz/{url}/deactivate", code: 200 })),
|
|
299
|
+
).annotate({
|
|
300
|
+
identifier: "DeactivateAuthorizationRequest",
|
|
301
|
+
}) as any as S.Schema<DeactivateAuthorizationRequest>;
|
|
302
|
+
|
|
303
|
+
export interface Identifier {
|
|
304
|
+
/** The type of identifier. This document defines the "dns" identifier type. See the registry defined in Section 9.7.7 for any others. */
|
|
305
|
+
type: string;
|
|
306
|
+
/** The identifier itself. */
|
|
307
|
+
value: string;
|
|
308
|
+
}
|
|
309
|
+
export const Identifier = /*@__PURE__*/ S.suspend(() =>
|
|
310
|
+
S.Struct({
|
|
311
|
+
type: S.String,
|
|
312
|
+
value: S.String,
|
|
313
|
+
}),
|
|
314
|
+
).annotate({ identifier: "Identifier" }) as any as S.Schema<Identifier>;
|
|
315
|
+
|
|
316
|
+
export interface Subproblem {
|
|
317
|
+
/** The error type URI. */
|
|
318
|
+
type?: string;
|
|
319
|
+
/** A human-readable explanation. */
|
|
320
|
+
detail?: string;
|
|
321
|
+
/** The identifier this subproblem is about. */
|
|
322
|
+
identifier?: Identifier;
|
|
323
|
+
}
|
|
324
|
+
export const Subproblem = /*@__PURE__*/ S.suspend(() =>
|
|
325
|
+
S.Struct({
|
|
326
|
+
type: S.optional(S.String),
|
|
327
|
+
detail: S.optional(S.String),
|
|
328
|
+
identifier: S.optional(Identifier),
|
|
329
|
+
}),
|
|
330
|
+
).annotate({ identifier: "Subproblem" }) as any as S.Schema<Subproblem>;
|
|
331
|
+
|
|
332
|
+
export type ProblemSubproblemsList = Array<Subproblem>;
|
|
333
|
+
export const ProblemSubproblemsList = /*@__PURE__*/ S.Array(
|
|
334
|
+
Subproblem,
|
|
335
|
+
) as any as S.Schema<ProblemSubproblemsList>;
|
|
336
|
+
|
|
337
|
+
/** RFC 7807 problem document (RFC 8555 §6.7). */
|
|
338
|
+
export interface Problem {
|
|
339
|
+
/** The error type URI, e.g. `urn:ietf:params:acme:error:malformed`. */
|
|
340
|
+
type?: string;
|
|
341
|
+
/** A human-readable explanation. */
|
|
342
|
+
detail?: string;
|
|
343
|
+
/** The HTTP status code. */
|
|
344
|
+
status?: number;
|
|
345
|
+
/** A URI reference identifying this occurrence. */
|
|
346
|
+
instance?: string;
|
|
347
|
+
/** The identifier the error relates to. */
|
|
348
|
+
identifier?: Identifier;
|
|
349
|
+
/** Errors for individual identifiers (RFC 8555 §6.7.1). */
|
|
350
|
+
subproblems?: ProblemSubproblemsList;
|
|
351
|
+
}
|
|
352
|
+
export const Problem = /*@__PURE__*/ S.suspend(() =>
|
|
353
|
+
S.Struct({
|
|
354
|
+
type: S.optional(S.String),
|
|
355
|
+
detail: S.optional(S.String),
|
|
356
|
+
status: S.optional(S.Number),
|
|
357
|
+
instance: S.optional(S.String),
|
|
358
|
+
identifier: S.optional(Identifier),
|
|
359
|
+
subproblems: S.optional(ProblemSubproblemsList),
|
|
360
|
+
}),
|
|
361
|
+
).annotate({ identifier: "Problem" }) as any as S.Schema<Problem>;
|
|
362
|
+
|
|
363
|
+
/** RFC 8555 §8 */
|
|
364
|
+
export interface Challenge {
|
|
365
|
+
/** The type of challenge encoded in the object. */
|
|
366
|
+
type: string;
|
|
367
|
+
/** The URL to which a response can be posted. */
|
|
368
|
+
url: string;
|
|
369
|
+
/** The status of this challenge. Possible values are "pending", "processing", "valid", and "invalid" (see Section 7.1.6). */
|
|
370
|
+
status: string;
|
|
371
|
+
/** The time at which the server validated this challenge, encoded in the format specified in [RFC3339]. This field is REQUIRED if the "status" field is "valid". */
|
|
372
|
+
validated?: string;
|
|
373
|
+
/** A random value that uniquely identifies the challenge. This value MUST have at least 128 bits of entropy. It MUST NOT contain any characters outside the base64url alphabet and MUST NOT include base64 padding characters ("="). See [RFC4086] for additional information on randomness requirements. */
|
|
374
|
+
token?: string;
|
|
375
|
+
/** Error that occurred while the server was validating the challenge, if any, structured as a problem document [RFC7807]. Multiple errors can be indicated by using subproblems Section 6.7.1. A challenge object with an error MUST have status equal to "invalid". */
|
|
376
|
+
error?: Problem;
|
|
377
|
+
}
|
|
378
|
+
export const Challenge = /*@__PURE__*/ S.suspend(() =>
|
|
379
|
+
S.Struct({
|
|
380
|
+
type: S.String,
|
|
381
|
+
url: S.String,
|
|
382
|
+
status: S.String,
|
|
383
|
+
validated: S.optional(S.String),
|
|
384
|
+
token: S.optional(S.String),
|
|
385
|
+
error: S.optional(Problem),
|
|
386
|
+
}),
|
|
387
|
+
).annotate({ identifier: "Challenge" }) as any as S.Schema<Challenge>;
|
|
388
|
+
|
|
389
|
+
export type AuthorizationChallengesList = Array<Challenge>;
|
|
390
|
+
export const AuthorizationChallengesList = /*@__PURE__*/ S.Array(
|
|
391
|
+
Challenge,
|
|
392
|
+
) as any as S.Schema<AuthorizationChallengesList>;
|
|
393
|
+
|
|
394
|
+
/** RFC 8555 §7.1.4 */
|
|
395
|
+
export interface Authorization {
|
|
396
|
+
/** The identifier that the account is authorized to represent. */
|
|
397
|
+
identifier: Identifier;
|
|
398
|
+
/** The status of this authorization. Possible values are "pending", "valid", "invalid", "deactivated", "expired", and "revoked". See Section 7.1.6. */
|
|
399
|
+
status: string;
|
|
400
|
+
/** The timestamp after which the server will consider this authorization invalid, encoded in the format specified in [RFC3339]. This field is REQUIRED for objects with "valid" in the "status" field. */
|
|
401
|
+
expires?: string;
|
|
402
|
+
/** For pending authorizations, the challenges that the client can fulfill in order to prove possession of the identifier. For valid authorizations, the challenge that was validated. For invalid authorizations, the challenge that was attempted and failed. Each array entry is an object with parameters required to validate the challenge. A client should attempt to fulfill one of these challenges, and a server should consider any one of the challenges sufficient to make the authorization valid. */
|
|
403
|
+
challenges: AuthorizationChallengesList;
|
|
404
|
+
/** This field MUST be present and true for authorizations created as a result of a newOrder request containing a DNS identifier with a value that was a wildcard domain name. For other authorizations, it MUST be absent. Wildcard domain names are described in Section 7.1.3. */
|
|
405
|
+
wildcard?: boolean;
|
|
406
|
+
}
|
|
407
|
+
export const Authorization = /*@__PURE__*/ S.suspend(() =>
|
|
408
|
+
S.Struct({
|
|
409
|
+
identifier: Identifier,
|
|
410
|
+
status: S.String,
|
|
411
|
+
expires: S.optional(S.String),
|
|
412
|
+
challenges: AuthorizationChallengesList,
|
|
413
|
+
wildcard: S.optional(S.Boolean),
|
|
414
|
+
}),
|
|
415
|
+
).annotate({ identifier: "Authorization" }) as any as S.Schema<Authorization>;
|
|
416
|
+
|
|
417
|
+
export interface DownloadCertificateRequest {
|
|
418
|
+
/** Absolute URL of the resource, as returned by the CA. */
|
|
419
|
+
url: string;
|
|
420
|
+
}
|
|
421
|
+
export const DownloadCertificateRequest = /*@__PURE__*/ S.suspend(() =>
|
|
422
|
+
S.Struct({
|
|
423
|
+
url: S.String.pipe(T.Label()),
|
|
424
|
+
}).pipe(T.Http({ method: "POST", uri: "/cert/{url}", code: 200 })),
|
|
425
|
+
).annotate({
|
|
426
|
+
identifier: "DownloadCertificateRequest",
|
|
427
|
+
}) as any as S.Schema<DownloadCertificateRequest>;
|
|
428
|
+
|
|
429
|
+
/** Alternate chain URLs from `Link: <url>;rel="alternate"` headers. */
|
|
430
|
+
export type CertificateChainAlternatesList = Array<string>;
|
|
431
|
+
export const CertificateChainAlternatesList = /*@__PURE__*/ S.Array(
|
|
432
|
+
S.String,
|
|
433
|
+
) as any as S.Schema<CertificateChainAlternatesList>;
|
|
434
|
+
|
|
435
|
+
export interface CertificateChain {
|
|
436
|
+
/** PEM certificate chain (`application/pem-certificate-chain`), leaf first. */
|
|
437
|
+
chain: string;
|
|
438
|
+
/** Alternate chain URLs from `Link: <url>;rel="alternate"` headers. */
|
|
439
|
+
alternates?: CertificateChainAlternatesList;
|
|
440
|
+
}
|
|
441
|
+
export const CertificateChain = /*@__PURE__*/ S.suspend(() =>
|
|
442
|
+
S.Struct({
|
|
443
|
+
chain: S.String,
|
|
444
|
+
alternates: S.optional(CertificateChainAlternatesList),
|
|
445
|
+
}),
|
|
446
|
+
).annotate({ identifier: "CertificateChain" }) as any as S.Schema<CertificateChain>;
|
|
447
|
+
|
|
448
|
+
export interface FinalizeOrderRequest {
|
|
449
|
+
/** Absolute URL of the resource, as returned by the CA. */
|
|
450
|
+
url: string;
|
|
451
|
+
/** A CSR encoding the parameters for the certificate being requested [RFC2986]. The CSR is sent in the base64url-encoded version of the DER format. (Note: Because this field uses base64url, and does not include headers, it is different from PEM.) */
|
|
452
|
+
csr: string;
|
|
453
|
+
}
|
|
454
|
+
export const FinalizeOrderRequest = /*@__PURE__*/ S.suspend(() =>
|
|
455
|
+
S.Struct({
|
|
456
|
+
url: S.String.pipe(T.Label()),
|
|
457
|
+
csr: S.String,
|
|
458
|
+
}).pipe(T.Http({ method: "POST", uri: "/finalize/{url}", code: 200 })),
|
|
459
|
+
).annotate({ identifier: "FinalizeOrderRequest" }) as any as S.Schema<FinalizeOrderRequest>;
|
|
460
|
+
|
|
461
|
+
export type OrderResponseIdentifiersList = Array<Identifier>;
|
|
462
|
+
export const OrderResponseIdentifiersList = /*@__PURE__*/ S.Array(
|
|
463
|
+
Identifier,
|
|
464
|
+
) as any as S.Schema<OrderResponseIdentifiersList>;
|
|
465
|
+
|
|
466
|
+
export type OrderResponseAuthorizationsList = Array<string>;
|
|
467
|
+
export const OrderResponseAuthorizationsList = /*@__PURE__*/ S.Array(
|
|
468
|
+
S.String,
|
|
469
|
+
) as any as S.Schema<OrderResponseAuthorizationsList>;
|
|
470
|
+
|
|
471
|
+
/** RFC 8555 §7.1.3, plus the `Location` header as `location`. */
|
|
472
|
+
export interface OrderResponse {
|
|
473
|
+
/** The status of this order. Possible values are "pending", "ready", "processing", "valid", and "invalid". See Section 7.1.6. */
|
|
474
|
+
status: string;
|
|
475
|
+
/** The timestamp after which the server will consider this order invalid, encoded in the format specified in [RFC3339]. This field is REQUIRED for objects with "pending" or "valid" in the status field. */
|
|
476
|
+
expires?: string;
|
|
477
|
+
/** An array of identifier objects that the order pertains to. */
|
|
478
|
+
identifiers: OrderResponseIdentifiersList;
|
|
479
|
+
/** The requested value of the notBefore field in the certificate, in the date format defined in [RFC3339]. */
|
|
480
|
+
notBefore?: string;
|
|
481
|
+
/** The requested value of the notAfter field in the certificate, in the date format defined in [RFC3339]. */
|
|
482
|
+
notAfter?: string;
|
|
483
|
+
/** The error that occurred while processing the order, if any. This field is structured as a problem document [RFC7807]. */
|
|
484
|
+
error?: Problem;
|
|
485
|
+
/** For pending orders, the authorizations that the client needs to complete before the requested certificate can be issued (see Section 7.5), including unexpired authorizations that the client has completed in the past for identifiers specified in the order. The authorizations required are dictated by server policy; there may not be a 1:1 relationship between the order identifiers and the authorizations required. For final orders (in the "valid" or "invalid" state), the authorizations that were completed. Each entry is a URL from which an authorization can be fetched with a POST-as-GET request. */
|
|
486
|
+
authorizations: OrderResponseAuthorizationsList;
|
|
487
|
+
/** A URL that a CSR must be POSTed to once all of the order's authorizations are satisfied to finalize the order. The result of a successful finalization will be the population of the certificate URL for the order. */
|
|
488
|
+
finalize: string;
|
|
489
|
+
/** A URL for the certificate that has been issued in response to this order. */
|
|
490
|
+
certificate?: string;
|
|
491
|
+
/** The order URL (`Location` header). */
|
|
492
|
+
location?: string;
|
|
493
|
+
}
|
|
494
|
+
export const OrderResponse = /*@__PURE__*/ S.suspend(() =>
|
|
495
|
+
S.Struct({
|
|
496
|
+
status: S.String,
|
|
497
|
+
expires: S.optional(S.String),
|
|
498
|
+
identifiers: OrderResponseIdentifiersList,
|
|
499
|
+
notBefore: S.optional(S.String),
|
|
500
|
+
notAfter: S.optional(S.String),
|
|
501
|
+
error: S.optional(Problem),
|
|
502
|
+
authorizations: OrderResponseAuthorizationsList,
|
|
503
|
+
finalize: S.String,
|
|
504
|
+
certificate: S.optional(S.String),
|
|
505
|
+
location: S.optional(S.String),
|
|
506
|
+
}),
|
|
507
|
+
).annotate({ identifier: "OrderResponse" }) as any as S.Schema<OrderResponse>;
|
|
508
|
+
|
|
509
|
+
export interface GetAuthorizationRequest {
|
|
510
|
+
/** Absolute URL of the resource, as returned by the CA. */
|
|
511
|
+
url: string;
|
|
512
|
+
}
|
|
513
|
+
export const GetAuthorizationRequest = /*@__PURE__*/ S.suspend(() =>
|
|
514
|
+
S.Struct({
|
|
515
|
+
url: S.String.pipe(T.Label()),
|
|
516
|
+
}).pipe(T.Http({ method: "POST", uri: "/authz/{url}", code: 200 })),
|
|
517
|
+
).annotate({ identifier: "GetAuthorizationRequest" }) as any as S.Schema<GetAuthorizationRequest>;
|
|
518
|
+
|
|
519
|
+
export interface GetDirectoryRequest {}
|
|
520
|
+
export const GetDirectoryRequest = /*@__PURE__*/ S.suspend(() =>
|
|
521
|
+
S.Struct({}).pipe(T.Http({ method: "GET", uri: "/directory", code: 200 })),
|
|
522
|
+
).annotate({ identifier: "GetDirectoryRequest" }) as any as S.Schema<GetDirectoryRequest>;
|
|
523
|
+
|
|
524
|
+
export type DirectoryMetaCaaIdentitiesList = Array<string>;
|
|
525
|
+
export const DirectoryMetaCaaIdentitiesList = /*@__PURE__*/ S.Array(
|
|
526
|
+
S.String,
|
|
527
|
+
) as any as S.Schema<DirectoryMetaCaaIdentitiesList>;
|
|
528
|
+
|
|
529
|
+
export interface DirectoryMeta {
|
|
530
|
+
/** A URL identifying the current terms of service. */
|
|
531
|
+
termsOfService?: string;
|
|
532
|
+
/** An HTTP or HTTPS URL locating a website providing more information about the ACME server. */
|
|
533
|
+
website?: string;
|
|
534
|
+
/** The hostnames that the ACME server recognizes as referring to itself for the purposes of CAA record validation as defined in [RFC6844]. Each string MUST represent the same sequence of ASCII code points that the server will expect to see as the "Issuer Domain Name" in a CAA issue or issuewild property tag. This allows clients to determine the correct issuer domain name to use when configuring CAA records. */
|
|
535
|
+
caaIdentities?: DirectoryMetaCaaIdentitiesList;
|
|
536
|
+
/** If this field is present and set to "true", then the CA requires that all newAccount requests include an "externalAccountBinding" field associating the new account with an external account. */
|
|
537
|
+
externalAccountRequired?: boolean;
|
|
538
|
+
}
|
|
539
|
+
export const DirectoryMeta = /*@__PURE__*/ S.suspend(() =>
|
|
540
|
+
S.Struct({
|
|
541
|
+
termsOfService: S.optional(S.String),
|
|
542
|
+
website: S.optional(S.String),
|
|
543
|
+
caaIdentities: S.optional(DirectoryMetaCaaIdentitiesList),
|
|
544
|
+
externalAccountRequired: S.optional(S.Boolean),
|
|
545
|
+
}),
|
|
546
|
+
).annotate({ identifier: "DirectoryMeta" }) as any as S.Schema<DirectoryMeta>;
|
|
547
|
+
|
|
548
|
+
/** RFC 8555 §7.1.1 */
|
|
549
|
+
export interface Directory {
|
|
550
|
+
/** URL of the new nonce resource. */
|
|
551
|
+
newNonce: string;
|
|
552
|
+
/** URL of the new account resource. */
|
|
553
|
+
newAccount: string;
|
|
554
|
+
/** URL of the new order resource. */
|
|
555
|
+
newOrder: string;
|
|
556
|
+
/** URL of the new authorization resource. */
|
|
557
|
+
newAuthz?: string;
|
|
558
|
+
/** URL of the revoke certificate resource. */
|
|
559
|
+
revokeCert: string;
|
|
560
|
+
/** URL of the key change resource. */
|
|
561
|
+
keyChange?: string;
|
|
562
|
+
/** Metadata relating to the service provided by the ACME server. */
|
|
563
|
+
meta?: DirectoryMeta;
|
|
564
|
+
}
|
|
565
|
+
export const Directory = /*@__PURE__*/ S.suspend(() =>
|
|
566
|
+
S.Struct({
|
|
567
|
+
newNonce: S.String,
|
|
568
|
+
newAccount: S.String,
|
|
569
|
+
newOrder: S.String,
|
|
570
|
+
newAuthz: S.optional(S.String),
|
|
571
|
+
revokeCert: S.String,
|
|
572
|
+
keyChange: S.optional(S.String),
|
|
573
|
+
meta: S.optional(DirectoryMeta),
|
|
574
|
+
}),
|
|
575
|
+
).annotate({ identifier: "Directory" }) as any as S.Schema<Directory>;
|
|
576
|
+
|
|
577
|
+
export interface GetOrderRequest {
|
|
578
|
+
/** Absolute URL of the resource, as returned by the CA. */
|
|
579
|
+
url: string;
|
|
580
|
+
}
|
|
581
|
+
export const GetOrderRequest = /*@__PURE__*/ S.suspend(() =>
|
|
582
|
+
S.Struct({
|
|
583
|
+
url: S.String.pipe(T.Label()),
|
|
584
|
+
}).pipe(T.Http({ method: "POST", uri: "/order/{url}", code: 200 })),
|
|
585
|
+
).annotate({ identifier: "GetOrderRequest" }) as any as S.Schema<GetOrderRequest>;
|
|
586
|
+
|
|
587
|
+
export type NewAccountRequestContactList = Array<string>;
|
|
588
|
+
export const NewAccountRequestContactList = /*@__PURE__*/ S.Array(
|
|
589
|
+
S.String,
|
|
590
|
+
) as any as S.Schema<NewAccountRequestContactList>;
|
|
591
|
+
|
|
592
|
+
/** A JWS binding this account to an existing CA account (RFC 8555 §7.3.4). The protocol builds it from the credentials' EAB key id and HMAC key. */
|
|
593
|
+
export interface ExternalAccountBinding {
|
|
594
|
+
protected: string;
|
|
595
|
+
payload: string;
|
|
596
|
+
signature: string;
|
|
597
|
+
}
|
|
598
|
+
export const ExternalAccountBinding = /*@__PURE__*/ S.suspend(() =>
|
|
599
|
+
S.Struct({
|
|
600
|
+
protected: S.String,
|
|
601
|
+
payload: S.String,
|
|
602
|
+
signature: S.String,
|
|
603
|
+
}),
|
|
604
|
+
).annotate({ identifier: "ExternalAccountBinding" }) as any as S.Schema<ExternalAccountBinding>;
|
|
605
|
+
|
|
606
|
+
export interface NewAccountRequest {
|
|
607
|
+
/** Same meaning as the corresponding server field defined in Section 7.1.2. */
|
|
608
|
+
contact?: NewAccountRequestContactList;
|
|
609
|
+
/** Same meaning as the corresponding server field defined in Section 7.1.2. */
|
|
610
|
+
termsOfServiceAgreed?: boolean;
|
|
611
|
+
/** If this field is present with the value "true", then the server MUST NOT create a new account if one does not already exist. This allows a client to look up an account URL based on an account key (see Section 7.3.1). */
|
|
612
|
+
onlyReturnExisting?: boolean;
|
|
613
|
+
/** Same meaning as the corresponding server field defined in Section 7.1.2 */
|
|
614
|
+
externalAccountBinding?: ExternalAccountBinding;
|
|
615
|
+
}
|
|
616
|
+
export const NewAccountRequest = /*@__PURE__*/ S.suspend(() =>
|
|
617
|
+
S.Struct({
|
|
618
|
+
contact: S.optional(NewAccountRequestContactList),
|
|
619
|
+
termsOfServiceAgreed: S.optional(S.Boolean),
|
|
620
|
+
onlyReturnExisting: S.optional(S.Boolean),
|
|
621
|
+
externalAccountBinding: S.optional(ExternalAccountBinding),
|
|
622
|
+
}).pipe(T.Http({ method: "POST", uri: "/newAccount", code: 200 })),
|
|
623
|
+
).annotate({ identifier: "NewAccountRequest" }) as any as S.Schema<NewAccountRequest>;
|
|
624
|
+
|
|
625
|
+
export type AccountResponseContactList = Array<string>;
|
|
626
|
+
export const AccountResponseContactList = /*@__PURE__*/ S.Array(
|
|
627
|
+
S.String,
|
|
628
|
+
) as any as S.Schema<AccountResponseContactList>;
|
|
629
|
+
|
|
630
|
+
/** RFC 8555 §7.1.2, plus the `Location` header as `location`. */
|
|
631
|
+
export interface AccountResponse {
|
|
632
|
+
/** The status of this account. Possible values are "valid", "deactivated", and "revoked". The value "deactivated" should be used to indicate client-initiated deactivation whereas "revoked" should be used to indicate server- initiated deactivation. See Section 7.1.6. */
|
|
633
|
+
status: string;
|
|
634
|
+
/** An array of URLs that the server can use to contact the client for issues related to this account. For example, the server may wish to notify the client about server-initiated revocation or certificate expiration. For information on supported URL schemes, see Section 7.3. */
|
|
635
|
+
contact?: AccountResponseContactList;
|
|
636
|
+
/** Including this field in a newAccount request, with a value of true, indicates the client's agreement with the terms of service. This field cannot be updated by the client. */
|
|
637
|
+
termsOfServiceAgreed?: boolean;
|
|
638
|
+
/** A URL from which a list of orders submitted by this account can be fetched via a POST-as-GET request, as described in Section 7.1.2.1. */
|
|
639
|
+
orders?: string;
|
|
640
|
+
/** The account URL (`Location` header); the `kid` for every later request. */
|
|
641
|
+
location?: string;
|
|
642
|
+
}
|
|
643
|
+
export const AccountResponse = /*@__PURE__*/ S.suspend(() =>
|
|
644
|
+
S.Struct({
|
|
645
|
+
status: S.String,
|
|
646
|
+
contact: S.optional(AccountResponseContactList),
|
|
647
|
+
termsOfServiceAgreed: S.optional(S.Boolean),
|
|
648
|
+
orders: S.optional(S.String),
|
|
649
|
+
location: S.optional(S.String),
|
|
650
|
+
}),
|
|
651
|
+
).annotate({ identifier: "AccountResponse" }) as any as S.Schema<AccountResponse>;
|
|
652
|
+
|
|
653
|
+
export interface NewNonceRequest {}
|
|
654
|
+
export const NewNonceRequest = /*@__PURE__*/ S.suspend(() =>
|
|
655
|
+
S.Struct({}).pipe(T.Http({ method: "GET", uri: "/newNonce", code: 200 })),
|
|
656
|
+
).annotate({ identifier: "NewNonceRequest" }) as any as S.Schema<NewNonceRequest>;
|
|
657
|
+
|
|
658
|
+
export interface NonceResponse {
|
|
659
|
+
/** The `Replay-Nonce` header. */
|
|
660
|
+
replayNonce: string;
|
|
661
|
+
}
|
|
662
|
+
export const NonceResponse = /*@__PURE__*/ S.suspend(() =>
|
|
663
|
+
S.Struct({
|
|
664
|
+
replayNonce: S.String,
|
|
665
|
+
}),
|
|
666
|
+
).annotate({ identifier: "NonceResponse" }) as any as S.Schema<NonceResponse>;
|
|
667
|
+
|
|
668
|
+
export type NewOrderRequestIdentifiersList = Array<Identifier>;
|
|
669
|
+
export const NewOrderRequestIdentifiersList = /*@__PURE__*/ S.Array(
|
|
670
|
+
Identifier,
|
|
671
|
+
) as any as S.Schema<NewOrderRequestIdentifiersList>;
|
|
672
|
+
|
|
673
|
+
export interface NewOrderRequest {
|
|
674
|
+
/** An array of identifier objects that the client wishes to submit an order for. */
|
|
675
|
+
identifiers: NewOrderRequestIdentifiersList;
|
|
676
|
+
/** The requested value of the notBefore field in the certificate, in the date format defined in [RFC3339]. */
|
|
677
|
+
notBefore?: string;
|
|
678
|
+
/** The requested value of the notAfter field in the certificate, in the date format defined in [RFC3339]. */
|
|
679
|
+
notAfter?: string;
|
|
680
|
+
}
|
|
681
|
+
export const NewOrderRequest = /*@__PURE__*/ S.suspend(() =>
|
|
682
|
+
S.Struct({
|
|
683
|
+
identifiers: NewOrderRequestIdentifiersList,
|
|
684
|
+
notBefore: S.optional(S.String),
|
|
685
|
+
notAfter: S.optional(S.String),
|
|
686
|
+
}).pipe(T.Http({ method: "POST", uri: "/newOrder", code: 200 })),
|
|
687
|
+
).annotate({ identifier: "NewOrderRequest" }) as any as S.Schema<NewOrderRequest>;
|
|
688
|
+
|
|
689
|
+
export interface RespondChallengeRequest {
|
|
690
|
+
/** Absolute URL of the resource, as returned by the CA. */
|
|
691
|
+
url: string;
|
|
692
|
+
}
|
|
693
|
+
export const RespondChallengeRequest = /*@__PURE__*/ S.suspend(() =>
|
|
694
|
+
S.Struct({
|
|
695
|
+
url: S.String.pipe(T.Label()),
|
|
696
|
+
}).pipe(T.Http({ method: "POST", uri: "/challenge/{url}", code: 200 })),
|
|
697
|
+
).annotate({ identifier: "RespondChallengeRequest" }) as any as S.Schema<RespondChallengeRequest>;
|
|
698
|
+
|
|
699
|
+
export interface RevokeCertificateRequest {
|
|
700
|
+
/** The certificate to be revoked, in the base64url-encoded version of the DER format. (Note: Because this field uses base64url, and does not include headers, it is different from PEM.) */
|
|
701
|
+
certificate: string;
|
|
702
|
+
/** One of the revocation reasonCodes defined in Section 5.3.1 of [RFC5280] to be used when generating OCSP responses and CRLs. If this field is not set, the server SHOULD omit the reasonCode CRL entry extension when generating OCSP responses and CRLs. The server MAY disallow a subset of reasonCodes from being used by the user. If a request contains a disallowed reasonCode, then the server MUST reject it with the error type "urn:ietf:params:acme:error:badRevocationReason". The problem document detail SHOULD indicate which reasonCodes are allowed. */
|
|
703
|
+
reason?: number;
|
|
704
|
+
}
|
|
705
|
+
export const RevokeCertificateRequest = /*@__PURE__*/ S.suspend(() =>
|
|
706
|
+
S.Struct({
|
|
707
|
+
certificate: S.String,
|
|
708
|
+
reason: S.optional(S.Number),
|
|
709
|
+
}).pipe(T.Http({ method: "POST", uri: "/revokeCert", code: 200 })),
|
|
710
|
+
).annotate({ identifier: "RevokeCertificateRequest" }) as any as S.Schema<RevokeCertificateRequest>;
|
|
711
|
+
|
|
712
|
+
export interface RevokeCertificateResponse {}
|
|
713
|
+
export const RevokeCertificateResponse = /*@__PURE__*/ S.suspend(() => S.Struct({})).annotate({
|
|
714
|
+
identifier: "RevokeCertificateResponse",
|
|
715
|
+
}) as any as S.Schema<RevokeCertificateResponse>;
|
|
716
|
+
|
|
717
|
+
export type UpdateAccountRequestContactList = Array<string>;
|
|
718
|
+
export const UpdateAccountRequestContactList = /*@__PURE__*/ S.Array(
|
|
719
|
+
S.String,
|
|
720
|
+
) as any as S.Schema<UpdateAccountRequestContactList>;
|
|
721
|
+
|
|
722
|
+
export interface UpdateAccountRequest {
|
|
723
|
+
/** Absolute URL of the resource, as returned by the CA. */
|
|
724
|
+
url: string;
|
|
725
|
+
/** An array of URLs that the server can use to contact the client for issues related to this account. For example, the server may wish to notify the client about server-initiated revocation or certificate expiration. For information on supported URL schemes, see Section 7.3. */
|
|
726
|
+
contact?: UpdateAccountRequestContactList;
|
|
727
|
+
/** `deactivated` to deactivate the account (RFC 8555 §7.3.6). */
|
|
728
|
+
status?: string;
|
|
729
|
+
}
|
|
730
|
+
export const UpdateAccountRequest = /*@__PURE__*/ S.suspend(() =>
|
|
731
|
+
S.Struct({
|
|
732
|
+
url: S.String.pipe(T.Label()),
|
|
733
|
+
contact: S.optional(UpdateAccountRequestContactList),
|
|
734
|
+
status: S.optional(S.String),
|
|
735
|
+
}).pipe(T.Http({ method: "POST", uri: "/account/{url}", code: 200 })),
|
|
736
|
+
).annotate({ identifier: "UpdateAccountRequest" }) as any as S.Schema<UpdateAccountRequest>;
|
|
737
|
+
|
|
738
|
+
export type DeactivateAuthorizationError =
|
|
739
|
+
| AcmeAccountDoesNotExist
|
|
740
|
+
| AcmeBadNonce
|
|
741
|
+
| AcmeMalformed
|
|
742
|
+
| AcmeRateLimited
|
|
743
|
+
| AcmeServerInternal
|
|
744
|
+
| AcmeUnauthorized
|
|
745
|
+
| AcmeOpError;
|
|
746
|
+
/** Deactivate the authorization at `url` */
|
|
747
|
+
export const deactivateAuthorization: API.OperationMethod<
|
|
748
|
+
DeactivateAuthorizationRequest,
|
|
749
|
+
Authorization,
|
|
750
|
+
DeactivateAuthorizationError,
|
|
751
|
+
AcmeOpContext
|
|
752
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
753
|
+
input: DeactivateAuthorizationRequest,
|
|
754
|
+
output: Authorization,
|
|
755
|
+
errors: [
|
|
756
|
+
AcmeAccountDoesNotExist,
|
|
757
|
+
AcmeBadNonce,
|
|
758
|
+
AcmeMalformed,
|
|
759
|
+
AcmeRateLimited,
|
|
760
|
+
AcmeServerInternal,
|
|
761
|
+
AcmeUnauthorized,
|
|
762
|
+
],
|
|
763
|
+
protocol: AcmeProtocol,
|
|
764
|
+
retry: Retry.Retry,
|
|
765
|
+
}));
|
|
766
|
+
|
|
767
|
+
export type DownloadCertificateError =
|
|
768
|
+
| AcmeAccountDoesNotExist
|
|
769
|
+
| AcmeBadNonce
|
|
770
|
+
| AcmeMalformed
|
|
771
|
+
| AcmeRateLimited
|
|
772
|
+
| AcmeServerInternal
|
|
773
|
+
| AcmeUnauthorized
|
|
774
|
+
| AcmeOpError;
|
|
775
|
+
/** Download the PEM certificate chain at `url` (POST-as-GET) */
|
|
776
|
+
export const downloadCertificate: API.OperationMethod<
|
|
777
|
+
DownloadCertificateRequest,
|
|
778
|
+
CertificateChain,
|
|
779
|
+
DownloadCertificateError,
|
|
780
|
+
AcmeOpContext
|
|
781
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
782
|
+
input: DownloadCertificateRequest,
|
|
783
|
+
output: CertificateChain,
|
|
784
|
+
errors: [
|
|
785
|
+
AcmeAccountDoesNotExist,
|
|
786
|
+
AcmeBadNonce,
|
|
787
|
+
AcmeMalformed,
|
|
788
|
+
AcmeRateLimited,
|
|
789
|
+
AcmeServerInternal,
|
|
790
|
+
AcmeUnauthorized,
|
|
791
|
+
],
|
|
792
|
+
protocol: AcmeProtocol,
|
|
793
|
+
retry: Retry.Retry,
|
|
794
|
+
}));
|
|
795
|
+
|
|
796
|
+
export type FinalizeOrderError =
|
|
797
|
+
| AcmeAccountDoesNotExist
|
|
798
|
+
| AcmeBadCsr
|
|
799
|
+
| AcmeBadNonce
|
|
800
|
+
| AcmeMalformed
|
|
801
|
+
| AcmeOrderNotReady
|
|
802
|
+
| AcmeRateLimited
|
|
803
|
+
| AcmeServerInternal
|
|
804
|
+
| AcmeUnauthorized
|
|
805
|
+
| AcmeOpError;
|
|
806
|
+
/** Submit the CSR to the order's finalize URL */
|
|
807
|
+
export const finalizeOrder: API.OperationMethod<
|
|
808
|
+
FinalizeOrderRequest,
|
|
809
|
+
OrderResponse,
|
|
810
|
+
FinalizeOrderError,
|
|
811
|
+
AcmeOpContext
|
|
812
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
813
|
+
input: FinalizeOrderRequest,
|
|
814
|
+
output: OrderResponse,
|
|
815
|
+
errors: [
|
|
816
|
+
AcmeAccountDoesNotExist,
|
|
817
|
+
AcmeBadCsr,
|
|
818
|
+
AcmeBadNonce,
|
|
819
|
+
AcmeMalformed,
|
|
820
|
+
AcmeOrderNotReady,
|
|
821
|
+
AcmeRateLimited,
|
|
822
|
+
AcmeServerInternal,
|
|
823
|
+
AcmeUnauthorized,
|
|
824
|
+
],
|
|
825
|
+
protocol: AcmeProtocol,
|
|
826
|
+
retry: Retry.Retry,
|
|
827
|
+
}));
|
|
828
|
+
|
|
829
|
+
export type GetAuthorizationError =
|
|
830
|
+
| AcmeAccountDoesNotExist
|
|
831
|
+
| AcmeBadNonce
|
|
832
|
+
| AcmeMalformed
|
|
833
|
+
| AcmeRateLimited
|
|
834
|
+
| AcmeServerInternal
|
|
835
|
+
| AcmeUnauthorized
|
|
836
|
+
| AcmeOpError;
|
|
837
|
+
/** Fetch the authorization at `url` (POST-as-GET) */
|
|
838
|
+
export const getAuthorization: API.OperationMethod<
|
|
839
|
+
GetAuthorizationRequest,
|
|
840
|
+
Authorization,
|
|
841
|
+
GetAuthorizationError,
|
|
842
|
+
AcmeOpContext
|
|
843
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
844
|
+
input: GetAuthorizationRequest,
|
|
845
|
+
output: Authorization,
|
|
846
|
+
errors: [
|
|
847
|
+
AcmeAccountDoesNotExist,
|
|
848
|
+
AcmeBadNonce,
|
|
849
|
+
AcmeMalformed,
|
|
850
|
+
AcmeRateLimited,
|
|
851
|
+
AcmeServerInternal,
|
|
852
|
+
AcmeUnauthorized,
|
|
853
|
+
],
|
|
854
|
+
protocol: AcmeProtocol,
|
|
855
|
+
retry: Retry.Retry,
|
|
856
|
+
}));
|
|
857
|
+
|
|
858
|
+
export type GetDirectoryError = AcmeOpError;
|
|
859
|
+
/** Fetch the CA's directory of resource URLs */
|
|
860
|
+
export const getDirectory: API.OperationMethod<
|
|
861
|
+
GetDirectoryRequest,
|
|
862
|
+
Directory,
|
|
863
|
+
GetDirectoryError,
|
|
864
|
+
AcmeOpContext
|
|
865
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
866
|
+
input: GetDirectoryRequest,
|
|
867
|
+
output: Directory,
|
|
868
|
+
errors: [],
|
|
869
|
+
protocol: AcmeProtocol,
|
|
870
|
+
retry: Retry.Retry,
|
|
871
|
+
}));
|
|
872
|
+
|
|
873
|
+
export type GetOrderError =
|
|
874
|
+
| AcmeAccountDoesNotExist
|
|
875
|
+
| AcmeBadNonce
|
|
876
|
+
| AcmeMalformed
|
|
877
|
+
| AcmeRateLimited
|
|
878
|
+
| AcmeServerInternal
|
|
879
|
+
| AcmeUnauthorized
|
|
880
|
+
| AcmeOpError;
|
|
881
|
+
/** Fetch the order at `url` (POST-as-GET) */
|
|
882
|
+
export const getOrder: API.OperationMethod<
|
|
883
|
+
GetOrderRequest,
|
|
884
|
+
OrderResponse,
|
|
885
|
+
GetOrderError,
|
|
886
|
+
AcmeOpContext
|
|
887
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
888
|
+
input: GetOrderRequest,
|
|
889
|
+
output: OrderResponse,
|
|
890
|
+
errors: [
|
|
891
|
+
AcmeAccountDoesNotExist,
|
|
892
|
+
AcmeBadNonce,
|
|
893
|
+
AcmeMalformed,
|
|
894
|
+
AcmeRateLimited,
|
|
895
|
+
AcmeServerInternal,
|
|
896
|
+
AcmeUnauthorized,
|
|
897
|
+
],
|
|
898
|
+
protocol: AcmeProtocol,
|
|
899
|
+
retry: Retry.Retry,
|
|
900
|
+
}));
|
|
901
|
+
|
|
902
|
+
export type NewAccountError =
|
|
903
|
+
| AcmeAccountDoesNotExist
|
|
904
|
+
| AcmeBadNonce
|
|
905
|
+
| AcmeBadPublicKey
|
|
906
|
+
| AcmeBadSignatureAlgorithm
|
|
907
|
+
| AcmeExternalAccountRequired
|
|
908
|
+
| AcmeInvalidContact
|
|
909
|
+
| AcmeMalformed
|
|
910
|
+
| AcmeRateLimited
|
|
911
|
+
| AcmeServerInternal
|
|
912
|
+
| AcmeUnauthorized
|
|
913
|
+
| AcmeUnsupportedContact
|
|
914
|
+
| AcmeUserActionRequired
|
|
915
|
+
| AcmeOpError;
|
|
916
|
+
/** Create an account, or find the existing account for this key */
|
|
917
|
+
export const newAccount: API.OperationMethod<
|
|
918
|
+
NewAccountRequest,
|
|
919
|
+
AccountResponse,
|
|
920
|
+
NewAccountError,
|
|
921
|
+
AcmeOpContext
|
|
922
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
923
|
+
input: NewAccountRequest,
|
|
924
|
+
output: AccountResponse,
|
|
925
|
+
errors: [
|
|
926
|
+
AcmeAccountDoesNotExist,
|
|
927
|
+
AcmeBadNonce,
|
|
928
|
+
AcmeBadPublicKey,
|
|
929
|
+
AcmeBadSignatureAlgorithm,
|
|
930
|
+
AcmeExternalAccountRequired,
|
|
931
|
+
AcmeInvalidContact,
|
|
932
|
+
AcmeMalformed,
|
|
933
|
+
AcmeRateLimited,
|
|
934
|
+
AcmeServerInternal,
|
|
935
|
+
AcmeUnauthorized,
|
|
936
|
+
AcmeUnsupportedContact,
|
|
937
|
+
AcmeUserActionRequired,
|
|
938
|
+
],
|
|
939
|
+
protocol: AcmeProtocol,
|
|
940
|
+
retry: Retry.Retry,
|
|
941
|
+
}));
|
|
942
|
+
|
|
943
|
+
export type NewNonceError = AcmeOpError;
|
|
944
|
+
/** Get a fresh anti-replay nonce (the `Replay-Nonce` header) */
|
|
945
|
+
export const newNonce: API.OperationMethod<
|
|
946
|
+
NewNonceRequest,
|
|
947
|
+
NonceResponse,
|
|
948
|
+
NewNonceError,
|
|
949
|
+
AcmeOpContext
|
|
950
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
951
|
+
input: NewNonceRequest,
|
|
952
|
+
output: NonceResponse,
|
|
953
|
+
errors: [],
|
|
954
|
+
protocol: AcmeProtocol,
|
|
955
|
+
retry: Retry.Retry,
|
|
956
|
+
}));
|
|
957
|
+
|
|
958
|
+
export type NewOrderError =
|
|
959
|
+
| AcmeAccountDoesNotExist
|
|
960
|
+
| AcmeBadNonce
|
|
961
|
+
| AcmeMalformed
|
|
962
|
+
| AcmeRateLimited
|
|
963
|
+
| AcmeRejectedIdentifier
|
|
964
|
+
| AcmeServerInternal
|
|
965
|
+
| AcmeUnauthorized
|
|
966
|
+
| AcmeUnsupportedIdentifier
|
|
967
|
+
| AcmeUserActionRequired
|
|
968
|
+
| AcmeOpError;
|
|
969
|
+
/** Create an order for a set of identifiers */
|
|
970
|
+
export const newOrder: API.OperationMethod<
|
|
971
|
+
NewOrderRequest,
|
|
972
|
+
OrderResponse,
|
|
973
|
+
NewOrderError,
|
|
974
|
+
AcmeOpContext
|
|
975
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
976
|
+
input: NewOrderRequest,
|
|
977
|
+
output: OrderResponse,
|
|
978
|
+
errors: [
|
|
979
|
+
AcmeAccountDoesNotExist,
|
|
980
|
+
AcmeBadNonce,
|
|
981
|
+
AcmeMalformed,
|
|
982
|
+
AcmeRateLimited,
|
|
983
|
+
AcmeRejectedIdentifier,
|
|
984
|
+
AcmeServerInternal,
|
|
985
|
+
AcmeUnauthorized,
|
|
986
|
+
AcmeUnsupportedIdentifier,
|
|
987
|
+
AcmeUserActionRequired,
|
|
988
|
+
],
|
|
989
|
+
protocol: AcmeProtocol,
|
|
990
|
+
retry: Retry.Retry,
|
|
991
|
+
}));
|
|
992
|
+
|
|
993
|
+
export type RespondChallengeError =
|
|
994
|
+
| AcmeAccountDoesNotExist
|
|
995
|
+
| AcmeBadNonce
|
|
996
|
+
| AcmeCaa
|
|
997
|
+
| AcmeConnection
|
|
998
|
+
| AcmeDns
|
|
999
|
+
| AcmeIncorrectResponse
|
|
1000
|
+
| AcmeMalformed
|
|
1001
|
+
| AcmeRateLimited
|
|
1002
|
+
| AcmeServerInternal
|
|
1003
|
+
| AcmeTls
|
|
1004
|
+
| AcmeUnauthorized
|
|
1005
|
+
| AcmeOpError;
|
|
1006
|
+
/** Tell the CA the challenge at `url` is ready to be validated */
|
|
1007
|
+
export const respondChallenge: API.OperationMethod<
|
|
1008
|
+
RespondChallengeRequest,
|
|
1009
|
+
Challenge,
|
|
1010
|
+
RespondChallengeError,
|
|
1011
|
+
AcmeOpContext
|
|
1012
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
1013
|
+
input: RespondChallengeRequest,
|
|
1014
|
+
output: Challenge,
|
|
1015
|
+
errors: [
|
|
1016
|
+
AcmeAccountDoesNotExist,
|
|
1017
|
+
AcmeBadNonce,
|
|
1018
|
+
AcmeCaa,
|
|
1019
|
+
AcmeConnection,
|
|
1020
|
+
AcmeDns,
|
|
1021
|
+
AcmeIncorrectResponse,
|
|
1022
|
+
AcmeMalformed,
|
|
1023
|
+
AcmeRateLimited,
|
|
1024
|
+
AcmeServerInternal,
|
|
1025
|
+
AcmeTls,
|
|
1026
|
+
AcmeUnauthorized,
|
|
1027
|
+
],
|
|
1028
|
+
protocol: AcmeProtocol,
|
|
1029
|
+
retry: Retry.Retry,
|
|
1030
|
+
}));
|
|
1031
|
+
|
|
1032
|
+
export type RevokeCertificateError =
|
|
1033
|
+
| AcmeAccountDoesNotExist
|
|
1034
|
+
| AcmeAlreadyRevoked
|
|
1035
|
+
| AcmeBadNonce
|
|
1036
|
+
| AcmeBadRevocationReason
|
|
1037
|
+
| AcmeMalformed
|
|
1038
|
+
| AcmeRateLimited
|
|
1039
|
+
| AcmeServerInternal
|
|
1040
|
+
| AcmeUnauthorized
|
|
1041
|
+
| AcmeOpError;
|
|
1042
|
+
/** Revoke a certificate */
|
|
1043
|
+
export const revokeCertificate: API.OperationMethod<
|
|
1044
|
+
RevokeCertificateRequest,
|
|
1045
|
+
RevokeCertificateResponse,
|
|
1046
|
+
RevokeCertificateError,
|
|
1047
|
+
AcmeOpContext
|
|
1048
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
1049
|
+
input: RevokeCertificateRequest,
|
|
1050
|
+
output: RevokeCertificateResponse,
|
|
1051
|
+
errors: [
|
|
1052
|
+
AcmeAccountDoesNotExist,
|
|
1053
|
+
AcmeAlreadyRevoked,
|
|
1054
|
+
AcmeBadNonce,
|
|
1055
|
+
AcmeBadRevocationReason,
|
|
1056
|
+
AcmeMalformed,
|
|
1057
|
+
AcmeRateLimited,
|
|
1058
|
+
AcmeServerInternal,
|
|
1059
|
+
AcmeUnauthorized,
|
|
1060
|
+
],
|
|
1061
|
+
protocol: AcmeProtocol,
|
|
1062
|
+
retry: Retry.Retry,
|
|
1063
|
+
}));
|
|
1064
|
+
|
|
1065
|
+
export type UpdateAccountError =
|
|
1066
|
+
| AcmeAccountDoesNotExist
|
|
1067
|
+
| AcmeBadNonce
|
|
1068
|
+
| AcmeInvalidContact
|
|
1069
|
+
| AcmeMalformed
|
|
1070
|
+
| AcmeRateLimited
|
|
1071
|
+
| AcmeServerInternal
|
|
1072
|
+
| AcmeUnauthorized
|
|
1073
|
+
| AcmeUnsupportedContact
|
|
1074
|
+
| AcmeOpError;
|
|
1075
|
+
/** Update (or deactivate) the account at `url` */
|
|
1076
|
+
export const updateAccount: API.OperationMethod<
|
|
1077
|
+
UpdateAccountRequest,
|
|
1078
|
+
AccountResponse,
|
|
1079
|
+
UpdateAccountError,
|
|
1080
|
+
AcmeOpContext
|
|
1081
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
1082
|
+
input: UpdateAccountRequest,
|
|
1083
|
+
output: AccountResponse,
|
|
1084
|
+
errors: [
|
|
1085
|
+
AcmeAccountDoesNotExist,
|
|
1086
|
+
AcmeBadNonce,
|
|
1087
|
+
AcmeInvalidContact,
|
|
1088
|
+
AcmeMalformed,
|
|
1089
|
+
AcmeRateLimited,
|
|
1090
|
+
AcmeServerInternal,
|
|
1091
|
+
AcmeUnauthorized,
|
|
1092
|
+
AcmeUnsupportedContact,
|
|
1093
|
+
],
|
|
1094
|
+
protocol: AcmeProtocol,
|
|
1095
|
+
retry: Retry.Retry,
|
|
1096
|
+
}));
|