From 8b243c2a2519c144ec81ee667b65366424bc13e7 Mon Sep 17 00:00:00 2001 From: Michael Geers Date: Wed, 15 Jul 2026 16:45:57 +0200 Subject: [PATCH] Sponsor: remove Creem license key activation (#31824) --- api/proto/auth.proto | 15 +- api/proto/pb/auth.pb.go | 201 ++++------------- api/proto/pb/auth_grpc.pb.go | 41 +--- assets/js/components/Config/SponsorModal.vue | 225 +++++-------------- i18n/cs.json | 4 - i18n/da.json | 4 - i18n/de.json | 4 - i18n/en.json | 4 - i18n/fi.json | 4 - i18n/fr.json | 4 - i18n/it.json | 4 - i18n/ja.json | 4 - i18n/lb.json | 4 - i18n/lt.json | 4 - i18n/lv.json | 4 - i18n/nl.json | 4 - i18n/pt.json | 4 - i18n/sk.json | 4 - i18n/sv.json | 4 - i18n/tr.json | 4 - server/http_config_site_other_handler.go | 28 +-- util/sponsor/auth.go | 64 +----- 22 files changed, 104 insertions(+), 534 deletions(-) diff --git a/api/proto/auth.proto b/api/proto/auth.proto index b1c10908c..df7661d1d 100644 --- a/api/proto/auth.proto +++ b/api/proto/auth.proto @@ -8,30 +8,19 @@ option go_package = "proto/pb"; service Auth { rpc IsAuthorized (AuthRequest) returns (AuthReply) {} - rpc Activate (ActivateRequest) returns (ActivateReply) {} rpc IsAuthorizedHardware (HardwareRequest) returns (HardwareReply) {} } message AuthRequest { string token = 1; + string machine_id = 2; } message AuthReply { + reserved 4; // was activation_key bool authorized = 1; string subject = 2; google.protobuf.Timestamp expires_at = 3; - string activation_key = 4; -} - -message ActivateRequest { - string key = 1; - string email = 2; - string machine_id = 3; -} - -message ActivateReply { - string token = 1; - string error = 2; } message HardwareRequest { diff --git a/api/proto/pb/auth.pb.go b/api/proto/pb/auth.pb.go index c67817048..266002973 100644 --- a/api/proto/pb/auth.pb.go +++ b/api/proto/pb/auth.pb.go @@ -1,19 +1,18 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v7.34.1 +// protoc v7.35.1 // source: proto/auth.proto package pb import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - 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" + unsafe "unsafe" ) const ( @@ -26,6 +25,7 @@ const ( type AuthRequest struct { state protoimpl.MessageState `protogen:"open.v1"` Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` + MachineId string `protobuf:"bytes,2,opt,name=machine_id,json=machineId,proto3" json:"machine_id,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -67,12 +67,18 @@ func (x *AuthRequest) GetToken() string { return "" } +func (x *AuthRequest) GetMachineId() string { + if x != nil { + return x.MachineId + } + return "" +} + type AuthReply struct { state protoimpl.MessageState `protogen:"open.v1"` Authorized bool `protobuf:"varint,1,opt,name=authorized,proto3" json:"authorized,omitempty"` Subject string `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"` ExpiresAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at,omitempty"` - ActivationKey string `protobuf:"bytes,4,opt,name=activation_key,json=activationKey,proto3" json:"activation_key,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -128,125 +134,6 @@ func (x *AuthReply) GetExpiresAt() *timestamppb.Timestamp { return nil } -func (x *AuthReply) GetActivationKey() string { - if x != nil { - return x.ActivationKey - } - return "" -} - -type ActivateRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"` - MachineId string `protobuf:"bytes,3,opt,name=machine_id,json=machineId,proto3" json:"machine_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ActivateRequest) Reset() { - *x = ActivateRequest{} - mi := &file_proto_auth_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ActivateRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ActivateRequest) ProtoMessage() {} - -func (x *ActivateRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_auth_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) -} - -// Deprecated: Use ActivateRequest.ProtoReflect.Descriptor instead. -func (*ActivateRequest) Descriptor() ([]byte, []int) { - return file_proto_auth_proto_rawDescGZIP(), []int{2} -} - -func (x *ActivateRequest) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *ActivateRequest) GetEmail() string { - if x != nil { - return x.Email - } - return "" -} - -func (x *ActivateRequest) GetMachineId() string { - if x != nil { - return x.MachineId - } - return "" -} - -type ActivateReply struct { - state protoimpl.MessageState `protogen:"open.v1"` - Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` - Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ActivateReply) Reset() { - *x = ActivateReply{} - mi := &file_proto_auth_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ActivateReply) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ActivateReply) ProtoMessage() {} - -func (x *ActivateReply) ProtoReflect() protoreflect.Message { - mi := &file_proto_auth_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) -} - -// Deprecated: Use ActivateReply.ProtoReflect.Descriptor instead. -func (*ActivateReply) Descriptor() ([]byte, []int) { - return file_proto_auth_proto_rawDescGZIP(), []int{3} -} - -func (x *ActivateReply) GetToken() string { - if x != nil { - return x.Token - } - return "" -} - -func (x *ActivateReply) GetError() string { - if x != nil { - return x.Error - } - return "" -} - type HardwareRequest struct { state protoimpl.MessageState `protogen:"open.v1"` MachineId string `protobuf:"bytes,1,opt,name=machine_id,json=machineId,proto3" json:"machine_id,omitempty"` @@ -258,7 +145,7 @@ type HardwareRequest struct { func (x *HardwareRequest) Reset() { *x = HardwareRequest{} - mi := &file_proto_auth_proto_msgTypes[4] + mi := &file_proto_auth_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -270,7 +157,7 @@ func (x *HardwareRequest) String() string { func (*HardwareRequest) ProtoMessage() {} func (x *HardwareRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_auth_proto_msgTypes[4] + mi := &file_proto_auth_proto_msgTypes[2] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -283,7 +170,7 @@ func (x *HardwareRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use HardwareRequest.ProtoReflect.Descriptor instead. func (*HardwareRequest) Descriptor() ([]byte, []int) { - return file_proto_auth_proto_rawDescGZIP(), []int{4} + return file_proto_auth_proto_rawDescGZIP(), []int{2} } func (x *HardwareRequest) GetMachineId() string { @@ -317,7 +204,7 @@ type HardwareReply struct { func (x *HardwareReply) Reset() { *x = HardwareReply{} - mi := &file_proto_auth_proto_msgTypes[5] + mi := &file_proto_auth_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -329,7 +216,7 @@ func (x *HardwareReply) String() string { func (*HardwareReply) ProtoMessage() {} func (x *HardwareReply) ProtoReflect() protoreflect.Message { - mi := &file_proto_auth_proto_msgTypes[5] + mi := &file_proto_auth_proto_msgTypes[3] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -342,7 +229,7 @@ func (x *HardwareReply) ProtoReflect() protoreflect.Message { // Deprecated: Use HardwareReply.ProtoReflect.Descriptor instead. func (*HardwareReply) Descriptor() ([]byte, []int) { - return file_proto_auth_proto_rawDescGZIP(), []int{5} + return file_proto_auth_proto_rawDescGZIP(), []int{3} } func (x *HardwareReply) GetAuthorized() bool { @@ -363,25 +250,18 @@ var File_proto_auth_proto protoreflect.FileDescriptor const file_proto_auth_proto_rawDesc = "" + "\n" + - "\x10proto/auth.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"#\n" + + "\x10proto/auth.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"B\n" + "\vAuthRequest\x12\x14\n" + - "\x05token\x18\x01 \x01(\tR\x05token\"\xa7\x01\n" + + "\x05token\x18\x01 \x01(\tR\x05token\x12\x1d\n" + + "\n" + + "machine_id\x18\x02 \x01(\tR\tmachineId\"\x86\x01\n" + "\tAuthReply\x12\x1e\n" + "\n" + "authorized\x18\x01 \x01(\bR\n" + "authorized\x12\x18\n" + "\asubject\x18\x02 \x01(\tR\asubject\x129\n" + "\n" + - "expires_at\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\texpiresAt\x12%\n" + - "\x0eactivation_key\x18\x04 \x01(\tR\ractivationKey\"X\n" + - "\x0fActivateRequest\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05email\x18\x02 \x01(\tR\x05email\x12\x1d\n" + - "\n" + - "machine_id\x18\x03 \x01(\tR\tmachineId\";\n" + - "\rActivateReply\x12\x14\n" + - "\x05token\x18\x01 \x01(\tR\x05token\x12\x14\n" + - "\x05error\x18\x02 \x01(\tR\x05error\"\xc1\x01\n" + + "expires_at\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\texpiresAtJ\x04\b\x04\x10\x05\"\xc1\x01\n" + "\x0fHardwareRequest\x12\x1d\n" + "\n" + "machine_id\x18\x01 \x01(\tR\tmachineId\x12\x16\n" + @@ -394,11 +274,10 @@ const file_proto_auth_proto_rawDesc = "" + "\n" + "authorized\x18\x01 \x01(\bR\n" + "authorized\x12\x18\n" + - "\asubject\x18\x02 \x01(\tR\asubject2\x9e\x01\n" + + "\asubject\x18\x02 \x01(\tR\asubject2n\n" + "\x04Auth\x12*\n" + "\fIsAuthorized\x12\f.AuthRequest\x1a\n" + - ".AuthReply\"\x00\x12.\n" + - "\bActivate\x12\x10.ActivateRequest\x1a\x0e.ActivateReply\"\x00\x12:\n" + + ".AuthReply\"\x00\x12:\n" + "\x14IsAuthorizedHardware\x12\x10.HardwareRequest\x1a\x0e.HardwareReply\"\x00B\n" + "Z\bproto/pbb\x06proto3" @@ -414,28 +293,24 @@ func file_proto_auth_proto_rawDescGZIP() []byte { return file_proto_auth_proto_rawDescData } -var file_proto_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_proto_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 5) var file_proto_auth_proto_goTypes = []any{ (*AuthRequest)(nil), // 0: AuthRequest (*AuthReply)(nil), // 1: AuthReply - (*ActivateRequest)(nil), // 2: ActivateRequest - (*ActivateReply)(nil), // 3: ActivateReply - (*HardwareRequest)(nil), // 4: HardwareRequest - (*HardwareReply)(nil), // 5: HardwareReply - nil, // 6: HardwareRequest.MetadataEntry - (*timestamppb.Timestamp)(nil), // 7: google.protobuf.Timestamp + (*HardwareRequest)(nil), // 2: HardwareRequest + (*HardwareReply)(nil), // 3: HardwareReply + nil, // 4: HardwareRequest.MetadataEntry + (*timestamppb.Timestamp)(nil), // 5: google.protobuf.Timestamp } var file_proto_auth_proto_depIdxs = []int32{ - 7, // 0: AuthReply.expires_at:type_name -> google.protobuf.Timestamp - 6, // 1: HardwareRequest.metadata:type_name -> HardwareRequest.MetadataEntry + 5, // 0: AuthReply.expires_at:type_name -> google.protobuf.Timestamp + 4, // 1: HardwareRequest.metadata:type_name -> HardwareRequest.MetadataEntry 0, // 2: Auth.IsAuthorized:input_type -> AuthRequest - 2, // 3: Auth.Activate:input_type -> ActivateRequest - 4, // 4: Auth.IsAuthorizedHardware:input_type -> HardwareRequest - 1, // 5: Auth.IsAuthorized:output_type -> AuthReply - 3, // 6: Auth.Activate:output_type -> ActivateReply - 5, // 7: Auth.IsAuthorizedHardware:output_type -> HardwareReply - 5, // [5:8] is the sub-list for method output_type - 2, // [2:5] is the sub-list for method input_type + 2, // 3: Auth.IsAuthorizedHardware:input_type -> HardwareRequest + 1, // 4: Auth.IsAuthorized:output_type -> AuthReply + 3, // 5: Auth.IsAuthorizedHardware:output_type -> HardwareReply + 4, // [4:6] is the sub-list for method output_type + 2, // [2:4] is the sub-list for method input_type 2, // [2:2] is the sub-list for extension type_name 2, // [2:2] is the sub-list for extension extendee 0, // [0:2] is the sub-list for field type_name @@ -452,7 +327,7 @@ func file_proto_auth_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_proto_auth_proto_rawDesc), len(file_proto_auth_proto_rawDesc)), NumEnums: 0, - NumMessages: 7, + NumMessages: 5, NumExtensions: 0, NumServices: 1, }, diff --git a/api/proto/pb/auth_grpc.pb.go b/api/proto/pb/auth_grpc.pb.go index 9155efaac..30c5cf014 100644 --- a/api/proto/pb/auth_grpc.pb.go +++ b/api/proto/pb/auth_grpc.pb.go @@ -1,14 +1,13 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.6.1 -// - protoc v7.34.1 +// - protoc v7.35.1 // source: proto/auth.proto package pb import ( context "context" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -21,7 +20,6 @@ const _ = grpc.SupportPackageIsVersion9 const ( Auth_IsAuthorized_FullMethodName = "/Auth/IsAuthorized" - Auth_Activate_FullMethodName = "/Auth/Activate" Auth_IsAuthorizedHardware_FullMethodName = "/Auth/IsAuthorizedHardware" ) @@ -30,7 +28,6 @@ const ( // 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. type AuthClient interface { IsAuthorized(ctx context.Context, in *AuthRequest, opts ...grpc.CallOption) (*AuthReply, error) - Activate(ctx context.Context, in *ActivateRequest, opts ...grpc.CallOption) (*ActivateReply, error) IsAuthorizedHardware(ctx context.Context, in *HardwareRequest, opts ...grpc.CallOption) (*HardwareReply, error) } @@ -52,16 +49,6 @@ func (c *authClient) IsAuthorized(ctx context.Context, in *AuthRequest, opts ... return out, nil } -func (c *authClient) Activate(ctx context.Context, in *ActivateRequest, opts ...grpc.CallOption) (*ActivateReply, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ActivateReply) - err := c.cc.Invoke(ctx, Auth_Activate_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *authClient) IsAuthorizedHardware(ctx context.Context, in *HardwareRequest, opts ...grpc.CallOption) (*HardwareReply, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(HardwareReply) @@ -77,7 +64,6 @@ func (c *authClient) IsAuthorizedHardware(ctx context.Context, in *HardwareReque // for forward compatibility. type AuthServer interface { IsAuthorized(context.Context, *AuthRequest) (*AuthReply, error) - Activate(context.Context, *ActivateRequest) (*ActivateReply, error) IsAuthorizedHardware(context.Context, *HardwareRequest) (*HardwareReply, error) mustEmbedUnimplementedAuthServer() } @@ -92,9 +78,6 @@ type UnimplementedAuthServer struct{} func (UnimplementedAuthServer) IsAuthorized(context.Context, *AuthRequest) (*AuthReply, error) { return nil, status.Error(codes.Unimplemented, "method IsAuthorized not implemented") } -func (UnimplementedAuthServer) Activate(context.Context, *ActivateRequest) (*ActivateReply, error) { - return nil, status.Error(codes.Unimplemented, "method Activate not implemented") -} func (UnimplementedAuthServer) IsAuthorizedHardware(context.Context, *HardwareRequest) (*HardwareReply, error) { return nil, status.Error(codes.Unimplemented, "method IsAuthorizedHardware not implemented") } @@ -137,24 +120,6 @@ func _Auth_IsAuthorized_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } -func _Auth_Activate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ActivateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServer).Activate(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Auth_Activate_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServer).Activate(ctx, req.(*ActivateRequest)) - } - return interceptor(ctx, in, info, handler) -} - func _Auth_IsAuthorizedHardware_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(HardwareRequest) if err := dec(in); err != nil { @@ -184,10 +149,6 @@ var Auth_ServiceDesc = grpc.ServiceDesc{ MethodName: "IsAuthorized", Handler: _Auth_IsAuthorized_Handler, }, - { - MethodName: "Activate", - Handler: _Auth_Activate_Handler, - }, { MethodName: "IsAuthorizedHardware", Handler: _Auth_IsAuthorizedHardware_Handler, diff --git a/assets/js/components/Config/SponsorModal.vue b/assets/js/components/Config/SponsorModal.vue index 28cdd0165..ea798aa8c 100644 --- a/assets/js/components/Config/SponsorModal.vue +++ b/assets/js/components/Config/SponsorModal.vue @@ -11,10 +11,7 @@ :disable-remove="!hasUiToken" disable-cancel @changed="$emit('changed')" - @open=" - showForm = false; - activeTab = 'github'; - " + @open="showForm = false" >