From 964c45ffc4d0fe10fac18550854260b38c9e6414 Mon Sep 17 00:00:00 2001 From: Arsen Musayelyan Date: Sun, 18 Dec 2022 13:52:57 -0800 Subject: [PATCH] Add GetBuildScript API endpoint --- cmd/lure-api-server/api.go | 26 +++ internal/api/lure.pb.go | 219 +++++++++++++++++---- internal/api/lure.proto | 11 ++ internal/api/lure.twirp.go | 387 ++++++++++++++++++++++++++++++++----- 4 files changed, 553 insertions(+), 90 deletions(-) diff --git a/cmd/lure-api-server/api.go b/cmd/lure-api-server/api.go index 822b77c..c5d6951 100644 --- a/cmd/lure-api-server/api.go +++ b/cmd/lure-api-server/api.go @@ -3,12 +3,17 @@ package main import ( "context" "fmt" + "os" + "path/filepath" "strconv" + "strings" "github.com/genjidb/genji" "github.com/genjidb/genji/document" "github.com/genjidb/genji/types" + "github.com/twitchtv/twirp" "go.arsenm.dev/lure/internal/api" + "go.arsenm.dev/lure/internal/config" "go.arsenm.dev/lure/internal/db" ) @@ -72,6 +77,27 @@ func (l lureWebAPI) GetPkg(ctx context.Context, req *api.GetPackageRequest) (*ap return dbPkgToAPI(pkg), nil } +func (l lureWebAPI) GetBuildScript(ctx context.Context, req *api.GetBuildScriptRequest) (*api.GetBuildScriptResponse, error) { + if strings.ContainsAny(req.Name, "./") || strings.ContainsAny(req.Repository, "./") { + return nil, twirp.NewError(twirp.InvalidArgument, "name and repository must not contain . or /") + } + + scriptPath := filepath.Join(config.RepoDir, req.Repository, req.Name, "lure.sh") + _, err := os.Stat(scriptPath) + if os.IsNotExist(err) { + return nil, twirp.NewError(twirp.NotFound, "requested package not found") + } else if err != nil { + return nil, err + } + + data, err := os.ReadFile(scriptPath) + if err != nil { + return nil, err + } + + return &api.GetBuildScriptResponse{Script: string(data)}, nil +} + func dbPkgToAPI(pkg *db.Package) *api.Package { return &api.Package{ Name: pkg.Name, diff --git a/internal/api/lure.pb.go b/internal/api/lure.pb.go index 649279f..eb3b23a 100644 --- a/internal/api/lure.pb.go +++ b/internal/api/lure.pb.go @@ -514,6 +514,108 @@ func (x *SearchResponse) GetPackages() []*Package { return nil } +type GetBuildScriptRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Repository string `protobuf:"bytes,2,opt,name=repository,proto3" json:"repository,omitempty"` +} + +func (x *GetBuildScriptRequest) Reset() { + *x = GetBuildScriptRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_lure_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetBuildScriptRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetBuildScriptRequest) ProtoMessage() {} + +func (x *GetBuildScriptRequest) ProtoReflect() protoreflect.Message { + mi := &file_lure_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetBuildScriptRequest.ProtoReflect.Descriptor instead. +func (*GetBuildScriptRequest) Descriptor() ([]byte, []int) { + return file_lure_proto_rawDescGZIP(), []int{5} +} + +func (x *GetBuildScriptRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *GetBuildScriptRequest) GetRepository() string { + if x != nil { + return x.Repository + } + return "" +} + +type GetBuildScriptResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Script string `protobuf:"bytes,1,opt,name=script,proto3" json:"script,omitempty"` +} + +func (x *GetBuildScriptResponse) Reset() { + *x = GetBuildScriptResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_lure_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetBuildScriptResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetBuildScriptResponse) ProtoMessage() {} + +func (x *GetBuildScriptResponse) ProtoReflect() protoreflect.Message { + mi := &file_lure_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetBuildScriptResponse.ProtoReflect.Descriptor instead. +func (*GetBuildScriptResponse) Descriptor() ([]byte, []int) { + return file_lure_proto_rawDescGZIP(), []int{6} +} + +func (x *GetBuildScriptResponse) GetScript() string { + if x != nil { + return x.Script + } + return "" +} + var File_lure_proto protoreflect.FileDescriptor var file_lure_proto_rawDesc = []byte{ @@ -588,23 +690,36 @@ var file_lure_proto_rawDesc = []byte{ 0x0e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x08, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x6c, 0x75, 0x72, 0x65, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, - 0x52, 0x08, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x2a, 0x3e, 0x0a, 0x07, 0x53, 0x4f, - 0x52, 0x54, 0x5f, 0x42, 0x59, 0x12, 0x0c, 0x0a, 0x08, 0x55, 0x4e, 0x53, 0x4f, 0x52, 0x54, 0x45, - 0x44, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x41, 0x4d, 0x45, 0x10, 0x01, 0x12, 0x0e, 0x0a, - 0x0a, 0x52, 0x45, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x4f, 0x52, 0x59, 0x10, 0x02, 0x12, 0x0b, 0x0a, - 0x07, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x10, 0x03, 0x2a, 0x42, 0x0a, 0x0b, 0x46, 0x49, - 0x4c, 0x54, 0x45, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x12, 0x0d, 0x0a, 0x09, 0x4e, 0x4f, 0x5f, - 0x46, 0x49, 0x4c, 0x54, 0x45, 0x52, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x49, 0x4e, 0x5f, 0x52, - 0x45, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x4f, 0x52, 0x59, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x53, - 0x55, 0x50, 0x50, 0x4f, 0x52, 0x54, 0x53, 0x5f, 0x41, 0x52, 0x43, 0x48, 0x10, 0x02, 0x32, 0x6c, + 0x52, 0x08, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x22, 0x4b, 0x0a, 0x15, 0x47, 0x65, + 0x74, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x70, + 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x22, 0x30, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x42, 0x75, + 0x69, 0x6c, 0x64, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2a, 0x3e, 0x0a, 0x07, 0x53, 0x4f, 0x52, + 0x54, 0x5f, 0x42, 0x59, 0x12, 0x0c, 0x0a, 0x08, 0x55, 0x4e, 0x53, 0x4f, 0x52, 0x54, 0x45, 0x44, + 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x41, 0x4d, 0x45, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, + 0x52, 0x45, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x4f, 0x52, 0x59, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, + 0x56, 0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x10, 0x03, 0x2a, 0x42, 0x0a, 0x0b, 0x46, 0x49, 0x4c, + 0x54, 0x45, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x12, 0x0d, 0x0a, 0x09, 0x4e, 0x4f, 0x5f, 0x46, + 0x49, 0x4c, 0x54, 0x45, 0x52, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x49, 0x4e, 0x5f, 0x52, 0x45, + 0x50, 0x4f, 0x53, 0x49, 0x54, 0x4f, 0x52, 0x59, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x53, 0x55, + 0x50, 0x50, 0x4f, 0x52, 0x54, 0x53, 0x5f, 0x41, 0x52, 0x43, 0x48, 0x10, 0x02, 0x32, 0xb9, 0x01, 0x0a, 0x03, 0x41, 0x50, 0x49, 0x12, 0x33, 0x0a, 0x06, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x13, 0x2e, 0x6c, 0x75, 0x72, 0x65, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x6c, 0x75, 0x72, 0x65, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x06, 0x47, 0x65, 0x74, 0x50, 0x6b, 0x67, 0x12, 0x17, 0x2e, 0x6c, 0x75, 0x72, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, - 0x6c, 0x75, 0x72, 0x65, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x42, 0x08, 0x5a, 0x06, - 0x2e, 0x2e, 0x2f, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6c, 0x75, 0x72, 0x65, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x4b, 0x0a, 0x0e, + 0x47, 0x65, 0x74, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x12, 0x1b, + 0x2e, 0x6c, 0x75, 0x72, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x53, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x6c, 0x75, + 0x72, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x53, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x08, 0x5a, 0x06, 0x2e, 0x2e, 0x2f, + 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -620,35 +735,39 @@ func file_lure_proto_rawDescGZIP() []byte { } var file_lure_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_lure_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_lure_proto_msgTypes = make([]protoimpl.MessageInfo, 9) var file_lure_proto_goTypes = []interface{}{ - (SORT_BY)(0), // 0: lure.SORT_BY - (FILTER_TYPE)(0), // 1: lure.FILTER_TYPE - (*SearchRequest)(nil), // 2: lure.SearchRequest - (*StringList)(nil), // 3: lure.StringList - (*Package)(nil), // 4: lure.Package - (*GetPackageRequest)(nil), // 5: lure.GetPackageRequest - (*SearchResponse)(nil), // 6: lure.SearchResponse - nil, // 7: lure.Package.DependsEntry - nil, // 8: lure.Package.BuildDependsEntry + (SORT_BY)(0), // 0: lure.SORT_BY + (FILTER_TYPE)(0), // 1: lure.FILTER_TYPE + (*SearchRequest)(nil), // 2: lure.SearchRequest + (*StringList)(nil), // 3: lure.StringList + (*Package)(nil), // 4: lure.Package + (*GetPackageRequest)(nil), // 5: lure.GetPackageRequest + (*SearchResponse)(nil), // 6: lure.SearchResponse + (*GetBuildScriptRequest)(nil), // 7: lure.GetBuildScriptRequest + (*GetBuildScriptResponse)(nil), // 8: lure.GetBuildScriptResponse + nil, // 9: lure.Package.DependsEntry + nil, // 10: lure.Package.BuildDependsEntry } var file_lure_proto_depIdxs = []int32{ - 0, // 0: lure.SearchRequest.sort_by:type_name -> lure.SORT_BY - 1, // 1: lure.SearchRequest.filter_type:type_name -> lure.FILTER_TYPE - 7, // 2: lure.Package.depends:type_name -> lure.Package.DependsEntry - 8, // 3: lure.Package.build_depends:type_name -> lure.Package.BuildDependsEntry - 4, // 4: lure.SearchResponse.packages:type_name -> lure.Package - 3, // 5: lure.Package.DependsEntry.value:type_name -> lure.StringList - 3, // 6: lure.Package.BuildDependsEntry.value:type_name -> lure.StringList - 2, // 7: lure.API.Search:input_type -> lure.SearchRequest - 5, // 8: lure.API.GetPkg:input_type -> lure.GetPackageRequest - 6, // 9: lure.API.Search:output_type -> lure.SearchResponse - 4, // 10: lure.API.GetPkg:output_type -> lure.Package - 9, // [9:11] is the sub-list for method output_type - 7, // [7:9] is the sub-list for method input_type - 7, // [7:7] is the sub-list for extension type_name - 7, // [7:7] is the sub-list for extension extendee - 0, // [0:7] is the sub-list for field type_name + 0, // 0: lure.SearchRequest.sort_by:type_name -> lure.SORT_BY + 1, // 1: lure.SearchRequest.filter_type:type_name -> lure.FILTER_TYPE + 9, // 2: lure.Package.depends:type_name -> lure.Package.DependsEntry + 10, // 3: lure.Package.build_depends:type_name -> lure.Package.BuildDependsEntry + 4, // 4: lure.SearchResponse.packages:type_name -> lure.Package + 3, // 5: lure.Package.DependsEntry.value:type_name -> lure.StringList + 3, // 6: lure.Package.BuildDependsEntry.value:type_name -> lure.StringList + 2, // 7: lure.API.Search:input_type -> lure.SearchRequest + 5, // 8: lure.API.GetPkg:input_type -> lure.GetPackageRequest + 7, // 9: lure.API.GetBuildScript:input_type -> lure.GetBuildScriptRequest + 6, // 10: lure.API.Search:output_type -> lure.SearchResponse + 4, // 11: lure.API.GetPkg:output_type -> lure.Package + 8, // 12: lure.API.GetBuildScript:output_type -> lure.GetBuildScriptResponse + 10, // [10:13] is the sub-list for method output_type + 7, // [7:10] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name } func init() { file_lure_proto_init() } @@ -717,6 +836,30 @@ func file_lure_proto_init() { return nil } } + file_lure_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetBuildScriptRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_lure_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetBuildScriptResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } file_lure_proto_msgTypes[0].OneofWrappers = []interface{}{} file_lure_proto_msgTypes[2].OneofWrappers = []interface{}{} @@ -726,7 +869,7 @@ func file_lure_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_lure_proto_rawDesc, NumEnums: 2, - NumMessages: 7, + NumMessages: 9, NumExtensions: 0, NumServices: 1, }, diff --git a/internal/api/lure.proto b/internal/api/lure.proto index 921b37d..06c2105 100644 --- a/internal/api/lure.proto +++ b/internal/api/lure.proto @@ -62,10 +62,21 @@ message SearchResponse { repeated Package packages = 1; } +message GetBuildScriptRequest { + string name = 1; + string repository = 2; +} + +message GetBuildScriptResponse { + string script = 1; +} + // Web is the LURE Web service service API { // Search searches through LURE packages in the database rpc Search(SearchRequest) returns (SearchResponse); // GetPkg gets a single LURE package from the database rpc GetPkg(GetPackageRequest) returns (Package); + // GetBuildScript returns the build script for the given package + rpc GetBuildScript(GetBuildScriptRequest) returns (GetBuildScriptResponse); } \ No newline at end of file diff --git a/internal/api/lure.twirp.go b/internal/api/lure.twirp.go index d90a2e8..dc8c799 100644 --- a/internal/api/lure.twirp.go +++ b/internal/api/lure.twirp.go @@ -38,6 +38,9 @@ type API interface { // GetPkg gets a single LURE package from the database GetPkg(context.Context, *GetPackageRequest) (*Package, error) + + // GetBuildScript returns the build script for the given package + GetBuildScript(context.Context, *GetBuildScriptRequest) (*GetBuildScriptResponse, error) } // =================== @@ -46,7 +49,7 @@ type API interface { type aPIProtobufClient struct { client HTTPClient - urls [2]string + urls [3]string interceptor twirp.Interceptor opts twirp.ClientOptions } @@ -74,9 +77,10 @@ func NewAPIProtobufClient(baseURL string, client HTTPClient, opts ...twirp.Clien // Build method URLs: []/./ serviceURL := sanitizeBaseURL(baseURL) serviceURL += baseServicePath(pathPrefix, "lure", "API") - urls := [2]string{ + urls := [3]string{ serviceURL + "Search", serviceURL + "GetPkg", + serviceURL + "GetBuildScript", } return &aPIProtobufClient{ @@ -179,13 +183,59 @@ func (c *aPIProtobufClient) callGetPkg(ctx context.Context, in *GetPackageReques return out, nil } +func (c *aPIProtobufClient) GetBuildScript(ctx context.Context, in *GetBuildScriptRequest) (*GetBuildScriptResponse, error) { + ctx = ctxsetters.WithPackageName(ctx, "lure") + ctx = ctxsetters.WithServiceName(ctx, "API") + ctx = ctxsetters.WithMethodName(ctx, "GetBuildScript") + caller := c.callGetBuildScript + if c.interceptor != nil { + caller = func(ctx context.Context, req *GetBuildScriptRequest) (*GetBuildScriptResponse, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*GetBuildScriptRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*GetBuildScriptRequest) when calling interceptor") + } + return c.callGetBuildScript(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*GetBuildScriptResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*GetBuildScriptResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *aPIProtobufClient) callGetBuildScript(ctx context.Context, in *GetBuildScriptRequest) (*GetBuildScriptResponse, error) { + out := new(GetBuildScriptResponse) + ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[2], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + // =============== // API JSON Client // =============== type aPIJSONClient struct { client HTTPClient - urls [2]string + urls [3]string interceptor twirp.Interceptor opts twirp.ClientOptions } @@ -213,9 +263,10 @@ func NewAPIJSONClient(baseURL string, client HTTPClient, opts ...twirp.ClientOpt // Build method URLs: []/./ serviceURL := sanitizeBaseURL(baseURL) serviceURL += baseServicePath(pathPrefix, "lure", "API") - urls := [2]string{ + urls := [3]string{ serviceURL + "Search", serviceURL + "GetPkg", + serviceURL + "GetBuildScript", } return &aPIJSONClient{ @@ -318,6 +369,52 @@ func (c *aPIJSONClient) callGetPkg(ctx context.Context, in *GetPackageRequest) ( return out, nil } +func (c *aPIJSONClient) GetBuildScript(ctx context.Context, in *GetBuildScriptRequest) (*GetBuildScriptResponse, error) { + ctx = ctxsetters.WithPackageName(ctx, "lure") + ctx = ctxsetters.WithServiceName(ctx, "API") + ctx = ctxsetters.WithMethodName(ctx, "GetBuildScript") + caller := c.callGetBuildScript + if c.interceptor != nil { + caller = func(ctx context.Context, req *GetBuildScriptRequest) (*GetBuildScriptResponse, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*GetBuildScriptRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*GetBuildScriptRequest) when calling interceptor") + } + return c.callGetBuildScript(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*GetBuildScriptResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*GetBuildScriptResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *aPIJSONClient) callGetBuildScript(ctx context.Context, in *GetBuildScriptRequest) (*GetBuildScriptResponse, error) { + out := new(GetBuildScriptResponse) + ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[2], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + // ================== // API Server Handler // ================== @@ -421,6 +518,9 @@ func (s *aPIServer) ServeHTTP(resp http.ResponseWriter, req *http.Request) { case "GetPkg": s.serveGetPkg(ctx, resp, req) return + case "GetBuildScript": + s.serveGetBuildScript(ctx, resp, req) + return default: msg := fmt.Sprintf("no handler for path %q", req.URL.Path) s.writeError(ctx, resp, badRouteError(msg, req.Method, req.URL.Path)) @@ -788,6 +888,186 @@ func (s *aPIServer) serveGetPkgProtobuf(ctx context.Context, resp http.ResponseW callResponseSent(ctx, s.hooks) } +func (s *aPIServer) serveGetBuildScript(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + header := req.Header.Get("Content-Type") + i := strings.Index(header, ";") + if i == -1 { + i = len(header) + } + switch strings.TrimSpace(strings.ToLower(header[:i])) { + case "application/json": + s.serveGetBuildScriptJSON(ctx, resp, req) + case "application/protobuf": + s.serveGetBuildScriptProtobuf(ctx, resp, req) + default: + msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) + twerr := badRouteError(msg, req.Method, req.URL.Path) + s.writeError(ctx, resp, twerr) + } +} + +func (s *aPIServer) serveGetBuildScriptJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "GetBuildScript") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + d := json.NewDecoder(req.Body) + rawReqBody := json.RawMessage{} + if err := d.Decode(&rawReqBody); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + reqContent := new(GetBuildScriptRequest) + unmarshaler := protojson.UnmarshalOptions{DiscardUnknown: true} + if err = unmarshaler.Unmarshal(rawReqBody, reqContent); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + + handler := s.API.GetBuildScript + if s.interceptor != nil { + handler = func(ctx context.Context, req *GetBuildScriptRequest) (*GetBuildScriptResponse, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*GetBuildScriptRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*GetBuildScriptRequest) when calling interceptor") + } + return s.API.GetBuildScript(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*GetBuildScriptResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*GetBuildScriptResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *GetBuildScriptResponse + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *GetBuildScriptResponse and nil error while calling GetBuildScript. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + marshaler := &protojson.MarshalOptions{UseProtoNames: !s.jsonCamelCase, EmitUnpopulated: !s.jsonSkipDefaults} + respBytes, err := marshaler.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/json") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *aPIServer) serveGetBuildScriptProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "GetBuildScript") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + buf, err := io.ReadAll(req.Body) + if err != nil { + s.handleRequestBodyError(ctx, resp, "failed to read request body", err) + return + } + reqContent := new(GetBuildScriptRequest) + if err = proto.Unmarshal(buf, reqContent); err != nil { + s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) + return + } + + handler := s.API.GetBuildScript + if s.interceptor != nil { + handler = func(ctx context.Context, req *GetBuildScriptRequest) (*GetBuildScriptResponse, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*GetBuildScriptRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*GetBuildScriptRequest) when calling interceptor") + } + return s.API.GetBuildScript(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*GetBuildScriptResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*GetBuildScriptResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *GetBuildScriptResponse + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *GetBuildScriptResponse and nil error while calling GetBuildScript. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + respBytes, err := proto.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/protobuf") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + func (s *aPIServer) ServiceDescriptor() ([]byte, int) { return twirpFileDescriptor0, 0 } @@ -1369,52 +1649,55 @@ func callClientError(ctx context.Context, h *twirp.ClientHooks, err twirp.Error) } var twirpFileDescriptor0 = []byte{ - // 738 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0x5f, 0x8f, 0xda, 0x46, - 0x10, 0x3f, 0xe3, 0x03, 0xec, 0x31, 0x26, 0xbe, 0x6d, 0xa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 0x92, 0xef, 0xc0, - 0xca, 0x75, 0x5e, 0xfd, 0xb8, 0x9c, 0xea, 0xfd, 0x57, 0xa7, 0x9d, 0xe4, 0x97, 0xbf, 0x42, 0xbb, - 0x5c, 0x0a, 0xa4, 0x03, 0xd6, 0x9b, 0xb9, 0x02, 0xd3, 0x1b, 0xef, 0x82, 0x58, 0x70, 0x39, 0xbf, - 0xfe, 0x63, 0xea, 0x19, 0xa4, 0x0b, 0x40, 0xa7, 0xcb, 0xc5, 0x6a, 0xb6, 0x5e, 0xd0, 0x7b, 0xaf, - 0x41, 0x1c, 0x68, 0xbf, 0x9d, 0xd2, 0xd5, 0x6c, 0x31, 0xf7, 0xcc, 0x97, 0x01, 0x38, 0xb5, 0x45, - 0x41, 0x5c, 0xb0, 0xe7, 0x8b, 0x50, 0x33, 0xde, 0x05, 0xb9, 0x02, 0x77, 0x36, 0x0f, 0x6b, 0xd1, - 0x86, 0xa2, 0x56, 0x6f, 0x96, 0xcb, 0x05, 0x5d, 0xaf, 0xc2, 0x6b, 0xfa, 0xdb, 0xad, 0xd7, 0x98, - 0x24, 0x60, 0x5e, 0x2f, 0x67, 0xe4, 0x15, 0xb4, 0x74, 0x1d, 0xe4, 0xb3, 0xb2, 0xdb, 0xf5, 0xfd, - 0xd7, 0x7b, 0x7e, 0x4e, 0x96, 0xa5, 0xfe, 0x00, 0x2d, 0xd5, 0xc5, 0xc7, 0x1d, 0xf9, 0x5c, 0xeb, - 0x9f, 0xf4, 0xb4, 0x77, 0x5e, 0x7b, 0x60, 0xfd, 0xd5, 0x1a, 0x8f, 0xbf, 0x8f, 0x72, 0xb6, 0x69, - 0x15, 0x0b, 0xf7, 0xd5, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x2b, 0xd4, 0x7c, 0x4f, 0x7e, 0x05, - 0x00, 0x00, + // 791 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 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