Add key expiry disable/enable toggle (#554)

This commit is contained in:
Julian Lehrhuber
2026-08-19 03:41:30 +02:00
committed by GitHub
parent 0feab692bd
commit cd59c310f6
9 changed files with 89 additions and 5 deletions
@@ -19,6 +19,7 @@ export interface NodeApi {
expire(id: string): Promise<void>;
rename(id: string, newName: string): Promise<void>;
setTags(id: string, tags: string[]): Promise<void>;
toggleExpiry(nodeId: string, disableExpiry: boolean): Promise<void>;
/**
* Reassign a node to a different user. Only present when
* `capabilities.nodeOwnerIsImmutable` is false (Headscale < 0.28).
@@ -104,6 +105,13 @@ export function makeNodeApi(
body: { tags },
});
},
toggleExpiry: async (nodeId, disableExpiry) => {
await transport.request({
method: "POST",
path: `v1/node/${nodeId}/expire?disableExpiry=${disableExpiry}`,
apiKey,
});
},
};
if (!capabilities.nodeOwnerIsImmutable) {