@autofleet/zehut 1.8.1-beta1 → 1.8.1-beta3

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/index.d.ts CHANGED
@@ -30,6 +30,7 @@ declare const _default: {
30
30
  UnauthorizedAccessError: typeof UnauthorizedAccessError;
31
31
  appMiddleware: (options: {
32
32
  appId: string;
33
+ clientSecret: string;
33
34
  }) => (req: any, res: any, next: any) => Promise<void>;
34
35
  };
35
36
  export default _default;
@@ -11,6 +11,7 @@ export declare const middlewareWithDecode: (options?: {
11
11
  }) => (req: any, res: any, next: any) => Promise<void>;
12
12
  export declare const appMiddleware: (options: {
13
13
  appId: string;
14
+ clientSecret: string;
14
15
  }) => (req: any, res: any, next: any) => Promise<void>;
15
16
  export declare const eagerLoadPermissionsMiddleware: (req: any, res: any, next: any) => Promise<any>;
16
17
  export declare const getDecodedBearer: (req: any) => any;
package/lib/user/index.js CHANGED
@@ -123,7 +123,7 @@ exports.middlewareWithDecode = (options = {}) => (req, res, next) => __awaiter(v
123
123
  return next();
124
124
  });
125
125
  exports.appMiddleware = (options) => (req, res, next) => __awaiter(void 0, void 0, void 0, function* () {
126
- const { appId, } = options;
126
+ const { appId, clientSecret, } = options;
127
127
  const trace = tracer_1.newTrace('userPayload');
128
128
  let decoded;
129
129
  if (!req.headers.authorization) {
@@ -168,7 +168,6 @@ exports.appMiddleware = (options) => (req, res, next) => __awaiter(void 0, void
168
168
  }
169
169
  const userObject = new ApiUser_1.default(userId);
170
170
  if (appId) {
171
- const clientSecret = yield app_auth_1.getClientSecret(appId);
172
171
  req.headers['x-autofleet-apps-secret'] = clientSecret;
173
172
  // Won't work until we find a better solution for identity ms
174
173
  yield userObject.getUserAppPermissions(appId, clientSecret);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autofleet/zehut",
3
- "version": "1.8.1-beta1",
3
+ "version": "1.8.1-beta3",
4
4
  "description": "manage user's identity",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",