@trojs/openapi-server 1.3.0 → 1.4.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.
package/README.md CHANGED
@@ -41,7 +41,6 @@ const api = new Api({
41
41
  version: 'v1',
42
42
  specification: openAPISpecification,
43
43
  controllers,
44
- secret: 'test',
45
44
  logger: console,
46
45
  ajvOptions: { allErrors: true }
47
46
  })
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@trojs/openapi-server",
3
3
  "description": "OpenAPI Server",
4
- "version": "1.3.0",
4
+ "version": "1.4.0",
5
5
  "author": {
6
6
  "name": "Pieter Wigboldus",
7
7
  "url": "https://trojs.org/"
package/src/api.js CHANGED
@@ -17,7 +17,6 @@ import { setupRouter } from './router.js';
17
17
  * @property {string} version
18
18
  * @property {object} specification
19
19
  * @property {object} controllers
20
- * @property {string=} secret
21
20
  * @property {string=} apiRoot
22
21
  * @property {boolean=} strictSpecification
23
22
  * @property {boolean=} errorDetails
@@ -43,7 +42,6 @@ export class Api {
43
42
  version,
44
43
  specification,
45
44
  controllers,
46
- secret,
47
45
  apiRoot,
48
46
  strictSpecification,
49
47
  errorDetails,
@@ -57,7 +55,6 @@ export class Api {
57
55
  this.version = version;
58
56
  this.specification = specification;
59
57
  this.controllers = controllers;
60
- this.secret = secret;
61
58
  this.apiRoot = apiRoot;
62
59
  this.strictSpecification = strictSpecification;
63
60
  this.errorDetails = errorDetails || false;
@@ -86,7 +83,6 @@ export class Api {
86
83
  }
87
84
 
88
85
  const { api } = setupRouter({
89
- secret: this.secret,
90
86
  openAPISpecification: this.specification,
91
87
  controllers: this.controllers,
92
88
  apiRoot: this.apiRoot,
package/src/router.js CHANGED
@@ -16,7 +16,6 @@ import { unauthorized } from './handlers/unauthorized.js';
16
16
  /**
17
17
  * Setup the router
18
18
  * @param {object} params
19
- * @param {string=} params.secret
20
19
  * @param {object} params.openAPISpecification
21
20
  * @param {object} params.controllers
22
21
  * @param {string=} params.apiRoot
@@ -29,7 +28,6 @@ import { unauthorized } from './handlers/unauthorized.js';
29
28
  * @returns {{ api: OpenAPIBackend<any>, openAPISpecification: object }}
30
29
  */
31
30
  export const setupRouter = ({
32
- secret,
33
31
  openAPISpecification,
34
32
  controllers,
35
33
  apiRoot,
@@ -83,13 +81,6 @@ export const setupRouter = ({
83
81
  return mock;
84
82
  });
85
83
 
86
- if (secret) {
87
- api.registerSecurityHandler(
88
- 'apiKey',
89
- (context) => context.request.headers['x-api-key'] === secret
90
- );
91
- }
92
-
93
84
  securityHandlers.forEach((securityHandler) => {
94
85
  api.registerSecurityHandler(
95
86
  securityHandler.name,
package/src/server.js CHANGED
@@ -75,7 +75,7 @@ export const setupServer = async ({
75
75
  poweredBy = 'TroJS',
76
76
  version = '1.0.0',
77
77
  middleware = [],
78
- maximumBodySize = '5mb',
78
+ maximumBodySize = undefined,
79
79
  }) => {
80
80
  const corsOptions = {
81
81
  origin,