@fonoster/authz 0.8.16 → 0.8.18

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/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export * from "./server";
2
2
  export * from "./client";
3
- export * from "./createCheckMethodAuthorized";
3
+ export * from "./makeCheckMethodAuthorized";
4
4
  export * from "./types";
package/dist/index.js CHANGED
@@ -34,5 +34,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
34
34
  */
35
35
  __exportStar(require("./server"), exports);
36
36
  __exportStar(require("./client"), exports);
37
- __exportStar(require("./createCheckMethodAuthorized"), exports);
37
+ __exportStar(require("./makeCheckMethodAuthorized"), exports);
38
38
  __exportStar(require("./types"), exports);
@@ -6,7 +6,7 @@ import { ServerInterceptingCall } from "@grpc/grpc-js";
6
6
  * @param {string} authzServer - The public key to validate the token
7
7
  * @return {Function} - The gRPC interceptor
8
8
  */
9
- declare function createCheckMethodAuthorized(authzServer: string, methods: string[]): (methodDefinition: {
9
+ declare function makeCheckMethodAuthorized(authzServer: string, methods: string[]): (methodDefinition: {
10
10
  path: string;
11
11
  }, call: ServerInterceptingCall) => ServerInterceptingCall;
12
- export { createCheckMethodAuthorized };
12
+ export { makeCheckMethodAuthorized };
@@ -1,24 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createCheckMethodAuthorized = createCheckMethodAuthorized;
4
- /*
5
- * Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
6
- * http://github.com/fonoster/fonoster
7
- *
8
- * This file is part of Fonoster
9
- *
10
- * Licensed under the MIT License (the "License");
11
- * you may not use this file except in compliance with
12
- * the License. You may obtain a copy of the License at
13
- *
14
- * https://opensource.org/licenses/MIT
15
- *
16
- * Unless required by applicable law or agreed to in writing, software
17
- * distributed under the License is distributed on an "AS IS" BASIS,
18
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
- * See the License for the specific language governing permissions and
20
- * limitations under the License.
21
- */
3
+ exports.makeCheckMethodAuthorized = makeCheckMethodAuthorized;
22
4
  const logger_1 = require("@fonoster/logger");
23
5
  const grpc_js_1 = require("@grpc/grpc-js");
24
6
  const AuthzClient_1 = require("./client/AuthzClient");
@@ -31,7 +13,7 @@ const logger = (0, logger_1.getLogger)({ service: "authz", filePath: __filename
31
13
  * @param {string} authzServer - The public key to validate the token
32
14
  * @return {Function} - The gRPC interceptor
33
15
  */
34
- function createCheckMethodAuthorized(authzServer, methods) {
16
+ function makeCheckMethodAuthorized(authzServer, methods) {
35
17
  logger.verbose("creating check method authorized interceptor", {
36
18
  authzServer,
37
19
  methods
@@ -60,9 +42,7 @@ function createCheckMethodAuthorized(authzServer, methods) {
60
42
  method
61
43
  })
62
44
  .then(() => {
63
- call.sendMessage({ authorized: true }, () => {
64
- logger.verbose("method is authorized", { method, accessKeyId });
65
- });
45
+ call.sendMessage({ authorized: true }, () => { });
66
46
  })
67
47
  .catch((error) => {
68
48
  logger.verbose("method is not authorized", { method, accessKeyId });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fonoster/authz",
3
- "version": "0.8.16",
3
+ "version": "0.8.18",
4
4
  "description": "Authorization module for Fonoster",
5
5
  "author": "Pedro Sanders <psanders@fonoster.com>",
6
6
  "homepage": "https://github.com/fonoster/fonoster#readme",
@@ -26,9 +26,9 @@
26
26
  "access": "public"
27
27
  },
28
28
  "dependencies": {
29
- "@fonoster/common": "^0.8.16",
30
- "@fonoster/identity": "^0.8.16",
31
- "@fonoster/logger": "^0.8.16",
29
+ "@fonoster/common": "^0.8.18",
30
+ "@fonoster/identity": "^0.8.18",
31
+ "@fonoster/logger": "^0.8.18",
32
32
  "@grpc/grpc-js": "~1.10.6",
33
33
  "deepmerge": "^4.3.1",
34
34
  "grpc-health-check": "^2.0.2"
@@ -40,5 +40,5 @@
40
40
  "bugs": {
41
41
  "url": "https://github.com/fonoster/fonoster/issues"
42
42
  },
43
- "gitHead": "3509817cc2cf3ef6684437e33ffd694d1174510b"
43
+ "gitHead": "83c6089aa8d7d5b9adaf425a80f18925d6a77978"
44
44
  }