MCPcopy Create free account
hub / github.com/Noumena-Network/code / parseSessionIdFromLeaseId

Function parseSessionIdFromLeaseId

src/utils/sessionIngressAuth.ts:108–119  ·  view source on GitHub ↗
(leaseId: string | undefined)

Source from the content-addressed store, hash-verified

106}
107
108function parseSessionIdFromLeaseId(leaseId: string | undefined): string | null {
109 if (!leaseId) {
110 return null
111 }
112
113 const match = /^session_ingress:([^:]+):/.exec(leaseId)
114 if (!match) {
115 return null
116 }
117
118 return match[1] === 'detached' ? null : match[1]
119}
120
121/**
122 * Read token via file descriptor, falling back to well-known file.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected