@openhi/constructs 0.0.48 → 0.0.50
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/lib/pre-token-generation.handler.js +4 -4
- package/lib/pre-token-generation.handler.js.map +1 -1
- package/lib/pre-token-generation.handler.mjs +4 -4
- package/lib/pre-token-generation.handler.mjs.map +1 -1
- package/lib/rest-api-lambda.handler.js +5 -10
- package/lib/rest-api-lambda.handler.js.map +1 -1
- package/lib/rest-api-lambda.handler.mjs +5 -10
- package/lib/rest-api-lambda.handler.mjs.map +1 -1
- package/package.json +5 -5
|
@@ -28,12 +28,7 @@ function normalizeJsonBodyMiddleware(req, _res, next) {
|
|
|
28
28
|
|
|
29
29
|
// src/data/middleware/open-hi-context.ts
|
|
30
30
|
import { getCurrentInvoke } from "@codegenie/serverless-express";
|
|
31
|
-
var REQUIRED_CLAIMS = [
|
|
32
|
-
"openhi_tenant_id",
|
|
33
|
-
"openhi_workspace_id",
|
|
34
|
-
"openhi_user_id",
|
|
35
|
-
"openhi_user_name"
|
|
36
|
-
];
|
|
31
|
+
var REQUIRED_CLAIMS = ["ohi_tid", "ohi_wid", "ohi_uid", "ohi_uname"];
|
|
37
32
|
function getJwtClaims(req) {
|
|
38
33
|
const invoke = getCurrentInvoke();
|
|
39
34
|
const event = invoke?.event ?? req.apiGateway?.event;
|
|
@@ -58,11 +53,11 @@ function openHiContextMiddleware(req, res, next) {
|
|
|
58
53
|
const event = invoke?.event ?? req.apiGateway?.event;
|
|
59
54
|
const requestId = typeof event?.requestContext?.requestId === "string" ? event.requestContext.requestId : void 0;
|
|
60
55
|
req.openhiContext = {
|
|
61
|
-
tenantId: claims.
|
|
62
|
-
workspaceId: claims.
|
|
56
|
+
tenantId: claims.ohi_tid,
|
|
57
|
+
workspaceId: claims.ohi_wid,
|
|
63
58
|
date: (/* @__PURE__ */ new Date()).toISOString(),
|
|
64
|
-
actorId: claims.
|
|
65
|
-
actorName: claims.
|
|
59
|
+
actorId: claims.ohi_uid,
|
|
60
|
+
actorName: claims.ohi_uname,
|
|
66
61
|
actorType: "human",
|
|
67
62
|
roleId: typeof claims.openhi_role_id === "string" && claims.openhi_role_id !== "" ? claims.openhi_role_id : void 0,
|
|
68
63
|
requestId,
|