Skip to content

Commit 2be7a3e

Browse files
committed
fix(push): keep govcloud subdomain for dev hosts
Govcloud in dev should use push.services.govcloud.dev.keepersecurity.us as the push server host, rather than push.services.dev.keepersecurity.us. Prod Govcloud continues to use push.services.keepersecurity.us, and omits "govcloud" from the hostname.
1 parent 9ea990b commit 2be7a3e

4 files changed

Lines changed: 14 additions & 5 deletions

File tree

keeperapi/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

keeperapi/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@keeper-security/keeperapi",
33
"description": "Keeper API Javascript SDK",
4-
"version": "18.2.0",
4+
"version": "18.2.1",
55
"browser": "dist/browser/index.js",
66
"main": "dist/index.cjs.js",
77
"types": "dist/node/index.d.ts",

keeperapi/src/auth.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { KeyWrapper, platform } from './platform'
1212
import {
1313
generateEncryptionKey,
1414
generateUidBytes,
15+
getKeeperPushSocketUrl,
1516
normal64,
1617
normal64Bytes,
1718
resolvablePromise,
@@ -258,8 +259,7 @@ export class Auth {
258259
}
259260

260261
async connect() {
261-
// When connecting to govcloud, remove the govcloud subdomain. There is no list of urls that do/don't require the govcloud subdomain, so for now do this.
262-
const url = `wss://push.services.${this.options.host.replace('govcloud.', '')}/wss_open_connection`
262+
const url = getKeeperPushSocketUrl(this.options.host)
263263
const getConnectionRequest = (messageSessionUid) => this.endpoint.getPushConnectionRequest(messageSessionUid)
264264

265265
this.socket = await createAsyncSocket(url, this.messageSessionUid, getConnectionRequest)

keeperapi/src/utils.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,15 @@ export function getKeeperRouterUrl(host: KeeperHost, forPath: string) {
3333
}
3434
}
3535

36+
export function getKeeperPushSocketUrl(host: KeeperHost) {
37+
switch (host) {
38+
case 'govcloud.keepersecurity.us':
39+
return `wss://push.services.keepersecurity.us/wss_open_connection`
40+
default:
41+
return `wss://push.services.${host}/wss_open_connection`
42+
}
43+
}
44+
3645
export function getKeeperSAMLUrl(host: KeeperHost, forPath: string, serviceProviderId?: number) {
3746
if (serviceProviderId) {
3847
return getKeeperUrl(host, `sso/saml/${forPath}/${serviceProviderId}`)

0 commit comments

Comments
 (0)