@lucaapp/service-utils 1.40.2 → 1.40.3

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.
@@ -53,11 +53,11 @@ declare class ServiceIdentity {
53
53
  error: import("../api/types/http").HTTPStatus.FORBIDDEN;
54
54
  }>;
55
55
  })[], undefined, undefined, undefined, z.ZodObject<{
56
- 'X-Identity': z.ZodString;
56
+ 'x-identity': z.ZodEffects<z.ZodString, string, string>;
57
57
  }, "strip", z.ZodTypeAny, {
58
- "X-Identity": string;
58
+ "x-identity": string;
59
59
  }, {
60
- "X-Identity": string;
60
+ "x-identity": string;
61
61
  }>, z.ZodObject<{
62
62
  payload: z.ZodAny;
63
63
  }, "strip", z.ZodTypeAny, {
@@ -35,8 +35,9 @@ const moment_1 = __importDefault(require("moment"));
35
35
  const requestTracer_1 = require("../requestTracer");
36
36
  const axios_1 = __importDefault(require("axios"));
37
37
  const zod_1 = require("zod");
38
+ const validator_1 = __importDefault(require("validator"));
38
39
  const JWT_ALGORITHM = 'ES256';
39
- const JWT_HEADER_NAME = 'X-Identity';
40
+ const JWT_HEADER_NAME = 'x-identity';
40
41
  const JWT_ALLOWED_ALGORITHMS = [JWT_ALGORITHM];
41
42
  const JWT_NBF = '0s';
42
43
  const JWT_EXP = '1m';
@@ -128,7 +129,7 @@ class ServiceIdentity {
128
129
  this.requireServiceIdentityV3 = (service) => (0, api_1.createMiddleware)({
129
130
  schemas: {
130
131
  headers: zod_1.z.object({
131
- 'X-Identity': zod_1.z.string(),
132
+ 'x-identity': zod_1.z.string().refine(value => validator_1.default.isJWT(value)),
132
133
  }),
133
134
  context: zod_1.z.object({ payload: zod_1.z.any() }),
134
135
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lucaapp/service-utils",
3
- "version": "1.40.2",
3
+ "version": "1.40.3",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [