feat(device-edge): standardize Core channel on mTLS 443
This commit is contained in:
@@ -266,7 +266,7 @@ function normalizeRegistration(value) {
|
||||
|| endpoint.pathname !== "/"
|
||||
|| endpoint.search
|
||||
|| endpoint.hash
|
||||
|| endpoint.port !== "8443"
|
||||
|| endpoint.port !== ""
|
||||
|| endpoint.hostname !== String(value.servername || "").toLowerCase()
|
||||
|| !isPublicIpv4(endpoint.hostname)
|
||||
) {
|
||||
|
||||
@@ -418,7 +418,7 @@ function normalizeEdgeEndpoint(value) {
|
||||
|| endpoint.pathname !== "/"
|
||||
|| endpoint.search
|
||||
|| endpoint.hash
|
||||
|| endpoint.port !== "8443"
|
||||
|| endpoint.port !== ""
|
||||
|| !isPublicIpv4(endpoint.hostname)
|
||||
) {
|
||||
throw new TypeError("device_edge_channel_endpoint_invalid");
|
||||
|
||||
@@ -101,7 +101,7 @@ test("supervisor keeps a failed trust enrollment isolated from other Edges", asy
|
||||
function registration(channelGeneration, edgeRegistrationId = "edge:pilot") {
|
||||
return {
|
||||
edgeRegistrationId,
|
||||
endpoint: "https://155.212.211.15:8443/",
|
||||
endpoint: "https://155.212.211.15/",
|
||||
servername: "155.212.211.15",
|
||||
channelGeneration,
|
||||
trustBundleRef: "edge-trust:moscow-edge",
|
||||
|
||||
@@ -150,7 +150,7 @@ test("normalizes only a pinned Core-initiated public Edge channel", () => {
|
||||
deploymentRef: "deployment:device-edge/moscow-1",
|
||||
lifecycleState: "active",
|
||||
channel: {
|
||||
endpoint: "https://155.212.211.15:8443/",
|
||||
endpoint: "https://155.212.211.15/",
|
||||
servername: "155.212.211.15",
|
||||
generationRef: "channel-generation:1",
|
||||
trustBundleRef: "edge-trust:moscow-edge",
|
||||
@@ -163,14 +163,15 @@ test("normalizes only a pinned Core-initiated public Edge channel", () => {
|
||||
},
|
||||
});
|
||||
|
||||
assert.equal(command.channel.endpoint, "https://155.212.211.15:8443/");
|
||||
assert.equal(command.channel.endpoint, "https://155.212.211.15/");
|
||||
assert.equal(command.channel.lifecycleState, "active");
|
||||
assert.equal(command.channel.certificateIdentities.length, 1);
|
||||
for (const endpoint of [
|
||||
"https://127.0.0.1:8443/",
|
||||
"https://192.168.1.1:8443/",
|
||||
"https://127.0.0.1/",
|
||||
"https://192.168.1.1/",
|
||||
"https://155.212.211.15:8443/",
|
||||
"https://155.212.211.15:9921/",
|
||||
"http://155.212.211.15:8443/",
|
||||
"http://155.212.211.15/",
|
||||
]) {
|
||||
assert.throws(
|
||||
() => normalizeInfrastructureManagementCommand("edge.ensure", {
|
||||
|
||||
@@ -198,7 +198,7 @@ test("lists only bounded active Edge channel registrations without secrets", asy
|
||||
step("from device_edges", {
|
||||
rows: [{
|
||||
id: edgeId,
|
||||
channel_endpoint: "https://155.212.211.15:8443/",
|
||||
channel_endpoint: "https://155.212.211.15/",
|
||||
channel_servername: "155.212.211.15",
|
||||
channel_generation_ref: "channel-generation:1",
|
||||
channel_trust_bundle_ref: "edge-trust:moscow-edge",
|
||||
@@ -218,7 +218,7 @@ test("lists only bounded active Edge channel registrations without secrets", asy
|
||||
|
||||
assert.deepEqual(registrations[0], {
|
||||
edgeRegistrationId: `edge:${edgeId}`,
|
||||
endpoint: "https://155.212.211.15:8443/",
|
||||
endpoint: "https://155.212.211.15/",
|
||||
servername: "155.212.211.15",
|
||||
channelGeneration: "channel-generation:1",
|
||||
trustBundleRef: "edge-trust:moscow-edge",
|
||||
|
||||
@@ -412,7 +412,7 @@ function normalizeConfig(options) {
|
||||
channelGeneration,
|
||||
trust,
|
||||
host: normalizeHost(options.host ?? "127.0.0.1"),
|
||||
port: normalizePort(options.port ?? 8443),
|
||||
port: normalizePort(options.port ?? 443),
|
||||
keepaliveMs,
|
||||
deadPeerMs,
|
||||
acceptanceTimeoutMs: normalizeDuration(
|
||||
|
||||
@@ -75,7 +75,7 @@ export async function readRuntimeConfiguration(environment = {}) {
|
||||
channelGeneration: config.channelGeneration,
|
||||
trustGeneration: config.trustGeneration,
|
||||
host: normalizeHost(environment.DEVICE_EDGE_CHANNEL_HOST ?? "0.0.0.0"),
|
||||
port: normalizePort(environment.DEVICE_EDGE_CHANNEL_PORT, 8443),
|
||||
port: normalizePort(environment.DEVICE_EDGE_CHANNEL_PORT, 443),
|
||||
tls: Object.freeze({
|
||||
key,
|
||||
cert,
|
||||
|
||||
Reference in New Issue
Block a user