@routr/connect 2.0.8-alpha.40 → 2.0.8-alpha.41
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/access.d.ts +4 -0
- package/dist/handlers.js +3 -0
- package/dist/router.js +3 -0
- package/dist/utils.js +2 -2
- package/package.json +5 -5
package/dist/access.d.ts
CHANGED
@@ -8,8 +8,12 @@ export declare const checkAccess: (accessRequest: {
|
|
8
8
|
routingDirection: RoutingDirection;
|
9
9
|
}) => Promise<Record<string, unknown>>;
|
10
10
|
export declare const checkAgentOrPeerAccess: (request: MessageRequest, caller: CC.RoutableResourceUnion) => Promise<{
|
11
|
+
metadata: {
|
12
|
+
accessKeyId: string;
|
13
|
+
};
|
11
14
|
message: {
|
12
15
|
responseType: CT.ResponseType;
|
16
|
+
reasonPhrase: string;
|
13
17
|
wwwAuthenticate: {
|
14
18
|
scheme: string;
|
15
19
|
realm: string;
|
package/dist/handlers.js
CHANGED
@@ -101,6 +101,9 @@ exports.handleRegistry = handleRegistry;
|
|
101
101
|
const handleRequest = (location, apiClient) => (request, res) => __awaiter(void 0, void 0, void 0, function* () {
|
102
102
|
try {
|
103
103
|
const req = common_1.Environment.ENFORCE_E164 ? enforceE164(request) : request;
|
104
|
+
req.metadata = {
|
105
|
+
accessKeyId: "xxxxxxxxx"
|
106
|
+
};
|
104
107
|
const route = processor_1.Extensions.getHeaderValue(req, common_1.CommonTypes.ExtraHeader.EDGEPORT_REF)
|
105
108
|
? location_1.Helper.createRouteFromLastMessage(req)
|
106
109
|
: yield (0, router_1.router)(location, apiClient)(req);
|
package/dist/router.js
CHANGED
@@ -48,6 +48,9 @@ function router(location, apiClient) {
|
|
48
48
|
if ((0, utils_1.hasXConnectObjectHeader)(request)) {
|
49
49
|
const connectToken = processor_1.Extensions.getHeaderValue(request, common_1.CommonTypes.ExtraHeader.CONNECT_TOKEN);
|
50
50
|
try {
|
51
|
+
if (!jwtVerifier) {
|
52
|
+
return common_1.Auth.createServerInternalErrorResponse();
|
53
|
+
}
|
51
54
|
const payload = (yield jwtVerifier.verify(connectToken));
|
52
55
|
const domain = yield (0, utils_1.findDomain)(apiClient, payload.domain);
|
53
56
|
if (!payload.allowedMethods.includes(common_1.Method.INVITE)) {
|
package/dist/utils.js
CHANGED
@@ -68,13 +68,13 @@ const isKind = (res, kind) => {
|
|
68
68
|
else if (res == null) {
|
69
69
|
return false;
|
70
70
|
}
|
71
|
-
else if ("
|
71
|
+
else if ("privacy" in res && kind === common_1.CommonConnect.Kind.AGENT) {
|
72
72
|
return true;
|
73
73
|
}
|
74
74
|
else if ("telUrl" in res && kind === common_1.CommonConnect.Kind.NUMBER) {
|
75
75
|
return true;
|
76
76
|
}
|
77
|
-
else if ("
|
77
|
+
else if ("username" in res && kind === common_1.CommonConnect.Kind.PEER) {
|
78
78
|
return true;
|
79
79
|
}
|
80
80
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@routr/connect",
|
3
|
-
"version": "2.0.8-alpha.
|
3
|
+
"version": "2.0.8-alpha.41",
|
4
4
|
"description": "Default processor",
|
5
5
|
"author": "Pedro Sanders <psanders@fonoster.com>",
|
6
6
|
"homepage": "https://github.com/fonoster/routr#readme",
|
@@ -29,9 +29,9 @@
|
|
29
29
|
"@opentelemetry/sdk-trace-base": "^1.0.4",
|
30
30
|
"@opentelemetry/sdk-trace-node": "^1.0.4",
|
31
31
|
"@opentelemetry/semantic-conventions": "^1.0.4",
|
32
|
-
"@routr/common": "^2.0.8-alpha.
|
33
|
-
"@routr/location": "^2.0.8-alpha.
|
34
|
-
"@routr/processor": "^2.0.8-alpha.
|
32
|
+
"@routr/common": "^2.0.8-alpha.41",
|
33
|
+
"@routr/location": "^2.0.8-alpha.41",
|
34
|
+
"@routr/processor": "^2.0.8-alpha.41",
|
35
35
|
"jsonwebtoken": "^9.0.0"
|
36
36
|
},
|
37
37
|
"devDependencies": {
|
@@ -50,5 +50,5 @@
|
|
50
50
|
"bugs": {
|
51
51
|
"url": "https://github.com/fonoster/routr/issues"
|
52
52
|
},
|
53
|
-
"gitHead": "
|
53
|
+
"gitHead": "52f44320b57824dfea40f48b02b44b9a8e6bdda3"
|
54
54
|
}
|