fix(cli): use renamed ListMyAccountsForCLI RPC

Tracks the shared proto rename that resolves the message-name collision
between PluginAuthService and AccountService.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Alex Dunmow 2026-06-04 20:55:10 +08:00
parent 051253396c
commit 7fc20a990b
5 changed files with 60 additions and 60 deletions

View File

@ -37,8 +37,8 @@ func newAccountListCmd() *cobra.Command {
if err != nil {
return err
}
accts, err := cli.Auth.ListMyAccounts(context.Background(),
connect.NewRequest(&v1.ListMyAccountsRequest{}))
accts, err := cli.Auth.ListMyAccountsForCLI(context.Background(),
connect.NewRequest(&v1.ListMyAccountsForCLIRequest{}))
if err != nil {
return fmt.Errorf("list accounts: %w", err)
}
@ -69,8 +69,8 @@ func newAccountSetCmd() *cobra.Command {
return err
}
slug := strings.TrimPrefix(args[0], "@")
accts, err := cli.Auth.ListMyAccounts(context.Background(),
connect.NewRequest(&v1.ListMyAccountsRequest{}))
accts, err := cli.Auth.ListMyAccountsForCLI(context.Background(),
connect.NewRequest(&v1.ListMyAccountsForCLIRequest{}))
if err != nil {
return fmt.Errorf("list accounts: %w", err)
}

View File

@ -108,7 +108,7 @@ func newWhoamiCmd() *cobra.Command {
// user has at least one). With 1 it auto-selects silently. With ≥2 it
// prompts interactively on stdin.
func selectActiveAccount(ctx context.Context, cli *orchclient.Client, hc *creds.HostCreds) error {
resp, err := cli.Auth.ListMyAccounts(ctx, connect.NewRequest(&v1.ListMyAccountsRequest{}))
resp, err := cli.Auth.ListMyAccountsForCLI(ctx, connect.NewRequest(&v1.ListMyAccountsForCLIRequest{}))
if err != nil {
return fmt.Errorf("list accounts: %w", err)
}

View File

@ -119,9 +119,9 @@ const (
// PluginAuthServiceWhoamiProcedure is the fully-qualified name of the PluginAuthService's Whoami
// RPC.
PluginAuthServiceWhoamiProcedure = "/orchestrator.v1.PluginAuthService/Whoami"
// PluginAuthServiceListMyAccountsProcedure is the fully-qualified name of the PluginAuthService's
// ListMyAccounts RPC.
PluginAuthServiceListMyAccountsProcedure = "/orchestrator.v1.PluginAuthService/ListMyAccounts"
// PluginAuthServiceListMyAccountsForCLIProcedure is the fully-qualified name of the
// PluginAuthService's ListMyAccountsForCLI RPC.
PluginAuthServiceListMyAccountsForCLIProcedure = "/orchestrator.v1.PluginAuthService/ListMyAccountsForCLI"
)
// PluginScopeServiceClient is a client for the orchestrator.v1.PluginScopeService service.
@ -844,7 +844,7 @@ type PluginAuthServiceClient interface {
// and AccountService would force core to also generate bindings for the
// full Account message and collide with the orchestrator's own copy at
// proto-registration time.
ListMyAccounts(context.Context, *connect.Request[v1.ListMyAccountsRequest]) (*connect.Response[v1.ListMyAccountsResponse], error)
ListMyAccountsForCLI(context.Context, *connect.Request[v1.ListMyAccountsForCLIRequest]) (*connect.Response[v1.ListMyAccountsForCLIResponse], error)
}
// NewPluginAuthServiceClient constructs a client for the orchestrator.v1.PluginAuthService service.
@ -894,10 +894,10 @@ func NewPluginAuthServiceClient(httpClient connect.HTTPClient, baseURL string, o
connect.WithSchema(pluginAuthServiceMethods.ByName("Whoami")),
connect.WithClientOptions(opts...),
),
listMyAccounts: connect.NewClient[v1.ListMyAccountsRequest, v1.ListMyAccountsResponse](
listMyAccountsForCLI: connect.NewClient[v1.ListMyAccountsForCLIRequest, v1.ListMyAccountsForCLIResponse](
httpClient,
baseURL+PluginAuthServiceListMyAccountsProcedure,
connect.WithSchema(pluginAuthServiceMethods.ByName("ListMyAccounts")),
baseURL+PluginAuthServiceListMyAccountsForCLIProcedure,
connect.WithSchema(pluginAuthServiceMethods.ByName("ListMyAccountsForCLI")),
connect.WithClientOptions(opts...),
),
}
@ -911,7 +911,7 @@ type pluginAuthServiceClient struct {
denyDevice *connect.Client[v1.DenyDeviceRequest, v1.DenyDeviceResponse]
getDeviceStatus *connect.Client[v1.GetDeviceStatusRequest, v1.GetDeviceStatusResponse]
whoami *connect.Client[v1.WhoamiRequest, v1.WhoamiResponse]
listMyAccounts *connect.Client[v1.ListMyAccountsRequest, v1.ListMyAccountsResponse]
listMyAccountsForCLI *connect.Client[v1.ListMyAccountsForCLIRequest, v1.ListMyAccountsForCLIResponse]
}
// StartDevice calls orchestrator.v1.PluginAuthService.StartDevice.
@ -944,9 +944,9 @@ func (c *pluginAuthServiceClient) Whoami(ctx context.Context, req *connect.Reque
return c.whoami.CallUnary(ctx, req)
}
// ListMyAccounts calls orchestrator.v1.PluginAuthService.ListMyAccounts.
func (c *pluginAuthServiceClient) ListMyAccounts(ctx context.Context, req *connect.Request[v1.ListMyAccountsRequest]) (*connect.Response[v1.ListMyAccountsResponse], error) {
return c.listMyAccounts.CallUnary(ctx, req)
// ListMyAccountsForCLI calls orchestrator.v1.PluginAuthService.ListMyAccountsForCLI.
func (c *pluginAuthServiceClient) ListMyAccountsForCLI(ctx context.Context, req *connect.Request[v1.ListMyAccountsForCLIRequest]) (*connect.Response[v1.ListMyAccountsForCLIResponse], error) {
return c.listMyAccountsForCLI.CallUnary(ctx, req)
}
// PluginAuthServiceHandler is an implementation of the orchestrator.v1.PluginAuthService service.
@ -963,7 +963,7 @@ type PluginAuthServiceHandler interface {
// and AccountService would force core to also generate bindings for the
// full Account message and collide with the orchestrator's own copy at
// proto-registration time.
ListMyAccounts(context.Context, *connect.Request[v1.ListMyAccountsRequest]) (*connect.Response[v1.ListMyAccountsResponse], error)
ListMyAccountsForCLI(context.Context, *connect.Request[v1.ListMyAccountsForCLIRequest]) (*connect.Response[v1.ListMyAccountsForCLIResponse], error)
}
// NewPluginAuthServiceHandler builds an HTTP handler from the service implementation. It returns
@ -1009,10 +1009,10 @@ func NewPluginAuthServiceHandler(svc PluginAuthServiceHandler, opts ...connect.H
connect.WithSchema(pluginAuthServiceMethods.ByName("Whoami")),
connect.WithHandlerOptions(opts...),
)
pluginAuthServiceListMyAccountsHandler := connect.NewUnaryHandler(
PluginAuthServiceListMyAccountsProcedure,
svc.ListMyAccounts,
connect.WithSchema(pluginAuthServiceMethods.ByName("ListMyAccounts")),
pluginAuthServiceListMyAccountsForCLIHandler := connect.NewUnaryHandler(
PluginAuthServiceListMyAccountsForCLIProcedure,
svc.ListMyAccountsForCLI,
connect.WithSchema(pluginAuthServiceMethods.ByName("ListMyAccountsForCLI")),
connect.WithHandlerOptions(opts...),
)
return "/orchestrator.v1.PluginAuthService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
@ -1029,8 +1029,8 @@ func NewPluginAuthServiceHandler(svc PluginAuthServiceHandler, opts ...connect.H
pluginAuthServiceGetDeviceStatusHandler.ServeHTTP(w, r)
case PluginAuthServiceWhoamiProcedure:
pluginAuthServiceWhoamiHandler.ServeHTTP(w, r)
case PluginAuthServiceListMyAccountsProcedure:
pluginAuthServiceListMyAccountsHandler.ServeHTTP(w, r)
case PluginAuthServiceListMyAccountsForCLIProcedure:
pluginAuthServiceListMyAccountsForCLIHandler.ServeHTTP(w, r)
default:
http.NotFound(w, r)
}
@ -1064,6 +1064,6 @@ func (UnimplementedPluginAuthServiceHandler) Whoami(context.Context, *connect.Re
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("orchestrator.v1.PluginAuthService.Whoami is not implemented"))
}
func (UnimplementedPluginAuthServiceHandler) ListMyAccounts(context.Context, *connect.Request[v1.ListMyAccountsRequest]) (*connect.Response[v1.ListMyAccountsResponse], error) {
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("orchestrator.v1.PluginAuthService.ListMyAccounts is not implemented"))
func (UnimplementedPluginAuthServiceHandler) ListMyAccountsForCLI(context.Context, *connect.Request[v1.ListMyAccountsForCLIRequest]) (*connect.Response[v1.ListMyAccountsForCLIResponse], error) {
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("orchestrator.v1.PluginAuthService.ListMyAccountsForCLI is not implemented"))
}

View File

@ -3494,26 +3494,26 @@ func (x *MyAccount) GetName() string {
return ""
}
type ListMyAccountsRequest struct {
type ListMyAccountsForCLIRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ListMyAccountsRequest) Reset() {
*x = ListMyAccountsRequest{}
func (x *ListMyAccountsForCLIRequest) Reset() {
*x = ListMyAccountsForCLIRequest{}
mi := &file_orchestrator_v1_plugin_registry_proto_msgTypes[61]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ListMyAccountsRequest) String() string {
func (x *ListMyAccountsForCLIRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListMyAccountsRequest) ProtoMessage() {}
func (*ListMyAccountsForCLIRequest) ProtoMessage() {}
func (x *ListMyAccountsRequest) ProtoReflect() protoreflect.Message {
func (x *ListMyAccountsForCLIRequest) ProtoReflect() protoreflect.Message {
mi := &file_orchestrator_v1_plugin_registry_proto_msgTypes[61]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -3525,32 +3525,32 @@ func (x *ListMyAccountsRequest) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
// Deprecated: Use ListMyAccountsRequest.ProtoReflect.Descriptor instead.
func (*ListMyAccountsRequest) Descriptor() ([]byte, []int) {
// Deprecated: Use ListMyAccountsForCLIRequest.ProtoReflect.Descriptor instead.
func (*ListMyAccountsForCLIRequest) Descriptor() ([]byte, []int) {
return file_orchestrator_v1_plugin_registry_proto_rawDescGZIP(), []int{61}
}
type ListMyAccountsResponse struct {
type ListMyAccountsForCLIResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
Accounts []*MyAccount `protobuf:"bytes,1,rep,name=accounts,proto3" json:"accounts,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ListMyAccountsResponse) Reset() {
*x = ListMyAccountsResponse{}
func (x *ListMyAccountsForCLIResponse) Reset() {
*x = ListMyAccountsForCLIResponse{}
mi := &file_orchestrator_v1_plugin_registry_proto_msgTypes[62]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ListMyAccountsResponse) String() string {
func (x *ListMyAccountsForCLIResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListMyAccountsResponse) ProtoMessage() {}
func (*ListMyAccountsForCLIResponse) ProtoMessage() {}
func (x *ListMyAccountsResponse) ProtoReflect() protoreflect.Message {
func (x *ListMyAccountsForCLIResponse) ProtoReflect() protoreflect.Message {
mi := &file_orchestrator_v1_plugin_registry_proto_msgTypes[62]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -3562,12 +3562,12 @@ func (x *ListMyAccountsResponse) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
// Deprecated: Use ListMyAccountsResponse.ProtoReflect.Descriptor instead.
func (*ListMyAccountsResponse) Descriptor() ([]byte, []int) {
// Deprecated: Use ListMyAccountsForCLIResponse.ProtoReflect.Descriptor instead.
func (*ListMyAccountsForCLIResponse) Descriptor() ([]byte, []int) {
return file_orchestrator_v1_plugin_registry_proto_rawDescGZIP(), []int{62}
}
func (x *ListMyAccountsResponse) GetAccounts() []*MyAccount {
func (x *ListMyAccountsForCLIResponse) GetAccounts() []*MyAccount {
if x != nil {
return x.Accounts
}
@ -3840,9 +3840,9 @@ const file_orchestrator_v1_plugin_registry_proto_rawDesc = "" +
"\tMyAccount\x12\x0e\n" +
"\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" +
"\x04slug\x18\x02 \x01(\tR\x04slug\x12\x12\n" +
"\x04name\x18\x03 \x01(\tR\x04name\"\x17\n" +
"\x15ListMyAccountsRequest\"P\n" +
"\x16ListMyAccountsResponse\x126\n" +
"\x04name\x18\x03 \x01(\tR\x04name\"\x1d\n" +
"\x1bListMyAccountsForCLIRequest\"V\n" +
"\x1cListMyAccountsForCLIResponse\x126\n" +
"\baccounts\x18\x01 \x03(\v2\x1a.orchestrator.v1.MyAccountR\baccounts*\xd8\x01\n" +
"\x10PluginVisibility\x12!\n" +
"\x1dPLUGIN_VISIBILITY_UNSPECIFIED\x10\x00\x12\x1d\n" +
@ -3875,7 +3875,7 @@ const file_orchestrator_v1_plugin_registry_proto_rawDesc = "" +
"\x10RejectSubmission\x12(.orchestrator.v1.RejectSubmissionRequest\x1a).orchestrator.v1.RejectSubmissionResponse\x12a\n" +
"\x0eRequestChanges\x12&.orchestrator.v1.RequestChangesRequest\x1a'.orchestrator.v1.RequestChangesResponse2y\n" +
"\x14PluginPublishService\x12a\n" +
"\x0ePublishVersion\x12&.orchestrator.v1.PublishVersionRequest\x1a'.orchestrator.v1.PublishVersionResponse2\x8f\x05\n" +
"\x0ePublishVersion\x12&.orchestrator.v1.PublishVersionRequest\x1a'.orchestrator.v1.PublishVersionResponse2\xa1\x05\n" +
"\x11PluginAuthService\x12X\n" +
"\vStartDevice\x12#.orchestrator.v1.StartDeviceRequest\x1a$.orchestrator.v1.StartDeviceResponse\x12U\n" +
"\n" +
@ -3884,8 +3884,8 @@ const file_orchestrator_v1_plugin_registry_proto_rawDesc = "" +
"\n" +
"DenyDevice\x12\".orchestrator.v1.DenyDeviceRequest\x1a#.orchestrator.v1.DenyDeviceResponse\x12d\n" +
"\x0fGetDeviceStatus\x12'.orchestrator.v1.GetDeviceStatusRequest\x1a(.orchestrator.v1.GetDeviceStatusResponse\x12I\n" +
"\x06Whoami\x12\x1e.orchestrator.v1.WhoamiRequest\x1a\x1f.orchestrator.v1.WhoamiResponse\x12a\n" +
"\x0eListMyAccounts\x12&.orchestrator.v1.ListMyAccountsRequest\x1a'.orchestrator.v1.ListMyAccountsResponseB\xd6\x01\n" +
"\x06Whoami\x12\x1e.orchestrator.v1.WhoamiRequest\x1a\x1f.orchestrator.v1.WhoamiResponse\x12s\n" +
"\x14ListMyAccountsForCLI\x12,.orchestrator.v1.ListMyAccountsForCLIRequest\x1a-.orchestrator.v1.ListMyAccountsForCLIResponseB\xd6\x01\n" +
"\x13com.orchestrator.v1B\x13PluginRegistryProtoP\x01ZMgit.dev.alexdunmow.com/block/core/internal/api/orchestrator/v1;orchestratorv1\xa2\x02\x03OXX\xaa\x02\x0fOrchestrator.V1\xca\x02\x0fOrchestrator\\V1\xe2\x02\x1bOrchestrator\\V1\\GPBMetadata\xea\x02\x10Orchestrator::V1b\x06proto3"
var (
@ -3965,8 +3965,8 @@ var file_orchestrator_v1_plugin_registry_proto_goTypes = []any{
(*WhoamiRequest)(nil), // 59: orchestrator.v1.WhoamiRequest
(*WhoamiResponse)(nil), // 60: orchestrator.v1.WhoamiResponse
(*MyAccount)(nil), // 61: orchestrator.v1.MyAccount
(*ListMyAccountsRequest)(nil), // 62: orchestrator.v1.ListMyAccountsRequest
(*ListMyAccountsResponse)(nil), // 63: orchestrator.v1.ListMyAccountsResponse
(*ListMyAccountsForCLIRequest)(nil), // 62: orchestrator.v1.ListMyAccountsForCLIRequest
(*ListMyAccountsForCLIResponse)(nil), // 63: orchestrator.v1.ListMyAccountsForCLIResponse
nil, // 64: orchestrator.v1.GetPluginResponse.ChannelsEntry
nil, // 65: orchestrator.v1.PrivatePluginSummary.ChannelVersionsEntry
(*timestamppb.Timestamp)(nil), // 66: google.protobuf.Timestamp
@ -3998,7 +3998,7 @@ var file_orchestrator_v1_plugin_registry_proto_depIdxs = []int32{
66, // 23: orchestrator.v1.PendingReview.submitted_at:type_name -> google.protobuf.Timestamp
36, // 24: orchestrator.v1.ListPendingReviewsResponse.reviews:type_name -> orchestrator.v1.PendingReview
4, // 25: orchestrator.v1.PublishVersionResponse.version:type_name -> orchestrator.v1.Version
61, // 26: orchestrator.v1.ListMyAccountsResponse.accounts:type_name -> orchestrator.v1.MyAccount
61, // 26: orchestrator.v1.ListMyAccountsForCLIResponse.accounts:type_name -> orchestrator.v1.MyAccount
6, // 27: orchestrator.v1.PluginScopeService.CreateScope:input_type -> orchestrator.v1.CreateScopeRequest
8, // 28: orchestrator.v1.PluginScopeService.ListMyScopes:input_type -> orchestrator.v1.ListMyScopesRequest
10, // 29: orchestrator.v1.PluginScopeService.GetScope:input_type -> orchestrator.v1.GetScopeRequest
@ -4025,7 +4025,7 @@ var file_orchestrator_v1_plugin_registry_proto_depIdxs = []int32{
55, // 50: orchestrator.v1.PluginAuthService.DenyDevice:input_type -> orchestrator.v1.DenyDeviceRequest
57, // 51: orchestrator.v1.PluginAuthService.GetDeviceStatus:input_type -> orchestrator.v1.GetDeviceStatusRequest
59, // 52: orchestrator.v1.PluginAuthService.Whoami:input_type -> orchestrator.v1.WhoamiRequest
62, // 53: orchestrator.v1.PluginAuthService.ListMyAccounts:input_type -> orchestrator.v1.ListMyAccountsRequest
62, // 53: orchestrator.v1.PluginAuthService.ListMyAccountsForCLI:input_type -> orchestrator.v1.ListMyAccountsForCLIRequest
7, // 54: orchestrator.v1.PluginScopeService.CreateScope:output_type -> orchestrator.v1.CreateScopeResponse
9, // 55: orchestrator.v1.PluginScopeService.ListMyScopes:output_type -> orchestrator.v1.ListMyScopesResponse
11, // 56: orchestrator.v1.PluginScopeService.GetScope:output_type -> orchestrator.v1.GetScopeResponse
@ -4052,7 +4052,7 @@ var file_orchestrator_v1_plugin_registry_proto_depIdxs = []int32{
56, // 77: orchestrator.v1.PluginAuthService.DenyDevice:output_type -> orchestrator.v1.DenyDeviceResponse
58, // 78: orchestrator.v1.PluginAuthService.GetDeviceStatus:output_type -> orchestrator.v1.GetDeviceStatusResponse
60, // 79: orchestrator.v1.PluginAuthService.Whoami:output_type -> orchestrator.v1.WhoamiResponse
63, // 80: orchestrator.v1.PluginAuthService.ListMyAccounts:output_type -> orchestrator.v1.ListMyAccountsResponse
63, // 80: orchestrator.v1.PluginAuthService.ListMyAccountsForCLI:output_type -> orchestrator.v1.ListMyAccountsForCLIResponse
54, // [54:81] is the sub-list for method output_type
27, // [27:54] is the sub-list for method input_type
27, // [27:27] is the sub-list for extension type_name

2
proto

@ -1 +1 @@
Subproject commit 89fa72ad116b16cb7fbb3183d2d9037d9b742ed3
Subproject commit 6d6445f74ec8152c0458257adf1f406d8ce8e68a