@andrewheberle/serverless-ssh-ca 0.23.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 (94) hide show
  1. package/README.md +119 -0
  2. package/dist/api/operations.d.ts +2 -1
  3. package/dist/api/operations.d.ts.map +1 -1
  4. package/dist/api/operations.js +103 -14
  5. package/dist/api/operations.js.map +1 -1
  6. package/dist/api/schema.d.ts +1 -0
  7. package/dist/api/schema.d.ts.map +1 -1
  8. package/dist/api/schema.js +8 -1
  9. package/dist/api/schema.js.map +1 -1
  10. package/dist/api/v3/index.d.ts.map +1 -1
  11. package/dist/api/v3/index.js +1 -1
  12. package/dist/api/v3/index.js.map +1 -1
  13. package/dist/api/v3/schema.d.ts.map +1 -1
  14. package/dist/api/v3/schema.js +11 -7
  15. package/dist/api/v3/schema.js.map +1 -1
  16. package/dist/api/v4/index.d.ts.map +1 -1
  17. package/dist/api/v4/index.js +1 -1
  18. package/dist/api/v4/index.js.map +1 -1
  19. package/dist/api/v4/schema.d.ts.map +1 -1
  20. package/dist/api/v4/schema.js +11 -7
  21. package/dist/api/v4/schema.js.map +1 -1
  22. package/dist/db/index.d.ts +51 -4
  23. package/dist/db/index.d.ts.map +1 -1
  24. package/dist/db/index.js +133 -33
  25. package/dist/db/index.js.map +1 -1
  26. package/dist/db/migrations/0003_krl_revision.d.ts +3 -0
  27. package/dist/db/migrations/0003_krl_revision.d.ts.map +1 -0
  28. package/dist/db/migrations/0003_krl_revision.js +14 -0
  29. package/dist/db/migrations/0003_krl_revision.js.map +1 -0
  30. package/dist/db/migrations/index.d.ts.map +1 -1
  31. package/dist/db/migrations/index.js +2 -0
  32. package/dist/db/migrations/index.js.map +1 -1
  33. package/dist/db/types.d.ts +2 -0
  34. package/dist/db/types.d.ts.map +1 -1
  35. package/dist/index.d.ts +5 -2
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.js +4 -2
  38. package/dist/index.js.map +1 -1
  39. package/dist/krl.d.ts +2 -1
  40. package/dist/krl.d.ts.map +1 -1
  41. package/dist/krl.js +3 -2
  42. package/dist/krl.js.map +1 -1
  43. package/dist/node/cache.d.ts +21 -0
  44. package/dist/node/cache.d.ts.map +1 -0
  45. package/dist/node/cache.js +49 -0
  46. package/dist/node/cache.js.map +1 -0
  47. package/dist/node/env.d.ts +6 -3
  48. package/dist/node/env.d.ts.map +1 -1
  49. package/dist/node/env.js +4 -3
  50. package/dist/node/env.js.map +1 -1
  51. package/dist/node/index.d.ts +1 -0
  52. package/dist/node/index.d.ts.map +1 -1
  53. package/dist/node/index.js +1 -0
  54. package/dist/node/index.js.map +1 -1
  55. package/dist/router.d.ts +25 -1
  56. package/dist/router.d.ts.map +1 -1
  57. package/dist/router.js +38 -1
  58. package/dist/router.js.map +1 -1
  59. package/dist/ssh/keys.d.ts +12 -0
  60. package/dist/ssh/keys.d.ts.map +1 -1
  61. package/dist/ssh/keys.js +28 -0
  62. package/dist/ssh/keys.js.map +1 -1
  63. package/dist/types.d.ts +53 -3
  64. package/dist/types.d.ts.map +1 -1
  65. package/dist/utils.d.ts +68 -1
  66. package/dist/utils.d.ts.map +1 -1
  67. package/dist/utils.js +166 -13
  68. package/dist/utils.js.map +1 -1
  69. package/dist/verify.d.ts +17 -5
  70. package/dist/verify.d.ts.map +1 -1
  71. package/dist/verify.js +47 -9
  72. package/dist/verify.js.map +1 -1
  73. package/openapi.json +402 -2
  74. package/package.json +1 -1
  75. package/src/api/operations.ts +115 -12
  76. package/src/api/schema.ts +9 -0
  77. package/src/api/v3/index.ts +1 -0
  78. package/src/api/v3/schema.ts +11 -4
  79. package/src/api/v4/index.ts +1 -0
  80. package/src/api/v4/schema.ts +11 -5
  81. package/src/db/index.ts +162 -37
  82. package/src/db/migrations/0003_krl_revision.ts +15 -0
  83. package/src/db/migrations/index.ts +2 -0
  84. package/src/db/types.ts +2 -0
  85. package/src/index.ts +6 -4
  86. package/src/krl.ts +3 -2
  87. package/src/node/cache.ts +62 -0
  88. package/src/node/env.ts +6 -5
  89. package/src/node/index.ts +1 -0
  90. package/src/router.ts +64 -2
  91. package/src/ssh/keys.ts +33 -0
  92. package/src/types.ts +49 -3
  93. package/src/utils.ts +188 -14
  94. package/src/verify.ts +54 -14
package/openapi.json CHANGED
@@ -587,6 +587,46 @@
587
587
  }
588
588
  }
589
589
  },
590
+ "429": {
591
+ "description": "Too Many Requests",
592
+ "content": {
593
+ "application/json": {
594
+ "schema": {
595
+ "type": "object",
596
+ "properties": {
597
+ "success": {
598
+ "type": "boolean",
599
+ "enum": [
600
+ false
601
+ ]
602
+ },
603
+ "errors": {
604
+ "type": "array",
605
+ "items": {
606
+ "type": "object",
607
+ "properties": {
608
+ "code": {
609
+ "type": "number"
610
+ },
611
+ "message": {
612
+ "type": "string"
613
+ }
614
+ },
615
+ "required": [
616
+ "code",
617
+ "message"
618
+ ]
619
+ }
620
+ }
621
+ },
622
+ "required": [
623
+ "success",
624
+ "errors"
625
+ ]
626
+ }
627
+ }
628
+ }
629
+ },
590
630
  "500": {
591
631
  "description": "Internal Server Error",
592
632
  "content": {
@@ -934,6 +974,46 @@
934
974
  }
935
975
  }
936
976
  },
977
+ "429": {
978
+ "description": "Too Many Requests",
979
+ "content": {
980
+ "application/json": {
981
+ "schema": {
982
+ "type": "object",
983
+ "properties": {
984
+ "success": {
985
+ "type": "boolean",
986
+ "enum": [
987
+ false
988
+ ]
989
+ },
990
+ "errors": {
991
+ "type": "array",
992
+ "items": {
993
+ "type": "object",
994
+ "properties": {
995
+ "code": {
996
+ "type": "number"
997
+ },
998
+ "message": {
999
+ "type": "string"
1000
+ }
1001
+ },
1002
+ "required": [
1003
+ "code",
1004
+ "message"
1005
+ ]
1006
+ }
1007
+ }
1008
+ },
1009
+ "required": [
1010
+ "success",
1011
+ "errors"
1012
+ ]
1013
+ }
1014
+ }
1015
+ }
1016
+ },
937
1017
  "500": {
938
1018
  "description": "Internal Server Error",
939
1019
  "content": {
@@ -1197,6 +1277,46 @@
1197
1277
  }
1198
1278
  }
1199
1279
  },
1280
+ "429": {
1281
+ "description": "Too Many Requests",
1282
+ "content": {
1283
+ "application/json": {
1284
+ "schema": {
1285
+ "type": "object",
1286
+ "properties": {
1287
+ "success": {
1288
+ "type": "boolean",
1289
+ "enum": [
1290
+ false
1291
+ ]
1292
+ },
1293
+ "errors": {
1294
+ "type": "array",
1295
+ "items": {
1296
+ "type": "object",
1297
+ "properties": {
1298
+ "code": {
1299
+ "type": "number"
1300
+ },
1301
+ "message": {
1302
+ "type": "string"
1303
+ }
1304
+ },
1305
+ "required": [
1306
+ "code",
1307
+ "message"
1308
+ ]
1309
+ }
1310
+ }
1311
+ },
1312
+ "required": [
1313
+ "success",
1314
+ "errors"
1315
+ ]
1316
+ }
1317
+ }
1318
+ }
1319
+ },
1200
1320
  "500": {
1201
1321
  "description": "Internal Server Error",
1202
1322
  "content": {
@@ -1246,7 +1366,7 @@
1246
1366
  "Host"
1247
1367
  ],
1248
1368
  "summary": "Renew a host certificate",
1249
- "description": "Issues a new SSH host certificate with the same principals as an existing, unexpired and unrevoked host certificate issued by this CA. No OIDC authentication is required; instead the public key must match the existing certificate and the proof of possession must be made with its private key. The lifetime of the renewed certificate is no longer than that of the existing certificate.",
1369
+ "description": "Issues a new SSH host certificate with the same principals as an existing, unexpired and unrevoked host certificate issued by this CA. No OIDC authentication is required; instead the public key must match the existing certificate and the proof of possession must be made with its private key. 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.",
1250
1370
  "operationId": "post_host_renew",
1251
1371
  "requestBody": {
1252
1372
  "content": {
@@ -1442,6 +1562,46 @@
1442
1562
  }
1443
1563
  }
1444
1564
  },
1565
+ "429": {
1566
+ "description": "Too Many Requests",
1567
+ "content": {
1568
+ "application/json": {
1569
+ "schema": {
1570
+ "type": "object",
1571
+ "properties": {
1572
+ "success": {
1573
+ "type": "boolean",
1574
+ "enum": [
1575
+ false
1576
+ ]
1577
+ },
1578
+ "errors": {
1579
+ "type": "array",
1580
+ "items": {
1581
+ "type": "object",
1582
+ "properties": {
1583
+ "code": {
1584
+ "type": "number"
1585
+ },
1586
+ "message": {
1587
+ "type": "string"
1588
+ }
1589
+ },
1590
+ "required": [
1591
+ "code",
1592
+ "message"
1593
+ ]
1594
+ }
1595
+ }
1596
+ },
1597
+ "required": [
1598
+ "success",
1599
+ "errors"
1600
+ ]
1601
+ }
1602
+ }
1603
+ }
1604
+ },
1445
1605
  "500": {
1446
1606
  "description": "Internal Server Error",
1447
1607
  "content": {
@@ -1789,6 +1949,46 @@
1789
1949
  }
1790
1950
  }
1791
1951
  },
1952
+ "429": {
1953
+ "description": "Too Many Requests",
1954
+ "content": {
1955
+ "application/json": {
1956
+ "schema": {
1957
+ "type": "object",
1958
+ "properties": {
1959
+ "success": {
1960
+ "type": "boolean",
1961
+ "enum": [
1962
+ false
1963
+ ]
1964
+ },
1965
+ "errors": {
1966
+ "type": "array",
1967
+ "items": {
1968
+ "type": "object",
1969
+ "properties": {
1970
+ "code": {
1971
+ "type": "number"
1972
+ },
1973
+ "message": {
1974
+ "type": "string"
1975
+ }
1976
+ },
1977
+ "required": [
1978
+ "code",
1979
+ "message"
1980
+ ]
1981
+ }
1982
+ }
1983
+ },
1984
+ "required": [
1985
+ "success",
1986
+ "errors"
1987
+ ]
1988
+ }
1989
+ }
1990
+ }
1991
+ },
1792
1992
  "500": {
1793
1993
  "description": "Internal Server Error",
1794
1994
  "content": {
@@ -2125,6 +2325,46 @@
2125
2325
  }
2126
2326
  }
2127
2327
  },
2328
+ "429": {
2329
+ "description": "Too Many Requests",
2330
+ "content": {
2331
+ "application/json": {
2332
+ "schema": {
2333
+ "type": "object",
2334
+ "properties": {
2335
+ "success": {
2336
+ "type": "boolean",
2337
+ "enum": [
2338
+ false
2339
+ ]
2340
+ },
2341
+ "errors": {
2342
+ "type": "array",
2343
+ "items": {
2344
+ "type": "object",
2345
+ "properties": {
2346
+ "code": {
2347
+ "type": "number"
2348
+ },
2349
+ "message": {
2350
+ "type": "string"
2351
+ }
2352
+ },
2353
+ "required": [
2354
+ "code",
2355
+ "message"
2356
+ ]
2357
+ }
2358
+ }
2359
+ },
2360
+ "required": [
2361
+ "success",
2362
+ "errors"
2363
+ ]
2364
+ }
2365
+ }
2366
+ }
2367
+ },
2128
2368
  "500": {
2129
2369
  "description": "Internal Server Error",
2130
2370
  "content": {
@@ -2339,6 +2579,46 @@
2339
2579
  }
2340
2580
  }
2341
2581
  },
2582
+ "429": {
2583
+ "description": "Too Many Requests",
2584
+ "content": {
2585
+ "application/json": {
2586
+ "schema": {
2587
+ "type": "object",
2588
+ "properties": {
2589
+ "success": {
2590
+ "type": "boolean",
2591
+ "enum": [
2592
+ false
2593
+ ]
2594
+ },
2595
+ "errors": {
2596
+ "type": "array",
2597
+ "items": {
2598
+ "type": "object",
2599
+ "properties": {
2600
+ "code": {
2601
+ "type": "number"
2602
+ },
2603
+ "message": {
2604
+ "type": "string"
2605
+ }
2606
+ },
2607
+ "required": [
2608
+ "code",
2609
+ "message"
2610
+ ]
2611
+ }
2612
+ }
2613
+ },
2614
+ "required": [
2615
+ "success",
2616
+ "errors"
2617
+ ]
2618
+ }
2619
+ }
2620
+ }
2621
+ },
2342
2622
  "500": {
2343
2623
  "description": "Internal Server Error",
2344
2624
  "content": {
@@ -2675,6 +2955,46 @@
2675
2955
  }
2676
2956
  }
2677
2957
  },
2958
+ "429": {
2959
+ "description": "Too Many Requests",
2960
+ "content": {
2961
+ "application/json": {
2962
+ "schema": {
2963
+ "type": "object",
2964
+ "properties": {
2965
+ "success": {
2966
+ "type": "boolean",
2967
+ "enum": [
2968
+ false
2969
+ ]
2970
+ },
2971
+ "errors": {
2972
+ "type": "array",
2973
+ "items": {
2974
+ "type": "object",
2975
+ "properties": {
2976
+ "code": {
2977
+ "type": "number"
2978
+ },
2979
+ "message": {
2980
+ "type": "string"
2981
+ }
2982
+ },
2983
+ "required": [
2984
+ "code",
2985
+ "message"
2986
+ ]
2987
+ }
2988
+ }
2989
+ },
2990
+ "required": [
2991
+ "success",
2992
+ "errors"
2993
+ ]
2994
+ }
2995
+ }
2996
+ }
2997
+ },
2678
2998
  "500": {
2679
2999
  "description": "Internal Server Error",
2680
3000
  "content": {
@@ -2725,7 +3045,7 @@
2725
3045
  ],
2726
3046
  "operationId": "renew_host_certificate",
2727
3047
  "summary": "Renew a host certificate",
2728
- "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 `Proof-Of-Possession` 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.",
3048
+ "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 `Proof-Of-Possession` 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.",
2729
3049
  "parameters": [
2730
3050
  {
2731
3051
  "schema": {
@@ -2945,6 +3265,46 @@
2945
3265
  }
2946
3266
  }
2947
3267
  },
3268
+ "429": {
3269
+ "description": "Too Many Requests",
3270
+ "content": {
3271
+ "application/json": {
3272
+ "schema": {
3273
+ "type": "object",
3274
+ "properties": {
3275
+ "success": {
3276
+ "type": "boolean",
3277
+ "enum": [
3278
+ false
3279
+ ]
3280
+ },
3281
+ "errors": {
3282
+ "type": "array",
3283
+ "items": {
3284
+ "type": "object",
3285
+ "properties": {
3286
+ "code": {
3287
+ "type": "number"
3288
+ },
3289
+ "message": {
3290
+ "type": "string"
3291
+ }
3292
+ },
3293
+ "required": [
3294
+ "code",
3295
+ "message"
3296
+ ]
3297
+ }
3298
+ }
3299
+ },
3300
+ "required": [
3301
+ "success",
3302
+ "errors"
3303
+ ]
3304
+ }
3305
+ }
3306
+ }
3307
+ },
2948
3308
  "500": {
2949
3309
  "description": "Internal Server Error",
2950
3310
  "content": {
@@ -3159,6 +3519,46 @@
3159
3519
  }
3160
3520
  }
3161
3521
  },
3522
+ "429": {
3523
+ "description": "Too Many Requests",
3524
+ "content": {
3525
+ "application/json": {
3526
+ "schema": {
3527
+ "type": "object",
3528
+ "properties": {
3529
+ "success": {
3530
+ "type": "boolean",
3531
+ "enum": [
3532
+ false
3533
+ ]
3534
+ },
3535
+ "errors": {
3536
+ "type": "array",
3537
+ "items": {
3538
+ "type": "object",
3539
+ "properties": {
3540
+ "code": {
3541
+ "type": "number"
3542
+ },
3543
+ "message": {
3544
+ "type": "string"
3545
+ }
3546
+ },
3547
+ "required": [
3548
+ "code",
3549
+ "message"
3550
+ ]
3551
+ }
3552
+ }
3553
+ },
3554
+ "required": [
3555
+ "success",
3556
+ "errors"
3557
+ ]
3558
+ }
3559
+ }
3560
+ }
3561
+ },
3162
3562
  "500": {
3163
3563
  "description": "Internal Server Error",
3164
3564
  "content": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andrewheberle/serverless-ssh-ca",
3
- "version": "0.23.0",
3
+ "version": "0.24.0",
4
4
  "description": "A serverless SSH CA built for Cloudflare Workers that can also run on Node.js",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",