diff --git a/packages/client-sdk-web/package-lock.json b/packages/client-sdk-web/package-lock.json index aa182104b..c5d106fef 100644 --- a/packages/client-sdk-web/package-lock.json +++ b/packages/client-sdk-web/package-lock.json @@ -2493,9 +2493,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.356", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.356.tgz", - "integrity": "sha512-nEftV1dRX3omlxAj42FwqRZT0i4xd2dIg39sog/CnCJeCcL1TRd2Uh0i9Oebgv8Ou0vzTPw++xc+Z20jzS2B6A==", + "version": "1.4.357", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.357.tgz", + "integrity": "sha512-UTkCbNTAcGXABmEnQrGcW4m3cG6fcyBfD4KDF0iyEAlbrGZiY9dmslyDAGOD1Kr5biN2F743Y30aRCOtau35Vw==", "dev": true }, "node_modules/emittery": { @@ -6156,9 +6156,9 @@ } }, "node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.4.0.tgz", + "integrity": "sha512-RgOxM8Mw+7Zus0+zcLEUn8+JfoLpj/huFTItQy2hsM4khuC1HYRDp0cU482Ewn/Fcy6bCjufD8vAj7voC66KQw==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -9007,9 +9007,9 @@ } }, "electron-to-chromium": { - "version": "1.4.356", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.356.tgz", - "integrity": "sha512-nEftV1dRX3omlxAj42FwqRZT0i4xd2dIg39sog/CnCJeCcL1TRd2Uh0i9Oebgv8Ou0vzTPw++xc+Z20jzS2B6A==", + "version": "1.4.357", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.357.tgz", + "integrity": "sha512-UTkCbNTAcGXABmEnQrGcW4m3cG6fcyBfD4KDF0iyEAlbrGZiY9dmslyDAGOD1Kr5biN2F743Y30aRCOtau35Vw==", "dev": true }, "emittery": { @@ -11700,9 +11700,9 @@ } }, "semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.4.0.tgz", + "integrity": "sha512-RgOxM8Mw+7Zus0+zcLEUn8+JfoLpj/huFTItQy2hsM4khuC1HYRDp0cU482Ewn/Fcy6bCjufD8vAj7voC66KQw==", "dev": true, "requires": { "lru-cache": "^6.0.0" diff --git a/packages/client-sdk-web/src/internal/auth-client.ts b/packages/client-sdk-web/src/internal/auth-client.ts index 18da2bdae..33f7e582a 100644 --- a/packages/client-sdk-web/src/internal/auth-client.ts +++ b/packages/client-sdk-web/src/internal/auth-client.ts @@ -37,9 +37,13 @@ export class InternalWebGrpcAuthClient< this.logger.debug( `Creating control client using endpoint: ${props.controlEndpoint}` ); - this.clientAuthWrapper = new auth.AuthClient(props.controlEndpoint, null, { - unaryInterceptors: this.interceptors, - }); + this.clientAuthWrapper = new auth.AuthClient( + `https://${props.controlEndpoint}`, + null, + { + unaryInterceptors: this.interceptors, + } + ); } public async generateApiToken( diff --git a/packages/common/src/internal/utils/string.ts b/packages/common/src/internal/utils/string.ts index 944397ba3..6e9c791ed 100644 --- a/packages/common/src/internal/utils/string.ts +++ b/packages/common/src/internal/utils/string.ts @@ -1,5 +1,13 @@ -export const decodeFromBase64 = (base64: string) => - Buffer.from(base64, 'base64').toString(); +/* Attention: +before merging this console branch back into main, we need to +fix how we are encoding/decoding base64 strings. The functions atob and btoa +are deprecated in the node environment, but Buffer does not exist in a browser. There +are a few ways we can handle this. -export const encodeToBase64 = (str: string) => - Buffer.from(str).toString('base64'); +1. have some way to determine an isNode() boolean flag +2. pull these functions out into their respective sdks +3. maybe some 3rd party library can help? */ + +export const decodeFromBase64 = (base64: string) => atob(base64); + +export const encodeToBase64 = (str: string) => btoa(str);