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

Function tokenFromSecret

scripts/mars-credentials.mjs:44–54  ·  view source on GitHub ↗

The token in a stored record; null for anything this version cannot read.

(secret)

Source from the content-addressed store, hash-verified

42
43/** The token in a stored record; null for anything this version cannot read. */
44function tokenFromSecret(secret) {
45 try {
46 const record = JSON.parse(secret);
47 if (record?.v === SECRET_VERSION && typeof record.token === "string") {
48 return record.token;
49 }
50 } catch {
51 // Not a record this code wrote.
52 }
53 return null;
54}
55
56/**
57 * Shape check matching the one `doctl` performs before storing a token: 64

Callers 1

loadFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected