MCPcopy Create free account
hub / github.com/OpenHands/OpenHands / decrypt

Function decrypt

scripts/mars-credentials.mjs:183–197  ·  view source on GitHub ↗
(connection)

Source from the content-addressed store, hash-verified

181 }
182
183 function decrypt(connection) {
184 const cached = memoryTokens.get(connection.id);
185 if (cached !== undefined) return cached;
186 if (!canEncrypt || !connection.token) return null;
187 try {
188 const token = safeStorage.decryptString(
189 Buffer.from(connection.token, "base64"),
190 );
191 memoryTokens.set(connection.id, token);
192 return token;
193 } catch {
194 // Keychain rotated or the profile moved between machines.
195 return null;
196 }
197 }
198
199 /** Keep a token where this store keeps tokens; false when it was refused. */
200 function storeToken(connection, token) {

Callers 3

toMetadataFunction · 0.85
getTokenFunction · 0.85
setTeamFunction · 0.85

Calls 1

setMethod · 0.80

Tested by

no test coverage detected