mirror of
https://github.com/tale/headplane.git
synced 2026-07-26 15:58:14 +00:00
badefc7f85
In Headscale 0.28+, nodes can be registered with tag-only preauth keys which have no associated user. This change updates the Machine type to make user optional and adds null checks throughout the codebase where node.user is accessed. Fixes tag node operations (rename, add tags) that previously failed with 'Unexpected Server Error' when accessing node.user.providerId on nodes without a user association. Refs: #432
35 lines
719 B
TypeScript
35 lines
719 B
TypeScript
import type { PreAuthKey } from "./PreAuthKey";
|
|
import type { User } from "./User";
|
|
|
|
export interface Machine {
|
|
id: string;
|
|
machineKey: string;
|
|
nodeKey: string;
|
|
discoKey: string;
|
|
ipAddresses: string[];
|
|
name: string;
|
|
|
|
// User can be null for tag-only nodes in Headscale 0.28+
|
|
user?: User;
|
|
lastSeen: string;
|
|
expiry: string | null;
|
|
|
|
preAuthKey?: PreAuthKey;
|
|
|
|
createdAt: string;
|
|
registerMethod:
|
|
| "REGISTER_METHOD_UNSPECIFIED"
|
|
| "REGISTER_METHOD_AUTH_KEY"
|
|
| "REGISTER_METHOD_CLI"
|
|
| "REGISTER_METHOD_OIDC";
|
|
|
|
tags: string[];
|
|
givenName: string;
|
|
online: boolean;
|
|
|
|
// Added in Headscale 0.26+
|
|
approvedRoutes: string[];
|
|
availableRoutes: string[];
|
|
subnetRoutes: string[];
|
|
}
|