Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZITI_EVENT_NO_WSS_ROUTERS #182

Merged
merged 1 commit into from
Aug 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"@auth0/auth0-spa-js": "^2.0.4",
"@azure/msal-browser": "^2.38.0",
"@babel/runtime": "^7.17.9",
"@openziti/ziti-browzer-core": "^0.28.0",
"@openziti/ziti-browzer-core": "^0.29.0",
"bowser": "^2.11.0",
"cookie-interceptor": "^1.0.0",
"core-js": "^3.22.8",
Expand Down
1 change: 1 addition & 0 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const ZBR_CONSTANTS =
ZBR_ERROR_CODE_SERVICE_UNREACHABLE: 1004,
ZBR_ERROR_CODE_SERVICE_HAS_NO_CONFIG: 1005,
ZBR_ERROR_CODE_UNSUPPORTED_BROWSER: 1006,
ZBR_ERROR_CODE_NO_WSS_ROUTERS: 1007,

};

Expand Down
34 changes: 27 additions & 7 deletions src/runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -979,6 +979,19 @@ class ZitiBrowzerRuntime {

}

noWSSRoutersEventHandler(noWSSRoutersEvent) {

this.logger.trace(`noWSSRoutersEventHandler() `, noWSSRoutersEvent);

window.zitiBrowzerRuntime.browzer_error({
status: 503,
code: ZBR_CONSTANTS.ZBR_ERROR_CODE_NO_WSS_ROUTERS,
title: `Cannot connect to Ziti Network Edge -- No WSS-Enabled Routers found.`,
message: `Current network is incompatible with BrowZer.`
});

}

updateXgressEventData(event) {

zitiBrowzerRuntime.xgressEventData[0].push( Math.floor(Date.now() / 1000) );
Expand Down Expand Up @@ -1457,13 +1470,14 @@ class ZitiBrowzerRuntime {

this.zitiContext.listControllerVersion();

this.zitiContext.on('idpAuthHealthEvent', this.idpAuthHealthEventHandler);
this.zitiContext.on('noConfigForServiceEvent', this.noConfigForServiceEventHandler);
this.zitiContext.on('noServiceEvent', this.noServiceEventHandler);
this.zitiContext.on('sessionCreationErrorEvent', this.sessionCreationErrorEventHandler);
this.zitiContext.on('invalidAuthEvent', this.invalidAuthEventHandler);
this.zitiContext.on('channelConnectFailEvent', this.channelConnectFailEventHandler);
this.zitiContext.on(ZITI_CONSTANTS.ZITI_EVENT_XGRESS, this.xgressEventHandler);
this.zitiContext.on(ZITI_CONSTANTS.ZITI_EVENT_IDP_AUTH_HEALTH, this.idpAuthHealthEventHandler);
this.zitiContext.on(ZITI_CONSTANTS.ZITI_EVENT_NO_CONFIG_FOR_SERVICE, this.noConfigForServiceEventHandler);
this.zitiContext.on(ZITI_CONSTANTS.ZITI_EVENT_NO_SERVICE, this.noServiceEventHandler);
this.zitiContext.on(ZITI_CONSTANTS.ZITI_EVENT_SESSION_CREATION_ERROR, this.sessionCreationErrorEventHandler);
this.zitiContext.on(ZITI_CONSTANTS.ZITI_EVENT_INVALID_AUTH, this.invalidAuthEventHandler);
this.zitiContext.on(ZITI_CONSTANTS.ZITI_EVENT_CHANNEL_CONNECT_FAIL, this.channelConnectFailEventHandler);
this.zitiContext.on(ZITI_CONSTANTS.ZITI_EVENT_NO_WSS_ROUTERS, this.noWSSRoutersEventHandler);
this.zitiContext.on(ZITI_CONSTANTS.ZITI_EVENT_XGRESS, this.xgressEventHandler);

}

Expand Down Expand Up @@ -1930,6 +1944,12 @@ if (isUndefined(window.zitiBrowzerRuntime)) {

}

else if (event.data.type === 'NO_WSS_ROUTERS') {

window.zitiBrowzerRuntime.noWSSRoutersEventHandler(event.data.payload.event);

}

else if (event.data.type === 'REQUEST_FAILED_WITH_NO_RESPONSE') {

window.zitiBrowzerRuntime.requestFailedWithNoResponseEventHandler(event.data.payload.event);
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1195,10 +1195,10 @@
"@types/emscripten" "^1.39.6"
"@wasmer/wasi" "^1.0.2"

"@openziti/ziti-browzer-core@^0.28.0":
version "0.28.0"
resolved "https://registry.yarnpkg.com/@openziti/ziti-browzer-core/-/ziti-browzer-core-0.28.0.tgz#c0d46cac0a517a19341b0baed2d224a00daefac1"
integrity sha512-XBtyFzBAJiWbIpianlV0PuLkVsAEzqErV5Li7WevDrz3kR3ELhFa1GPYxiX/XVbiMRiD6z4iR7BmZzXHn6Cm4Q==
"@openziti/ziti-browzer-core@^0.29.0":
version "0.29.0"
resolved "https://registry.yarnpkg.com/@openziti/ziti-browzer-core/-/ziti-browzer-core-0.29.0.tgz#c2ac5f0e9fe45ead457c7e145d460ae30e5ea81b"
integrity sha512-Sj3maTB+ywSwpRPSXhz48mwkSGFa5QUVmLnV/8G2c4y05A3cDU4bsg0cYT1Cg5ugEVHJrahhwKClyNPRSwzvUg==
dependencies:
"@openziti/libcrypto-js" "^0.15.0"
"@openziti/ziti-browzer-edge-client" "^0.6.2"
Expand Down
Loading