diff --git a/acls_test.go b/acls_test.go index 34d4085..c664bce 100644 --- a/acls_test.go +++ b/acls_test.go @@ -98,7 +98,7 @@ func (s *Suite) TestSshRules(c *check.C) { DiscoKey: "faa", Hostname: "testmachine", IPAddresses: MachineAddresses{netip.MustParseAddr("100.64.0.1")}, - UserID: user.ID, + UserID: user.ID, RegisterMethod: RegisterMethodAuthKey, AuthKeyID: uint(pak.ID), HostInfo: HostInfo(hostInfo), @@ -208,7 +208,7 @@ func (s *Suite) TestValidExpandTagOwnersInSources(c *check.C) { DiscoKey: "faa", Hostname: "testmachine", IPAddresses: MachineAddresses{netip.MustParseAddr("100.64.0.1")}, - UserID: user.ID, + UserID: user.ID, RegisterMethod: RegisterMethodAuthKey, AuthKeyID: uint(pak.ID), HostInfo: HostInfo(hostInfo), @@ -258,7 +258,7 @@ func (s *Suite) TestValidExpandTagOwnersInDestinations(c *check.C) { DiscoKey: "faa", Hostname: "testmachine", IPAddresses: MachineAddresses{netip.MustParseAddr("100.64.0.1")}, - UserID: user.ID, + UserID: user.ID, RegisterMethod: RegisterMethodAuthKey, AuthKeyID: uint(pak.ID), HostInfo: HostInfo(hostInfo), @@ -308,7 +308,7 @@ func (s *Suite) TestInvalidTagValidUser(c *check.C) { DiscoKey: "faa", Hostname: "testmachine", IPAddresses: MachineAddresses{netip.MustParseAddr("100.64.0.1")}, - UserID: user.ID, + UserID: user.ID, RegisterMethod: RegisterMethodAuthKey, AuthKeyID: uint(pak.ID), HostInfo: HostInfo(hostInfo), @@ -357,7 +357,7 @@ func (s *Suite) TestValidTagInvalidUser(c *check.C) { DiscoKey: "faa", Hostname: "webserver", IPAddresses: MachineAddresses{netip.MustParseAddr("100.64.0.1")}, - UserID: user.ID, + UserID: user.ID, RegisterMethod: RegisterMethodAuthKey, AuthKeyID: uint(pak.ID), HostInfo: HostInfo(hostInfo), @@ -376,7 +376,7 @@ func (s *Suite) TestValidTagInvalidUser(c *check.C) { DiscoKey: "faab", Hostname: "user", IPAddresses: MachineAddresses{netip.MustParseAddr("100.64.0.2")}, - UserID: user.ID, + UserID: user.ID, RegisterMethod: RegisterMethodAuthKey, AuthKeyID: uint(pak.ID), HostInfo: HostInfo(hostInfo2), @@ -483,7 +483,7 @@ func (s *Suite) TestPortUser(c *check.C) { NodeKey: "bar", DiscoKey: "faa", Hostname: "testmachine", - UserID: user.ID, + UserID: user.ID, RegisterMethod: RegisterMethodAuthKey, IPAddresses: ips, AuthKeyID: uint(pak.ID), @@ -528,7 +528,7 @@ func (s *Suite) TestPortGroup(c *check.C) { NodeKey: "bar", DiscoKey: "faa", Hostname: "testmachine", - UserID: user.ID, + UserID: user.ID, RegisterMethod: RegisterMethodAuthKey, IPAddresses: ips, AuthKeyID: uint(pak.ID), @@ -845,8 +845,8 @@ func Test_expandPorts(t *testing.T) { func Test_listMachinesInUser(t *testing.T) { type args struct { - machines []Machine - user string + machines []Machine + user string } tests := []struct { name string @@ -1160,14 +1160,14 @@ func Test_expandAlias(t *testing.T) { IPAddresses: MachineAddresses{ netip.MustParseAddr("100.64.0.1"), }, - User: User{Name: "joe"}, + User: User{Name: "joe"}, ForcedTags: []string{"tag:hr-webserver"}, }, { IPAddresses: MachineAddresses{ netip.MustParseAddr("100.64.0.2"), }, - User: User{Name: "joe"}, + User: User{Name: "joe"}, ForcedTags: []string{"tag:hr-webserver"}, }, { @@ -1198,7 +1198,7 @@ func Test_expandAlias(t *testing.T) { IPAddresses: MachineAddresses{ netip.MustParseAddr("100.64.0.1"), }, - User: User{Name: "joe"}, + User: User{Name: "joe"}, ForcedTags: []string{"tag:hr-webserver"}, }, { @@ -1308,7 +1308,7 @@ func Test_excludeCorrectlyTaggedNodes(t *testing.T) { type args struct { aclPolicy ACLPolicy nodes []Machine - user string + user string stripEmailDomain bool } tests := []struct { @@ -1353,13 +1353,13 @@ func Test_excludeCorrectlyTaggedNodes(t *testing.T) { User: User{Name: "joe"}, }, }, - user: "joe", + user: "joe", stripEmailDomain: true, }, want: []Machine{ { IPAddresses: MachineAddresses{netip.MustParseAddr("100.64.0.4")}, - User: User{Name: "joe"}, + User: User{Name: "joe"}, }, }, }, @@ -1404,13 +1404,13 @@ func Test_excludeCorrectlyTaggedNodes(t *testing.T) { User: User{Name: "joe"}, }, }, - user: "joe", + user: "joe", stripEmailDomain: true, }, want: []Machine{ { IPAddresses: MachineAddresses{netip.MustParseAddr("100.64.0.4")}, - User: User{Name: "joe"}, + User: User{Name: "joe"}, }, }, }, @@ -1436,7 +1436,7 @@ func Test_excludeCorrectlyTaggedNodes(t *testing.T) { IPAddresses: MachineAddresses{ netip.MustParseAddr("100.64.0.2"), }, - User: User{Name: "joe"}, + User: User{Name: "joe"}, ForcedTags: []string{"tag:accountant-webserver"}, }, { @@ -1446,13 +1446,13 @@ func Test_excludeCorrectlyTaggedNodes(t *testing.T) { User: User{Name: "joe"}, }, }, - user: "joe", + user: "joe", stripEmailDomain: true, }, want: []Machine{ { IPAddresses: MachineAddresses{netip.MustParseAddr("100.64.0.4")}, - User: User{Name: "joe"}, + User: User{Name: "joe"}, }, }, }, @@ -1492,7 +1492,7 @@ func Test_excludeCorrectlyTaggedNodes(t *testing.T) { User: User{Name: "joe"}, }, }, - user: "joe", + user: "joe", stripEmailDomain: true, }, want: []Machine{ diff --git a/cmd/headscale/cli/debug.go b/cmd/headscale/cli/debug.go index a275072..d149de2 100644 --- a/cmd/headscale/cli/debug.go +++ b/cmd/headscale/cli/debug.go @@ -110,10 +110,10 @@ var createNodeCmd = &cobra.Command{ } request := &v1.DebugCreateMachineRequest{ - Key: machineKey, - Name: name, - User: user, - Routes: routes, + Key: machineKey, + Name: name, + User: user, + Routes: routes, } response, err := client.DebugCreateMachine(ctx, request) diff --git a/cmd/headscale/cli/nodes.go b/cmd/headscale/cli/nodes.go index 039f05a..e5d35fc 100644 --- a/cmd/headscale/cli/nodes.go +++ b/cmd/headscale/cli/nodes.go @@ -116,7 +116,7 @@ var registerNodeCmd = &cobra.Command{ } request := &v1.RegisterMachineRequest{ - Key: machineKey, + Key: machineKey, User: user, } @@ -439,7 +439,7 @@ var moveNodeCmd = &cobra.Command{ moveRequest := &v1.MoveMachineRequest{ MachineId: identifier, - User: user, + User: user, } moveResponse, err := client.MoveMachine(ctx, moveRequest) diff --git a/cmd/headscale/cli/preauthkeys.go b/cmd/headscale/cli/preauthkeys.go index 7175823..c08b463 100644 --- a/cmd/headscale/cli/preauthkeys.go +++ b/cmd/headscale/cli/preauthkeys.go @@ -166,7 +166,7 @@ var createPreAuthKeyCmd = &cobra.Command{ Msg("Preparing to create preauthkey") request := &v1.CreatePreAuthKeyRequest{ - User: user, + User: user, Reusable: reusable, Ephemeral: ephemeral, AclTags: tags, @@ -238,7 +238,7 @@ var expirePreAuthKeyCmd = &cobra.Command{ request := &v1.ExpirePreAuthKeyRequest{ User: user, - Key: args[0], + Key: args[0], } response, err := client.ExpirePreAuthKey(ctx, request) diff --git a/dns_test.go b/dns_test.go index 03b7f47..eb96bbe 100644 --- a/dns_test.go +++ b/dns_test.go @@ -166,8 +166,8 @@ func (s *Suite) TestDNSConfigMapResponseWithMagicDNS(c *check.C) { NodeKey: "686824e749f3b7f2a5927ee6c1e422aee5292592d9179a271ed7b3e659b44a66", DiscoKey: "686824e749f3b7f2a5927ee6c1e422aee5292592d9179a271ed7b3e659b44a66", Hostname: "test_get_shared_nodes_1", - UserID: userShared1.ID, - User: *userShared1, + UserID: userShared1.ID, + User: *userShared1, RegisterMethod: RegisterMethodAuthKey, IPAddresses: []netip.Addr{netip.MustParseAddr("100.64.0.1")}, AuthKeyID: uint(preAuthKeyInShared1.ID), @@ -183,8 +183,8 @@ func (s *Suite) TestDNSConfigMapResponseWithMagicDNS(c *check.C) { NodeKey: "dec46ef9dc45c7d2f03bfcd5a640d9e24e3cc68ce3d9da223867c9bc6d5e9863", DiscoKey: "dec46ef9dc45c7d2f03bfcd5a640d9e24e3cc68ce3d9da223867c9bc6d5e9863", Hostname: "test_get_shared_nodes_2", - UserID: userShared2.ID, - User: *userShared2, + UserID: userShared2.ID, + User: *userShared2, RegisterMethod: RegisterMethodAuthKey, IPAddresses: []netip.Addr{netip.MustParseAddr("100.64.0.2")}, AuthKeyID: uint(preAuthKeyInShared2.ID), @@ -200,8 +200,8 @@ func (s *Suite) TestDNSConfigMapResponseWithMagicDNS(c *check.C) { NodeKey: "dec46ef9dc45c7d2f03bfcd5a640d9e24e3cc68ce3d9da223867c9bc6d5e9863", DiscoKey: "dec46ef9dc45c7d2f03bfcd5a640d9e24e3cc68ce3d9da223867c9bc6d5e9863", Hostname: "test_get_shared_nodes_3", - UserID: userShared3.ID, - User: *userShared3, + UserID: userShared3.ID, + User: *userShared3, RegisterMethod: RegisterMethodAuthKey, IPAddresses: []netip.Addr{netip.MustParseAddr("100.64.0.3")}, AuthKeyID: uint(preAuthKeyInShared3.ID), @@ -217,8 +217,8 @@ func (s *Suite) TestDNSConfigMapResponseWithMagicDNS(c *check.C) { NodeKey: "dec46ef9dc45c7d2f03bfcd5a640d9e24e3cc68ce3d9da223867c9bc6d5e9863", DiscoKey: "dec46ef9dc45c7d2f03bfcd5a640d9e24e3cc68ce3d9da223867c9bc6d5e9863", Hostname: "test_get_shared_nodes_4", - UserID: userShared1.ID, - User: *userShared1, + UserID: userShared1.ID, + User: *userShared1, RegisterMethod: RegisterMethodAuthKey, IPAddresses: []netip.Addr{netip.MustParseAddr("100.64.0.4")}, AuthKeyID: uint(PreAuthKey2InShared1.ID), @@ -313,8 +313,8 @@ func (s *Suite) TestDNSConfigMapResponseWithoutMagicDNS(c *check.C) { NodeKey: "686824e749f3b7f2a5927ee6c1e422aee5292592d9179a271ed7b3e659b44a66", DiscoKey: "686824e749f3b7f2a5927ee6c1e422aee5292592d9179a271ed7b3e659b44a66", Hostname: "test_get_shared_nodes_1", - UserID: userShared1.ID, - User: *userShared1, + UserID: userShared1.ID, + User: *userShared1, RegisterMethod: RegisterMethodAuthKey, IPAddresses: []netip.Addr{netip.MustParseAddr("100.64.0.1")}, AuthKeyID: uint(preAuthKeyInShared1.ID), @@ -330,8 +330,8 @@ func (s *Suite) TestDNSConfigMapResponseWithoutMagicDNS(c *check.C) { NodeKey: "dec46ef9dc45c7d2f03bfcd5a640d9e24e3cc68ce3d9da223867c9bc6d5e9863", DiscoKey: "dec46ef9dc45c7d2f03bfcd5a640d9e24e3cc68ce3d9da223867c9bc6d5e9863", Hostname: "test_get_shared_nodes_2", - UserID: userShared2.ID, - User: *userShared2, + UserID: userShared2.ID, + User: *userShared2, RegisterMethod: RegisterMethodAuthKey, IPAddresses: []netip.Addr{netip.MustParseAddr("100.64.0.2")}, AuthKeyID: uint(preAuthKeyInShared2.ID), @@ -347,8 +347,8 @@ func (s *Suite) TestDNSConfigMapResponseWithoutMagicDNS(c *check.C) { NodeKey: "dec46ef9dc45c7d2f03bfcd5a640d9e24e3cc68ce3d9da223867c9bc6d5e9863", DiscoKey: "dec46ef9dc45c7d2f03bfcd5a640d9e24e3cc68ce3d9da223867c9bc6d5e9863", Hostname: "test_get_shared_nodes_3", - UserID: userShared3.ID, - User: *userShared3, + UserID: userShared3.ID, + User: *userShared3, RegisterMethod: RegisterMethodAuthKey, IPAddresses: []netip.Addr{netip.MustParseAddr("100.64.0.3")}, AuthKeyID: uint(preAuthKeyInShared3.ID), @@ -364,8 +364,8 @@ func (s *Suite) TestDNSConfigMapResponseWithoutMagicDNS(c *check.C) { NodeKey: "dec46ef9dc45c7d2f03bfcd5a640d9e24e3cc68ce3d9da223867c9bc6d5e9863", DiscoKey: "dec46ef9dc45c7d2f03bfcd5a640d9e24e3cc68ce3d9da223867c9bc6d5e9863", Hostname: "test_get_shared_nodes_4", - UserID: userShared1.ID, - User: *userShared1, + UserID: userShared1.ID, + User: *userShared1, RegisterMethod: RegisterMethodAuthKey, IPAddresses: []netip.Addr{netip.MustParseAddr("100.64.0.4")}, AuthKeyID: uint(preAuthKey2InShared1.ID), diff --git a/gen/go/headscale/v1/apikey.pb.go b/gen/go/headscale/v1/apikey.pb.go index 4e29272..8b7f3cb 100644 --- a/gen/go/headscale/v1/apikey.pb.go +++ b/gen/go/headscale/v1/apikey.pb.go @@ -7,11 +7,12 @@ package v1 import ( + reflect "reflect" + sync "sync" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" ) const ( @@ -422,17 +423,19 @@ func file_headscale_v1_apikey_proto_rawDescGZIP() []byte { return file_headscale_v1_apikey_proto_rawDescData } -var file_headscale_v1_apikey_proto_msgTypes = make([]protoimpl.MessageInfo, 7) -var file_headscale_v1_apikey_proto_goTypes = []interface{}{ - (*ApiKey)(nil), // 0: headscale.v1.ApiKey - (*CreateApiKeyRequest)(nil), // 1: headscale.v1.CreateApiKeyRequest - (*CreateApiKeyResponse)(nil), // 2: headscale.v1.CreateApiKeyResponse - (*ExpireApiKeyRequest)(nil), // 3: headscale.v1.ExpireApiKeyRequest - (*ExpireApiKeyResponse)(nil), // 4: headscale.v1.ExpireApiKeyResponse - (*ListApiKeysRequest)(nil), // 5: headscale.v1.ListApiKeysRequest - (*ListApiKeysResponse)(nil), // 6: headscale.v1.ListApiKeysResponse - (*timestamppb.Timestamp)(nil), // 7: google.protobuf.Timestamp -} +var ( + file_headscale_v1_apikey_proto_msgTypes = make([]protoimpl.MessageInfo, 7) + file_headscale_v1_apikey_proto_goTypes = []interface{}{ + (*ApiKey)(nil), // 0: headscale.v1.ApiKey + (*CreateApiKeyRequest)(nil), // 1: headscale.v1.CreateApiKeyRequest + (*CreateApiKeyResponse)(nil), // 2: headscale.v1.CreateApiKeyResponse + (*ExpireApiKeyRequest)(nil), // 3: headscale.v1.ExpireApiKeyRequest + (*ExpireApiKeyResponse)(nil), // 4: headscale.v1.ExpireApiKeyResponse + (*ListApiKeysRequest)(nil), // 5: headscale.v1.ListApiKeysRequest + (*ListApiKeysResponse)(nil), // 6: headscale.v1.ListApiKeysResponse + (*timestamppb.Timestamp)(nil), // 7: google.protobuf.Timestamp + } +) var file_headscale_v1_apikey_proto_depIdxs = []int32{ 7, // 0: headscale.v1.ApiKey.expiration:type_name -> google.protobuf.Timestamp 7, // 1: headscale.v1.ApiKey.created_at:type_name -> google.protobuf.Timestamp diff --git a/gen/go/headscale/v1/device.pb.go b/gen/go/headscale/v1/device.pb.go index dc8f498..0bafde3 100644 --- a/gen/go/headscale/v1/device.pb.go +++ b/gen/go/headscale/v1/device.pb.go @@ -7,11 +7,12 @@ package v1 import ( + reflect "reflect" + sync "sync" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" ) const ( @@ -924,22 +925,24 @@ func file_headscale_v1_device_proto_rawDescGZIP() []byte { return file_headscale_v1_device_proto_rawDescData } -var file_headscale_v1_device_proto_msgTypes = make([]protoimpl.MessageInfo, 12) -var file_headscale_v1_device_proto_goTypes = []interface{}{ - (*Latency)(nil), // 0: headscale.v1.Latency - (*ClientSupports)(nil), // 1: headscale.v1.ClientSupports - (*ClientConnectivity)(nil), // 2: headscale.v1.ClientConnectivity - (*GetDeviceRequest)(nil), // 3: headscale.v1.GetDeviceRequest - (*GetDeviceResponse)(nil), // 4: headscale.v1.GetDeviceResponse - (*DeleteDeviceRequest)(nil), // 5: headscale.v1.DeleteDeviceRequest - (*DeleteDeviceResponse)(nil), // 6: headscale.v1.DeleteDeviceResponse - (*GetDeviceRoutesRequest)(nil), // 7: headscale.v1.GetDeviceRoutesRequest - (*GetDeviceRoutesResponse)(nil), // 8: headscale.v1.GetDeviceRoutesResponse - (*EnableDeviceRoutesRequest)(nil), // 9: headscale.v1.EnableDeviceRoutesRequest - (*EnableDeviceRoutesResponse)(nil), // 10: headscale.v1.EnableDeviceRoutesResponse - nil, // 11: headscale.v1.ClientConnectivity.LatencyEntry - (*timestamppb.Timestamp)(nil), // 12: google.protobuf.Timestamp -} +var ( + file_headscale_v1_device_proto_msgTypes = make([]protoimpl.MessageInfo, 12) + file_headscale_v1_device_proto_goTypes = []interface{}{ + (*Latency)(nil), // 0: headscale.v1.Latency + (*ClientSupports)(nil), // 1: headscale.v1.ClientSupports + (*ClientConnectivity)(nil), // 2: headscale.v1.ClientConnectivity + (*GetDeviceRequest)(nil), // 3: headscale.v1.GetDeviceRequest + (*GetDeviceResponse)(nil), // 4: headscale.v1.GetDeviceResponse + (*DeleteDeviceRequest)(nil), // 5: headscale.v1.DeleteDeviceRequest + (*DeleteDeviceResponse)(nil), // 6: headscale.v1.DeleteDeviceResponse + (*GetDeviceRoutesRequest)(nil), // 7: headscale.v1.GetDeviceRoutesRequest + (*GetDeviceRoutesResponse)(nil), // 8: headscale.v1.GetDeviceRoutesResponse + (*EnableDeviceRoutesRequest)(nil), // 9: headscale.v1.EnableDeviceRoutesRequest + (*EnableDeviceRoutesResponse)(nil), // 10: headscale.v1.EnableDeviceRoutesResponse + nil, // 11: headscale.v1.ClientConnectivity.LatencyEntry + (*timestamppb.Timestamp)(nil), // 12: google.protobuf.Timestamp + } +) var file_headscale_v1_device_proto_depIdxs = []int32{ 11, // 0: headscale.v1.ClientConnectivity.latency:type_name -> headscale.v1.ClientConnectivity.LatencyEntry 1, // 1: headscale.v1.ClientConnectivity.client_supports:type_name -> headscale.v1.ClientSupports diff --git a/gen/go/headscale/v1/headscale.pb.go b/gen/go/headscale/v1/headscale.pb.go index 8266395..7ce2970 100644 --- a/gen/go/headscale/v1/headscale.pb.go +++ b/gen/go/headscale/v1/headscale.pb.go @@ -7,10 +7,11 @@ package v1 import ( + reflect "reflect" + _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" ) const ( @@ -277,6 +278,7 @@ var file_headscale_v1_headscale_proto_goTypes = []interface{}{ (*ExpireApiKeyResponse)(nil), // 46: headscale.v1.ExpireApiKeyResponse (*ListApiKeysResponse)(nil), // 47: headscale.v1.ListApiKeysResponse } + var file_headscale_v1_headscale_proto_depIdxs = []int32{ 0, // 0: headscale.v1.HeadscaleService.GetUser:input_type -> headscale.v1.GetUserRequest 1, // 1: headscale.v1.HeadscaleService.CreateUser:input_type -> headscale.v1.CreateUserRequest diff --git a/gen/go/headscale/v1/headscale.pb.gw.go b/gen/go/headscale/v1/headscale.pb.gw.go index 3d47502..4695c07 100644 --- a/gen/go/headscale/v1/headscale.pb.gw.go +++ b/gen/go/headscale/v1/headscale.pb.gw.go @@ -25,11 +25,14 @@ import ( // Suppress "imported and not used" errors var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = metadata.Join + +var ( + _ io.Reader + _ status.Status + _ = runtime.String + _ = utilities.NewDoubleArray + _ = metadata.Join +) func request_HeadscaleService_GetUser_0(ctx context.Context, marshaler runtime.Marshaler, client HeadscaleServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq GetUserRequest @@ -54,7 +57,6 @@ func request_HeadscaleService_GetUser_0(ctx context.Context, marshaler runtime.M msg, err := client.GetUser(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_HeadscaleService_GetUser_0(ctx context.Context, marshaler runtime.Marshaler, server HeadscaleServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -80,7 +82,6 @@ func local_request_HeadscaleService_GetUser_0(ctx context.Context, marshaler run msg, err := server.GetUser(ctx, &protoReq) return msg, metadata, err - } func request_HeadscaleService_CreateUser_0(ctx context.Context, marshaler runtime.Marshaler, client HeadscaleServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -97,7 +98,6 @@ func request_HeadscaleService_CreateUser_0(ctx context.Context, marshaler runtim msg, err := client.CreateUser(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_HeadscaleService_CreateUser_0(ctx context.Context, marshaler runtime.Marshaler, server HeadscaleServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -114,7 +114,6 @@ func local_request_HeadscaleService_CreateUser_0(ctx context.Context, marshaler msg, err := server.CreateUser(ctx, &protoReq) return msg, metadata, err - } func request_HeadscaleService_RenameUser_0(ctx context.Context, marshaler runtime.Marshaler, client HeadscaleServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -150,7 +149,6 @@ func request_HeadscaleService_RenameUser_0(ctx context.Context, marshaler runtim msg, err := client.RenameUser(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_HeadscaleService_RenameUser_0(ctx context.Context, marshaler runtime.Marshaler, server HeadscaleServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -186,7 +184,6 @@ func local_request_HeadscaleService_RenameUser_0(ctx context.Context, marshaler msg, err := server.RenameUser(ctx, &protoReq) return msg, metadata, err - } func request_HeadscaleService_DeleteUser_0(ctx context.Context, marshaler runtime.Marshaler, client HeadscaleServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -212,7 +209,6 @@ func request_HeadscaleService_DeleteUser_0(ctx context.Context, marshaler runtim msg, err := client.DeleteUser(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_HeadscaleService_DeleteUser_0(ctx context.Context, marshaler runtime.Marshaler, server HeadscaleServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -238,7 +234,6 @@ func local_request_HeadscaleService_DeleteUser_0(ctx context.Context, marshaler msg, err := server.DeleteUser(ctx, &protoReq) return msg, metadata, err - } func request_HeadscaleService_ListUsers_0(ctx context.Context, marshaler runtime.Marshaler, client HeadscaleServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -247,7 +242,6 @@ func request_HeadscaleService_ListUsers_0(ctx context.Context, marshaler runtime msg, err := client.ListUsers(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_HeadscaleService_ListUsers_0(ctx context.Context, marshaler runtime.Marshaler, server HeadscaleServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -256,7 +250,6 @@ func local_request_HeadscaleService_ListUsers_0(ctx context.Context, marshaler r msg, err := server.ListUsers(ctx, &protoReq) return msg, metadata, err - } func request_HeadscaleService_CreatePreAuthKey_0(ctx context.Context, marshaler runtime.Marshaler, client HeadscaleServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -273,7 +266,6 @@ func request_HeadscaleService_CreatePreAuthKey_0(ctx context.Context, marshaler msg, err := client.CreatePreAuthKey(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_HeadscaleService_CreatePreAuthKey_0(ctx context.Context, marshaler runtime.Marshaler, server HeadscaleServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -290,7 +282,6 @@ func local_request_HeadscaleService_CreatePreAuthKey_0(ctx context.Context, mars msg, err := server.CreatePreAuthKey(ctx, &protoReq) return msg, metadata, err - } func request_HeadscaleService_ExpirePreAuthKey_0(ctx context.Context, marshaler runtime.Marshaler, client HeadscaleServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -307,7 +298,6 @@ func request_HeadscaleService_ExpirePreAuthKey_0(ctx context.Context, marshaler msg, err := client.ExpirePreAuthKey(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_HeadscaleService_ExpirePreAuthKey_0(ctx context.Context, marshaler runtime.Marshaler, server HeadscaleServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -324,12 +314,9 @@ func local_request_HeadscaleService_ExpirePreAuthKey_0(ctx context.Context, mars msg, err := server.ExpirePreAuthKey(ctx, &protoReq) return msg, metadata, err - } -var ( - filter_HeadscaleService_ListPreAuthKeys_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) +var filter_HeadscaleService_ListPreAuthKeys_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} func request_HeadscaleService_ListPreAuthKeys_0(ctx context.Context, marshaler runtime.Marshaler, client HeadscaleServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq ListPreAuthKeysRequest @@ -344,7 +331,6 @@ func request_HeadscaleService_ListPreAuthKeys_0(ctx context.Context, marshaler r msg, err := client.ListPreAuthKeys(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_HeadscaleService_ListPreAuthKeys_0(ctx context.Context, marshaler runtime.Marshaler, server HeadscaleServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -360,7 +346,6 @@ func local_request_HeadscaleService_ListPreAuthKeys_0(ctx context.Context, marsh msg, err := server.ListPreAuthKeys(ctx, &protoReq) return msg, metadata, err - } func request_HeadscaleService_DebugCreateMachine_0(ctx context.Context, marshaler runtime.Marshaler, client HeadscaleServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -377,7 +362,6 @@ func request_HeadscaleService_DebugCreateMachine_0(ctx context.Context, marshale msg, err := client.DebugCreateMachine(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_HeadscaleService_DebugCreateMachine_0(ctx context.Context, marshaler runtime.Marshaler, server HeadscaleServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -394,7 +378,6 @@ func local_request_HeadscaleService_DebugCreateMachine_0(ctx context.Context, ma msg, err := server.DebugCreateMachine(ctx, &protoReq) return msg, metadata, err - } func request_HeadscaleService_GetMachine_0(ctx context.Context, marshaler runtime.Marshaler, client HeadscaleServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -420,7 +403,6 @@ func request_HeadscaleService_GetMachine_0(ctx context.Context, marshaler runtim msg, err := client.GetMachine(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_HeadscaleService_GetMachine_0(ctx context.Context, marshaler runtime.Marshaler, server HeadscaleServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -446,7 +428,6 @@ func local_request_HeadscaleService_GetMachine_0(ctx context.Context, marshaler msg, err := server.GetMachine(ctx, &protoReq) return msg, metadata, err - } func request_HeadscaleService_SetTags_0(ctx context.Context, marshaler runtime.Marshaler, client HeadscaleServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -480,7 +461,6 @@ func request_HeadscaleService_SetTags_0(ctx context.Context, marshaler runtime.M msg, err := client.SetTags(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_HeadscaleService_SetTags_0(ctx context.Context, marshaler runtime.Marshaler, server HeadscaleServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -514,12 +494,9 @@ func local_request_HeadscaleService_SetTags_0(ctx context.Context, marshaler run msg, err := server.SetTags(ctx, &protoReq) return msg, metadata, err - } -var ( - filter_HeadscaleService_RegisterMachine_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) +var filter_HeadscaleService_RegisterMachine_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} func request_HeadscaleService_RegisterMachine_0(ctx context.Context, marshaler runtime.Marshaler, client HeadscaleServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq RegisterMachineRequest @@ -534,7 +511,6 @@ func request_HeadscaleService_RegisterMachine_0(ctx context.Context, marshaler r msg, err := client.RegisterMachine(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_HeadscaleService_RegisterMachine_0(ctx context.Context, marshaler runtime.Marshaler, server HeadscaleServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -550,7 +526,6 @@ func local_request_HeadscaleService_RegisterMachine_0(ctx context.Context, marsh msg, err := server.RegisterMachine(ctx, &protoReq) return msg, metadata, err - } func request_HeadscaleService_DeleteMachine_0(ctx context.Context, marshaler runtime.Marshaler, client HeadscaleServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -576,7 +551,6 @@ func request_HeadscaleService_DeleteMachine_0(ctx context.Context, marshaler run msg, err := client.DeleteMachine(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_HeadscaleService_DeleteMachine_0(ctx context.Context, marshaler runtime.Marshaler, server HeadscaleServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -602,7 +576,6 @@ func local_request_HeadscaleService_DeleteMachine_0(ctx context.Context, marshal msg, err := server.DeleteMachine(ctx, &protoReq) return msg, metadata, err - } func request_HeadscaleService_ExpireMachine_0(ctx context.Context, marshaler runtime.Marshaler, client HeadscaleServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -628,7 +601,6 @@ func request_HeadscaleService_ExpireMachine_0(ctx context.Context, marshaler run msg, err := client.ExpireMachine(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_HeadscaleService_ExpireMachine_0(ctx context.Context, marshaler runtime.Marshaler, server HeadscaleServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -654,7 +626,6 @@ func local_request_HeadscaleService_ExpireMachine_0(ctx context.Context, marshal msg, err := server.ExpireMachine(ctx, &protoReq) return msg, metadata, err - } func request_HeadscaleService_RenameMachine_0(ctx context.Context, marshaler runtime.Marshaler, client HeadscaleServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -690,7 +661,6 @@ func request_HeadscaleService_RenameMachine_0(ctx context.Context, marshaler run msg, err := client.RenameMachine(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_HeadscaleService_RenameMachine_0(ctx context.Context, marshaler runtime.Marshaler, server HeadscaleServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -726,12 +696,9 @@ func local_request_HeadscaleService_RenameMachine_0(ctx context.Context, marshal msg, err := server.RenameMachine(ctx, &protoReq) return msg, metadata, err - } -var ( - filter_HeadscaleService_ListMachines_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) +var filter_HeadscaleService_ListMachines_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} func request_HeadscaleService_ListMachines_0(ctx context.Context, marshaler runtime.Marshaler, client HeadscaleServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq ListMachinesRequest @@ -746,7 +713,6 @@ func request_HeadscaleService_ListMachines_0(ctx context.Context, marshaler runt msg, err := client.ListMachines(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_HeadscaleService_ListMachines_0(ctx context.Context, marshaler runtime.Marshaler, server HeadscaleServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -762,12 +728,9 @@ func local_request_HeadscaleService_ListMachines_0(ctx context.Context, marshale msg, err := server.ListMachines(ctx, &protoReq) return msg, metadata, err - } -var ( - filter_HeadscaleService_MoveMachine_0 = &utilities.DoubleArray{Encoding: map[string]int{"machine_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} -) +var filter_HeadscaleService_MoveMachine_0 = &utilities.DoubleArray{Encoding: map[string]int{"machine_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} func request_HeadscaleService_MoveMachine_0(ctx context.Context, marshaler runtime.Marshaler, client HeadscaleServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq MoveMachineRequest @@ -799,7 +762,6 @@ func request_HeadscaleService_MoveMachine_0(ctx context.Context, marshaler runti msg, err := client.MoveMachine(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_HeadscaleService_MoveMachine_0(ctx context.Context, marshaler runtime.Marshaler, server HeadscaleServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -832,7 +794,6 @@ func local_request_HeadscaleService_MoveMachine_0(ctx context.Context, marshaler msg, err := server.MoveMachine(ctx, &protoReq) return msg, metadata, err - } func request_HeadscaleService_GetRoutes_0(ctx context.Context, marshaler runtime.Marshaler, client HeadscaleServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -841,7 +802,6 @@ func request_HeadscaleService_GetRoutes_0(ctx context.Context, marshaler runtime msg, err := client.GetRoutes(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_HeadscaleService_GetRoutes_0(ctx context.Context, marshaler runtime.Marshaler, server HeadscaleServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -850,7 +810,6 @@ func local_request_HeadscaleService_GetRoutes_0(ctx context.Context, marshaler r msg, err := server.GetRoutes(ctx, &protoReq) return msg, metadata, err - } func request_HeadscaleService_EnableRoute_0(ctx context.Context, marshaler runtime.Marshaler, client HeadscaleServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -876,7 +835,6 @@ func request_HeadscaleService_EnableRoute_0(ctx context.Context, marshaler runti msg, err := client.EnableRoute(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_HeadscaleService_EnableRoute_0(ctx context.Context, marshaler runtime.Marshaler, server HeadscaleServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -902,7 +860,6 @@ func local_request_HeadscaleService_EnableRoute_0(ctx context.Context, marshaler msg, err := server.EnableRoute(ctx, &protoReq) return msg, metadata, err - } func request_HeadscaleService_DisableRoute_0(ctx context.Context, marshaler runtime.Marshaler, client HeadscaleServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -928,7 +885,6 @@ func request_HeadscaleService_DisableRoute_0(ctx context.Context, marshaler runt msg, err := client.DisableRoute(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_HeadscaleService_DisableRoute_0(ctx context.Context, marshaler runtime.Marshaler, server HeadscaleServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -954,7 +910,6 @@ func local_request_HeadscaleService_DisableRoute_0(ctx context.Context, marshale msg, err := server.DisableRoute(ctx, &protoReq) return msg, metadata, err - } func request_HeadscaleService_GetMachineRoutes_0(ctx context.Context, marshaler runtime.Marshaler, client HeadscaleServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -980,7 +935,6 @@ func request_HeadscaleService_GetMachineRoutes_0(ctx context.Context, marshaler msg, err := client.GetMachineRoutes(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_HeadscaleService_GetMachineRoutes_0(ctx context.Context, marshaler runtime.Marshaler, server HeadscaleServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -1006,7 +960,6 @@ func local_request_HeadscaleService_GetMachineRoutes_0(ctx context.Context, mars msg, err := server.GetMachineRoutes(ctx, &protoReq) return msg, metadata, err - } func request_HeadscaleService_CreateApiKey_0(ctx context.Context, marshaler runtime.Marshaler, client HeadscaleServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -1023,7 +976,6 @@ func request_HeadscaleService_CreateApiKey_0(ctx context.Context, marshaler runt msg, err := client.CreateApiKey(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_HeadscaleService_CreateApiKey_0(ctx context.Context, marshaler runtime.Marshaler, server HeadscaleServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -1040,7 +992,6 @@ func local_request_HeadscaleService_CreateApiKey_0(ctx context.Context, marshale msg, err := server.CreateApiKey(ctx, &protoReq) return msg, metadata, err - } func request_HeadscaleService_ExpireApiKey_0(ctx context.Context, marshaler runtime.Marshaler, client HeadscaleServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -1057,7 +1008,6 @@ func request_HeadscaleService_ExpireApiKey_0(ctx context.Context, marshaler runt msg, err := client.ExpireApiKey(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_HeadscaleService_ExpireApiKey_0(ctx context.Context, marshaler runtime.Marshaler, server HeadscaleServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -1074,7 +1024,6 @@ func local_request_HeadscaleService_ExpireApiKey_0(ctx context.Context, marshale msg, err := server.ExpireApiKey(ctx, &protoReq) return msg, metadata, err - } func request_HeadscaleService_ListApiKeys_0(ctx context.Context, marshaler runtime.Marshaler, client HeadscaleServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -1083,7 +1032,6 @@ func request_HeadscaleService_ListApiKeys_0(ctx context.Context, marshaler runti msg, err := client.ListApiKeys(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_HeadscaleService_ListApiKeys_0(ctx context.Context, marshaler runtime.Marshaler, server HeadscaleServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -1092,7 +1040,6 @@ func local_request_HeadscaleService_ListApiKeys_0(ctx context.Context, marshaler msg, err := server.ListApiKeys(ctx, &protoReq) return msg, metadata, err - } // RegisterHeadscaleServiceHandlerServer registers the http handlers for service HeadscaleService to "mux". @@ -1100,7 +1047,6 @@ func local_request_HeadscaleService_ListApiKeys_0(ctx context.Context, marshaler // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterHeadscaleServiceHandlerFromEndpoint instead. func RegisterHeadscaleServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server HeadscaleServiceServer) error { - mux.Handle("GET", pattern_HeadscaleService_GetUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1123,7 +1069,6 @@ func RegisterHeadscaleServiceHandlerServer(ctx context.Context, mux *runtime.Ser } forward_HeadscaleService_GetUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("POST", pattern_HeadscaleService_CreateUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -1148,7 +1093,6 @@ func RegisterHeadscaleServiceHandlerServer(ctx context.Context, mux *runtime.Ser } forward_HeadscaleService_CreateUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("POST", pattern_HeadscaleService_RenameUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -1173,7 +1117,6 @@ func RegisterHeadscaleServiceHandlerServer(ctx context.Context, mux *runtime.Ser } forward_HeadscaleService_RenameUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("DELETE", pattern_HeadscaleService_DeleteUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -1198,7 +1141,6 @@ func RegisterHeadscaleServiceHandlerServer(ctx context.Context, mux *runtime.Ser } forward_HeadscaleService_DeleteUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("GET", pattern_HeadscaleService_ListUsers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -1223,7 +1165,6 @@ func RegisterHeadscaleServiceHandlerServer(ctx context.Context, mux *runtime.Ser } forward_HeadscaleService_ListUsers_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("POST", pattern_HeadscaleService_CreatePreAuthKey_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -1248,7 +1189,6 @@ func RegisterHeadscaleServiceHandlerServer(ctx context.Context, mux *runtime.Ser } forward_HeadscaleService_CreatePreAuthKey_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("POST", pattern_HeadscaleService_ExpirePreAuthKey_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -1273,7 +1213,6 @@ func RegisterHeadscaleServiceHandlerServer(ctx context.Context, mux *runtime.Ser } forward_HeadscaleService_ExpirePreAuthKey_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("GET", pattern_HeadscaleService_ListPreAuthKeys_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -1298,7 +1237,6 @@ func RegisterHeadscaleServiceHandlerServer(ctx context.Context, mux *runtime.Ser } forward_HeadscaleService_ListPreAuthKeys_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("POST", pattern_HeadscaleService_DebugCreateMachine_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -1323,7 +1261,6 @@ func RegisterHeadscaleServiceHandlerServer(ctx context.Context, mux *runtime.Ser } forward_HeadscaleService_DebugCreateMachine_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("GET", pattern_HeadscaleService_GetMachine_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -1348,7 +1285,6 @@ func RegisterHeadscaleServiceHandlerServer(ctx context.Context, mux *runtime.Ser } forward_HeadscaleService_GetMachine_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("POST", pattern_HeadscaleService_SetTags_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -1373,7 +1309,6 @@ func RegisterHeadscaleServiceHandlerServer(ctx context.Context, mux *runtime.Ser } forward_HeadscaleService_SetTags_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("POST", pattern_HeadscaleService_RegisterMachine_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -1398,7 +1333,6 @@ func RegisterHeadscaleServiceHandlerServer(ctx context.Context, mux *runtime.Ser } forward_HeadscaleService_RegisterMachine_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("DELETE", pattern_HeadscaleService_DeleteMachine_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -1423,7 +1357,6 @@ func RegisterHeadscaleServiceHandlerServer(ctx context.Context, mux *runtime.Ser } forward_HeadscaleService_DeleteMachine_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("POST", pattern_HeadscaleService_ExpireMachine_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -1448,7 +1381,6 @@ func RegisterHeadscaleServiceHandlerServer(ctx context.Context, mux *runtime.Ser } forward_HeadscaleService_ExpireMachine_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("POST", pattern_HeadscaleService_RenameMachine_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -1473,7 +1405,6 @@ func RegisterHeadscaleServiceHandlerServer(ctx context.Context, mux *runtime.Ser } forward_HeadscaleService_RenameMachine_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("GET", pattern_HeadscaleService_ListMachines_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -1498,7 +1429,6 @@ func RegisterHeadscaleServiceHandlerServer(ctx context.Context, mux *runtime.Ser } forward_HeadscaleService_ListMachines_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("POST", pattern_HeadscaleService_MoveMachine_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -1523,7 +1453,6 @@ func RegisterHeadscaleServiceHandlerServer(ctx context.Context, mux *runtime.Ser } forward_HeadscaleService_MoveMachine_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("GET", pattern_HeadscaleService_GetRoutes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -1548,7 +1477,6 @@ func RegisterHeadscaleServiceHandlerServer(ctx context.Context, mux *runtime.Ser } forward_HeadscaleService_GetRoutes_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("POST", pattern_HeadscaleService_EnableRoute_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -1573,7 +1501,6 @@ func RegisterHeadscaleServiceHandlerServer(ctx context.Context, mux *runtime.Ser } forward_HeadscaleService_EnableRoute_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("POST", pattern_HeadscaleService_DisableRoute_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -1598,7 +1525,6 @@ func RegisterHeadscaleServiceHandlerServer(ctx context.Context, mux *runtime.Ser } forward_HeadscaleService_DisableRoute_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("GET", pattern_HeadscaleService_GetMachineRoutes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -1623,7 +1549,6 @@ func RegisterHeadscaleServiceHandlerServer(ctx context.Context, mux *runtime.Ser } forward_HeadscaleService_GetMachineRoutes_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("POST", pattern_HeadscaleService_CreateApiKey_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -1648,7 +1573,6 @@ func RegisterHeadscaleServiceHandlerServer(ctx context.Context, mux *runtime.Ser } forward_HeadscaleService_CreateApiKey_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("POST", pattern_HeadscaleService_ExpireApiKey_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -1673,7 +1597,6 @@ func RegisterHeadscaleServiceHandlerServer(ctx context.Context, mux *runtime.Ser } forward_HeadscaleService_ExpireApiKey_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("GET", pattern_HeadscaleService_ListApiKeys_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -1698,7 +1621,6 @@ func RegisterHeadscaleServiceHandlerServer(ctx context.Context, mux *runtime.Ser } forward_HeadscaleService_ListApiKeys_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) return nil @@ -1741,7 +1663,6 @@ func RegisterHeadscaleServiceHandler(ctx context.Context, mux *runtime.ServeMux, // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in // "HeadscaleServiceClient" to call the correct interceptors. func RegisterHeadscaleServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client HeadscaleServiceClient) error { - mux.Handle("GET", pattern_HeadscaleService_GetUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1761,7 +1682,6 @@ func RegisterHeadscaleServiceHandlerClient(ctx context.Context, mux *runtime.Ser } forward_HeadscaleService_GetUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("POST", pattern_HeadscaleService_CreateUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -1783,7 +1703,6 @@ func RegisterHeadscaleServiceHandlerClient(ctx context.Context, mux *runtime.Ser } forward_HeadscaleService_CreateUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("POST", pattern_HeadscaleService_RenameUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -1805,7 +1724,6 @@ func RegisterHeadscaleServiceHandlerClient(ctx context.Context, mux *runtime.Ser } forward_HeadscaleService_RenameUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("DELETE", pattern_HeadscaleService_DeleteUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -1827,7 +1745,6 @@ func RegisterHeadscaleServiceHandlerClient(ctx context.Context, mux *runtime.Ser } forward_HeadscaleService_DeleteUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("GET", pattern_HeadscaleService_ListUsers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -1849,7 +1766,6 @@ func RegisterHeadscaleServiceHandlerClient(ctx context.Context, mux *runtime.Ser } forward_HeadscaleService_ListUsers_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("POST", pattern_HeadscaleService_CreatePreAuthKey_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -1871,7 +1787,6 @@ func RegisterHeadscaleServiceHandlerClient(ctx context.Context, mux *runtime.Ser } forward_HeadscaleService_CreatePreAuthKey_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("POST", pattern_HeadscaleService_ExpirePreAuthKey_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -1893,7 +1808,6 @@ func RegisterHeadscaleServiceHandlerClient(ctx context.Context, mux *runtime.Ser } forward_HeadscaleService_ExpirePreAuthKey_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("GET", pattern_HeadscaleService_ListPreAuthKeys_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -1915,7 +1829,6 @@ func RegisterHeadscaleServiceHandlerClient(ctx context.Context, mux *runtime.Ser } forward_HeadscaleService_ListPreAuthKeys_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("POST", pattern_HeadscaleService_DebugCreateMachine_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -1937,7 +1850,6 @@ func RegisterHeadscaleServiceHandlerClient(ctx context.Context, mux *runtime.Ser } forward_HeadscaleService_DebugCreateMachine_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("GET", pattern_HeadscaleService_GetMachine_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -1959,7 +1871,6 @@ func RegisterHeadscaleServiceHandlerClient(ctx context.Context, mux *runtime.Ser } forward_HeadscaleService_GetMachine_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("POST", pattern_HeadscaleService_SetTags_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -1981,7 +1892,6 @@ func RegisterHeadscaleServiceHandlerClient(ctx context.Context, mux *runtime.Ser } forward_HeadscaleService_SetTags_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("POST", pattern_HeadscaleService_RegisterMachine_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -2003,7 +1913,6 @@ func RegisterHeadscaleServiceHandlerClient(ctx context.Context, mux *runtime.Ser } forward_HeadscaleService_RegisterMachine_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("DELETE", pattern_HeadscaleService_DeleteMachine_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -2025,7 +1934,6 @@ func RegisterHeadscaleServiceHandlerClient(ctx context.Context, mux *runtime.Ser } forward_HeadscaleService_DeleteMachine_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("POST", pattern_HeadscaleService_ExpireMachine_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -2047,7 +1955,6 @@ func RegisterHeadscaleServiceHandlerClient(ctx context.Context, mux *runtime.Ser } forward_HeadscaleService_ExpireMachine_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("POST", pattern_HeadscaleService_RenameMachine_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -2069,7 +1976,6 @@ func RegisterHeadscaleServiceHandlerClient(ctx context.Context, mux *runtime.Ser } forward_HeadscaleService_RenameMachine_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("GET", pattern_HeadscaleService_ListMachines_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -2091,7 +1997,6 @@ func RegisterHeadscaleServiceHandlerClient(ctx context.Context, mux *runtime.Ser } forward_HeadscaleService_ListMachines_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("POST", pattern_HeadscaleService_MoveMachine_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -2113,7 +2018,6 @@ func RegisterHeadscaleServiceHandlerClient(ctx context.Context, mux *runtime.Ser } forward_HeadscaleService_MoveMachine_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("GET", pattern_HeadscaleService_GetRoutes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -2135,7 +2039,6 @@ func RegisterHeadscaleServiceHandlerClient(ctx context.Context, mux *runtime.Ser } forward_HeadscaleService_GetRoutes_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("POST", pattern_HeadscaleService_EnableRoute_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -2157,7 +2060,6 @@ func RegisterHeadscaleServiceHandlerClient(ctx context.Context, mux *runtime.Ser } forward_HeadscaleService_EnableRoute_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("POST", pattern_HeadscaleService_DisableRoute_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -2179,7 +2081,6 @@ func RegisterHeadscaleServiceHandlerClient(ctx context.Context, mux *runtime.Ser } forward_HeadscaleService_DisableRoute_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("GET", pattern_HeadscaleService_GetMachineRoutes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -2201,7 +2102,6 @@ func RegisterHeadscaleServiceHandlerClient(ctx context.Context, mux *runtime.Ser } forward_HeadscaleService_GetMachineRoutes_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("POST", pattern_HeadscaleService_CreateApiKey_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -2223,7 +2123,6 @@ func RegisterHeadscaleServiceHandlerClient(ctx context.Context, mux *runtime.Ser } forward_HeadscaleService_CreateApiKey_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("POST", pattern_HeadscaleService_ExpireApiKey_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -2245,7 +2144,6 @@ func RegisterHeadscaleServiceHandlerClient(ctx context.Context, mux *runtime.Ser } forward_HeadscaleService_ExpireApiKey_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) mux.Handle("GET", pattern_HeadscaleService_ListApiKeys_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -2267,7 +2165,6 @@ func RegisterHeadscaleServiceHandlerClient(ctx context.Context, mux *runtime.Ser } forward_HeadscaleService_ListApiKeys_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) return nil diff --git a/gen/go/headscale/v1/headscale_grpc.pb.go b/gen/go/headscale/v1/headscale_grpc.pb.go index a1c8eba..9087b25 100644 --- a/gen/go/headscale/v1/headscale_grpc.pb.go +++ b/gen/go/headscale/v1/headscale_grpc.pb.go @@ -8,6 +8,7 @@ package v1 import ( context "context" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -314,78 +315,100 @@ type HeadscaleServiceServer interface { } // UnimplementedHeadscaleServiceServer must be embedded to have forward compatible implementations. -type UnimplementedHeadscaleServiceServer struct { -} +type UnimplementedHeadscaleServiceServer struct{} func (UnimplementedHeadscaleServiceServer) GetUser(context.Context, *GetUserRequest) (*GetUserResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetUser not implemented") } + func (UnimplementedHeadscaleServiceServer) CreateUser(context.Context, *CreateUserRequest) (*CreateUserResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateUser not implemented") } + func (UnimplementedHeadscaleServiceServer) RenameUser(context.Context, *RenameUserRequest) (*RenameUserResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RenameUser not implemented") } + func (UnimplementedHeadscaleServiceServer) DeleteUser(context.Context, *DeleteUserRequest) (*DeleteUserResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteUser not implemented") } + func (UnimplementedHeadscaleServiceServer) ListUsers(context.Context, *ListUsersRequest) (*ListUsersResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListUsers not implemented") } + func (UnimplementedHeadscaleServiceServer) CreatePreAuthKey(context.Context, *CreatePreAuthKeyRequest) (*CreatePreAuthKeyResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreatePreAuthKey not implemented") } + func (UnimplementedHeadscaleServiceServer) ExpirePreAuthKey(context.Context, *ExpirePreAuthKeyRequest) (*ExpirePreAuthKeyResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ExpirePreAuthKey not implemented") } + func (UnimplementedHeadscaleServiceServer) ListPreAuthKeys(context.Context, *ListPreAuthKeysRequest) (*ListPreAuthKeysResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListPreAuthKeys not implemented") } + func (UnimplementedHeadscaleServiceServer) DebugCreateMachine(context.Context, *DebugCreateMachineRequest) (*DebugCreateMachineResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DebugCreateMachine not implemented") } + func (UnimplementedHeadscaleServiceServer) GetMachine(context.Context, *GetMachineRequest) (*GetMachineResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetMachine not implemented") } + func (UnimplementedHeadscaleServiceServer) SetTags(context.Context, *SetTagsRequest) (*SetTagsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SetTags not implemented") } + func (UnimplementedHeadscaleServiceServer) RegisterMachine(context.Context, *RegisterMachineRequest) (*RegisterMachineResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RegisterMachine not implemented") } + func (UnimplementedHeadscaleServiceServer) DeleteMachine(context.Context, *DeleteMachineRequest) (*DeleteMachineResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteMachine not implemented") } + func (UnimplementedHeadscaleServiceServer) ExpireMachine(context.Context, *ExpireMachineRequest) (*ExpireMachineResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ExpireMachine not implemented") } + func (UnimplementedHeadscaleServiceServer) RenameMachine(context.Context, *RenameMachineRequest) (*RenameMachineResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RenameMachine not implemented") } + func (UnimplementedHeadscaleServiceServer) ListMachines(context.Context, *ListMachinesRequest) (*ListMachinesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListMachines not implemented") } + func (UnimplementedHeadscaleServiceServer) MoveMachine(context.Context, *MoveMachineRequest) (*MoveMachineResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method MoveMachine not implemented") } + func (UnimplementedHeadscaleServiceServer) GetRoutes(context.Context, *GetRoutesRequest) (*GetRoutesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetRoutes not implemented") } + func (UnimplementedHeadscaleServiceServer) EnableRoute(context.Context, *EnableRouteRequest) (*EnableRouteResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method EnableRoute not implemented") } + func (UnimplementedHeadscaleServiceServer) DisableRoute(context.Context, *DisableRouteRequest) (*DisableRouteResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DisableRoute not implemented") } + func (UnimplementedHeadscaleServiceServer) GetMachineRoutes(context.Context, *GetMachineRoutesRequest) (*GetMachineRoutesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetMachineRoutes not implemented") } + func (UnimplementedHeadscaleServiceServer) CreateApiKey(context.Context, *CreateApiKeyRequest) (*CreateApiKeyResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateApiKey not implemented") } + func (UnimplementedHeadscaleServiceServer) ExpireApiKey(context.Context, *ExpireApiKeyRequest) (*ExpireApiKeyResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ExpireApiKey not implemented") } + func (UnimplementedHeadscaleServiceServer) ListApiKeys(context.Context, *ListApiKeysRequest) (*ListApiKeysResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListApiKeys not implemented") } diff --git a/gen/go/headscale/v1/machine.pb.go b/gen/go/headscale/v1/machine.pb.go index 616ef2f..12f9811 100644 --- a/gen/go/headscale/v1/machine.pb.go +++ b/gen/go/headscale/v1/machine.pb.go @@ -7,11 +7,12 @@ package v1 import ( + reflect "reflect" + sync "sync" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" ) const ( @@ -1309,33 +1310,35 @@ func file_headscale_v1_machine_proto_rawDescGZIP() []byte { return file_headscale_v1_machine_proto_rawDescData } -var file_headscale_v1_machine_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_headscale_v1_machine_proto_msgTypes = make([]protoimpl.MessageInfo, 19) -var file_headscale_v1_machine_proto_goTypes = []interface{}{ - (RegisterMethod)(0), // 0: headscale.v1.RegisterMethod - (*Machine)(nil), // 1: headscale.v1.Machine - (*RegisterMachineRequest)(nil), // 2: headscale.v1.RegisterMachineRequest - (*RegisterMachineResponse)(nil), // 3: headscale.v1.RegisterMachineResponse - (*GetMachineRequest)(nil), // 4: headscale.v1.GetMachineRequest - (*GetMachineResponse)(nil), // 5: headscale.v1.GetMachineResponse - (*SetTagsRequest)(nil), // 6: headscale.v1.SetTagsRequest - (*SetTagsResponse)(nil), // 7: headscale.v1.SetTagsResponse - (*DeleteMachineRequest)(nil), // 8: headscale.v1.DeleteMachineRequest - (*DeleteMachineResponse)(nil), // 9: headscale.v1.DeleteMachineResponse - (*ExpireMachineRequest)(nil), // 10: headscale.v1.ExpireMachineRequest - (*ExpireMachineResponse)(nil), // 11: headscale.v1.ExpireMachineResponse - (*RenameMachineRequest)(nil), // 12: headscale.v1.RenameMachineRequest - (*RenameMachineResponse)(nil), // 13: headscale.v1.RenameMachineResponse - (*ListMachinesRequest)(nil), // 14: headscale.v1.ListMachinesRequest - (*ListMachinesResponse)(nil), // 15: headscale.v1.ListMachinesResponse - (*MoveMachineRequest)(nil), // 16: headscale.v1.MoveMachineRequest - (*MoveMachineResponse)(nil), // 17: headscale.v1.MoveMachineResponse - (*DebugCreateMachineRequest)(nil), // 18: headscale.v1.DebugCreateMachineRequest - (*DebugCreateMachineResponse)(nil), // 19: headscale.v1.DebugCreateMachineResponse - (*User)(nil), // 20: headscale.v1.User - (*timestamppb.Timestamp)(nil), // 21: google.protobuf.Timestamp - (*PreAuthKey)(nil), // 22: headscale.v1.PreAuthKey -} +var ( + file_headscale_v1_machine_proto_enumTypes = make([]protoimpl.EnumInfo, 1) + file_headscale_v1_machine_proto_msgTypes = make([]protoimpl.MessageInfo, 19) + file_headscale_v1_machine_proto_goTypes = []interface{}{ + (RegisterMethod)(0), // 0: headscale.v1.RegisterMethod + (*Machine)(nil), // 1: headscale.v1.Machine + (*RegisterMachineRequest)(nil), // 2: headscale.v1.RegisterMachineRequest + (*RegisterMachineResponse)(nil), // 3: headscale.v1.RegisterMachineResponse + (*GetMachineRequest)(nil), // 4: headscale.v1.GetMachineRequest + (*GetMachineResponse)(nil), // 5: headscale.v1.GetMachineResponse + (*SetTagsRequest)(nil), // 6: headscale.v1.SetTagsRequest + (*SetTagsResponse)(nil), // 7: headscale.v1.SetTagsResponse + (*DeleteMachineRequest)(nil), // 8: headscale.v1.DeleteMachineRequest + (*DeleteMachineResponse)(nil), // 9: headscale.v1.DeleteMachineResponse + (*ExpireMachineRequest)(nil), // 10: headscale.v1.ExpireMachineRequest + (*ExpireMachineResponse)(nil), // 11: headscale.v1.ExpireMachineResponse + (*RenameMachineRequest)(nil), // 12: headscale.v1.RenameMachineRequest + (*RenameMachineResponse)(nil), // 13: headscale.v1.RenameMachineResponse + (*ListMachinesRequest)(nil), // 14: headscale.v1.ListMachinesRequest + (*ListMachinesResponse)(nil), // 15: headscale.v1.ListMachinesResponse + (*MoveMachineRequest)(nil), // 16: headscale.v1.MoveMachineRequest + (*MoveMachineResponse)(nil), // 17: headscale.v1.MoveMachineResponse + (*DebugCreateMachineRequest)(nil), // 18: headscale.v1.DebugCreateMachineRequest + (*DebugCreateMachineResponse)(nil), // 19: headscale.v1.DebugCreateMachineResponse + (*User)(nil), // 20: headscale.v1.User + (*timestamppb.Timestamp)(nil), // 21: google.protobuf.Timestamp + (*PreAuthKey)(nil), // 22: headscale.v1.PreAuthKey + } +) var file_headscale_v1_machine_proto_depIdxs = []int32{ 20, // 0: headscale.v1.Machine.user:type_name -> headscale.v1.User 21, // 1: headscale.v1.Machine.last_seen:type_name -> google.protobuf.Timestamp diff --git a/gen/go/headscale/v1/preauthkey.pb.go b/gen/go/headscale/v1/preauthkey.pb.go index 4b03209..c0a3283 100644 --- a/gen/go/headscale/v1/preauthkey.pb.go +++ b/gen/go/headscale/v1/preauthkey.pb.go @@ -7,11 +7,12 @@ package v1 import ( + reflect "reflect" + sync "sync" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" ) const ( @@ -521,17 +522,19 @@ func file_headscale_v1_preauthkey_proto_rawDescGZIP() []byte { return file_headscale_v1_preauthkey_proto_rawDescData } -var file_headscale_v1_preauthkey_proto_msgTypes = make([]protoimpl.MessageInfo, 7) -var file_headscale_v1_preauthkey_proto_goTypes = []interface{}{ - (*PreAuthKey)(nil), // 0: headscale.v1.PreAuthKey - (*CreatePreAuthKeyRequest)(nil), // 1: headscale.v1.CreatePreAuthKeyRequest - (*CreatePreAuthKeyResponse)(nil), // 2: headscale.v1.CreatePreAuthKeyResponse - (*ExpirePreAuthKeyRequest)(nil), // 3: headscale.v1.ExpirePreAuthKeyRequest - (*ExpirePreAuthKeyResponse)(nil), // 4: headscale.v1.ExpirePreAuthKeyResponse - (*ListPreAuthKeysRequest)(nil), // 5: headscale.v1.ListPreAuthKeysRequest - (*ListPreAuthKeysResponse)(nil), // 6: headscale.v1.ListPreAuthKeysResponse - (*timestamppb.Timestamp)(nil), // 7: google.protobuf.Timestamp -} +var ( + file_headscale_v1_preauthkey_proto_msgTypes = make([]protoimpl.MessageInfo, 7) + file_headscale_v1_preauthkey_proto_goTypes = []interface{}{ + (*PreAuthKey)(nil), // 0: headscale.v1.PreAuthKey + (*CreatePreAuthKeyRequest)(nil), // 1: headscale.v1.CreatePreAuthKeyRequest + (*CreatePreAuthKeyResponse)(nil), // 2: headscale.v1.CreatePreAuthKeyResponse + (*ExpirePreAuthKeyRequest)(nil), // 3: headscale.v1.ExpirePreAuthKeyRequest + (*ExpirePreAuthKeyResponse)(nil), // 4: headscale.v1.ExpirePreAuthKeyResponse + (*ListPreAuthKeysRequest)(nil), // 5: headscale.v1.ListPreAuthKeysRequest + (*ListPreAuthKeysResponse)(nil), // 6: headscale.v1.ListPreAuthKeysResponse + (*timestamppb.Timestamp)(nil), // 7: google.protobuf.Timestamp + } +) var file_headscale_v1_preauthkey_proto_depIdxs = []int32{ 7, // 0: headscale.v1.PreAuthKey.expiration:type_name -> google.protobuf.Timestamp 7, // 1: headscale.v1.PreAuthKey.created_at:type_name -> google.protobuf.Timestamp diff --git a/gen/go/headscale/v1/routes.pb.go b/gen/go/headscale/v1/routes.pb.go index 0032dd2..63535e5 100644 --- a/gen/go/headscale/v1/routes.pb.go +++ b/gen/go/headscale/v1/routes.pb.go @@ -7,11 +7,12 @@ package v1 import ( + reflect "reflect" + sync "sync" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" ) const ( @@ -554,20 +555,22 @@ func file_headscale_v1_routes_proto_rawDescGZIP() []byte { return file_headscale_v1_routes_proto_rawDescData } -var file_headscale_v1_routes_proto_msgTypes = make([]protoimpl.MessageInfo, 9) -var file_headscale_v1_routes_proto_goTypes = []interface{}{ - (*Route)(nil), // 0: headscale.v1.Route - (*GetRoutesRequest)(nil), // 1: headscale.v1.GetRoutesRequest - (*GetRoutesResponse)(nil), // 2: headscale.v1.GetRoutesResponse - (*EnableRouteRequest)(nil), // 3: headscale.v1.EnableRouteRequest - (*EnableRouteResponse)(nil), // 4: headscale.v1.EnableRouteResponse - (*DisableRouteRequest)(nil), // 5: headscale.v1.DisableRouteRequest - (*DisableRouteResponse)(nil), // 6: headscale.v1.DisableRouteResponse - (*GetMachineRoutesRequest)(nil), // 7: headscale.v1.GetMachineRoutesRequest - (*GetMachineRoutesResponse)(nil), // 8: headscale.v1.GetMachineRoutesResponse - (*Machine)(nil), // 9: headscale.v1.Machine - (*timestamppb.Timestamp)(nil), // 10: google.protobuf.Timestamp -} +var ( + file_headscale_v1_routes_proto_msgTypes = make([]protoimpl.MessageInfo, 9) + file_headscale_v1_routes_proto_goTypes = []interface{}{ + (*Route)(nil), // 0: headscale.v1.Route + (*GetRoutesRequest)(nil), // 1: headscale.v1.GetRoutesRequest + (*GetRoutesResponse)(nil), // 2: headscale.v1.GetRoutesResponse + (*EnableRouteRequest)(nil), // 3: headscale.v1.EnableRouteRequest + (*EnableRouteResponse)(nil), // 4: headscale.v1.EnableRouteResponse + (*DisableRouteRequest)(nil), // 5: headscale.v1.DisableRouteRequest + (*DisableRouteResponse)(nil), // 6: headscale.v1.DisableRouteResponse + (*GetMachineRoutesRequest)(nil), // 7: headscale.v1.GetMachineRoutesRequest + (*GetMachineRoutesResponse)(nil), // 8: headscale.v1.GetMachineRoutesResponse + (*Machine)(nil), // 9: headscale.v1.Machine + (*timestamppb.Timestamp)(nil), // 10: google.protobuf.Timestamp + } +) var file_headscale_v1_routes_proto_depIdxs = []int32{ 9, // 0: headscale.v1.Route.machine:type_name -> headscale.v1.Machine 10, // 1: headscale.v1.Route.created_at:type_name -> google.protobuf.Timestamp diff --git a/gen/go/headscale/v1/user.pb.go b/gen/go/headscale/v1/user.pb.go index 905afc8..4583247 100644 --- a/gen/go/headscale/v1/user.pb.go +++ b/gen/go/headscale/v1/user.pb.go @@ -7,11 +7,12 @@ package v1 import ( + reflect "reflect" + sync "sync" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" ) const ( @@ -606,21 +607,23 @@ func file_headscale_v1_user_proto_rawDescGZIP() []byte { return file_headscale_v1_user_proto_rawDescData } -var file_headscale_v1_user_proto_msgTypes = make([]protoimpl.MessageInfo, 11) -var file_headscale_v1_user_proto_goTypes = []interface{}{ - (*User)(nil), // 0: headscale.v1.User - (*GetUserRequest)(nil), // 1: headscale.v1.GetUserRequest - (*GetUserResponse)(nil), // 2: headscale.v1.GetUserResponse - (*CreateUserRequest)(nil), // 3: headscale.v1.CreateUserRequest - (*CreateUserResponse)(nil), // 4: headscale.v1.CreateUserResponse - (*RenameUserRequest)(nil), // 5: headscale.v1.RenameUserRequest - (*RenameUserResponse)(nil), // 6: headscale.v1.RenameUserResponse - (*DeleteUserRequest)(nil), // 7: headscale.v1.DeleteUserRequest - (*DeleteUserResponse)(nil), // 8: headscale.v1.DeleteUserResponse - (*ListUsersRequest)(nil), // 9: headscale.v1.ListUsersRequest - (*ListUsersResponse)(nil), // 10: headscale.v1.ListUsersResponse - (*timestamppb.Timestamp)(nil), // 11: google.protobuf.Timestamp -} +var ( + file_headscale_v1_user_proto_msgTypes = make([]protoimpl.MessageInfo, 11) + file_headscale_v1_user_proto_goTypes = []interface{}{ + (*User)(nil), // 0: headscale.v1.User + (*GetUserRequest)(nil), // 1: headscale.v1.GetUserRequest + (*GetUserResponse)(nil), // 2: headscale.v1.GetUserResponse + (*CreateUserRequest)(nil), // 3: headscale.v1.CreateUserRequest + (*CreateUserResponse)(nil), // 4: headscale.v1.CreateUserResponse + (*RenameUserRequest)(nil), // 5: headscale.v1.RenameUserRequest + (*RenameUserResponse)(nil), // 6: headscale.v1.RenameUserResponse + (*DeleteUserRequest)(nil), // 7: headscale.v1.DeleteUserRequest + (*DeleteUserResponse)(nil), // 8: headscale.v1.DeleteUserResponse + (*ListUsersRequest)(nil), // 9: headscale.v1.ListUsersRequest + (*ListUsersResponse)(nil), // 10: headscale.v1.ListUsersResponse + (*timestamppb.Timestamp)(nil), // 11: google.protobuf.Timestamp + } +) var file_headscale_v1_user_proto_depIdxs = []int32{ 11, // 0: headscale.v1.User.created_at:type_name -> google.protobuf.Timestamp 0, // 1: headscale.v1.GetUserResponse.user:type_name -> headscale.v1.User diff --git a/integration/scenario.go b/integration/scenario.go index 60e60fc..0fc7e2a 100644 --- a/integration/scenario.go +++ b/integration/scenario.go @@ -25,7 +25,7 @@ const ( var ( errNoHeadscaleAvailable = errors.New("no headscale available") - errNoUserAvailable = errors.New("no user available") + errNoUserAvailable = errors.New("no user available") // Tailscale started adding TS2021 support in CapabilityVersion>=28 (v1.24.0), but // proper support in Headscale was only added for CapabilityVersion>=39 clients (v1.30.0). @@ -116,7 +116,7 @@ func NewScenario() (*Scenario, error) { return &Scenario{ controlServers: xsync.NewMapOf[ControlServer](), - users: make(map[string]*User), + users: make(map[string]*User), pool: pool, network: network, diff --git a/integration_common_test.go b/integration_common_test.go index 7dc0d17..0abaae1 100644 --- a/integration_common_test.go +++ b/integration_common_test.go @@ -1,4 +1,4 @@ -//nolint +// nolint package headscale import ( diff --git a/integration_embedded_derp_test.go b/integration_embedded_derp_test.go index 45f622a..a099c09 100644 --- a/integration_embedded_derp_test.go +++ b/integration_embedded_derp_test.go @@ -1,4 +1,4 @@ -//nolint +// nolint package headscale import ( @@ -26,7 +26,7 @@ import ( const ( headscaleDerpHostname = "headscale-derp" - userName = "derpuser" + userName = "derpuser" totalContainers = 3 ) diff --git a/machine.go b/machine.go index 8498590..b13cd48 100644 --- a/machine.go +++ b/machine.go @@ -27,7 +27,7 @@ const ( ) ErrCouldNotConvertMachineInterface = Error("failed to convert machine interface") ErrHostnameTooLong = Error("Hostname too long") - ErrDifferentRegisteredUser = Error( + ErrDifferentRegisteredUser = Error( "machine was previously registered with a different user", ) MachineGivenNameHashLength = 8 @@ -56,9 +56,9 @@ type Machine struct { // // GivenName is the name used in all DNS related // parts of headscale. - GivenName string `gorm:"type:varchar(63);unique_index"` - UserID uint - User User `gorm:"foreignKey:UserID"` + GivenName string `gorm:"type:varchar(63);unique_index"` + UserID uint + User User `gorm:"foreignKey:UserID"` RegisterMethod string @@ -782,7 +782,7 @@ func (machine *Machine) toProto() *v1.Machine { IpAddresses: machine.IPAddresses.ToStringSlice(), Name: machine.Hostname, GivenName: machine.GivenName, - User: machine.User.toProto(), + User: machine.User.toProto(), ForcedTags: machine.ForcedTags, Online: machine.isOnline(), diff --git a/machine_test.go b/machine_test.go index 481f3db..8e35cbf 100644 --- a/machine_test.go +++ b/machine_test.go @@ -30,7 +30,7 @@ func (s *Suite) TestGetMachine(c *check.C) { NodeKey: "bar", DiscoKey: "faa", Hostname: "testmachine", - UserID: user.ID, + UserID: user.ID, RegisterMethod: RegisterMethodAuthKey, AuthKeyID: uint(pak.ID), } @@ -56,7 +56,7 @@ func (s *Suite) TestGetMachineByID(c *check.C) { NodeKey: "bar", DiscoKey: "faa", Hostname: "testmachine", - UserID: user.ID, + UserID: user.ID, RegisterMethod: RegisterMethodAuthKey, AuthKeyID: uint(pak.ID), } @@ -85,7 +85,7 @@ func (s *Suite) TestGetMachineByNodeKey(c *check.C) { NodeKey: NodePublicKeyStripPrefix(nodeKey.Public()), DiscoKey: "faa", Hostname: "testmachine", - UserID: user.ID, + UserID: user.ID, RegisterMethod: RegisterMethodAuthKey, AuthKeyID: uint(pak.ID), } @@ -116,7 +116,7 @@ func (s *Suite) TestGetMachineByAnyNodeKey(c *check.C) { NodeKey: NodePublicKeyStripPrefix(nodeKey.Public()), DiscoKey: "faa", Hostname: "testmachine", - UserID: user.ID, + UserID: user.ID, RegisterMethod: RegisterMethodAuthKey, AuthKeyID: uint(pak.ID), } @@ -135,7 +135,7 @@ func (s *Suite) TestDeleteMachine(c *check.C) { NodeKey: "bar", DiscoKey: "faa", Hostname: "testmachine", - UserID: user.ID, + UserID: user.ID, RegisterMethod: RegisterMethodAuthKey, AuthKeyID: uint(1), } @@ -157,7 +157,7 @@ func (s *Suite) TestHardDeleteMachine(c *check.C) { NodeKey: "bar", DiscoKey: "faa", Hostname: "testmachine3", - UserID: user.ID, + UserID: user.ID, RegisterMethod: RegisterMethodAuthKey, AuthKeyID: uint(1), } @@ -187,7 +187,7 @@ func (s *Suite) TestListPeers(c *check.C) { NodeKey: "bar" + strconv.Itoa(index), DiscoKey: "faa" + strconv.Itoa(index), Hostname: "testmachine" + strconv.Itoa(index), - UserID: user.ID, + UserID: user.ID, RegisterMethod: RegisterMethodAuthKey, AuthKeyID: uint(pak.ID), } @@ -209,7 +209,7 @@ func (s *Suite) TestListPeers(c *check.C) { func (s *Suite) TestGetACLFilteredPeers(c *check.C) { type base struct { user *User - key *PreAuthKey + key *PreAuthKey } stor := make([]base, 0) @@ -235,7 +235,7 @@ func (s *Suite) TestGetACLFilteredPeers(c *check.C) { netip.MustParseAddr(fmt.Sprintf("100.64.0.%v", strconv.Itoa(index+1))), }, Hostname: "testmachine" + strconv.Itoa(index), - UserID: stor[index%2].user.ID, + UserID: stor[index%2].user.ID, RegisterMethod: RegisterMethodAuthKey, AuthKeyID: uint(stor[index%2].key.ID), } @@ -309,7 +309,7 @@ func (s *Suite) TestExpireMachine(c *check.C) { NodeKey: "bar", DiscoKey: "faa", Hostname: "testmachine", - UserID: user.ID, + UserID: user.ID, RegisterMethod: RegisterMethodAuthKey, AuthKeyID: uint(pak.ID), Expiry: &time.Time{}, @@ -366,7 +366,7 @@ func (s *Suite) TestGenerateGivenName(c *check.C) { DiscoKey: "disco-key-1", Hostname: "hostname-1", GivenName: "hostname-1", - UserID: user1.ID, + UserID: user1.ID, RegisterMethod: RegisterMethodAuthKey, AuthKeyID: uint(pak.ID), } @@ -409,7 +409,7 @@ func (s *Suite) TestSetTags(c *check.C) { NodeKey: "bar", DiscoKey: "faa", Hostname: "testmachine", - UserID: user.ID, + UserID: user.ID, RegisterMethod: RegisterMethodAuthKey, AuthKeyID: uint(pak.ID), } @@ -635,19 +635,19 @@ func Test_getFilteredByACLPeers(t *testing.T) { machine: &Machine{ // current machine ID: 1, IPAddresses: MachineAddresses{netip.MustParseAddr("100.64.0.1")}, - User: User{Name: "joe"}, + User: User{Name: "joe"}, }, }, want: Machines{ { ID: 2, IPAddresses: MachineAddresses{netip.MustParseAddr("100.64.0.2")}, - User: User{Name: "marc"}, + User: User{Name: "marc"}, }, { ID: 3, IPAddresses: MachineAddresses{netip.MustParseAddr("100.64.0.3")}, - User: User{Name: "mickael"}, + User: User{Name: "mickael"}, }, }, }, @@ -688,14 +688,14 @@ func Test_getFilteredByACLPeers(t *testing.T) { machine: &Machine{ // current machine ID: 1, IPAddresses: MachineAddresses{netip.MustParseAddr("100.64.0.1")}, - User: User{Name: "joe"}, + User: User{Name: "joe"}, }, }, want: Machines{ { ID: 2, IPAddresses: MachineAddresses{netip.MustParseAddr("100.64.0.2")}, - User: User{Name: "marc"}, + User: User{Name: "marc"}, }, }, }, @@ -736,14 +736,14 @@ func Test_getFilteredByACLPeers(t *testing.T) { machine: &Machine{ // current machine ID: 2, IPAddresses: MachineAddresses{netip.MustParseAddr("100.64.0.2")}, - User: User{Name: "marc"}, + User: User{Name: "marc"}, }, }, want: Machines{ { ID: 3, IPAddresses: MachineAddresses{netip.MustParseAddr("100.64.0.3")}, - User: User{Name: "mickael"}, + User: User{Name: "mickael"}, }, }, }, @@ -895,7 +895,7 @@ func Test_getFilteredByACLPeers(t *testing.T) { machine: &Machine{ // current machine ID: 2, IPAddresses: MachineAddresses{netip.MustParseAddr("100.64.0.2")}, - User: User{Name: "marc"}, + User: User{Name: "marc"}, }, }, want: Machines{ @@ -909,7 +909,7 @@ func Test_getFilteredByACLPeers(t *testing.T) { { ID: 3, IPAddresses: MachineAddresses{netip.MustParseAddr("100.64.0.3")}, - User: User{Name: "mickael"}, + User: User{Name: "mickael"}, }, }, }, @@ -944,7 +944,7 @@ func Test_getFilteredByACLPeers(t *testing.T) { machine: &Machine{ // current machine ID: 2, IPAddresses: MachineAddresses{netip.MustParseAddr("100.64.0.2")}, - User: User{Name: "marc"}, + User: User{Name: "marc"}, }, }, want: Machines{}, @@ -1144,7 +1144,7 @@ func (s *Suite) TestAutoApproveRoutes(c *check.C) { NodeKey: NodePublicKeyStripPrefix(nodeKey.Public()), DiscoKey: "faa", Hostname: "test", - UserID: user.ID, + UserID: user.ID, RegisterMethod: RegisterMethodAuthKey, AuthKeyID: uint(pak.ID), HostInfo: HostInfo{ diff --git a/preauth_keys.go b/preauth_keys.go index 64e44c4..3222c71 100644 --- a/preauth_keys.go +++ b/preauth_keys.go @@ -18,20 +18,20 @@ const ( ErrPreAuthKeyNotFound = Error("AuthKey not found") ErrPreAuthKeyExpired = Error("AuthKey expired") ErrSingleUseAuthKeyHasBeenUsed = Error("AuthKey has already been used") - ErrUserMismatch = Error("user mismatch") + ErrUserMismatch = Error("user mismatch") ErrPreAuthKeyACLTagInvalid = Error("AuthKey tag is invalid") ) // PreAuthKey describes a pre-authorization key usable in a particular user. type PreAuthKey struct { - ID uint64 `gorm:"primary_key"` - Key string - UserID uint - User User - Reusable bool - Ephemeral bool `gorm:"default:false"` - Used bool `gorm:"default:false"` - ACLTags []PreAuthKeyACLTag + ID uint64 `gorm:"primary_key"` + Key string + UserID uint + User User + Reusable bool + Ephemeral bool `gorm:"default:false"` + Used bool `gorm:"default:false"` + ACLTags []PreAuthKeyACLTag CreatedAt *time.Time Expiration *time.Time @@ -70,13 +70,13 @@ func (h *Headscale) CreatePreAuthKey( } key := PreAuthKey{ - Key: kstr, - UserID: user.ID, - User: *user, - Reusable: reusable, - Ephemeral: ephemeral, - CreatedAt: &now, - Expiration: expiration, + Key: kstr, + UserID: user.ID, + User: *user, + Reusable: reusable, + Ephemeral: ephemeral, + CreatedAt: &now, + Expiration: expiration, } err = h.db.Transaction(func(db *gorm.DB) error { @@ -217,7 +217,7 @@ func (h *Headscale) generateKey() (string, error) { func (key *PreAuthKey) toProto() *v1.PreAuthKey { protoKey := v1.PreAuthKey{ - User: key.User.Name, + User: key.User.Name, Id: strconv.FormatUint(key.ID, Base10), Key: key.Key, Ephemeral: key.Ephemeral, diff --git a/preauth_keys_test.go b/preauth_keys_test.go index 5d90b04..697144f 100644 --- a/preauth_keys_test.go +++ b/preauth_keys_test.go @@ -79,7 +79,7 @@ func (*Suite) TestAlreadyUsedKey(c *check.C) { NodeKey: "bar", DiscoKey: "faa", Hostname: "testest", - UserID: user.ID, + UserID: user.ID, RegisterMethod: RegisterMethodAuthKey, AuthKeyID: uint(pak.ID), } @@ -103,7 +103,7 @@ func (*Suite) TestReusableBeingUsedKey(c *check.C) { NodeKey: "bar", DiscoKey: "faa", Hostname: "testest", - UserID: user.ID, + UserID: user.ID, RegisterMethod: RegisterMethodAuthKey, AuthKeyID: uint(pak.ID), } @@ -140,7 +140,7 @@ func (*Suite) TestEphemeralKey(c *check.C) { NodeKey: "bar", DiscoKey: "faa", Hostname: "testest", - UserID: user.ID, + UserID: user.ID, RegisterMethod: RegisterMethodAuthKey, LastSeen: &now, AuthKeyID: uint(pak.ID), diff --git a/protocol_common.go b/protocol_common.go index bded49c..77a5b91 100644 --- a/protocol_common.go +++ b/protocol_common.go @@ -428,7 +428,7 @@ func (h *Headscale) handleAuthKeyCommon( machineToRegister := Machine{ Hostname: registerRequest.Hostinfo.Hostname, GivenName: givenName, - UserID: pak.User.ID, + UserID: pak.User.ID, MachineKey: MachinePublicKeyStripPrefix(machineKey), RegisterMethod: RegisterMethodAuthKey, Expiry: ®isterRequest.Expiry, diff --git a/routes_test.go b/routes_test.go index 7af3f05..172df03 100644 --- a/routes_test.go +++ b/routes_test.go @@ -32,7 +32,7 @@ func (s *Suite) TestGetRoutes(c *check.C) { NodeKey: "bar", DiscoKey: "faa", Hostname: "test_get_route_machine", - UserID: user.ID, + UserID: user.ID, RegisterMethod: RegisterMethodAuthKey, AuthKeyID: uint(pak.ID), HostInfo: HostInfo(hostInfo), @@ -83,7 +83,7 @@ func (s *Suite) TestGetEnableRoutes(c *check.C) { NodeKey: "bar", DiscoKey: "faa", Hostname: "test_enable_route_machine", - UserID: user.ID, + UserID: user.ID, RegisterMethod: RegisterMethodAuthKey, AuthKeyID: uint(pak.ID), HostInfo: HostInfo(hostInfo), @@ -157,7 +157,7 @@ func (s *Suite) TestIsUniquePrefix(c *check.C) { NodeKey: "bar", DiscoKey: "faa", Hostname: "test_enable_route_machine", - UserID: user.ID, + UserID: user.ID, RegisterMethod: RegisterMethodAuthKey, AuthKeyID: uint(pak.ID), HostInfo: HostInfo(hostInfo1), @@ -182,7 +182,7 @@ func (s *Suite) TestIsUniquePrefix(c *check.C) { NodeKey: "bar", DiscoKey: "faa", Hostname: "test_enable_route_machine", - UserID: user.ID, + UserID: user.ID, RegisterMethod: RegisterMethodAuthKey, AuthKeyID: uint(pak.ID), HostInfo: HostInfo(hostInfo2), @@ -243,7 +243,7 @@ func (s *Suite) TestSubnetFailover(c *check.C) { NodeKey: "bar", DiscoKey: "faa", Hostname: "test_enable_route_machine", - UserID: user.ID, + UserID: user.ID, RegisterMethod: RegisterMethodAuthKey, AuthKeyID: uint(pak.ID), HostInfo: HostInfo(hostInfo1), @@ -280,7 +280,7 @@ func (s *Suite) TestSubnetFailover(c *check.C) { NodeKey: "bar", DiscoKey: "faa", Hostname: "test_enable_route_machine", - UserID: user.ID, + UserID: user.ID, RegisterMethod: RegisterMethodAuthKey, AuthKeyID: uint(pak.ID), HostInfo: HostInfo(hostInfo2), @@ -402,7 +402,7 @@ func (s *Suite) TestAllowedIPRoutes(c *check.C) { NodeKey: NodePublicKeyStripPrefix(nodeKey.Public()), DiscoKey: DiscoPublicKeyStripPrefix(discoKey.Public()), Hostname: "test_enable_route_machine", - UserID: user.ID, + UserID: user.ID, RegisterMethod: RegisterMethodAuthKey, AuthKeyID: uint(pak.ID), HostInfo: HostInfo(hostInfo1), diff --git a/users_test.go b/users_test.go index 7b27b43..b96fbbe 100644 --- a/users_test.go +++ b/users_test.go @@ -53,7 +53,7 @@ func (s *Suite) TestDestroyUserErrors(c *check.C) { NodeKey: "bar", DiscoKey: "faa", Hostname: "testmachine", - UserID: user.ID, + UserID: user.ID, RegisterMethod: RegisterMethodAuthKey, AuthKeyID: uint(pak.ID), } @@ -147,8 +147,8 @@ func (s *Suite) TestGetMapResponseUserProfiles(c *check.C) { NodeKey: "686824e749f3b7f2a5927ee6c1e422aee5292592d9179a271ed7b3e659b44a66", DiscoKey: "686824e749f3b7f2a5927ee6c1e422aee5292592d9179a271ed7b3e659b44a66", Hostname: "test_get_shared_nodes_1", - UserID: userShared1.ID, - User: *userShared1, + UserID: userShared1.ID, + User: *userShared1, RegisterMethod: RegisterMethodAuthKey, IPAddresses: []netip.Addr{netip.MustParseAddr("100.64.0.1")}, AuthKeyID: uint(preAuthKeyShared1.ID), @@ -164,8 +164,8 @@ func (s *Suite) TestGetMapResponseUserProfiles(c *check.C) { NodeKey: "dec46ef9dc45c7d2f03bfcd5a640d9e24e3cc68ce3d9da223867c9bc6d5e9863", DiscoKey: "dec46ef9dc45c7d2f03bfcd5a640d9e24e3cc68ce3d9da223867c9bc6d5e9863", Hostname: "test_get_shared_nodes_2", - UserID: userShared2.ID, - User: *userShared2, + UserID: userShared2.ID, + User: *userShared2, RegisterMethod: RegisterMethodAuthKey, IPAddresses: []netip.Addr{netip.MustParseAddr("100.64.0.2")}, AuthKeyID: uint(preAuthKeyShared2.ID), @@ -181,8 +181,8 @@ func (s *Suite) TestGetMapResponseUserProfiles(c *check.C) { NodeKey: "dec46ef9dc45c7d2f03bfcd5a640d9e24e3cc68ce3d9da223867c9bc6d5e9863", DiscoKey: "dec46ef9dc45c7d2f03bfcd5a640d9e24e3cc68ce3d9da223867c9bc6d5e9863", Hostname: "test_get_shared_nodes_3", - UserID: userShared3.ID, - User: *userShared3, + UserID: userShared3.ID, + User: *userShared3, RegisterMethod: RegisterMethodAuthKey, IPAddresses: []netip.Addr{netip.MustParseAddr("100.64.0.3")}, AuthKeyID: uint(preAuthKeyShared3.ID), @@ -198,8 +198,8 @@ func (s *Suite) TestGetMapResponseUserProfiles(c *check.C) { NodeKey: "dec46ef9dc45c7d2f03bfcd5a640d9e24e3cc68ce3d9da223867c9bc6d5e9863", DiscoKey: "dec46ef9dc45c7d2f03bfcd5a640d9e24e3cc68ce3d9da223867c9bc6d5e9863", Hostname: "test_get_shared_nodes_4", - UserID: userShared1.ID, - User: *userShared1, + UserID: userShared1.ID, + User: *userShared1, RegisterMethod: RegisterMethodAuthKey, IPAddresses: []netip.Addr{netip.MustParseAddr("100.64.0.4")}, AuthKeyID: uint(preAuthKey2Shared1.ID), @@ -393,7 +393,7 @@ func (s *Suite) TestSetMachineUser(c *check.C) { NodeKey: "bar", DiscoKey: "faa", Hostname: "testmachine", - UserID: oldUser.ID, + UserID: oldUser.ID, RegisterMethod: RegisterMethodAuthKey, AuthKeyID: uint(pak.ID), } diff --git a/utils_test.go b/utils_test.go index 85495a5..fd1d25e 100644 --- a/utils_test.go +++ b/utils_test.go @@ -37,7 +37,7 @@ func (s *Suite) TestGetUsedIps(c *check.C) { NodeKey: "bar", DiscoKey: "faa", Hostname: "testmachine", - UserID: user.ID, + UserID: user.ID, RegisterMethod: RegisterMethodAuthKey, AuthKeyID: uint(pak.ID), IPAddresses: ips, @@ -85,7 +85,7 @@ func (s *Suite) TestGetMultiIp(c *check.C) { NodeKey: "bar", DiscoKey: "faa", Hostname: "testmachine", - UserID: user.ID, + UserID: user.ID, RegisterMethod: RegisterMethodAuthKey, AuthKeyID: uint(pak.ID), IPAddresses: ips, @@ -175,7 +175,7 @@ func (s *Suite) TestGetAvailableIpMachineWithoutIP(c *check.C) { NodeKey: "bar", DiscoKey: "faa", Hostname: "testmachine", - UserID: user.ID, + UserID: user.ID, RegisterMethod: RegisterMethodAuthKey, AuthKeyID: uint(pak.ID), }