@fonoster/authz 0.26.0 → 0.30.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.
@@ -75,7 +75,11 @@ class AuthzServer {
75
75
  const server = new grpc.Server();
76
76
  server.addService(serviceDefinition_1.serviceDefinition, {
77
77
  checkSessionAuthorized: async (call, callback) => {
78
- logger.verbose("checkSessionAuthorized called", call.request);
78
+ // Not the request itself: it carries the caller's token (M11).
79
+ logger.verbose("checkSessionAuthorized called", {
80
+ accessKeyId: call.request?.accessKeyId ?? call.request?.access_key_id,
81
+ appRef: call.request?.appRef ?? call.request?.app_ref
82
+ });
79
83
  try {
80
84
  const authorized = await handler.checkSessionAuthorized(call.request);
81
85
  callback(null, { authorized });
@@ -89,7 +93,11 @@ class AuthzServer {
89
93
  }
90
94
  },
91
95
  checkMethodAuthorized: async (call, callback) => {
92
- logger.verbose("checkMethodAuthorized called", call.request);
96
+ // Not the request itself: it carries the caller's token (M11).
97
+ logger.verbose("checkMethodAuthorized called", {
98
+ accessKeyId: call.request?.accessKeyId,
99
+ method: call.request?.method
100
+ });
93
101
  try {
94
102
  const authorized = await handler.checkMethodAuthorized(call.request);
95
103
  callback(null, { authorized });
@@ -103,7 +111,9 @@ class AuthzServer {
103
111
  }
104
112
  },
105
113
  addBillingMeterEvent: async (call, callback) => {
106
- logger.verbose("addBillingMeterEvent called", call.request);
114
+ logger.verbose("addBillingMeterEvent called", {
115
+ accessKeyId: call.request?.accessKeyId
116
+ });
107
117
  try {
108
118
  const request = {
109
119
  accessKeyId: call.request.accessKeyId,
package/dist/types.d.ts CHANGED
@@ -16,7 +16,20 @@
16
16
  * See the License for the specific language governing permissions and
17
17
  * limitations under the License.
18
18
  */
19
- import { VoiceRequest } from "@fonoster/common";
19
+ /** The call a session would serve (CheckSessionAuthorizedRequest in authz.proto). */
20
+ type VoiceRequest = {
21
+ appRef: string;
22
+ accessKeyId: string;
23
+ endpoint: string;
24
+ ingressNumber: string;
25
+ callerName: string;
26
+ callerNumber: string;
27
+ mediaSessionRef: string;
28
+ callRef: string;
29
+ sessionToken: string;
30
+ callDirection: "FROM_PSTN" | "TO_PSTN" | "INTRA_NETWORK";
31
+ metadata?: Record<string, string>;
32
+ };
20
33
  type ServerConfig = {
21
34
  bind?: string;
22
35
  port?: number;
package/dist/types.js CHANGED
@@ -1,2 +1,20 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
4
+ * http://github.com/fonoster/fonoster
5
+ *
6
+ * This file is part of Fonoster
7
+ *
8
+ * Licensed under the MIT License (the "License");
9
+ * you may not use this file except in compliance with
10
+ * the License. You may obtain a copy of the License at
11
+ *
12
+ * https://opensource.org/licenses/MIT
13
+ *
14
+ * Unless required by applicable law or agreed to in writing, software
15
+ * distributed under the License is distributed on an "AS IS" BASIS,
16
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ * See the License for the specific language governing permissions and
18
+ * limitations under the License.
19
+ */
2
20
  Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fonoster/authz",
3
- "version": "0.26.0",
3
+ "version": "0.30.0",
4
4
  "description": "Authorization module for Fonoster",
5
5
  "author": "Pedro Sanders <psanders@fonoster.com>",
6
6
  "homepage": "https://github.com/fonoster/fonoster#readme",
@@ -24,10 +24,10 @@
24
24
  "access": "public"
25
25
  },
26
26
  "dependencies": {
27
- "@fonoster/common": "^0.26.0",
28
- "@fonoster/identity": "^0.26.0",
29
- "@fonoster/logger": "^0.26.0",
30
- "@grpc/grpc-js": "~1.10.6",
27
+ "@fonoster/common": "^0.30.0",
28
+ "@fonoster/identity": "^0.30.0",
29
+ "@fonoster/logger": "^0.30.0",
30
+ "@grpc/grpc-js": "~1.14.6",
31
31
  "deepmerge": "^4.3.1",
32
32
  "grpc-health-check": "^2.0.2"
33
33
  },
@@ -38,5 +38,5 @@
38
38
  "bugs": {
39
39
  "url": "https://github.com/fonoster/fonoster/issues"
40
40
  },
41
- "gitHead": "d14f414d791a33f92e8c4225f7e462abc440a142"
41
+ "gitHead": "b59b06a3ef325abe3f188c0fb87cc22d50ed5471"
42
42
  }