@routr/registry 2.0.8-alpha.8 → 2.0.9
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/config/get_config.js +3 -3
- package/dist/config/schema.js +2 -2
- package/dist/envs.d.ts +2 -0
- package/dist/envs.js +25 -0
- package/dist/errors.js +1 -1
- package/dist/request.js +3 -1
- package/dist/runner.js +14 -4
- package/dist/sender.d.ts +2 -2
- package/dist/sender.js +3 -4
- package/dist/service.js +11 -12
- package/dist/tracer.js +1 -1
- package/dist/utils.d.ts +3 -5
- package/dist/utils.js +16 -55
- package/package.json +9 -6
|
@@ -28,7 +28,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.getConfig = void 0;
|
|
30
30
|
/*
|
|
31
|
-
* Copyright (C)
|
|
31
|
+
* Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
|
|
32
32
|
* http://github.com/fonoster/routr
|
|
33
33
|
*
|
|
34
34
|
* This file is part of Routr
|
|
@@ -46,16 +46,16 @@ exports.getConfig = void 0;
|
|
|
46
46
|
* limitations under the License.
|
|
47
47
|
*/
|
|
48
48
|
const types_1 = require("../types");
|
|
49
|
-
const fs_1 = __importDefault(require("fs"));
|
|
50
49
|
const schema_1 = require("./schema");
|
|
51
50
|
const ajv_1 = __importDefault(require("ajv"));
|
|
52
51
|
const E = __importStar(require("fp-ts/Either"));
|
|
53
52
|
const errors_1 = require("../errors");
|
|
53
|
+
const common_1 = require("@routr/common");
|
|
54
54
|
const ajv = new ajv_1.default();
|
|
55
55
|
const validate = ajv.compile(schema_1.schema);
|
|
56
56
|
const getConfig = (path) => {
|
|
57
57
|
var _a, _b, _c;
|
|
58
|
-
const c =
|
|
58
|
+
const c = common_1.Helper.readConfigFile(path);
|
|
59
59
|
if (!validate(Object.assign({}, c))) {
|
|
60
60
|
return E.left(new errors_1.InvalidSchemaConfiguration(JSON.stringify(validate.errors[0].message)));
|
|
61
61
|
}
|
package/dist/config/schema.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.schema = void 0;
|
|
4
4
|
/*
|
|
5
|
-
* Copyright (C)
|
|
5
|
+
* Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
|
|
6
6
|
* http://github.com/fonoster/routr
|
|
7
7
|
*
|
|
8
8
|
* This file is part of Routr
|
|
@@ -29,7 +29,7 @@ exports.schema = {
|
|
|
29
29
|
enum: ["Registry", "registry"]
|
|
30
30
|
},
|
|
31
31
|
apiVersion: {
|
|
32
|
-
enum: ["
|
|
32
|
+
enum: ["v2beta1"]
|
|
33
33
|
},
|
|
34
34
|
metadata: {
|
|
35
35
|
description: "Resource metadata",
|
package/dist/envs.d.ts
ADDED
package/dist/envs.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ENABLE_HEALTHCHECKS = exports.CONFIG_PATH = void 0;
|
|
4
|
+
/*
|
|
5
|
+
* Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
|
|
6
|
+
* http://github.com/fonoster
|
|
7
|
+
*
|
|
8
|
+
* This file is part of Routr.
|
|
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
|
+
*/
|
|
22
|
+
const common_1 = require("@routr/common");
|
|
23
|
+
common_1.Assertions.assertEnvsAreSet(["CONFIG_PATH"]);
|
|
24
|
+
exports.CONFIG_PATH = process.env.CONFIG_PATH;
|
|
25
|
+
exports.ENABLE_HEALTHCHECKS = process.env.ENABLE_HEALTHCHECKS !== "false";
|
package/dist/errors.js
CHANGED
|
@@ -25,7 +25,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.InvalidSchemaConfiguration = void 0;
|
|
27
27
|
/*
|
|
28
|
-
* Copyright (C)
|
|
28
|
+
* Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
|
|
29
29
|
* http://github.com/fonoster/routr
|
|
30
30
|
*
|
|
31
31
|
* This file is part of Routr
|
package/dist/request.js
CHANGED
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getPortFromAddress = exports.getHostFromAddress = void 0;
|
|
7
7
|
/*
|
|
8
|
-
* Copyright (C)
|
|
8
|
+
* Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
|
|
9
9
|
* http://github.com/fonoster/routr
|
|
10
10
|
*
|
|
11
11
|
* This file is part of Routr
|
|
@@ -135,6 +135,8 @@ function createRegistrationRequest(params) {
|
|
|
135
135
|
methodParam: common_1.Method.REGISTER,
|
|
136
136
|
secure: params.secure
|
|
137
137
|
},
|
|
138
|
+
via: [],
|
|
139
|
+
recordRoute: [],
|
|
138
140
|
messageType: common_1.CommonTypes.MessageType.REQUEST
|
|
139
141
|
}
|
|
140
142
|
};
|
package/dist/runner.js
CHANGED
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
};
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
/*
|
|
8
|
-
* Copyright (C)
|
|
8
|
+
* Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
|
|
9
9
|
* http://github.com/fonoster/routr
|
|
10
10
|
*
|
|
11
11
|
* This file is part of Routr
|
|
@@ -26,14 +26,24 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
require("./tracer").init("dispatcher");
|
|
27
27
|
const service_1 = __importDefault(require("./service"));
|
|
28
28
|
const get_config_1 = require("./config/get_config");
|
|
29
|
-
const common_1 = require("@routr/common");
|
|
30
29
|
const logger_1 = require("@fonoster/logger");
|
|
30
|
+
const envs_1 = require("./envs");
|
|
31
|
+
const express_1 = __importDefault(require("express"));
|
|
32
|
+
const app = (0, express_1.default)();
|
|
33
|
+
const healthPort = 8080;
|
|
31
34
|
const logger = (0, logger_1.getLogger)({ service: "registry", filePath: __filename });
|
|
32
|
-
|
|
33
|
-
const config = (0, get_config_1.getConfig)(process.env.CONFIG_PATH);
|
|
35
|
+
const config = (0, get_config_1.getConfig)(envs_1.CONFIG_PATH);
|
|
34
36
|
if (config._tag === "Right") {
|
|
35
37
|
(0, service_1.default)(config.right);
|
|
36
38
|
}
|
|
37
39
|
else {
|
|
38
40
|
logger.error(config.left);
|
|
39
41
|
}
|
|
42
|
+
if (envs_1.ENABLE_HEALTHCHECKS) {
|
|
43
|
+
app.get("/healthz", (_, res) => {
|
|
44
|
+
res.send("OK");
|
|
45
|
+
});
|
|
46
|
+
app.listen(healthPort, () => {
|
|
47
|
+
logger.info(`health check endpoint listening on port ${healthPort}`);
|
|
48
|
+
});
|
|
49
|
+
}
|
package/dist/sender.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CommonErrors as CE } from "@routr/common";
|
|
2
2
|
import { RegistrationRequest, SendMessageResponse } from "./types";
|
|
3
|
-
export declare const sendRegisterMessage: (requesterAddr: string) => (request: RegistrationRequest) => Promise<ServiceUnavailableError | SendMessageResponse>;
|
|
3
|
+
export declare const sendRegisterMessage: (requesterAddr: string) => (request: RegistrationRequest) => Promise<CE.ServiceUnavailableError | SendMessageResponse>;
|
package/dist/sender.js
CHANGED
|
@@ -25,7 +25,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.sendRegisterMessage = void 0;
|
|
27
27
|
/*
|
|
28
|
-
* Copyright (C)
|
|
28
|
+
* Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
|
|
29
29
|
* http://github.com/fonoster/routr
|
|
30
30
|
*
|
|
31
31
|
* This file is part of Routr
|
|
@@ -44,14 +44,13 @@ exports.sendRegisterMessage = void 0;
|
|
|
44
44
|
*/
|
|
45
45
|
const grpc = __importStar(require("@grpc/grpc-js"));
|
|
46
46
|
const common_1 = require("@routr/common");
|
|
47
|
-
const common_2 = require("@routr/common");
|
|
48
47
|
const sendRegisterMessage = (requesterAddr) => {
|
|
49
48
|
return (request) => {
|
|
50
|
-
const client = new
|
|
49
|
+
const client = new common_1.CommonRequester.REQUESTER_PROTO.v2beta1.Requester(requesterAddr, grpc.credentials.createInsecure());
|
|
51
50
|
return new Promise((resolve, reject) => {
|
|
52
51
|
client.sendMessage(request, (err, response) => {
|
|
53
52
|
if ((err === null || err === void 0 ? void 0 : err.code) === 14) {
|
|
54
|
-
return reject(new common_1.ServiceUnavailableError(requesterAddr));
|
|
53
|
+
return reject(new common_1.CommonErrors.ServiceUnavailableError(requesterAddr));
|
|
55
54
|
}
|
|
56
55
|
else if (err) {
|
|
57
56
|
return reject(err);
|
package/dist/service.js
CHANGED
|
@@ -13,7 +13,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
/*
|
|
16
|
-
* Copyright (C)
|
|
16
|
+
* Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
|
|
17
17
|
* http://github.com/fonoster/routr
|
|
18
18
|
*
|
|
19
19
|
* This file is part of Routr
|
|
@@ -36,7 +36,6 @@ const types_1 = require("./types");
|
|
|
36
36
|
const utils_1 = require("./utils");
|
|
37
37
|
const common_1 = require("@routr/common");
|
|
38
38
|
const logger_1 = require("@fonoster/logger");
|
|
39
|
-
const common_2 = require("@routr/common");
|
|
40
39
|
const logger = (0, logger_1.getLogger)({ service: "registry", filePath: __filename });
|
|
41
40
|
const DEFAULT_REGISTRATION_INTERVAL = 60;
|
|
42
41
|
// TODO:
|
|
@@ -49,15 +48,15 @@ const DEFAULT_REGISTRATION_INTERVAL = 60;
|
|
|
49
48
|
function registryService(config) {
|
|
50
49
|
var _a;
|
|
51
50
|
logger.info("starting registry service");
|
|
52
|
-
const registerInterval = (_a = config.registerInterval) !== null && _a !== void 0 ? _a : DEFAULT_REGISTRATION_INTERVAL;
|
|
53
51
|
const store = (0, utils_1.buildStore)(config);
|
|
52
|
+
const dataAPI = common_1.CommonConnect.apiClient({ apiAddr: config.apiAddr });
|
|
53
|
+
const registerInterval = (_a = config.registerInterval) !== null && _a !== void 0 ? _a : DEFAULT_REGISTRATION_INTERVAL;
|
|
54
54
|
// Creates internval to send registration request every X seconds
|
|
55
55
|
setInterval(() => __awaiter(this, void 0, void 0, function* () {
|
|
56
56
|
logger.verbose("starting registration process");
|
|
57
|
-
let
|
|
58
|
-
const dataAPI = common_1.CommonConnect.dataAPI(config.apiAddr);
|
|
57
|
+
let trunks = [];
|
|
59
58
|
try {
|
|
60
|
-
|
|
59
|
+
trunks = yield (0, utils_1.findTrunks)(dataAPI);
|
|
61
60
|
}
|
|
62
61
|
catch (err) {
|
|
63
62
|
logger.error("failed to retrieve trunks from API", err);
|
|
@@ -65,10 +64,10 @@ function registryService(config) {
|
|
|
65
64
|
}
|
|
66
65
|
// Create a list of trunks in the Store
|
|
67
66
|
const trunksInStore = (yield store.list()).map((r) => r.trunkRef);
|
|
68
|
-
const registryInvocations =
|
|
69
|
-
.filter((
|
|
70
|
-
.map((
|
|
71
|
-
const registrationRequestInput = (0, utils_1.registrationRequestInputFromTrunk)(
|
|
67
|
+
const registryInvocations = trunks
|
|
68
|
+
.filter((trunk) => !trunksInStore.includes(trunk.ref))
|
|
69
|
+
.map((trunk) => __awaiter(this, void 0, void 0, function* () {
|
|
70
|
+
const registrationRequestInput = (0, utils_1.registrationRequestInputFromTrunk)(trunk, config);
|
|
72
71
|
const request = (0, request_1.default)(registrationRequestInput);
|
|
73
72
|
return (0, sender_1.sendRegisterMessage)(config.requesterAddr)(request);
|
|
74
73
|
}));
|
|
@@ -80,7 +79,7 @@ function registryService(config) {
|
|
|
80
79
|
logger.error("request rejected", result.reason);
|
|
81
80
|
return;
|
|
82
81
|
}
|
|
83
|
-
if (result.value instanceof
|
|
82
|
+
if (result.value instanceof common_1.CommonErrors.ServiceUnavailableError) {
|
|
84
83
|
logger.error("service unavailable", result.value);
|
|
85
84
|
return;
|
|
86
85
|
}
|
|
@@ -88,7 +87,7 @@ function registryService(config) {
|
|
|
88
87
|
// Makes sure we send register before the last register expires
|
|
89
88
|
const retentionTime = ((_e = (_c = (_b = message.contact) === null || _b === void 0 ? void 0 : _b.expires) !== null && _c !== void 0 ? _c : (_d = message.expires) === null || _d === void 0 ? void 0 : _d.expires) !== null && _e !== void 0 ? _e : types_1.DEFAULT_EXPIRES) - registerInterval;
|
|
90
89
|
// TODO: Refactor to use ResponseType instead of string
|
|
91
|
-
const status = message.responseType
|
|
90
|
+
const status = message.responseType == common_1.CommonTypes.ResponseType.OK
|
|
92
91
|
? types_1.RegistrationEntryStatus.REGISTERED
|
|
93
92
|
: types_1.RegistrationEntryStatus.QUARANTINE;
|
|
94
93
|
// Storing trunk in registry with status and retention time
|
package/dist/tracer.js
CHANGED
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.init = void 0;
|
|
7
7
|
/*
|
|
8
|
-
* Copyright (C)
|
|
8
|
+
* Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
|
|
9
9
|
* http://github.com/fonoster/routr
|
|
10
10
|
*
|
|
11
11
|
* This file is part of Routr
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
import { Transport } from "@routr/common";
|
|
2
1
|
import { CommonConnect as CC } from "@routr/common";
|
|
3
2
|
import MemoryStore from "./memory_store";
|
|
4
3
|
import RedisStore from "./redis_store";
|
|
5
4
|
import { IRegistryStore, RegistryConfig, Trunk } from "./types";
|
|
6
5
|
export declare function getUnregisteredTrunks(store: IRegistryStore): (trunks: Trunk[]) => Promise<Trunk[]>;
|
|
7
|
-
export declare function findTrunks(
|
|
6
|
+
export declare function findTrunks(apiClient: CC.APIClient): Promise<CC.Trunk[]>;
|
|
8
7
|
export declare const configFromString: (params: string, allowedKeys: string[]) => Record<string, string | boolean>;
|
|
9
8
|
export declare const buildStore: (config: RegistryConfig) => MemoryStore | RedisStore;
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const registrationRequestInputFromTrunk: (trunk: Trunk, config: RegistryConfig) => {
|
|
9
|
+
export declare const registrationRequestInputFromTrunk: (trunk: CC.Trunk, config: RegistryConfig) => {
|
|
12
10
|
trunkRef: string;
|
|
13
11
|
user: string;
|
|
14
12
|
targetDomain: string;
|
|
15
13
|
targetAddress: string;
|
|
16
14
|
proxyAddress: string;
|
|
17
|
-
transport: Transport;
|
|
15
|
+
transport: import("@routr/common").Transport;
|
|
18
16
|
auth: {
|
|
19
17
|
username: string;
|
|
20
18
|
secret: string;
|
package/dist/utils.js
CHANGED
|
@@ -12,27 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.registrationRequestInputFromTrunk = exports.
|
|
16
|
-
/*
|
|
17
|
-
* Copyright (C) 2022 by Fonoster Inc (https://fonoster.com)
|
|
18
|
-
* http://github.com/fonoster
|
|
19
|
-
*
|
|
20
|
-
* This file is part of Routr.
|
|
21
|
-
*
|
|
22
|
-
* Licensed under the MIT License (the "License");
|
|
23
|
-
* you may not use this file except in compliance with
|
|
24
|
-
* the License. You may obtain a copy of the License at
|
|
25
|
-
*
|
|
26
|
-
* https://opensource.org/licenses/MIT
|
|
27
|
-
*
|
|
28
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
29
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
30
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
31
|
-
* See the License for the specific language governing permissions and
|
|
32
|
-
* limitations under the License.
|
|
33
|
-
*/
|
|
34
|
-
const common_1 = require("@routr/common");
|
|
35
|
-
const common_2 = require("@routr/common");
|
|
15
|
+
exports.registrationRequestInputFromTrunk = exports.buildStore = exports.configFromString = exports.findTrunks = exports.getUnregisteredTrunks = void 0;
|
|
36
16
|
const memory_store_1 = __importDefault(require("./memory_store"));
|
|
37
17
|
const redis_store_1 = __importDefault(require("./redis_store"));
|
|
38
18
|
const types_1 = require("./types");
|
|
@@ -47,13 +27,12 @@ function getUnregisteredTrunks(store) {
|
|
|
47
27
|
}
|
|
48
28
|
exports.getUnregisteredTrunks = getUnregisteredTrunks;
|
|
49
29
|
// eslint-disable-next-line require-jsdoc
|
|
50
|
-
function findTrunks(
|
|
30
|
+
function findTrunks(apiClient) {
|
|
51
31
|
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
-
return yield
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
});
|
|
32
|
+
return (yield apiClient.trunks.findBy({
|
|
33
|
+
fieldName: "sendRegister",
|
|
34
|
+
fieldValue: "true"
|
|
35
|
+
})).items;
|
|
57
36
|
});
|
|
58
37
|
}
|
|
59
38
|
exports.findTrunks = findTrunks;
|
|
@@ -89,39 +68,21 @@ const buildStore = (config) => {
|
|
|
89
68
|
}
|
|
90
69
|
};
|
|
91
70
|
exports.buildStore = buildStore;
|
|
92
|
-
const convertResourceToTrunk = (dataAPI, resource) => __awaiter(void 0, void 0, void 0, function* () {
|
|
93
|
-
var _a, _b, _c, _d, _e, _f;
|
|
94
|
-
const metadata = resource.metadata;
|
|
95
|
-
const trunkSpec = resource.spec;
|
|
96
|
-
const uri = (_b = (_a = trunkSpec.outbound) === null || _a === void 0 ? void 0 : _a.uris[0]) === null || _b === void 0 ? void 0 : _b.uri;
|
|
97
|
-
// WARNING: Perhaps we should bring this on a single API call
|
|
98
|
-
const cred = yield dataAPI.get((_c = trunkSpec.outbound) === null || _c === void 0 ? void 0 : _c.credentialsRef);
|
|
99
|
-
const usernameAndPassword = cred === null || cred === void 0 ? void 0 : cred.spec.credentials;
|
|
100
|
-
return {
|
|
101
|
-
ref: resource.ref,
|
|
102
|
-
name: resource.metadata.name,
|
|
103
|
-
region: metadata.region,
|
|
104
|
-
host: uri.host,
|
|
105
|
-
port: (_d = uri.port) !== null && _d !== void 0 ? _d : 5060,
|
|
106
|
-
user: uri.user,
|
|
107
|
-
credentials: {
|
|
108
|
-
username: usernameAndPassword === null || usernameAndPassword === void 0 ? void 0 : usernameAndPassword.username,
|
|
109
|
-
secret: usernameAndPassword === null || usernameAndPassword === void 0 ? void 0 : usernameAndPassword.password
|
|
110
|
-
},
|
|
111
|
-
transport: (_f = (_e = uri.transport) === null || _e === void 0 ? void 0 : _e.toLowerCase()) !== null && _f !== void 0 ? _f : common_1.Transport.UDP
|
|
112
|
-
};
|
|
113
|
-
});
|
|
114
|
-
exports.convertResourceToTrunk = convertResourceToTrunk;
|
|
115
71
|
const registrationRequestInputFromTrunk = (trunk, config) => {
|
|
72
|
+
var _a, _b;
|
|
73
|
+
const uri = trunk.uris[0];
|
|
116
74
|
return {
|
|
117
75
|
trunkRef: trunk.ref,
|
|
118
|
-
user:
|
|
119
|
-
targetDomain:
|
|
120
|
-
targetAddress: `${
|
|
76
|
+
user: uri.user,
|
|
77
|
+
targetDomain: uri.host,
|
|
78
|
+
targetAddress: `${uri.host}:${uri.port}`,
|
|
121
79
|
// TODO: Find closest edgeport instead of [0]
|
|
122
80
|
proxyAddress: config.edgePorts[0].address,
|
|
123
|
-
transport:
|
|
124
|
-
auth:
|
|
81
|
+
transport: uri.transport,
|
|
82
|
+
auth: {
|
|
83
|
+
username: (_a = trunk.outboundCredentials) === null || _a === void 0 ? void 0 : _a.username,
|
|
84
|
+
secret: (_b = trunk.outboundCredentials) === null || _b === void 0 ? void 0 : _b.password
|
|
85
|
+
},
|
|
125
86
|
methods: config.methods
|
|
126
87
|
};
|
|
127
88
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@routr/registry",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.9",
|
|
4
4
|
"description": "Sends trunks registrations and maintains their bindings",
|
|
5
5
|
"author": "Pedro Sanders <psanders@fonoster.com>",
|
|
6
6
|
"homepage": "https://github.com/fonoster/routr#readme",
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
"build": "tsc -b tsconfig.json"
|
|
13
13
|
},
|
|
14
14
|
"bin": {
|
|
15
|
-
"run_registry": "dist/runner.js"
|
|
15
|
+
"run_registry": "dist/runner.js",
|
|
16
|
+
"healthcheck_registry": "dist/healthcheck.js"
|
|
16
17
|
},
|
|
17
18
|
"directories": {
|
|
18
19
|
"src": "src",
|
|
@@ -25,7 +26,7 @@
|
|
|
25
26
|
"access": "public"
|
|
26
27
|
},
|
|
27
28
|
"dependencies": {
|
|
28
|
-
"@grpc/grpc-js": "^1.
|
|
29
|
+
"@grpc/grpc-js": "^1.8.4",
|
|
29
30
|
"@opentelemetry/api": "^1.0.4",
|
|
30
31
|
"@opentelemetry/exporter-jaeger": "^1.0.4",
|
|
31
32
|
"@opentelemetry/instrumentation": "^0.27.0",
|
|
@@ -34,9 +35,10 @@
|
|
|
34
35
|
"@opentelemetry/sdk-trace-base": "^1.0.4",
|
|
35
36
|
"@opentelemetry/sdk-trace-node": "^1.0.4",
|
|
36
37
|
"@opentelemetry/semantic-conventions": "^1.0.4",
|
|
37
|
-
"@routr/common": "^2.0.
|
|
38
|
-
"@routr/processor": "^2.0.
|
|
38
|
+
"@routr/common": "^2.0.9",
|
|
39
|
+
"@routr/processor": "^2.0.9",
|
|
39
40
|
"ajv": "^6.12.6",
|
|
41
|
+
"express": "^4.18.2",
|
|
40
42
|
"fp-ts": "^2.11.8",
|
|
41
43
|
"pb-util": "^1.0.3",
|
|
42
44
|
"redis": "^4.0.4",
|
|
@@ -50,7 +52,8 @@
|
|
|
50
52
|
"url": "https://github.com/fonoster/routr/issues"
|
|
51
53
|
},
|
|
52
54
|
"devDependencies": {
|
|
55
|
+
"@types/express": "^4.17.17",
|
|
53
56
|
"@types/uniqid": "^5.3.2"
|
|
54
57
|
},
|
|
55
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "62eb05f0b3bfa05d84c9ce4b4644de5fb5453295"
|
|
56
59
|
}
|