MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / base64BasicCredentials

Function base64BasicCredentials

packages/core/sdk/src/oauth-helpers.ts:954–959  ·  view source on GitHub ↗
(clientId: string, clientSecret: string)

Source from the content-addressed store, hash-verified

952// `method` only chooses HOW a present secret is sent (post vs either Basic
953// credential encoding).
954const base64BasicCredentials = (clientId: string, clientSecret: string): string => {
955 const bytes = new TextEncoder().encode(`${clientId}:${clientSecret}`);
956 let binary = "";
957 for (const byte of bytes) binary += String.fromCharCode(byte);
958 return globalThis.btoa(binary);
959};
960
961const rawClientSecretBasic =
962 (clientSecret: string): oauth.ClientAuth =>

Callers 1

rawClientSecretBasicFunction · 0.85

Calls 2

encodeMethod · 0.80
btoaMethod · 0.80

Tested by

no test coverage detected