MCPcopy Create free account
hub / github.com/tiann/hapi / isRunnerStateCompatibleWithIdentity

Function isRunnerStateCompatibleWithIdentity

cli/src/runner/runnerIdentity.ts:18–38  ·  view source on GitHub ↗
(
    state: Pick<
        RunnerLocallyPersistedState,
        'startedWithApiUrl' | 'startedWithMachineId' | 'startedWithCliApiTokenHash'
    >,
    current: RunnerConnectionIdentity
)

Source from the content-addressed store, hash-verified

16}
17
18export function isRunnerStateCompatibleWithIdentity(
19 state: Pick<
20 RunnerLocallyPersistedState,
21 'startedWithApiUrl' | 'startedWithMachineId' | 'startedWithCliApiTokenHash'
22 >,
23 current: RunnerConnectionIdentity
24): boolean {
25 if (!state.startedWithApiUrl || state.startedWithApiUrl !== current.apiUrl) {
26 return false
27 }
28
29 if (!current.machineId || state.startedWithMachineId !== current.machineId) {
30 return false
31 }
32
33 if (!current.cliApiTokenHash || state.startedWithCliApiTokenHash !== current.cliApiTokenHash) {
34 return false
35 }
36
37 return true
38}

Calls

no outgoing calls

Tested by

no test coverage detected