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

Function isValidPatFormat

scripts/mars-credentials.mjs:64–68  ·  view source on GitHub ↗
(token)

Source from the content-addressed store, hash-verified

62 * the API before treating the connection as usable.
63 */
64export function isValidPatFormat(token) {
65 const trimmed = token?.trim() ?? "";
66 if (trimmed.length === LEGACY_PAT_LENGTH) return true;
67 return trimmed.length === V1_PAT_LENGTH && trimmed.startsWith(V1_PAT_PREFIX);
68}
69
70/**
71 * A short hash that recognises the same token entered twice (or `MARS_TOKEN`

Callers 2

savePatFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected