From 8381e3f4d8d35d3ffbb8b6f08eaaaf750c59a9f5 Mon Sep 17 00:00:00 2001 From: Amp Date: Fri, 17 Jul 2026 15:46:07 +0000 Subject: [PATCH 1/3] Generate public authentication API clients Co-authored-by: Stefan Amberger --- .../authentication/v1/authentication.pb.go | 568 ++++++++++++++++++ .../v1/authentication_grpc.pb.go | 131 ++++ .../authentication.connect.go | 116 ++++ 3 files changed, 815 insertions(+) create mode 100644 protogen/authentication/v1/authentication.pb.go create mode 100644 protogen/authentication/v1/authentication_grpc.pb.go create mode 100644 protogen/authentication/v1/authenticationv1connect/authentication.connect.go diff --git a/protogen/authentication/v1/authentication.pb.go b/protogen/authentication/v1/authentication.pb.go new file mode 100644 index 0000000..5b24296 --- /dev/null +++ b/protogen/authentication/v1/authentication.pb.go @@ -0,0 +1,568 @@ +// Public API for resolving the identity associated with an authenticated request. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.11 +// protoc (unknown) +// source: authentication/v1/authentication.proto + +package authenticationv1 + +import ( + _ "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate" + v1 "github.com/tilebox/tilebox-go/protogen/tilebox/v1" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// User is the Tilebox user associated with an authenticated request. +type User struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Id *v1.ID `protobuf:"bytes,1,opt,name=id"` + xxx_hidden_Name string `protobuf:"bytes,2,opt,name=name"` + xxx_hidden_Email string `protobuf:"bytes,3,opt,name=email"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *User) Reset() { + *x = User{} + mi := &file_authentication_v1_authentication_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *User) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*User) ProtoMessage() {} + +func (x *User) ProtoReflect() protoreflect.Message { + mi := &file_authentication_v1_authentication_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *User) GetId() *v1.ID { + if x != nil { + return x.xxx_hidden_Id + } + return nil +} + +func (x *User) GetName() string { + if x != nil { + return x.xxx_hidden_Name + } + return "" +} + +func (x *User) GetEmail() string { + if x != nil { + return x.xxx_hidden_Email + } + return "" +} + +func (x *User) SetId(v *v1.ID) { + x.xxx_hidden_Id = v +} + +func (x *User) SetName(v string) { + x.xxx_hidden_Name = v +} + +func (x *User) SetEmail(v string) { + x.xxx_hidden_Email = v +} + +func (x *User) HasId() bool { + if x == nil { + return false + } + return x.xxx_hidden_Id != nil +} + +func (x *User) ClearId() { + x.xxx_hidden_Id = nil +} + +type User_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // The user's Tilebox ID. + Id *v1.ID + // The user's display name. + Name string + // The user's email address. + Email string +} + +func (b0 User_builder) Build() *User { + m0 := &User{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Id = b.Id + x.xxx_hidden_Name = b.Name + x.xxx_hidden_Email = b.Email + return m0 +} + +// Organization is the Tilebox organization associated with an authenticated request. +type Organization struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Id *v1.ID `protobuf:"bytes,1,opt,name=id"` + xxx_hidden_Name string `protobuf:"bytes,2,opt,name=name"` + xxx_hidden_Slug string `protobuf:"bytes,3,opt,name=slug"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Organization) Reset() { + *x = Organization{} + mi := &file_authentication_v1_authentication_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Organization) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Organization) ProtoMessage() {} + +func (x *Organization) ProtoReflect() protoreflect.Message { + mi := &file_authentication_v1_authentication_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Organization) GetId() *v1.ID { + if x != nil { + return x.xxx_hidden_Id + } + return nil +} + +func (x *Organization) GetName() string { + if x != nil { + return x.xxx_hidden_Name + } + return "" +} + +func (x *Organization) GetSlug() string { + if x != nil { + return x.xxx_hidden_Slug + } + return "" +} + +func (x *Organization) SetId(v *v1.ID) { + x.xxx_hidden_Id = v +} + +func (x *Organization) SetName(v string) { + x.xxx_hidden_Name = v +} + +func (x *Organization) SetSlug(v string) { + x.xxx_hidden_Slug = v +} + +func (x *Organization) HasId() bool { + if x == nil { + return false + } + return x.xxx_hidden_Id != nil +} + +func (x *Organization) ClearId() { + x.xxx_hidden_Id = nil +} + +type Organization_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // The organization's Tilebox ID. + Id *v1.ID + // The organization's display name. + Name string + // The organization's unique slug. + Slug string +} + +func (b0 Organization_builder) Build() *Organization { + m0 := &Organization{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Id = b.Id + x.xxx_hidden_Name = b.Name + x.xxx_hidden_Slug = b.Slug + return m0 +} + +// APIKey identifies an API key without exposing its secret. +type APIKey struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Id *v1.ID `protobuf:"bytes,1,opt,name=id"` + xxx_hidden_Identifier string `protobuf:"bytes,2,opt,name=identifier"` + xxx_hidden_Description string `protobuf:"bytes,3,opt,name=description"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *APIKey) Reset() { + *x = APIKey{} + mi := &file_authentication_v1_authentication_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *APIKey) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*APIKey) ProtoMessage() {} + +func (x *APIKey) ProtoReflect() protoreflect.Message { + mi := &file_authentication_v1_authentication_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *APIKey) GetId() *v1.ID { + if x != nil { + return x.xxx_hidden_Id + } + return nil +} + +func (x *APIKey) GetIdentifier() string { + if x != nil { + return x.xxx_hidden_Identifier + } + return "" +} + +func (x *APIKey) GetDescription() string { + if x != nil { + return x.xxx_hidden_Description + } + return "" +} + +func (x *APIKey) SetId(v *v1.ID) { + x.xxx_hidden_Id = v +} + +func (x *APIKey) SetIdentifier(v string) { + x.xxx_hidden_Identifier = v +} + +func (x *APIKey) SetDescription(v string) { + x.xxx_hidden_Description = v +} + +func (x *APIKey) HasId() bool { + if x == nil { + return false + } + return x.xxx_hidden_Id != nil +} + +func (x *APIKey) ClearId() { + x.xxx_hidden_Id = nil +} + +type APIKey_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // The API key's Tilebox ID. + Id *v1.ID + // The non-secret identifier embedded in the API key. + Identifier string + // The API key's user-provided description. + Description string +} + +func (b0 APIKey_builder) Build() *APIKey { + m0 := &APIKey{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Id = b.Id + x.xxx_hidden_Identifier = b.Identifier + x.xxx_hidden_Description = b.Description + return m0 +} + +// GetAuthenticationStatusRequest requests the identity associated with the calling credential. +type GetAuthenticationStatusRequest struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetAuthenticationStatusRequest) Reset() { + *x = GetAuthenticationStatusRequest{} + mi := &file_authentication_v1_authentication_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetAuthenticationStatusRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAuthenticationStatusRequest) ProtoMessage() {} + +func (x *GetAuthenticationStatusRequest) ProtoReflect() protoreflect.Message { + mi := &file_authentication_v1_authentication_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +type GetAuthenticationStatusRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + +} + +func (b0 GetAuthenticationStatusRequest_builder) Build() *GetAuthenticationStatusRequest { + m0 := &GetAuthenticationStatusRequest{} + b, x := &b0, m0 + _, _ = b, x + return m0 +} + +// AuthenticationStatus describes the identity associated with the calling credential. +type AuthenticationStatus struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_User *User `protobuf:"bytes,1,opt,name=user"` + xxx_hidden_Organization *Organization `protobuf:"bytes,2,opt,name=organization"` + xxx_hidden_ApiKey *APIKey `protobuf:"bytes,3,opt,name=api_key,json=apiKey"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AuthenticationStatus) Reset() { + *x = AuthenticationStatus{} + mi := &file_authentication_v1_authentication_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AuthenticationStatus) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AuthenticationStatus) ProtoMessage() {} + +func (x *AuthenticationStatus) ProtoReflect() protoreflect.Message { + mi := &file_authentication_v1_authentication_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *AuthenticationStatus) GetUser() *User { + if x != nil { + return x.xxx_hidden_User + } + return nil +} + +func (x *AuthenticationStatus) GetOrganization() *Organization { + if x != nil { + return x.xxx_hidden_Organization + } + return nil +} + +func (x *AuthenticationStatus) GetApiKey() *APIKey { + if x != nil { + return x.xxx_hidden_ApiKey + } + return nil +} + +func (x *AuthenticationStatus) SetUser(v *User) { + x.xxx_hidden_User = v +} + +func (x *AuthenticationStatus) SetOrganization(v *Organization) { + x.xxx_hidden_Organization = v +} + +func (x *AuthenticationStatus) SetApiKey(v *APIKey) { + x.xxx_hidden_ApiKey = v +} + +func (x *AuthenticationStatus) HasUser() bool { + if x == nil { + return false + } + return x.xxx_hidden_User != nil +} + +func (x *AuthenticationStatus) HasOrganization() bool { + if x == nil { + return false + } + return x.xxx_hidden_Organization != nil +} + +func (x *AuthenticationStatus) HasApiKey() bool { + if x == nil { + return false + } + return x.xxx_hidden_ApiKey != nil +} + +func (x *AuthenticationStatus) ClearUser() { + x.xxx_hidden_User = nil +} + +func (x *AuthenticationStatus) ClearOrganization() { + x.xxx_hidden_Organization = nil +} + +func (x *AuthenticationStatus) ClearApiKey() { + x.xxx_hidden_ApiKey = nil +} + +type AuthenticationStatus_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // The authenticated user. + User *User + // The organization the request acts within. + Organization *Organization + // The API key used to authenticate the request. Unset for JWT or session authentication. + ApiKey *APIKey +} + +func (b0 AuthenticationStatus_builder) Build() *AuthenticationStatus { + m0 := &AuthenticationStatus{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_User = b.User + x.xxx_hidden_Organization = b.Organization + x.xxx_hidden_ApiKey = b.ApiKey + return m0 +} + +var File_authentication_v1_authentication_proto protoreflect.FileDescriptor + +const file_authentication_v1_authentication_proto_rawDesc = "" + + "\n" + + "&authentication/v1/authentication.proto\x12\x11authentication.v1\x1a\x1bbuf/validate/validate.proto\x1a\x13tilebox/v1/id.proto\"X\n" + + "\x04User\x12&\n" + + "\x02id\x18\x01 \x01(\v2\x0e.tilebox.v1.IDB\x06\xbaH\x03\xc8\x01\x01R\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x14\n" + + "\x05email\x18\x03 \x01(\tR\x05email\"^\n" + + "\fOrganization\x12&\n" + + "\x02id\x18\x01 \x01(\v2\x0e.tilebox.v1.IDB\x06\xbaH\x03\xc8\x01\x01R\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x12\n" + + "\x04slug\x18\x03 \x01(\tR\x04slug\"r\n" + + "\x06APIKey\x12&\n" + + "\x02id\x18\x01 \x01(\v2\x0e.tilebox.v1.IDB\x06\xbaH\x03\xc8\x01\x01R\x02id\x12\x1e\n" + + "\n" + + "identifier\x18\x02 \x01(\tR\n" + + "identifier\x12 \n" + + "\vdescription\x18\x03 \x01(\tR\vdescription\" \n" + + "\x1eGetAuthenticationStatusRequest\"\xcc\x01\n" + + "\x14AuthenticationStatus\x123\n" + + "\x04user\x18\x01 \x01(\v2\x17.authentication.v1.UserB\x06\xbaH\x03\xc8\x01\x01R\x04user\x12K\n" + + "\forganization\x18\x02 \x01(\v2\x1f.authentication.v1.OrganizationB\x06\xbaH\x03\xc8\x01\x01R\forganization\x122\n" + + "\aapi_key\x18\x03 \x01(\v2\x19.authentication.v1.APIKeyR\x06apiKey2\x90\x01\n" + + "\x15AuthenticationService\x12w\n" + + "\x17GetAuthenticationStatus\x121.authentication.v1.GetAuthenticationStatusRequest\x1a'.authentication.v1.AuthenticationStatus\"\x00B\xe1\x01\n" + + "\x15com.authentication.v1B\x13AuthenticationProtoP\x01ZIgithub.com/tilebox/tilebox-go/protogen/authentication/v1;authenticationv1\xa2\x02\x03AXX\xaa\x02\x11Authentication.V1\xca\x02\x11Authentication\\V1\xe2\x02\x1dAuthentication\\V1\\GPBMetadata\xea\x02\x12Authentication::V1\x92\x03\x02\b\x02b\beditionsp\xe8\a" + +var file_authentication_v1_authentication_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_authentication_v1_authentication_proto_goTypes = []any{ + (*User)(nil), // 0: authentication.v1.User + (*Organization)(nil), // 1: authentication.v1.Organization + (*APIKey)(nil), // 2: authentication.v1.APIKey + (*GetAuthenticationStatusRequest)(nil), // 3: authentication.v1.GetAuthenticationStatusRequest + (*AuthenticationStatus)(nil), // 4: authentication.v1.AuthenticationStatus + (*v1.ID)(nil), // 5: tilebox.v1.ID +} +var file_authentication_v1_authentication_proto_depIdxs = []int32{ + 5, // 0: authentication.v1.User.id:type_name -> tilebox.v1.ID + 5, // 1: authentication.v1.Organization.id:type_name -> tilebox.v1.ID + 5, // 2: authentication.v1.APIKey.id:type_name -> tilebox.v1.ID + 0, // 3: authentication.v1.AuthenticationStatus.user:type_name -> authentication.v1.User + 1, // 4: authentication.v1.AuthenticationStatus.organization:type_name -> authentication.v1.Organization + 2, // 5: authentication.v1.AuthenticationStatus.api_key:type_name -> authentication.v1.APIKey + 3, // 6: authentication.v1.AuthenticationService.GetAuthenticationStatus:input_type -> authentication.v1.GetAuthenticationStatusRequest + 4, // 7: authentication.v1.AuthenticationService.GetAuthenticationStatus:output_type -> authentication.v1.AuthenticationStatus + 7, // [7:8] is the sub-list for method output_type + 6, // [6:7] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name +} + +func init() { file_authentication_v1_authentication_proto_init() } +func file_authentication_v1_authentication_proto_init() { + if File_authentication_v1_authentication_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_authentication_v1_authentication_proto_rawDesc), len(file_authentication_v1_authentication_proto_rawDesc)), + NumEnums: 0, + NumMessages: 5, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_authentication_v1_authentication_proto_goTypes, + DependencyIndexes: file_authentication_v1_authentication_proto_depIdxs, + MessageInfos: file_authentication_v1_authentication_proto_msgTypes, + }.Build() + File_authentication_v1_authentication_proto = out.File + file_authentication_v1_authentication_proto_goTypes = nil + file_authentication_v1_authentication_proto_depIdxs = nil +} diff --git a/protogen/authentication/v1/authentication_grpc.pb.go b/protogen/authentication/v1/authentication_grpc.pb.go new file mode 100644 index 0000000..ebd4e94 --- /dev/null +++ b/protogen/authentication/v1/authentication_grpc.pb.go @@ -0,0 +1,131 @@ +// Public API for resolving the identity associated with an authenticated request. + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.6.2 +// - protoc (unknown) +// source: authentication/v1/authentication.proto + +package authenticationv1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + AuthenticationService_GetAuthenticationStatus_FullMethodName = "/authentication.v1.AuthenticationService/GetAuthenticationStatus" +) + +// AuthenticationServiceClient is the client API for AuthenticationService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// AuthenticationService exposes information about the effective authentication of a request. +type AuthenticationServiceClient interface { + // GetAuthenticationStatus resolves the calling credential to its effective user and organization. + // Requests without valid authentication fail with UNAUTHENTICATED. + GetAuthenticationStatus(ctx context.Context, in *GetAuthenticationStatusRequest, opts ...grpc.CallOption) (*AuthenticationStatus, error) +} + +type authenticationServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewAuthenticationServiceClient(cc grpc.ClientConnInterface) AuthenticationServiceClient { + return &authenticationServiceClient{cc} +} + +func (c *authenticationServiceClient) GetAuthenticationStatus(ctx context.Context, in *GetAuthenticationStatusRequest, opts ...grpc.CallOption) (*AuthenticationStatus, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(AuthenticationStatus) + err := c.cc.Invoke(ctx, AuthenticationService_GetAuthenticationStatus_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// AuthenticationServiceServer is the server API for AuthenticationService service. +// All implementations must embed UnimplementedAuthenticationServiceServer +// for forward compatibility. +// +// AuthenticationService exposes information about the effective authentication of a request. +type AuthenticationServiceServer interface { + // GetAuthenticationStatus resolves the calling credential to its effective user and organization. + // Requests without valid authentication fail with UNAUTHENTICATED. + GetAuthenticationStatus(context.Context, *GetAuthenticationStatusRequest) (*AuthenticationStatus, error) + mustEmbedUnimplementedAuthenticationServiceServer() +} + +// UnimplementedAuthenticationServiceServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedAuthenticationServiceServer struct{} + +func (UnimplementedAuthenticationServiceServer) GetAuthenticationStatus(context.Context, *GetAuthenticationStatusRequest) (*AuthenticationStatus, error) { + return nil, status.Error(codes.Unimplemented, "method GetAuthenticationStatus not implemented") +} +func (UnimplementedAuthenticationServiceServer) mustEmbedUnimplementedAuthenticationServiceServer() {} +func (UnimplementedAuthenticationServiceServer) testEmbeddedByValue() {} + +// UnsafeAuthenticationServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to AuthenticationServiceServer will +// result in compilation errors. +type UnsafeAuthenticationServiceServer interface { + mustEmbedUnimplementedAuthenticationServiceServer() +} + +func RegisterAuthenticationServiceServer(s grpc.ServiceRegistrar, srv AuthenticationServiceServer) { + // If the following call panics, it indicates UnimplementedAuthenticationServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&AuthenticationService_ServiceDesc, srv) +} + +func _AuthenticationService_GetAuthenticationStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetAuthenticationStatusRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AuthenticationServiceServer).GetAuthenticationStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AuthenticationService_GetAuthenticationStatus_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AuthenticationServiceServer).GetAuthenticationStatus(ctx, req.(*GetAuthenticationStatusRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// AuthenticationService_ServiceDesc is the grpc.ServiceDesc for AuthenticationService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var AuthenticationService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "authentication.v1.AuthenticationService", + HandlerType: (*AuthenticationServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetAuthenticationStatus", + Handler: _AuthenticationService_GetAuthenticationStatus_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "authentication/v1/authentication.proto", +} diff --git a/protogen/authentication/v1/authenticationv1connect/authentication.connect.go b/protogen/authentication/v1/authenticationv1connect/authentication.connect.go new file mode 100644 index 0000000..934b560 --- /dev/null +++ b/protogen/authentication/v1/authenticationv1connect/authentication.connect.go @@ -0,0 +1,116 @@ +// Public API for resolving the identity associated with an authenticated request. + +// Code generated by protoc-gen-connect-go. DO NOT EDIT. +// +// Source: authentication/v1/authentication.proto + +package authenticationv1connect + +import ( + connect "connectrpc.com/connect" + context "context" + errors "errors" + v1 "github.com/tilebox/tilebox-go/protogen/authentication/v1" + http "net/http" + strings "strings" +) + +// This is a compile-time assertion to ensure that this generated file and the connect package are +// compatible. If you get a compiler error that this constant is not defined, this code was +// generated with a version of connect newer than the one compiled into your binary. You can fix the +// problem by either regenerating this code with an older version of connect or updating the connect +// version compiled into your binary. +const _ = connect.IsAtLeastVersion1_13_0 + +const ( + // AuthenticationServiceName is the fully-qualified name of the AuthenticationService service. + AuthenticationServiceName = "authentication.v1.AuthenticationService" +) + +// These constants are the fully-qualified names of the RPCs defined in this package. They're +// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route. +// +// Note that these are different from the fully-qualified method names used by +// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to +// reflection-formatted method names, remove the leading slash and convert the remaining slash to a +// period. +const ( + // AuthenticationServiceGetAuthenticationStatusProcedure is the fully-qualified name of the + // AuthenticationService's GetAuthenticationStatus RPC. + AuthenticationServiceGetAuthenticationStatusProcedure = "/authentication.v1.AuthenticationService/GetAuthenticationStatus" +) + +// AuthenticationServiceClient is a client for the authentication.v1.AuthenticationService service. +type AuthenticationServiceClient interface { + // GetAuthenticationStatus resolves the calling credential to its effective user and organization. + // Requests without valid authentication fail with UNAUTHENTICATED. + GetAuthenticationStatus(context.Context, *connect.Request[v1.GetAuthenticationStatusRequest]) (*connect.Response[v1.AuthenticationStatus], error) +} + +// NewAuthenticationServiceClient constructs a client for the +// authentication.v1.AuthenticationService service. By default, it uses the Connect protocol with +// the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use +// the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options. +// +// The URL supplied here should be the base URL for the Connect or gRPC server (for example, +// http://api.acme.com or https://acme.com/grpc). +func NewAuthenticationServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) AuthenticationServiceClient { + baseURL = strings.TrimRight(baseURL, "/") + authenticationServiceMethods := v1.File_authentication_v1_authentication_proto.Services().ByName("AuthenticationService").Methods() + return &authenticationServiceClient{ + getAuthenticationStatus: connect.NewClient[v1.GetAuthenticationStatusRequest, v1.AuthenticationStatus]( + httpClient, + baseURL+AuthenticationServiceGetAuthenticationStatusProcedure, + connect.WithSchema(authenticationServiceMethods.ByName("GetAuthenticationStatus")), + connect.WithClientOptions(opts...), + ), + } +} + +// authenticationServiceClient implements AuthenticationServiceClient. +type authenticationServiceClient struct { + getAuthenticationStatus *connect.Client[v1.GetAuthenticationStatusRequest, v1.AuthenticationStatus] +} + +// GetAuthenticationStatus calls authentication.v1.AuthenticationService.GetAuthenticationStatus. +func (c *authenticationServiceClient) GetAuthenticationStatus(ctx context.Context, req *connect.Request[v1.GetAuthenticationStatusRequest]) (*connect.Response[v1.AuthenticationStatus], error) { + return c.getAuthenticationStatus.CallUnary(ctx, req) +} + +// AuthenticationServiceHandler is an implementation of the authentication.v1.AuthenticationService +// service. +type AuthenticationServiceHandler interface { + // GetAuthenticationStatus resolves the calling credential to its effective user and organization. + // Requests without valid authentication fail with UNAUTHENTICATED. + GetAuthenticationStatus(context.Context, *connect.Request[v1.GetAuthenticationStatusRequest]) (*connect.Response[v1.AuthenticationStatus], error) +} + +// NewAuthenticationServiceHandler builds an HTTP handler from the service implementation. It +// returns the path on which to mount the handler and the handler itself. +// +// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf +// and JSON codecs. They also support gzip compression. +func NewAuthenticationServiceHandler(svc AuthenticationServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { + authenticationServiceMethods := v1.File_authentication_v1_authentication_proto.Services().ByName("AuthenticationService").Methods() + authenticationServiceGetAuthenticationStatusHandler := connect.NewUnaryHandler( + AuthenticationServiceGetAuthenticationStatusProcedure, + svc.GetAuthenticationStatus, + connect.WithSchema(authenticationServiceMethods.ByName("GetAuthenticationStatus")), + connect.WithHandlerOptions(opts...), + ) + return "/authentication.v1.AuthenticationService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + switch r.URL.Path { + case AuthenticationServiceGetAuthenticationStatusProcedure: + authenticationServiceGetAuthenticationStatusHandler.ServeHTTP(w, r) + default: + http.NotFound(w, r) + } + }) +} + +// UnimplementedAuthenticationServiceHandler returns CodeUnimplemented from all methods. +type UnimplementedAuthenticationServiceHandler struct{} + +func (UnimplementedAuthenticationServiceHandler) GetAuthenticationStatus(context.Context, *connect.Request[v1.GetAuthenticationStatusRequest]) (*connect.Response[v1.AuthenticationStatus], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("authentication.v1.AuthenticationService.GetAuthenticationStatus is not implemented")) +} From f752e80985bf1a1e27aa0fface01cd2699470c9d Mon Sep 17 00:00:00 2001 From: Amp Date: Sat, 18 Jul 2026 09:50:47 +0000 Subject: [PATCH 2/3] Regenerate authentication API under v1beta1 Co-authored-by: Stefan Amberger --- .../{v1 => v1beta1}/authentication.pb.go | 100 +++++++++--------- .../{v1 => v1beta1}/authentication_grpc.pb.go | 10 +- .../authentication.connect.go | 47 ++++---- 3 files changed, 80 insertions(+), 77 deletions(-) rename protogen/authentication/{v1 => v1beta1}/authentication.pb.go (76%) rename protogen/authentication/{v1 => v1beta1}/authentication_grpc.pb.go (95%) rename protogen/authentication/{v1/authenticationv1connect => v1beta1/authenticationv1beta1connect}/authentication.connect.go (65%) diff --git a/protogen/authentication/v1/authentication.pb.go b/protogen/authentication/v1beta1/authentication.pb.go similarity index 76% rename from protogen/authentication/v1/authentication.pb.go rename to protogen/authentication/v1beta1/authentication.pb.go index 5b24296..fd95280 100644 --- a/protogen/authentication/v1/authentication.pb.go +++ b/protogen/authentication/v1beta1/authentication.pb.go @@ -4,9 +4,9 @@ // versions: // protoc-gen-go v1.36.11 // protoc (unknown) -// source: authentication/v1/authentication.proto +// source: authentication/v1beta1/authentication.proto -package authenticationv1 +package authenticationv1beta1 import ( _ "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate" @@ -36,7 +36,7 @@ type User struct { func (x *User) Reset() { *x = User{} - mi := &file_authentication_v1_authentication_proto_msgTypes[0] + mi := &file_authentication_v1beta1_authentication_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -48,7 +48,7 @@ func (x *User) String() string { func (*User) ProtoMessage() {} func (x *User) ProtoReflect() protoreflect.Message { - mi := &file_authentication_v1_authentication_proto_msgTypes[0] + mi := &file_authentication_v1beta1_authentication_proto_msgTypes[0] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -136,7 +136,7 @@ type Organization struct { func (x *Organization) Reset() { *x = Organization{} - mi := &file_authentication_v1_authentication_proto_msgTypes[1] + mi := &file_authentication_v1beta1_authentication_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -148,7 +148,7 @@ func (x *Organization) String() string { func (*Organization) ProtoMessage() {} func (x *Organization) ProtoReflect() protoreflect.Message { - mi := &file_authentication_v1_authentication_proto_msgTypes[1] + mi := &file_authentication_v1beta1_authentication_proto_msgTypes[1] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -236,7 +236,7 @@ type APIKey struct { func (x *APIKey) Reset() { *x = APIKey{} - mi := &file_authentication_v1_authentication_proto_msgTypes[2] + mi := &file_authentication_v1beta1_authentication_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -248,7 +248,7 @@ func (x *APIKey) String() string { func (*APIKey) ProtoMessage() {} func (x *APIKey) ProtoReflect() protoreflect.Message { - mi := &file_authentication_v1_authentication_proto_msgTypes[2] + mi := &file_authentication_v1beta1_authentication_proto_msgTypes[2] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -333,7 +333,7 @@ type GetAuthenticationStatusRequest struct { func (x *GetAuthenticationStatusRequest) Reset() { *x = GetAuthenticationStatusRequest{} - mi := &file_authentication_v1_authentication_proto_msgTypes[3] + mi := &file_authentication_v1beta1_authentication_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -345,7 +345,7 @@ func (x *GetAuthenticationStatusRequest) String() string { func (*GetAuthenticationStatusRequest) ProtoMessage() {} func (x *GetAuthenticationStatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_authentication_v1_authentication_proto_msgTypes[3] + mi := &file_authentication_v1beta1_authentication_proto_msgTypes[3] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -380,7 +380,7 @@ type AuthenticationStatus struct { func (x *AuthenticationStatus) Reset() { *x = AuthenticationStatus{} - mi := &file_authentication_v1_authentication_proto_msgTypes[4] + mi := &file_authentication_v1beta1_authentication_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -392,7 +392,7 @@ func (x *AuthenticationStatus) String() string { func (*AuthenticationStatus) ProtoMessage() {} func (x *AuthenticationStatus) ProtoReflect() protoreflect.Message { - mi := &file_authentication_v1_authentication_proto_msgTypes[4] + mi := &file_authentication_v1beta1_authentication_proto_msgTypes[4] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -490,11 +490,11 @@ func (b0 AuthenticationStatus_builder) Build() *AuthenticationStatus { return m0 } -var File_authentication_v1_authentication_proto protoreflect.FileDescriptor +var File_authentication_v1beta1_authentication_proto protoreflect.FileDescriptor -const file_authentication_v1_authentication_proto_rawDesc = "" + +const file_authentication_v1beta1_authentication_proto_rawDesc = "" + "\n" + - "&authentication/v1/authentication.proto\x12\x11authentication.v1\x1a\x1bbuf/validate/validate.proto\x1a\x13tilebox/v1/id.proto\"X\n" + + "+authentication/v1beta1/authentication.proto\x12\x16authentication.v1beta1\x1a\x1bbuf/validate/validate.proto\x1a\x13tilebox/v1/id.proto\"X\n" + "\x04User\x12&\n" + "\x02id\x18\x01 \x01(\v2\x0e.tilebox.v1.IDB\x06\xbaH\x03\xc8\x01\x01R\x02id\x12\x12\n" + "\x04name\x18\x02 \x01(\tR\x04name\x12\x14\n" + @@ -509,33 +509,33 @@ const file_authentication_v1_authentication_proto_rawDesc = "" + "identifier\x18\x02 \x01(\tR\n" + "identifier\x12 \n" + "\vdescription\x18\x03 \x01(\tR\vdescription\" \n" + - "\x1eGetAuthenticationStatusRequest\"\xcc\x01\n" + - "\x14AuthenticationStatus\x123\n" + - "\x04user\x18\x01 \x01(\v2\x17.authentication.v1.UserB\x06\xbaH\x03\xc8\x01\x01R\x04user\x12K\n" + - "\forganization\x18\x02 \x01(\v2\x1f.authentication.v1.OrganizationB\x06\xbaH\x03\xc8\x01\x01R\forganization\x122\n" + - "\aapi_key\x18\x03 \x01(\v2\x19.authentication.v1.APIKeyR\x06apiKey2\x90\x01\n" + - "\x15AuthenticationService\x12w\n" + - "\x17GetAuthenticationStatus\x121.authentication.v1.GetAuthenticationStatusRequest\x1a'.authentication.v1.AuthenticationStatus\"\x00B\xe1\x01\n" + - "\x15com.authentication.v1B\x13AuthenticationProtoP\x01ZIgithub.com/tilebox/tilebox-go/protogen/authentication/v1;authenticationv1\xa2\x02\x03AXX\xaa\x02\x11Authentication.V1\xca\x02\x11Authentication\\V1\xe2\x02\x1dAuthentication\\V1\\GPBMetadata\xea\x02\x12Authentication::V1\x92\x03\x02\b\x02b\beditionsp\xe8\a" - -var file_authentication_v1_authentication_proto_msgTypes = make([]protoimpl.MessageInfo, 5) -var file_authentication_v1_authentication_proto_goTypes = []any{ - (*User)(nil), // 0: authentication.v1.User - (*Organization)(nil), // 1: authentication.v1.Organization - (*APIKey)(nil), // 2: authentication.v1.APIKey - (*GetAuthenticationStatusRequest)(nil), // 3: authentication.v1.GetAuthenticationStatusRequest - (*AuthenticationStatus)(nil), // 4: authentication.v1.AuthenticationStatus + "\x1eGetAuthenticationStatusRequest\"\xdb\x01\n" + + "\x14AuthenticationStatus\x128\n" + + "\x04user\x18\x01 \x01(\v2\x1c.authentication.v1beta1.UserB\x06\xbaH\x03\xc8\x01\x01R\x04user\x12P\n" + + "\forganization\x18\x02 \x01(\v2$.authentication.v1beta1.OrganizationB\x06\xbaH\x03\xc8\x01\x01R\forganization\x127\n" + + "\aapi_key\x18\x03 \x01(\v2\x1e.authentication.v1beta1.APIKeyR\x06apiKey2\x9b\x01\n" + + "\x15AuthenticationService\x12\x81\x01\n" + + "\x17GetAuthenticationStatus\x126.authentication.v1beta1.GetAuthenticationStatusRequest\x1a,.authentication.v1beta1.AuthenticationStatus\"\x00B\x84\x02\n" + + "\x1acom.authentication.v1beta1B\x13AuthenticationProtoP\x01ZSgithub.com/tilebox/tilebox-go/protogen/authentication/v1beta1;authenticationv1beta1\xa2\x02\x03AXX\xaa\x02\x16Authentication.V1beta1\xca\x02\x16Authentication\\V1beta1\xe2\x02\"Authentication\\V1beta1\\GPBMetadata\xea\x02\x17Authentication::V1beta1\x92\x03\x02\b\x02b\beditionsp\xe8\a" + +var file_authentication_v1beta1_authentication_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_authentication_v1beta1_authentication_proto_goTypes = []any{ + (*User)(nil), // 0: authentication.v1beta1.User + (*Organization)(nil), // 1: authentication.v1beta1.Organization + (*APIKey)(nil), // 2: authentication.v1beta1.APIKey + (*GetAuthenticationStatusRequest)(nil), // 3: authentication.v1beta1.GetAuthenticationStatusRequest + (*AuthenticationStatus)(nil), // 4: authentication.v1beta1.AuthenticationStatus (*v1.ID)(nil), // 5: tilebox.v1.ID } -var file_authentication_v1_authentication_proto_depIdxs = []int32{ - 5, // 0: authentication.v1.User.id:type_name -> tilebox.v1.ID - 5, // 1: authentication.v1.Organization.id:type_name -> tilebox.v1.ID - 5, // 2: authentication.v1.APIKey.id:type_name -> tilebox.v1.ID - 0, // 3: authentication.v1.AuthenticationStatus.user:type_name -> authentication.v1.User - 1, // 4: authentication.v1.AuthenticationStatus.organization:type_name -> authentication.v1.Organization - 2, // 5: authentication.v1.AuthenticationStatus.api_key:type_name -> authentication.v1.APIKey - 3, // 6: authentication.v1.AuthenticationService.GetAuthenticationStatus:input_type -> authentication.v1.GetAuthenticationStatusRequest - 4, // 7: authentication.v1.AuthenticationService.GetAuthenticationStatus:output_type -> authentication.v1.AuthenticationStatus +var file_authentication_v1beta1_authentication_proto_depIdxs = []int32{ + 5, // 0: authentication.v1beta1.User.id:type_name -> tilebox.v1.ID + 5, // 1: authentication.v1beta1.Organization.id:type_name -> tilebox.v1.ID + 5, // 2: authentication.v1beta1.APIKey.id:type_name -> tilebox.v1.ID + 0, // 3: authentication.v1beta1.AuthenticationStatus.user:type_name -> authentication.v1beta1.User + 1, // 4: authentication.v1beta1.AuthenticationStatus.organization:type_name -> authentication.v1beta1.Organization + 2, // 5: authentication.v1beta1.AuthenticationStatus.api_key:type_name -> authentication.v1beta1.APIKey + 3, // 6: authentication.v1beta1.AuthenticationService.GetAuthenticationStatus:input_type -> authentication.v1beta1.GetAuthenticationStatusRequest + 4, // 7: authentication.v1beta1.AuthenticationService.GetAuthenticationStatus:output_type -> authentication.v1beta1.AuthenticationStatus 7, // [7:8] is the sub-list for method output_type 6, // [6:7] is the sub-list for method input_type 6, // [6:6] is the sub-list for extension type_name @@ -543,26 +543,26 @@ var file_authentication_v1_authentication_proto_depIdxs = []int32{ 0, // [0:6] is the sub-list for field type_name } -func init() { file_authentication_v1_authentication_proto_init() } -func file_authentication_v1_authentication_proto_init() { - if File_authentication_v1_authentication_proto != nil { +func init() { file_authentication_v1beta1_authentication_proto_init() } +func file_authentication_v1beta1_authentication_proto_init() { + if File_authentication_v1beta1_authentication_proto != nil { return } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_authentication_v1_authentication_proto_rawDesc), len(file_authentication_v1_authentication_proto_rawDesc)), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_authentication_v1beta1_authentication_proto_rawDesc), len(file_authentication_v1beta1_authentication_proto_rawDesc)), NumEnums: 0, NumMessages: 5, NumExtensions: 0, NumServices: 1, }, - GoTypes: file_authentication_v1_authentication_proto_goTypes, - DependencyIndexes: file_authentication_v1_authentication_proto_depIdxs, - MessageInfos: file_authentication_v1_authentication_proto_msgTypes, + GoTypes: file_authentication_v1beta1_authentication_proto_goTypes, + DependencyIndexes: file_authentication_v1beta1_authentication_proto_depIdxs, + MessageInfos: file_authentication_v1beta1_authentication_proto_msgTypes, }.Build() - File_authentication_v1_authentication_proto = out.File - file_authentication_v1_authentication_proto_goTypes = nil - file_authentication_v1_authentication_proto_depIdxs = nil + File_authentication_v1beta1_authentication_proto = out.File + file_authentication_v1beta1_authentication_proto_goTypes = nil + file_authentication_v1beta1_authentication_proto_depIdxs = nil } diff --git a/protogen/authentication/v1/authentication_grpc.pb.go b/protogen/authentication/v1beta1/authentication_grpc.pb.go similarity index 95% rename from protogen/authentication/v1/authentication_grpc.pb.go rename to protogen/authentication/v1beta1/authentication_grpc.pb.go index ebd4e94..c8192de 100644 --- a/protogen/authentication/v1/authentication_grpc.pb.go +++ b/protogen/authentication/v1beta1/authentication_grpc.pb.go @@ -4,9 +4,9 @@ // versions: // - protoc-gen-go-grpc v1.6.2 // - protoc (unknown) -// source: authentication/v1/authentication.proto +// source: authentication/v1beta1/authentication.proto -package authenticationv1 +package authenticationv1beta1 import ( context "context" @@ -21,7 +21,7 @@ import ( const _ = grpc.SupportPackageIsVersion9 const ( - AuthenticationService_GetAuthenticationStatus_FullMethodName = "/authentication.v1.AuthenticationService/GetAuthenticationStatus" + AuthenticationService_GetAuthenticationStatus_FullMethodName = "/authentication.v1beta1.AuthenticationService/GetAuthenticationStatus" ) // AuthenticationServiceClient is the client API for AuthenticationService service. @@ -118,7 +118,7 @@ func _AuthenticationService_GetAuthenticationStatus_Handler(srv interface{}, ctx // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var AuthenticationService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "authentication.v1.AuthenticationService", + ServiceName: "authentication.v1beta1.AuthenticationService", HandlerType: (*AuthenticationServiceServer)(nil), Methods: []grpc.MethodDesc{ { @@ -127,5 +127,5 @@ var AuthenticationService_ServiceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "authentication/v1/authentication.proto", + Metadata: "authentication/v1beta1/authentication.proto", } diff --git a/protogen/authentication/v1/authenticationv1connect/authentication.connect.go b/protogen/authentication/v1beta1/authenticationv1beta1connect/authentication.connect.go similarity index 65% rename from protogen/authentication/v1/authenticationv1connect/authentication.connect.go rename to protogen/authentication/v1beta1/authenticationv1beta1connect/authentication.connect.go index 934b560..eaa3311 100644 --- a/protogen/authentication/v1/authenticationv1connect/authentication.connect.go +++ b/protogen/authentication/v1beta1/authenticationv1beta1connect/authentication.connect.go @@ -2,15 +2,15 @@ // Code generated by protoc-gen-connect-go. DO NOT EDIT. // -// Source: authentication/v1/authentication.proto +// Source: authentication/v1beta1/authentication.proto -package authenticationv1connect +package authenticationv1beta1connect import ( connect "connectrpc.com/connect" context "context" errors "errors" - v1 "github.com/tilebox/tilebox-go/protogen/authentication/v1" + v1beta1 "github.com/tilebox/tilebox-go/protogen/authentication/v1beta1" http "net/http" strings "strings" ) @@ -24,7 +24,7 @@ const _ = connect.IsAtLeastVersion1_13_0 const ( // AuthenticationServiceName is the fully-qualified name of the AuthenticationService service. - AuthenticationServiceName = "authentication.v1.AuthenticationService" + AuthenticationServiceName = "authentication.v1beta1.AuthenticationService" ) // These constants are the fully-qualified names of the RPCs defined in this package. They're @@ -37,28 +37,30 @@ const ( const ( // AuthenticationServiceGetAuthenticationStatusProcedure is the fully-qualified name of the // AuthenticationService's GetAuthenticationStatus RPC. - AuthenticationServiceGetAuthenticationStatusProcedure = "/authentication.v1.AuthenticationService/GetAuthenticationStatus" + AuthenticationServiceGetAuthenticationStatusProcedure = "/authentication.v1beta1.AuthenticationService/GetAuthenticationStatus" ) -// AuthenticationServiceClient is a client for the authentication.v1.AuthenticationService service. +// AuthenticationServiceClient is a client for the authentication.v1beta1.AuthenticationService +// service. type AuthenticationServiceClient interface { // GetAuthenticationStatus resolves the calling credential to its effective user and organization. // Requests without valid authentication fail with UNAUTHENTICATED. - GetAuthenticationStatus(context.Context, *connect.Request[v1.GetAuthenticationStatusRequest]) (*connect.Response[v1.AuthenticationStatus], error) + GetAuthenticationStatus(context.Context, *connect.Request[v1beta1.GetAuthenticationStatusRequest]) (*connect.Response[v1beta1.AuthenticationStatus], error) } // NewAuthenticationServiceClient constructs a client for the -// authentication.v1.AuthenticationService service. By default, it uses the Connect protocol with -// the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use -// the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options. +// authentication.v1beta1.AuthenticationService service. By default, it uses the Connect protocol +// with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To +// use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() +// options. // // The URL supplied here should be the base URL for the Connect or gRPC server (for example, // http://api.acme.com or https://acme.com/grpc). func NewAuthenticationServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) AuthenticationServiceClient { baseURL = strings.TrimRight(baseURL, "/") - authenticationServiceMethods := v1.File_authentication_v1_authentication_proto.Services().ByName("AuthenticationService").Methods() + authenticationServiceMethods := v1beta1.File_authentication_v1beta1_authentication_proto.Services().ByName("AuthenticationService").Methods() return &authenticationServiceClient{ - getAuthenticationStatus: connect.NewClient[v1.GetAuthenticationStatusRequest, v1.AuthenticationStatus]( + getAuthenticationStatus: connect.NewClient[v1beta1.GetAuthenticationStatusRequest, v1beta1.AuthenticationStatus]( httpClient, baseURL+AuthenticationServiceGetAuthenticationStatusProcedure, connect.WithSchema(authenticationServiceMethods.ByName("GetAuthenticationStatus")), @@ -69,20 +71,21 @@ func NewAuthenticationServiceClient(httpClient connect.HTTPClient, baseURL strin // authenticationServiceClient implements AuthenticationServiceClient. type authenticationServiceClient struct { - getAuthenticationStatus *connect.Client[v1.GetAuthenticationStatusRequest, v1.AuthenticationStatus] + getAuthenticationStatus *connect.Client[v1beta1.GetAuthenticationStatusRequest, v1beta1.AuthenticationStatus] } -// GetAuthenticationStatus calls authentication.v1.AuthenticationService.GetAuthenticationStatus. -func (c *authenticationServiceClient) GetAuthenticationStatus(ctx context.Context, req *connect.Request[v1.GetAuthenticationStatusRequest]) (*connect.Response[v1.AuthenticationStatus], error) { +// GetAuthenticationStatus calls +// authentication.v1beta1.AuthenticationService.GetAuthenticationStatus. +func (c *authenticationServiceClient) GetAuthenticationStatus(ctx context.Context, req *connect.Request[v1beta1.GetAuthenticationStatusRequest]) (*connect.Response[v1beta1.AuthenticationStatus], error) { return c.getAuthenticationStatus.CallUnary(ctx, req) } -// AuthenticationServiceHandler is an implementation of the authentication.v1.AuthenticationService -// service. +// AuthenticationServiceHandler is an implementation of the +// authentication.v1beta1.AuthenticationService service. type AuthenticationServiceHandler interface { // GetAuthenticationStatus resolves the calling credential to its effective user and organization. // Requests without valid authentication fail with UNAUTHENTICATED. - GetAuthenticationStatus(context.Context, *connect.Request[v1.GetAuthenticationStatusRequest]) (*connect.Response[v1.AuthenticationStatus], error) + GetAuthenticationStatus(context.Context, *connect.Request[v1beta1.GetAuthenticationStatusRequest]) (*connect.Response[v1beta1.AuthenticationStatus], error) } // NewAuthenticationServiceHandler builds an HTTP handler from the service implementation. It @@ -91,14 +94,14 @@ type AuthenticationServiceHandler interface { // By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf // and JSON codecs. They also support gzip compression. func NewAuthenticationServiceHandler(svc AuthenticationServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { - authenticationServiceMethods := v1.File_authentication_v1_authentication_proto.Services().ByName("AuthenticationService").Methods() + authenticationServiceMethods := v1beta1.File_authentication_v1beta1_authentication_proto.Services().ByName("AuthenticationService").Methods() authenticationServiceGetAuthenticationStatusHandler := connect.NewUnaryHandler( AuthenticationServiceGetAuthenticationStatusProcedure, svc.GetAuthenticationStatus, connect.WithSchema(authenticationServiceMethods.ByName("GetAuthenticationStatus")), connect.WithHandlerOptions(opts...), ) - return "/authentication.v1.AuthenticationService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + return "/authentication.v1beta1.AuthenticationService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { switch r.URL.Path { case AuthenticationServiceGetAuthenticationStatusProcedure: authenticationServiceGetAuthenticationStatusHandler.ServeHTTP(w, r) @@ -111,6 +114,6 @@ func NewAuthenticationServiceHandler(svc AuthenticationServiceHandler, opts ...c // UnimplementedAuthenticationServiceHandler returns CodeUnimplemented from all methods. type UnimplementedAuthenticationServiceHandler struct{} -func (UnimplementedAuthenticationServiceHandler) GetAuthenticationStatus(context.Context, *connect.Request[v1.GetAuthenticationStatusRequest]) (*connect.Response[v1.AuthenticationStatus], error) { - return nil, connect.NewError(connect.CodeUnimplemented, errors.New("authentication.v1.AuthenticationService.GetAuthenticationStatus is not implemented")) +func (UnimplementedAuthenticationServiceHandler) GetAuthenticationStatus(context.Context, *connect.Request[v1beta1.GetAuthenticationStatusRequest]) (*connect.Response[v1beta1.AuthenticationStatus], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("authentication.v1beta1.AuthenticationService.GetAuthenticationStatus is not implemented")) } From 23118ab0f354b166b3c26a0c7d5424de51c112c5 Mon Sep 17 00:00:00 2001 From: Amp Date: Sat, 18 Jul 2026 10:06:22 +0000 Subject: [PATCH 3/3] Regenerate authentication API under v1alpha1 Co-authored-by: Stefan Amberger --- .../authentication.pb.go | 100 +++++++++--------- .../authentication_grpc.pb.go | 10 +- .../authentication.connect.go | 38 +++---- 3 files changed, 74 insertions(+), 74 deletions(-) rename protogen/authentication/{v1beta1 => v1alpha1}/authentication.pb.go (76%) rename protogen/authentication/{v1beta1 => v1alpha1}/authentication_grpc.pb.go (95%) rename protogen/authentication/{v1beta1/authenticationv1beta1connect => v1alpha1/authenticationv1alpha1connect}/authentication.connect.go (69%) diff --git a/protogen/authentication/v1beta1/authentication.pb.go b/protogen/authentication/v1alpha1/authentication.pb.go similarity index 76% rename from protogen/authentication/v1beta1/authentication.pb.go rename to protogen/authentication/v1alpha1/authentication.pb.go index fd95280..a87c1e0 100644 --- a/protogen/authentication/v1beta1/authentication.pb.go +++ b/protogen/authentication/v1alpha1/authentication.pb.go @@ -4,9 +4,9 @@ // versions: // protoc-gen-go v1.36.11 // protoc (unknown) -// source: authentication/v1beta1/authentication.proto +// source: authentication/v1alpha1/authentication.proto -package authenticationv1beta1 +package authenticationv1alpha1 import ( _ "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate" @@ -36,7 +36,7 @@ type User struct { func (x *User) Reset() { *x = User{} - mi := &file_authentication_v1beta1_authentication_proto_msgTypes[0] + mi := &file_authentication_v1alpha1_authentication_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -48,7 +48,7 @@ func (x *User) String() string { func (*User) ProtoMessage() {} func (x *User) ProtoReflect() protoreflect.Message { - mi := &file_authentication_v1beta1_authentication_proto_msgTypes[0] + mi := &file_authentication_v1alpha1_authentication_proto_msgTypes[0] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -136,7 +136,7 @@ type Organization struct { func (x *Organization) Reset() { *x = Organization{} - mi := &file_authentication_v1beta1_authentication_proto_msgTypes[1] + mi := &file_authentication_v1alpha1_authentication_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -148,7 +148,7 @@ func (x *Organization) String() string { func (*Organization) ProtoMessage() {} func (x *Organization) ProtoReflect() protoreflect.Message { - mi := &file_authentication_v1beta1_authentication_proto_msgTypes[1] + mi := &file_authentication_v1alpha1_authentication_proto_msgTypes[1] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -236,7 +236,7 @@ type APIKey struct { func (x *APIKey) Reset() { *x = APIKey{} - mi := &file_authentication_v1beta1_authentication_proto_msgTypes[2] + mi := &file_authentication_v1alpha1_authentication_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -248,7 +248,7 @@ func (x *APIKey) String() string { func (*APIKey) ProtoMessage() {} func (x *APIKey) ProtoReflect() protoreflect.Message { - mi := &file_authentication_v1beta1_authentication_proto_msgTypes[2] + mi := &file_authentication_v1alpha1_authentication_proto_msgTypes[2] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -333,7 +333,7 @@ type GetAuthenticationStatusRequest struct { func (x *GetAuthenticationStatusRequest) Reset() { *x = GetAuthenticationStatusRequest{} - mi := &file_authentication_v1beta1_authentication_proto_msgTypes[3] + mi := &file_authentication_v1alpha1_authentication_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -345,7 +345,7 @@ func (x *GetAuthenticationStatusRequest) String() string { func (*GetAuthenticationStatusRequest) ProtoMessage() {} func (x *GetAuthenticationStatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_authentication_v1beta1_authentication_proto_msgTypes[3] + mi := &file_authentication_v1alpha1_authentication_proto_msgTypes[3] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -380,7 +380,7 @@ type AuthenticationStatus struct { func (x *AuthenticationStatus) Reset() { *x = AuthenticationStatus{} - mi := &file_authentication_v1beta1_authentication_proto_msgTypes[4] + mi := &file_authentication_v1alpha1_authentication_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -392,7 +392,7 @@ func (x *AuthenticationStatus) String() string { func (*AuthenticationStatus) ProtoMessage() {} func (x *AuthenticationStatus) ProtoReflect() protoreflect.Message { - mi := &file_authentication_v1beta1_authentication_proto_msgTypes[4] + mi := &file_authentication_v1alpha1_authentication_proto_msgTypes[4] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -490,11 +490,11 @@ func (b0 AuthenticationStatus_builder) Build() *AuthenticationStatus { return m0 } -var File_authentication_v1beta1_authentication_proto protoreflect.FileDescriptor +var File_authentication_v1alpha1_authentication_proto protoreflect.FileDescriptor -const file_authentication_v1beta1_authentication_proto_rawDesc = "" + +const file_authentication_v1alpha1_authentication_proto_rawDesc = "" + "\n" + - "+authentication/v1beta1/authentication.proto\x12\x16authentication.v1beta1\x1a\x1bbuf/validate/validate.proto\x1a\x13tilebox/v1/id.proto\"X\n" + + ",authentication/v1alpha1/authentication.proto\x12\x17authentication.v1alpha1\x1a\x1bbuf/validate/validate.proto\x1a\x13tilebox/v1/id.proto\"X\n" + "\x04User\x12&\n" + "\x02id\x18\x01 \x01(\v2\x0e.tilebox.v1.IDB\x06\xbaH\x03\xc8\x01\x01R\x02id\x12\x12\n" + "\x04name\x18\x02 \x01(\tR\x04name\x12\x14\n" + @@ -509,33 +509,33 @@ const file_authentication_v1beta1_authentication_proto_rawDesc = "" + "identifier\x18\x02 \x01(\tR\n" + "identifier\x12 \n" + "\vdescription\x18\x03 \x01(\tR\vdescription\" \n" + - "\x1eGetAuthenticationStatusRequest\"\xdb\x01\n" + - "\x14AuthenticationStatus\x128\n" + - "\x04user\x18\x01 \x01(\v2\x1c.authentication.v1beta1.UserB\x06\xbaH\x03\xc8\x01\x01R\x04user\x12P\n" + - "\forganization\x18\x02 \x01(\v2$.authentication.v1beta1.OrganizationB\x06\xbaH\x03\xc8\x01\x01R\forganization\x127\n" + - "\aapi_key\x18\x03 \x01(\v2\x1e.authentication.v1beta1.APIKeyR\x06apiKey2\x9b\x01\n" + - "\x15AuthenticationService\x12\x81\x01\n" + - "\x17GetAuthenticationStatus\x126.authentication.v1beta1.GetAuthenticationStatusRequest\x1a,.authentication.v1beta1.AuthenticationStatus\"\x00B\x84\x02\n" + - "\x1acom.authentication.v1beta1B\x13AuthenticationProtoP\x01ZSgithub.com/tilebox/tilebox-go/protogen/authentication/v1beta1;authenticationv1beta1\xa2\x02\x03AXX\xaa\x02\x16Authentication.V1beta1\xca\x02\x16Authentication\\V1beta1\xe2\x02\"Authentication\\V1beta1\\GPBMetadata\xea\x02\x17Authentication::V1beta1\x92\x03\x02\b\x02b\beditionsp\xe8\a" - -var file_authentication_v1beta1_authentication_proto_msgTypes = make([]protoimpl.MessageInfo, 5) -var file_authentication_v1beta1_authentication_proto_goTypes = []any{ - (*User)(nil), // 0: authentication.v1beta1.User - (*Organization)(nil), // 1: authentication.v1beta1.Organization - (*APIKey)(nil), // 2: authentication.v1beta1.APIKey - (*GetAuthenticationStatusRequest)(nil), // 3: authentication.v1beta1.GetAuthenticationStatusRequest - (*AuthenticationStatus)(nil), // 4: authentication.v1beta1.AuthenticationStatus + "\x1eGetAuthenticationStatusRequest\"\xde\x01\n" + + "\x14AuthenticationStatus\x129\n" + + "\x04user\x18\x01 \x01(\v2\x1d.authentication.v1alpha1.UserB\x06\xbaH\x03\xc8\x01\x01R\x04user\x12Q\n" + + "\forganization\x18\x02 \x01(\v2%.authentication.v1alpha1.OrganizationB\x06\xbaH\x03\xc8\x01\x01R\forganization\x128\n" + + "\aapi_key\x18\x03 \x01(\v2\x1f.authentication.v1alpha1.APIKeyR\x06apiKey2\x9d\x01\n" + + "\x15AuthenticationService\x12\x83\x01\n" + + "\x17GetAuthenticationStatus\x127.authentication.v1alpha1.GetAuthenticationStatusRequest\x1a-.authentication.v1alpha1.AuthenticationStatus\"\x00B\x8b\x02\n" + + "\x1bcom.authentication.v1alpha1B\x13AuthenticationProtoP\x01ZUgithub.com/tilebox/tilebox-go/protogen/authentication/v1alpha1;authenticationv1alpha1\xa2\x02\x03AXX\xaa\x02\x17Authentication.V1alpha1\xca\x02\x17Authentication\\V1alpha1\xe2\x02#Authentication\\V1alpha1\\GPBMetadata\xea\x02\x18Authentication::V1alpha1\x92\x03\x02\b\x02b\beditionsp\xe8\a" + +var file_authentication_v1alpha1_authentication_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_authentication_v1alpha1_authentication_proto_goTypes = []any{ + (*User)(nil), // 0: authentication.v1alpha1.User + (*Organization)(nil), // 1: authentication.v1alpha1.Organization + (*APIKey)(nil), // 2: authentication.v1alpha1.APIKey + (*GetAuthenticationStatusRequest)(nil), // 3: authentication.v1alpha1.GetAuthenticationStatusRequest + (*AuthenticationStatus)(nil), // 4: authentication.v1alpha1.AuthenticationStatus (*v1.ID)(nil), // 5: tilebox.v1.ID } -var file_authentication_v1beta1_authentication_proto_depIdxs = []int32{ - 5, // 0: authentication.v1beta1.User.id:type_name -> tilebox.v1.ID - 5, // 1: authentication.v1beta1.Organization.id:type_name -> tilebox.v1.ID - 5, // 2: authentication.v1beta1.APIKey.id:type_name -> tilebox.v1.ID - 0, // 3: authentication.v1beta1.AuthenticationStatus.user:type_name -> authentication.v1beta1.User - 1, // 4: authentication.v1beta1.AuthenticationStatus.organization:type_name -> authentication.v1beta1.Organization - 2, // 5: authentication.v1beta1.AuthenticationStatus.api_key:type_name -> authentication.v1beta1.APIKey - 3, // 6: authentication.v1beta1.AuthenticationService.GetAuthenticationStatus:input_type -> authentication.v1beta1.GetAuthenticationStatusRequest - 4, // 7: authentication.v1beta1.AuthenticationService.GetAuthenticationStatus:output_type -> authentication.v1beta1.AuthenticationStatus +var file_authentication_v1alpha1_authentication_proto_depIdxs = []int32{ + 5, // 0: authentication.v1alpha1.User.id:type_name -> tilebox.v1.ID + 5, // 1: authentication.v1alpha1.Organization.id:type_name -> tilebox.v1.ID + 5, // 2: authentication.v1alpha1.APIKey.id:type_name -> tilebox.v1.ID + 0, // 3: authentication.v1alpha1.AuthenticationStatus.user:type_name -> authentication.v1alpha1.User + 1, // 4: authentication.v1alpha1.AuthenticationStatus.organization:type_name -> authentication.v1alpha1.Organization + 2, // 5: authentication.v1alpha1.AuthenticationStatus.api_key:type_name -> authentication.v1alpha1.APIKey + 3, // 6: authentication.v1alpha1.AuthenticationService.GetAuthenticationStatus:input_type -> authentication.v1alpha1.GetAuthenticationStatusRequest + 4, // 7: authentication.v1alpha1.AuthenticationService.GetAuthenticationStatus:output_type -> authentication.v1alpha1.AuthenticationStatus 7, // [7:8] is the sub-list for method output_type 6, // [6:7] is the sub-list for method input_type 6, // [6:6] is the sub-list for extension type_name @@ -543,26 +543,26 @@ var file_authentication_v1beta1_authentication_proto_depIdxs = []int32{ 0, // [0:6] is the sub-list for field type_name } -func init() { file_authentication_v1beta1_authentication_proto_init() } -func file_authentication_v1beta1_authentication_proto_init() { - if File_authentication_v1beta1_authentication_proto != nil { +func init() { file_authentication_v1alpha1_authentication_proto_init() } +func file_authentication_v1alpha1_authentication_proto_init() { + if File_authentication_v1alpha1_authentication_proto != nil { return } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_authentication_v1beta1_authentication_proto_rawDesc), len(file_authentication_v1beta1_authentication_proto_rawDesc)), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_authentication_v1alpha1_authentication_proto_rawDesc), len(file_authentication_v1alpha1_authentication_proto_rawDesc)), NumEnums: 0, NumMessages: 5, NumExtensions: 0, NumServices: 1, }, - GoTypes: file_authentication_v1beta1_authentication_proto_goTypes, - DependencyIndexes: file_authentication_v1beta1_authentication_proto_depIdxs, - MessageInfos: file_authentication_v1beta1_authentication_proto_msgTypes, + GoTypes: file_authentication_v1alpha1_authentication_proto_goTypes, + DependencyIndexes: file_authentication_v1alpha1_authentication_proto_depIdxs, + MessageInfos: file_authentication_v1alpha1_authentication_proto_msgTypes, }.Build() - File_authentication_v1beta1_authentication_proto = out.File - file_authentication_v1beta1_authentication_proto_goTypes = nil - file_authentication_v1beta1_authentication_proto_depIdxs = nil + File_authentication_v1alpha1_authentication_proto = out.File + file_authentication_v1alpha1_authentication_proto_goTypes = nil + file_authentication_v1alpha1_authentication_proto_depIdxs = nil } diff --git a/protogen/authentication/v1beta1/authentication_grpc.pb.go b/protogen/authentication/v1alpha1/authentication_grpc.pb.go similarity index 95% rename from protogen/authentication/v1beta1/authentication_grpc.pb.go rename to protogen/authentication/v1alpha1/authentication_grpc.pb.go index c8192de..0e69e99 100644 --- a/protogen/authentication/v1beta1/authentication_grpc.pb.go +++ b/protogen/authentication/v1alpha1/authentication_grpc.pb.go @@ -4,9 +4,9 @@ // versions: // - protoc-gen-go-grpc v1.6.2 // - protoc (unknown) -// source: authentication/v1beta1/authentication.proto +// source: authentication/v1alpha1/authentication.proto -package authenticationv1beta1 +package authenticationv1alpha1 import ( context "context" @@ -21,7 +21,7 @@ import ( const _ = grpc.SupportPackageIsVersion9 const ( - AuthenticationService_GetAuthenticationStatus_FullMethodName = "/authentication.v1beta1.AuthenticationService/GetAuthenticationStatus" + AuthenticationService_GetAuthenticationStatus_FullMethodName = "/authentication.v1alpha1.AuthenticationService/GetAuthenticationStatus" ) // AuthenticationServiceClient is the client API for AuthenticationService service. @@ -118,7 +118,7 @@ func _AuthenticationService_GetAuthenticationStatus_Handler(srv interface{}, ctx // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var AuthenticationService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "authentication.v1beta1.AuthenticationService", + ServiceName: "authentication.v1alpha1.AuthenticationService", HandlerType: (*AuthenticationServiceServer)(nil), Methods: []grpc.MethodDesc{ { @@ -127,5 +127,5 @@ var AuthenticationService_ServiceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "authentication/v1beta1/authentication.proto", + Metadata: "authentication/v1alpha1/authentication.proto", } diff --git a/protogen/authentication/v1beta1/authenticationv1beta1connect/authentication.connect.go b/protogen/authentication/v1alpha1/authenticationv1alpha1connect/authentication.connect.go similarity index 69% rename from protogen/authentication/v1beta1/authenticationv1beta1connect/authentication.connect.go rename to protogen/authentication/v1alpha1/authenticationv1alpha1connect/authentication.connect.go index eaa3311..38eaf72 100644 --- a/protogen/authentication/v1beta1/authenticationv1beta1connect/authentication.connect.go +++ b/protogen/authentication/v1alpha1/authenticationv1alpha1connect/authentication.connect.go @@ -2,15 +2,15 @@ // Code generated by protoc-gen-connect-go. DO NOT EDIT. // -// Source: authentication/v1beta1/authentication.proto +// Source: authentication/v1alpha1/authentication.proto -package authenticationv1beta1connect +package authenticationv1alpha1connect import ( connect "connectrpc.com/connect" context "context" errors "errors" - v1beta1 "github.com/tilebox/tilebox-go/protogen/authentication/v1beta1" + v1alpha1 "github.com/tilebox/tilebox-go/protogen/authentication/v1alpha1" http "net/http" strings "strings" ) @@ -24,7 +24,7 @@ const _ = connect.IsAtLeastVersion1_13_0 const ( // AuthenticationServiceName is the fully-qualified name of the AuthenticationService service. - AuthenticationServiceName = "authentication.v1beta1.AuthenticationService" + AuthenticationServiceName = "authentication.v1alpha1.AuthenticationService" ) // These constants are the fully-qualified names of the RPCs defined in this package. They're @@ -37,19 +37,19 @@ const ( const ( // AuthenticationServiceGetAuthenticationStatusProcedure is the fully-qualified name of the // AuthenticationService's GetAuthenticationStatus RPC. - AuthenticationServiceGetAuthenticationStatusProcedure = "/authentication.v1beta1.AuthenticationService/GetAuthenticationStatus" + AuthenticationServiceGetAuthenticationStatusProcedure = "/authentication.v1alpha1.AuthenticationService/GetAuthenticationStatus" ) -// AuthenticationServiceClient is a client for the authentication.v1beta1.AuthenticationService +// AuthenticationServiceClient is a client for the authentication.v1alpha1.AuthenticationService // service. type AuthenticationServiceClient interface { // GetAuthenticationStatus resolves the calling credential to its effective user and organization. // Requests without valid authentication fail with UNAUTHENTICATED. - GetAuthenticationStatus(context.Context, *connect.Request[v1beta1.GetAuthenticationStatusRequest]) (*connect.Response[v1beta1.AuthenticationStatus], error) + GetAuthenticationStatus(context.Context, *connect.Request[v1alpha1.GetAuthenticationStatusRequest]) (*connect.Response[v1alpha1.AuthenticationStatus], error) } // NewAuthenticationServiceClient constructs a client for the -// authentication.v1beta1.AuthenticationService service. By default, it uses the Connect protocol +// authentication.v1alpha1.AuthenticationService service. By default, it uses the Connect protocol // with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To // use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() // options. @@ -58,9 +58,9 @@ type AuthenticationServiceClient interface { // http://api.acme.com or https://acme.com/grpc). func NewAuthenticationServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) AuthenticationServiceClient { baseURL = strings.TrimRight(baseURL, "/") - authenticationServiceMethods := v1beta1.File_authentication_v1beta1_authentication_proto.Services().ByName("AuthenticationService").Methods() + authenticationServiceMethods := v1alpha1.File_authentication_v1alpha1_authentication_proto.Services().ByName("AuthenticationService").Methods() return &authenticationServiceClient{ - getAuthenticationStatus: connect.NewClient[v1beta1.GetAuthenticationStatusRequest, v1beta1.AuthenticationStatus]( + getAuthenticationStatus: connect.NewClient[v1alpha1.GetAuthenticationStatusRequest, v1alpha1.AuthenticationStatus]( httpClient, baseURL+AuthenticationServiceGetAuthenticationStatusProcedure, connect.WithSchema(authenticationServiceMethods.ByName("GetAuthenticationStatus")), @@ -71,21 +71,21 @@ func NewAuthenticationServiceClient(httpClient connect.HTTPClient, baseURL strin // authenticationServiceClient implements AuthenticationServiceClient. type authenticationServiceClient struct { - getAuthenticationStatus *connect.Client[v1beta1.GetAuthenticationStatusRequest, v1beta1.AuthenticationStatus] + getAuthenticationStatus *connect.Client[v1alpha1.GetAuthenticationStatusRequest, v1alpha1.AuthenticationStatus] } // GetAuthenticationStatus calls -// authentication.v1beta1.AuthenticationService.GetAuthenticationStatus. -func (c *authenticationServiceClient) GetAuthenticationStatus(ctx context.Context, req *connect.Request[v1beta1.GetAuthenticationStatusRequest]) (*connect.Response[v1beta1.AuthenticationStatus], error) { +// authentication.v1alpha1.AuthenticationService.GetAuthenticationStatus. +func (c *authenticationServiceClient) GetAuthenticationStatus(ctx context.Context, req *connect.Request[v1alpha1.GetAuthenticationStatusRequest]) (*connect.Response[v1alpha1.AuthenticationStatus], error) { return c.getAuthenticationStatus.CallUnary(ctx, req) } // AuthenticationServiceHandler is an implementation of the -// authentication.v1beta1.AuthenticationService service. +// authentication.v1alpha1.AuthenticationService service. type AuthenticationServiceHandler interface { // GetAuthenticationStatus resolves the calling credential to its effective user and organization. // Requests without valid authentication fail with UNAUTHENTICATED. - GetAuthenticationStatus(context.Context, *connect.Request[v1beta1.GetAuthenticationStatusRequest]) (*connect.Response[v1beta1.AuthenticationStatus], error) + GetAuthenticationStatus(context.Context, *connect.Request[v1alpha1.GetAuthenticationStatusRequest]) (*connect.Response[v1alpha1.AuthenticationStatus], error) } // NewAuthenticationServiceHandler builds an HTTP handler from the service implementation. It @@ -94,14 +94,14 @@ type AuthenticationServiceHandler interface { // By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf // and JSON codecs. They also support gzip compression. func NewAuthenticationServiceHandler(svc AuthenticationServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { - authenticationServiceMethods := v1beta1.File_authentication_v1beta1_authentication_proto.Services().ByName("AuthenticationService").Methods() + authenticationServiceMethods := v1alpha1.File_authentication_v1alpha1_authentication_proto.Services().ByName("AuthenticationService").Methods() authenticationServiceGetAuthenticationStatusHandler := connect.NewUnaryHandler( AuthenticationServiceGetAuthenticationStatusProcedure, svc.GetAuthenticationStatus, connect.WithSchema(authenticationServiceMethods.ByName("GetAuthenticationStatus")), connect.WithHandlerOptions(opts...), ) - return "/authentication.v1beta1.AuthenticationService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + return "/authentication.v1alpha1.AuthenticationService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { switch r.URL.Path { case AuthenticationServiceGetAuthenticationStatusProcedure: authenticationServiceGetAuthenticationStatusHandler.ServeHTTP(w, r) @@ -114,6 +114,6 @@ func NewAuthenticationServiceHandler(svc AuthenticationServiceHandler, opts ...c // UnimplementedAuthenticationServiceHandler returns CodeUnimplemented from all methods. type UnimplementedAuthenticationServiceHandler struct{} -func (UnimplementedAuthenticationServiceHandler) GetAuthenticationStatus(context.Context, *connect.Request[v1beta1.GetAuthenticationStatusRequest]) (*connect.Response[v1beta1.AuthenticationStatus], error) { - return nil, connect.NewError(connect.CodeUnimplemented, errors.New("authentication.v1beta1.AuthenticationService.GetAuthenticationStatus is not implemented")) +func (UnimplementedAuthenticationServiceHandler) GetAuthenticationStatus(context.Context, *connect.Request[v1alpha1.GetAuthenticationStatusRequest]) (*connect.Response[v1alpha1.AuthenticationStatus], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("authentication.v1alpha1.AuthenticationService.GetAuthenticationStatus is not implemented")) }