@andrewheberle/serverless-ssh-ca 0.22.0 → 0.24.0

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.
Files changed (122) hide show
  1. package/README.md +174 -1
  2. package/dist/api/operations.d.ts +50 -0
  3. package/dist/api/operations.d.ts.map +1 -0
  4. package/dist/api/operations.js +264 -0
  5. package/dist/api/operations.js.map +1 -0
  6. package/dist/api/schema.d.ts +72 -0
  7. package/dist/api/schema.d.ts.map +1 -0
  8. package/dist/api/schema.js +114 -0
  9. package/dist/api/schema.js.map +1 -0
  10. package/dist/api/v3/index.d.ts.map +1 -1
  11. package/dist/api/v3/index.js +13 -202
  12. package/dist/api/v3/index.js.map +1 -1
  13. package/dist/api/v3/schema.d.ts +23 -68
  14. package/dist/api/v3/schema.d.ts.map +1 -1
  15. package/dist/api/v3/schema.js +18 -104
  16. package/dist/api/v3/schema.js.map +1 -1
  17. package/dist/api/v4/index.d.ts +8 -0
  18. package/dist/api/v4/index.d.ts.map +1 -0
  19. package/dist/api/v4/index.js +155 -0
  20. package/dist/api/v4/index.js.map +1 -0
  21. package/dist/api/v4/schema.d.ts +268 -0
  22. package/dist/api/v4/schema.d.ts.map +1 -0
  23. package/dist/api/v4/schema.js +186 -0
  24. package/dist/api/v4/schema.js.map +1 -0
  25. package/dist/certificate.d.ts +9 -6
  26. package/dist/certificate.d.ts.map +1 -1
  27. package/dist/certificate.js +55 -99
  28. package/dist/certificate.js.map +1 -1
  29. package/dist/db/index.d.ts +68 -9
  30. package/dist/db/index.d.ts.map +1 -1
  31. package/dist/db/index.js +165 -49
  32. package/dist/db/index.js.map +1 -1
  33. package/dist/db/migrations/0003_krl_revision.d.ts +3 -0
  34. package/dist/db/migrations/0003_krl_revision.d.ts.map +1 -0
  35. package/dist/db/migrations/0003_krl_revision.js +14 -0
  36. package/dist/db/migrations/0003_krl_revision.js.map +1 -0
  37. package/dist/db/migrations/index.d.ts.map +1 -1
  38. package/dist/db/migrations/index.js +2 -0
  39. package/dist/db/migrations/index.js.map +1 -1
  40. package/dist/db/types.d.ts +2 -0
  41. package/dist/db/types.d.ts.map +1 -1
  42. package/dist/index.d.ts +5 -2
  43. package/dist/index.d.ts.map +1 -1
  44. package/dist/index.js +4 -2
  45. package/dist/index.js.map +1 -1
  46. package/dist/krl.d.ts +3 -2
  47. package/dist/krl.d.ts.map +1 -1
  48. package/dist/krl.js +12 -165
  49. package/dist/krl.js.map +1 -1
  50. package/dist/node/cache.d.ts +21 -0
  51. package/dist/node/cache.d.ts.map +1 -0
  52. package/dist/node/cache.js +49 -0
  53. package/dist/node/cache.js.map +1 -0
  54. package/dist/node/env.d.ts +6 -3
  55. package/dist/node/env.d.ts.map +1 -1
  56. package/dist/node/env.js +4 -3
  57. package/dist/node/env.js.map +1 -1
  58. package/dist/node/index.d.ts +1 -0
  59. package/dist/node/index.d.ts.map +1 -1
  60. package/dist/node/index.js +1 -0
  61. package/dist/node/index.js.map +1 -1
  62. package/dist/proof.d.ts +36 -7
  63. package/dist/proof.d.ts.map +1 -1
  64. package/dist/proof.js +53 -21
  65. package/dist/proof.js.map +1 -1
  66. package/dist/router.d.ts +25 -1
  67. package/dist/router.d.ts.map +1 -1
  68. package/dist/router.js +41 -2
  69. package/dist/router.js.map +1 -1
  70. package/dist/ssh/certificate.d.ts +93 -0
  71. package/dist/ssh/certificate.d.ts.map +1 -0
  72. package/dist/ssh/certificate.js +178 -0
  73. package/dist/ssh/certificate.js.map +1 -0
  74. package/dist/ssh/encoding.d.ts +41 -0
  75. package/dist/ssh/encoding.d.ts.map +1 -0
  76. package/dist/ssh/encoding.js +70 -0
  77. package/dist/ssh/encoding.js.map +1 -0
  78. package/dist/ssh/keys.d.ts +92 -0
  79. package/dist/ssh/keys.d.ts.map +1 -0
  80. package/dist/ssh/keys.js +277 -0
  81. package/dist/ssh/keys.js.map +1 -0
  82. package/dist/ssh/signer.d.ts +35 -0
  83. package/dist/ssh/signer.d.ts.map +1 -0
  84. package/dist/ssh/signer.js +99 -0
  85. package/dist/ssh/signer.js.map +1 -0
  86. package/dist/types.d.ts +64 -19
  87. package/dist/types.d.ts.map +1 -1
  88. package/dist/utils.d.ts +107 -21
  89. package/dist/utils.d.ts.map +1 -1
  90. package/dist/utils.js +251 -65
  91. package/dist/utils.js.map +1 -1
  92. package/dist/verify.d.ts +17 -5
  93. package/dist/verify.d.ts.map +1 -1
  94. package/dist/verify.js +47 -9
  95. package/dist/verify.js.map +1 -1
  96. package/openapi.json +1942 -1
  97. package/package.json +4 -3
  98. package/src/api/operations.ts +314 -0
  99. package/src/api/schema.ts +146 -0
  100. package/src/api/v3/index.ts +21 -248
  101. package/src/api/v3/schema.ts +36 -128
  102. package/src/api/v4/index.ts +266 -0
  103. package/src/api/v4/schema.ts +241 -0
  104. package/src/certificate.ts +62 -123
  105. package/src/db/index.ts +196 -56
  106. package/src/db/migrations/0003_krl_revision.ts +15 -0
  107. package/src/db/migrations/index.ts +2 -0
  108. package/src/db/types.ts +2 -0
  109. package/src/index.ts +6 -4
  110. package/src/krl.ts +13 -197
  111. package/src/node/cache.ts +62 -0
  112. package/src/node/env.ts +6 -5
  113. package/src/node/index.ts +1 -0
  114. package/src/proof.ts +65 -31
  115. package/src/router.ts +67 -3
  116. package/src/ssh/certificate.ts +236 -0
  117. package/src/ssh/encoding.ts +81 -0
  118. package/src/ssh/keys.ts +327 -0
  119. package/src/ssh/signer.ts +129 -0
  120. package/src/types.ts +60 -20
  121. package/src/utils.ts +285 -81
  122. package/src/verify.ts +54 -14
@@ -0,0 +1,268 @@
1
+ import z from "zod";
2
+ import type { SshCaBindings } from "../../types.js";
3
+ import { CertificateType } from "../../db/types.js";
4
+ /**
5
+ * The name of the header carrying the proof of possession of the private key
6
+ */
7
+ export declare const ProofHeader = "Proof-Of-Possession";
8
+ export declare const createProofSchema: (env: SshCaBindings) => z.ZodPipe<z.ZodString, z.ZodTransform<import("../../proof.js").ProofOfPossession, string>>;
9
+ /**
10
+ * Headers for a request authorised by a proof of possession alone
11
+ */
12
+ export declare const createProofHeaderSchema: (env: SshCaBindings) => z.ZodObject<{
13
+ "Proof-Of-Possession": z.ZodPipe<z.ZodString, z.ZodTransform<import("../../proof.js").ProofOfPossession, string>>;
14
+ }, z.core.$strip>;
15
+ /**
16
+ * Headers for a request authenticated with an access token and authorised by
17
+ * a proof of possession
18
+ */
19
+ export declare const createAuthenticatedHeaderSchema: (env: SshCaBindings) => z.ZodObject<{
20
+ Authorization: z.ZodPipe<z.ZodString, z.ZodTransform<{
21
+ email: string;
22
+ sub: string;
23
+ }, string>>;
24
+ "Proof-Of-Possession": z.ZodPipe<z.ZodString, z.ZodTransform<import("../../proof.js").ProofOfPossession, string>>;
25
+ }, z.core.$strip>;
26
+ export declare const serialParamSchema: z.ZodObject<{
27
+ serial: z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>;
28
+ }, z.core.$strip>;
29
+ export declare const createCaPublicKeyEndpointSchema: () => {
30
+ tags: string[];
31
+ summary: string;
32
+ description: string;
33
+ responses: {
34
+ "200": {
35
+ content: {
36
+ "text/plain": {
37
+ schema: z.ZodString;
38
+ };
39
+ };
40
+ description: string;
41
+ };
42
+ };
43
+ operationId: string;
44
+ };
45
+ export declare const createGetRevocationListEndpointSchema: (certificateType: CertificateType) => {
46
+ tags: ("Host" | "User")[];
47
+ summary: string;
48
+ description: string;
49
+ responses: {
50
+ "200": {
51
+ content: {
52
+ "application/json": {
53
+ schema: z.ZodType<{
54
+ krl: Buffer<ArrayBuffer>;
55
+ signature: string;
56
+ }, unknown, z.core.$ZodTypeInternals<{
57
+ krl: Buffer<ArrayBuffer>;
58
+ signature: string;
59
+ }, unknown>>;
60
+ };
61
+ };
62
+ description: string;
63
+ };
64
+ };
65
+ operationId: string;
66
+ };
67
+ export declare const issueUserCertificateEndpointBodySchema: (env: SshCaBindings) => z.ZodObject<{
68
+ public_key: z.ZodPipe<z.ZodPipe<z.ZodBase64, z.ZodTransform<Buffer<ArrayBuffer>, string>>, z.ZodTransform<import("../../ssh/keys.js").PublicKey, Buffer<ArrayBuffer>>>;
69
+ identity: z.ZodPipe<z.ZodString, z.ZodTransform<{
70
+ sub: string;
71
+ principals: string[];
72
+ }, string>>;
73
+ extensions: z.ZodDefault<z.ZodArray<z.ZodString>>;
74
+ lifetime: z.ZodDefault<z.ZodInt>;
75
+ }, z.core.$strip>;
76
+ export declare const createIssueUserCertificateEndpointSchema: (env: SshCaBindings) => {
77
+ tags: ("Host" | "User")[];
78
+ operationId: string;
79
+ summary: string;
80
+ description: string;
81
+ security: {
82
+ oidcAuth: never[];
83
+ }[];
84
+ request: {
85
+ headers: z.ZodObject<{
86
+ Authorization: z.ZodPipe<z.ZodString, z.ZodTransform<{
87
+ email: string;
88
+ sub: string;
89
+ }, string>>;
90
+ "Proof-Of-Possession": z.ZodPipe<z.ZodString, z.ZodTransform<import("../../proof.js").ProofOfPossession, string>>;
91
+ }, z.core.$strip>;
92
+ body: {
93
+ content: {
94
+ "application/json": {
95
+ schema: z.ZodType<{
96
+ public_key: import("../../ssh/keys.js").PublicKey;
97
+ identity: {
98
+ sub: string;
99
+ principals: string[];
100
+ };
101
+ extensions: string[];
102
+ lifetime: number;
103
+ }, unknown, z.core.$ZodTypeInternals<{
104
+ public_key: import("../../ssh/keys.js").PublicKey;
105
+ identity: {
106
+ sub: string;
107
+ principals: string[];
108
+ };
109
+ extensions: string[];
110
+ lifetime: number;
111
+ }, unknown>>;
112
+ };
113
+ };
114
+ };
115
+ };
116
+ responses: {
117
+ "200": {
118
+ content: {
119
+ "application/json": {
120
+ schema: z.ZodType<{
121
+ certificate: Buffer<ArrayBuffer>;
122
+ }, unknown, z.core.$ZodTypeInternals<{
123
+ certificate: Buffer<ArrayBuffer>;
124
+ }, unknown>>;
125
+ };
126
+ };
127
+ description: string;
128
+ };
129
+ };
130
+ };
131
+ export declare const issueHostCertificateEndpointBodySchema: (env: SshCaBindings) => z.ZodObject<{
132
+ public_key: z.ZodPipe<z.ZodPipe<z.ZodBase64, z.ZodTransform<Buffer<ArrayBuffer>, string>>, z.ZodTransform<import("../../ssh/keys.js").PublicKey, Buffer<ArrayBuffer>>>;
133
+ identity: z.ZodPipe<z.ZodString, z.ZodTransform<{
134
+ sub: string;
135
+ principals: string[];
136
+ }, string>>;
137
+ principals: z.ZodArray<z.ZodString>;
138
+ lifetime: z.ZodDefault<z.ZodInt>;
139
+ }, z.core.$strip>;
140
+ export declare const createIssueHostCertificateEndpointSchema: (env: SshCaBindings) => {
141
+ tags: ("Host" | "User")[];
142
+ operationId: string;
143
+ summary: string;
144
+ description: string;
145
+ security: {
146
+ oidcAuth: never[];
147
+ }[];
148
+ request: {
149
+ headers: z.ZodObject<{
150
+ Authorization: z.ZodPipe<z.ZodString, z.ZodTransform<{
151
+ email: string;
152
+ sub: string;
153
+ }, string>>;
154
+ "Proof-Of-Possession": z.ZodPipe<z.ZodString, z.ZodTransform<import("../../proof.js").ProofOfPossession, string>>;
155
+ }, z.core.$strip>;
156
+ body: {
157
+ content: {
158
+ "application/json": {
159
+ schema: z.ZodType<{
160
+ public_key: import("../../ssh/keys.js").PublicKey;
161
+ identity: {
162
+ sub: string;
163
+ principals: string[];
164
+ };
165
+ principals: string[];
166
+ lifetime: number;
167
+ }, unknown, z.core.$ZodTypeInternals<{
168
+ public_key: import("../../ssh/keys.js").PublicKey;
169
+ identity: {
170
+ sub: string;
171
+ principals: string[];
172
+ };
173
+ principals: string[];
174
+ lifetime: number;
175
+ }, unknown>>;
176
+ };
177
+ };
178
+ };
179
+ };
180
+ responses: {
181
+ "200": {
182
+ content: {
183
+ "application/json": {
184
+ schema: z.ZodType<{
185
+ certificate: Buffer<ArrayBuffer>;
186
+ }, unknown, z.core.$ZodTypeInternals<{
187
+ certificate: Buffer<ArrayBuffer>;
188
+ }, unknown>>;
189
+ };
190
+ };
191
+ description: string;
192
+ };
193
+ };
194
+ };
195
+ export declare const renewHostCertificateEndpointBodySchema: (env: SshCaBindings) => z.ZodObject<{
196
+ certificate: z.ZodPipe<z.ZodPipe<z.ZodBase64, z.ZodTransform<Buffer<ArrayBuffer>, string>>, z.ZodTransform<import("../../ssh/certificate.js").SshCertificate, Buffer<ArrayBuffer>>>;
197
+ lifetime: z.ZodDefault<z.ZodInt>;
198
+ }, z.core.$strip>;
199
+ export declare const createRenewHostCertificateEndpointSchema: (env: SshCaBindings) => {
200
+ tags: ("Host" | "User")[];
201
+ operationId: string;
202
+ summary: string;
203
+ description: string;
204
+ request: {
205
+ params: z.ZodObject<{
206
+ serial: z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>;
207
+ }, z.core.$strip>;
208
+ headers: z.ZodObject<{
209
+ "Proof-Of-Possession": z.ZodPipe<z.ZodString, z.ZodTransform<import("../../proof.js").ProofOfPossession, string>>;
210
+ }, z.core.$strip>;
211
+ body: {
212
+ content: {
213
+ "application/json": {
214
+ schema: z.ZodType<{
215
+ certificate: import("../../ssh/certificate.js").SshCertificate;
216
+ lifetime: number;
217
+ }, unknown, z.core.$ZodTypeInternals<{
218
+ certificate: import("../../ssh/certificate.js").SshCertificate;
219
+ lifetime: number;
220
+ }, unknown>>;
221
+ };
222
+ };
223
+ };
224
+ };
225
+ responses: {
226
+ "200": {
227
+ content: {
228
+ "application/json": {
229
+ schema: z.ZodType<{
230
+ certificate: Buffer<ArrayBuffer>;
231
+ }, unknown, z.core.$ZodTypeInternals<{
232
+ certificate: Buffer<ArrayBuffer>;
233
+ }, unknown>>;
234
+ };
235
+ };
236
+ description: string;
237
+ };
238
+ };
239
+ };
240
+ export declare const createRevokeCertificateEndpointSchema: (env: SshCaBindings, certificateType: CertificateType) => {
241
+ tags: ("Host" | "User")[];
242
+ operationId: string;
243
+ summary: string;
244
+ description: string;
245
+ request: {
246
+ params: z.ZodObject<{
247
+ serial: z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>;
248
+ }, z.core.$strip>;
249
+ headers: z.ZodObject<{
250
+ "Proof-Of-Possession": z.ZodPipe<z.ZodString, z.ZodTransform<import("../../proof.js").ProofOfPossession, string>>;
251
+ }, z.core.$strip>;
252
+ };
253
+ responses: {
254
+ "200": {
255
+ content: {
256
+ "application/json": {
257
+ schema: z.ZodType<{
258
+ revoked_at: string;
259
+ }, unknown, z.core.$ZodTypeInternals<{
260
+ revoked_at: string;
261
+ }, unknown>>;
262
+ };
263
+ };
264
+ description: string;
265
+ };
266
+ };
267
+ };
268
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/api/v4/schema.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAA;AACnB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAqBnD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAanD;;GAEG;AACH,eAAO,MAAM,WAAW,wBAAwB,CAAA;AAEhD,eAAO,MAAM,iBAAiB,QAAS,aAAa,+FAOnD,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB,QAAS,aAAa;;iBAIzD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,+BAA+B,QAAS,aAAa;;;;;;iBAKjE,CAAA;AAED,eAAO,MAAM,iBAAiB;;iBAS5B,CAAA;AAUF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;CAG1C,CAAA;AAEF,eAAO,MAAM,qCAAqC,oBAAqB,eAAe;;;;;;;;;;;;;;;;;;;;;CAGpF,CAAA;AAEF,eAAO,MAAM,sCAAsC,QAAS,aAAa;;;;;;;;iBAcxE,CAAA;AAED,eAAO,MAAM,wCAAwC,QAAS,aAAa;;;;;;;;;QAOzE,OAAO;;;;;;;QACP,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAcJ,CAAA;AAEF,eAAO,MAAM,sCAAsC,QAAS,aAAa;;;;;;;;iBAaxE,CAAA;AAED,eAAO,MAAM,wCAAwC,QAAS,aAAa;;;;;;;;;QAOzE,OAAO;;;;;;;QACP,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAcJ,CAAA;AAEF,eAAO,MAAM,sCAAsC,QAAS,aAAa;;;iBAaxE,CAAA;AAED,eAAO,MAAM,wCAAwC,QAAS,aAAa;;;;;;QAMzE,MAAM;;;QACN,OAAO;;;QACP,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAcJ,CAAA;AAEF,eAAO,MAAM,qCAAqC,QAAS,aAAa,mBAAmB,eAAe;;;;;;QAMxG,MAAM;;;QACN,OAAO;;;;;;;;;;;;;;;;;;CAiBP,CAAA"}
@@ -0,0 +1,186 @@
1
+ import z from "zod";
2
+ import { refineHostPrincipal, refineRenewableCertificate, split, transformCertificate, transformProofOfPossession, } from "../../utils.js";
3
+ import { ConflictException, contentJson, InputValidationException, InternalServerErrorException, TooManyRequestsException, NotFoundException, UnauthorizedException, ForbiddenException, UnprocessableEntityException, } from "chanfana";
4
+ import { seconds } from "itty-time";
5
+ import { isRevoked } from "../../db/index.js";
6
+ import { CertificateType } from "../../db/types.js";
7
+ import { CaPublicKeyEndpointSchema, certificate, certificateTypeName, certificateTypeTag, createAccessTokenSchema, createIdentityTokenSchema, createRevocationListEndpointSchema, openapiStringByte, subjectPublicKey, } from "../schema.js";
8
+ /**
9
+ * The name of the header carrying the proof of possession of the private key
10
+ */
11
+ export const ProofHeader = "Proof-Of-Possession";
12
+ export const createProofSchema = (env) => (z.string()
13
+ .meta({
14
+ description: "Proof of possession of the private key comprising of `${timestamp}.${fingerprint}.${signature}`. The signature is a BASE64 encoded armored SSHSIG signature, made with the `request-proof-of-possession@com.github.serverless-ssh-ca.andrewheberle` namespace, of `${timestamp}.${fingerprint}.${METHOD} ${path}` where `${METHOD} ${path}` is the request the proof is for, for example `DELETE /api/v4/user/certificates/12345678901234567890`. The timestamp is in milliseconds since the Unix epoch.",
15
+ example: "1765696780805.SHA256:79mq0wtpQMTvS4+Of8VzLN0qmYWNUyTXYmqKwhEgSLs.LS0tLS1CRUdJTiBTU0ggU0lHTkFUVVJFLS0tLS0K...",
16
+ })
17
+ .transform((val, ctx) => transformProofOfPossession(env, val, ctx)));
18
+ /**
19
+ * Headers for a request authorised by a proof of possession alone
20
+ */
21
+ export const createProofHeaderSchema = (env) => (z.object({
22
+ [ProofHeader]: createProofSchema(env),
23
+ }));
24
+ /**
25
+ * Headers for a request authenticated with an access token and authorised by
26
+ * a proof of possession
27
+ */
28
+ export const createAuthenticatedHeaderSchema = (env) => (z.object({
29
+ "Authorization": createAccessTokenSchema(env),
30
+ [ProofHeader]: createProofSchema(env),
31
+ }));
32
+ export const serialParamSchema = z.object({
33
+ // a string as JSON cannot carry a bigint and numbers lose precision
34
+ // above 2^53, and without leading zeros so the path a proof is made for
35
+ // has only one form
36
+ serial: z.string()
37
+ .regex(/^(0|[1-9]\d*)$/)
38
+ .transform(BigInt)
39
+ .refine((v) => v <= 0xffffffffffffffffn, { message: "serial must fit in an unsigned 64-bit integer" })
40
+ .meta({ description: "Serial number of the certificate", example: "12345678901234567890" }),
41
+ });
42
+ const certificateResponse = {
43
+ ...contentJson(z.object({
44
+ certificate: certificate,
45
+ })
46
+ .openapi("Certificate Response"))
47
+ };
48
+ export const createCaPublicKeyEndpointSchema = () => ({
49
+ ...CaPublicKeyEndpointSchema,
50
+ operationId: "get_ca_public_key",
51
+ });
52
+ export const createGetRevocationListEndpointSchema = (certificateType) => ({
53
+ ...createRevocationListEndpointSchema(certificateType),
54
+ operationId: `get_${certificateTypeName(certificateType)}_revocation_list`,
55
+ });
56
+ export const issueUserCertificateEndpointBodySchema = (env) => (z.object({
57
+ public_key: subjectPublicKey,
58
+ identity: createIdentityTokenSchema(env),
59
+ extensions: z.array(z.string())
60
+ .default(split(env.SSH_CERTIFICATE_EXTENSIONS))
61
+ .meta({ description: "Extensions to include in the issued SSH certificate" }),
62
+ lifetime: z.int()
63
+ .min(seconds("5 minutes"))
64
+ .max(seconds(env.SSH_CERTIFICATE_LIFETIME))
65
+ .default(seconds(env.SSH_CERTIFICATE_LIFETIME))
66
+ .meta({ description: "Lifetime of issued SSH certificate" }),
67
+ })
68
+ .openapi("User Certificate Issue Request"));
69
+ export const createIssueUserCertificateEndpointSchema = (env) => ({
70
+ tags: [certificateTypeTag(CertificateType.User)],
71
+ operationId: "issue_user_certificate",
72
+ summary: "Request a user certificate",
73
+ description: `Issues a signed SSH user certificate for the provided public key. The request must be authenticated with an access token and include an identity token from the OIDC IdP for the same subject, along with a proof of possession of the private key for \`public_key\` in the \`${ProofHeader}\` header made for this request. Principals on the issued certificate are derived from the identity token.`,
74
+ security: [{ oidcAuth: [] }],
75
+ request: {
76
+ headers: createAuthenticatedHeaderSchema(env),
77
+ body: contentJson(issueUserCertificateEndpointBodySchema(env)),
78
+ },
79
+ responses: {
80
+ "200": {
81
+ description: "SSH User Certificate issued successfully",
82
+ ...certificateResponse,
83
+ },
84
+ ...UnauthorizedException.schema(),
85
+ ...ForbiddenException.schema(),
86
+ ...InputValidationException.schema(),
87
+ ...UnprocessableEntityException.schema(),
88
+ ...InternalServerErrorException.schema(),
89
+ ...TooManyRequestsException.schema(),
90
+ }
91
+ });
92
+ export const issueHostCertificateEndpointBodySchema = (env) => (z.object({
93
+ public_key: subjectPublicKey,
94
+ identity: createIdentityTokenSchema(env),
95
+ principals: z.array(z.string().superRefine(refineHostPrincipal)).min(1)
96
+ .meta({ description: "List of principals to include on the issued certificate" }),
97
+ lifetime: z.int()
98
+ .min(seconds("24 hours"))
99
+ .max(seconds(env.SSH_HOST_CERTIFICATE_LIFETIME))
100
+ .default(seconds(env.SSH_HOST_CERTIFICATE_LIFETIME))
101
+ .meta({ description: "Lifetime of issued Host SSH certificate" }),
102
+ })
103
+ .openapi("Host Certificate Issue Request"));
104
+ export const createIssueHostCertificateEndpointSchema = (env) => ({
105
+ tags: [certificateTypeTag(CertificateType.Host)],
106
+ operationId: "issue_host_certificate",
107
+ summary: "Request a host certificate",
108
+ description: `Issues a signed SSH host certificate for the provided public key and principals. The request must be authenticated with an access token and include an identity token from the OIDC IdP for the same subject, along with a proof of possession of the private key for \`public_key\` in the \`${ProofHeader}\` header made for this request. The user must be permitted to request host certificates by email address or role.`,
109
+ security: [{ oidcAuth: [] }],
110
+ request: {
111
+ headers: createAuthenticatedHeaderSchema(env),
112
+ body: contentJson(issueHostCertificateEndpointBodySchema(env)),
113
+ },
114
+ responses: {
115
+ "200": {
116
+ description: "SSH Host Certificate issued successfully",
117
+ ...certificateResponse,
118
+ },
119
+ ...UnauthorizedException.schema(),
120
+ ...ForbiddenException.schema(),
121
+ ...InputValidationException.schema(),
122
+ ...UnprocessableEntityException.schema(),
123
+ ...InternalServerErrorException.schema(),
124
+ ...TooManyRequestsException.schema(),
125
+ }
126
+ });
127
+ export const renewHostCertificateEndpointBodySchema = (env) => (z.object({
128
+ certificate: openapiStringByte
129
+ .transform(transformCertificate)
130
+ .meta({ description: "SSH certificate to renew, which must have the serial number in the path" }),
131
+ lifetime: z.int()
132
+ .min(seconds("24 hours"))
133
+ .max(seconds(env.SSH_HOST_CERTIFICATE_LIFETIME))
134
+ .default(seconds(env.SSH_HOST_CERTIFICATE_LIFETIME))
135
+ .meta({ description: "Lifetime of renewed Host SSH certificate" }),
136
+ })
137
+ .superRefine((val, ctx) => refineRenewableCertificate(env, isRevoked, val, ctx))
138
+ .openapi("Host Certificate Renewal Request"));
139
+ export const createRenewHostCertificateEndpointSchema = (env) => ({
140
+ tags: [certificateTypeTag(CertificateType.Host)],
141
+ operationId: "renew_host_certificate",
142
+ summary: "Renew a host certificate",
143
+ description: `Issues a new SSH host certificate for the same public key and principals as an existing, unexpired and unrevoked host certificate issued by this CA. No OIDC authentication is required; instead the \`${ProofHeader}\` header must contain a proof of possession of the private key for the existing certificate made for this request. The lifetime of the renewed certificate is no longer than that of the existing certificate. The existing certificate is revoked, so it cannot be used or renewed again once the renewed certificate is installed.`,
144
+ request: {
145
+ params: serialParamSchema,
146
+ headers: createProofHeaderSchema(env),
147
+ body: contentJson(renewHostCertificateEndpointBodySchema(env)),
148
+ },
149
+ responses: {
150
+ "200": {
151
+ description: "SSH Host Certificate renewed successfully",
152
+ ...certificateResponse,
153
+ },
154
+ ...UnauthorizedException.schema(),
155
+ ...ForbiddenException.schema(),
156
+ ...InputValidationException.schema(),
157
+ ...UnprocessableEntityException.schema(),
158
+ ...InternalServerErrorException.schema(),
159
+ ...TooManyRequestsException.schema(),
160
+ }
161
+ });
162
+ export const createRevokeCertificateEndpointSchema = (env, certificateType) => ({
163
+ tags: [certificateTypeTag(certificateType)],
164
+ operationId: `revoke_${certificateTypeName(certificateType)}_certificate`,
165
+ summary: `Revoke a ${certificateTypeName(certificateType)} certificate`,
166
+ description: `Revokes a ${certificateTypeName(certificateType)} certificate issued by this CA and adds it to the ${certificateTypeName(certificateType)} Key Revocation List. The \`${ProofHeader}\` header must contain a proof of possession of the private key for the public key that the certificate was issued for, made for this request. A certificate issued for a different public key is reported as not found.`,
167
+ request: {
168
+ params: serialParamSchema,
169
+ headers: createProofHeaderSchema(env),
170
+ },
171
+ responses: {
172
+ "200": {
173
+ description: `SSH ${certificateTypeName(certificateType)} certificate revoked successfully`,
174
+ ...contentJson(z.object({
175
+ revoked_at: z.iso.datetime(),
176
+ })
177
+ .openapi("Revocation Response")),
178
+ },
179
+ ...InputValidationException.schema(),
180
+ ...NotFoundException.schema(),
181
+ ...ConflictException.schema(),
182
+ ...InternalServerErrorException.schema(),
183
+ ...TooManyRequestsException.schema(),
184
+ }
185
+ });
186
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/api/v4/schema.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAA;AAEnB,OAAO,EACN,mBAAmB,EACnB,0BAA0B,EAC1B,KAAK,EACL,oBAAoB,EACpB,0BAA0B,GAC1B,MAAM,gBAAgB,CAAA;AACvB,OAAO,EACN,iBAAiB,EACjB,WAAW,EACX,wBAAwB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AAE;KACpC;CACD,CAAC,CAAA"}
@@ -1,5 +1,6 @@
1
- import type { Certificate, Identity, Key, PrivateKey } from "sshpk";
1
+ import type { PrivateKey, PublicKey } from "./ssh/keys.js";
2
2
  import type { SshCaBindings } from "./types.js";
3
+ import { type SshCertificate } from "./ssh/certificate.js";
3
4
  export type CreateCertificateOptions = {
4
5
  lifetime?: number;
5
6
  principals?: string[];
@@ -16,16 +17,18 @@ export type GenerateCertificateOptions = {
16
17
  */
17
18
  serial?: bigint;
18
19
  } & CreateCertificateOptions;
19
- export declare const generateCertificate: (env: SshCaBindings, email: string, key: PrivateKey, public_key: Key, options?: GenerateCertificateOptions) => Certificate;
20
- export declare function createSignedCertificate(env: SshCaBindings, email: string, public_key: Key, options?: CreateCertificateOptions): Promise<Certificate>;
20
+ export declare const generateCertificate: (env: SshCaBindings, email: string, key: PrivateKey, public_key: PublicKey, options?: GenerateCertificateOptions) => Promise<SshCertificate>;
21
+ export declare function createSignedCertificate(env: SshCaBindings, email: string, public_key: PublicKey, options?: CreateCertificateOptions): Promise<SshCertificate>;
21
22
  export type CreateHostCertificateOptions = {
22
23
  lifetime?: number;
23
24
  principals?: string[];
24
- subjects?: Identity[];
25
25
  };
26
26
  export declare class BadIssuerError extends Error {
27
27
  constructor(message: string);
28
28
  }
29
- export declare function createSignedHostCertificate(env: SshCaBindings, public_key: Key, options?: CreateHostCertificateOptions): Promise<Certificate>;
30
- export declare const generateSerial: (serial?: bigint) => Buffer<ArrayBuffer>;
29
+ export declare function createSignedHostCertificate(env: SshCaBindings, public_key: PublicKey, options?: CreateHostCertificateOptions): Promise<SshCertificate>;
30
+ /**
31
+ * Returns a random certificate serial number
32
+ */
33
+ export declare const generateSerial: () => bigint;
31
34
  //# sourceMappingURL=certificate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"certificate.d.ts","sourceRoot":"","sources":["../src/certificate.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,G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