MCPcopy Index your code
hub / github.com/sourcebot-dev/sourcebot / isOAuthTokenEncrypted

Function isOAuthTokenEncrypted

packages/shared/src/crypto.ts:158–166  ·  view source on GitHub ↗
(token: string)

Source from the content-addressed store, hash-verified

156}
157
158function isOAuthTokenEncrypted(token: string): boolean {
159 try {
160 const decoded = Buffer.from(token, 'base64').toString('utf8');
161 const parsed = JSON.parse(decoded);
162 return encryptedOAuthTokenSchema.safeParse(parsed).success;
163 } catch {
164 return false;
165 }
166}
167
168/**
169 * Encrypts OAuth token using AUTH_SECRET. Idempotent - returns token unchanged if already encrypted.

Callers 2

encryptOAuthTokenFunction · 0.85
decryptOAuthTokenFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected