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

chore: update endpoint #401

Merged
merged 8 commits into from
Apr 11, 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
24 changes: 12 additions & 12 deletions packages/client-sdk-web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions packages/client-sdk-web/src/internal/auth-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
16 changes: 12 additions & 4 deletions packages/common/src/internal/utils/string.ts
Original file line number Diff line number Diff line change
@@ -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);