feat(BRIDGE-424): FIDO2 GUI support.
This commit is contained in:
@ -87,8 +87,7 @@ func withClientConn(ctx context.Context, settingsPath string, fn func(context.Co
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
cc, err := grpc.DialContext(
|
||||
ctx,
|
||||
cc, err := grpc.NewClient(
|
||||
net.JoinHostPort(Host, fmt.Sprint(config.Port)),
|
||||
grpc.WithTransportCredentials(insecure.NewCredentials()),
|
||||
)
|
||||
|
||||
@ -17,8 +17,8 @@
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.31.0
|
||||
// protoc v3.21.12
|
||||
// protoc-gen-go v1.36.6
|
||||
// protoc v5.29.5
|
||||
// source: focus.proto
|
||||
|
||||
package proto
|
||||
@ -30,6 +30,7 @@ import (
|
||||
wrapperspb "google.golang.org/protobuf/types/known/wrapperspb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
@ -40,20 +41,17 @@ const (
|
||||
)
|
||||
|
||||
type VersionResponse struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *VersionResponse) Reset() {
|
||||
*x = VersionResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_focus_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
mi := &file_focus_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *VersionResponse) String() string {
|
||||
@ -64,7 +62,7 @@ func (*VersionResponse) ProtoMessage() {}
|
||||
|
||||
func (x *VersionResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_focus_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@ -88,44 +86,29 @@ func (x *VersionResponse) GetVersion() string {
|
||||
|
||||
var File_focus_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_focus_proto_rawDesc = []byte{
|
||||
0x0a, 0x0b, 0x66, 0x6f, 0x63, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x66,
|
||||
0x6f, 0x63, 0x75, 0x73, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
|
||||
0x75, 0x66, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x22, 0x2b, 0x0a, 0x0f, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70,
|
||||
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18,
|
||||
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x32, 0x81,
|
||||
0x01, 0x0a, 0x05, 0x46, 0x6f, 0x63, 0x75, 0x73, 0x12, 0x3d, 0x0a, 0x05, 0x52, 0x61, 0x69, 0x73,
|
||||
0x65, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x1a,
|
||||
0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
|
||||
0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x39, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69,
|
||||
0x6f, 0x6e, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x16, 0x2e, 0x66, 0x6f, 0x63,
|
||||
0x75, 0x73, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
||||
0x73, 0x65, 0x42, 0x3d, 0x5a, 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,
|
||||
0x2f, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x4d, 0x61, 0x69, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x6e, 0x2d, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2f, 0x76, 0x33, 0x2f, 0x69, 0x6e, 0x74,
|
||||
0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x66, 0x6f, 0x63, 0x75, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
const file_focus_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\vfocus.proto\x12\x05focus\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1egoogle/protobuf/wrappers.proto\"+\n" +
|
||||
"\x0fVersionResponse\x12\x18\n" +
|
||||
"\aversion\x18\x01 \x01(\tR\aversion2\x81\x01\n" +
|
||||
"\x05Focus\x12=\n" +
|
||||
"\x05Raise\x12\x1c.google.protobuf.StringValue\x1a\x16.google.protobuf.Empty\x129\n" +
|
||||
"\aVersion\x12\x16.google.protobuf.Empty\x1a\x16.focus.VersionResponseB=Z;github.com/ProtonMail/proton-bridge/v3/internal/focus/protob\x06proto3"
|
||||
|
||||
var (
|
||||
file_focus_proto_rawDescOnce sync.Once
|
||||
file_focus_proto_rawDescData = file_focus_proto_rawDesc
|
||||
file_focus_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_focus_proto_rawDescGZIP() []byte {
|
||||
file_focus_proto_rawDescOnce.Do(func() {
|
||||
file_focus_proto_rawDescData = protoimpl.X.CompressGZIP(file_focus_proto_rawDescData)
|
||||
file_focus_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_focus_proto_rawDesc), len(file_focus_proto_rawDesc)))
|
||||
})
|
||||
return file_focus_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_focus_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_focus_proto_goTypes = []interface{}{
|
||||
var file_focus_proto_goTypes = []any{
|
||||
(*VersionResponse)(nil), // 0: focus.VersionResponse
|
||||
(*wrapperspb.StringValue)(nil), // 1: google.protobuf.StringValue
|
||||
(*emptypb.Empty)(nil), // 2: google.protobuf.Empty
|
||||
@ -147,25 +130,11 @@ func file_focus_proto_init() {
|
||||
if File_focus_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_focus_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*VersionResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_focus_proto_rawDesc,
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_focus_proto_rawDesc), len(file_focus_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
@ -176,7 +145,6 @@ func file_focus_proto_init() {
|
||||
MessageInfos: file_focus_proto_msgTypes,
|
||||
}.Build()
|
||||
File_focus_proto = out.File
|
||||
file_focus_proto_rawDesc = nil
|
||||
file_focus_proto_goTypes = nil
|
||||
file_focus_proto_depIdxs = nil
|
||||
}
|
||||
|
||||
@ -17,8 +17,8 @@
|
||||
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.3.0
|
||||
// - protoc v3.21.12
|
||||
// - protoc-gen-go-grpc v1.5.1
|
||||
// - protoc v5.29.5
|
||||
// source: focus.proto
|
||||
|
||||
package proto
|
||||
@ -34,8 +34,8 @@ import (
|
||||
|
||||
// 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.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
Focus_Raise_FullMethodName = "/focus.Focus/Raise"
|
||||
@ -45,6 +45,12 @@ const (
|
||||
// FocusClient is the client API for Focus 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.
|
||||
//
|
||||
// **********************************************************************************************************************
|
||||
//
|
||||
// Service Declaration
|
||||
//
|
||||
// **********************************************************************************************************************≠––
|
||||
type FocusClient interface {
|
||||
Raise(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
Version(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*VersionResponse, error)
|
||||
@ -59,8 +65,9 @@ func NewFocusClient(cc grpc.ClientConnInterface) FocusClient {
|
||||
}
|
||||
|
||||
func (c *focusClient) Raise(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, Focus_Raise_FullMethodName, in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, Focus_Raise_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -68,8 +75,9 @@ func (c *focusClient) Raise(ctx context.Context, in *wrapperspb.StringValue, opt
|
||||
}
|
||||
|
||||
func (c *focusClient) Version(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*VersionResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(VersionResponse)
|
||||
err := c.cc.Invoke(ctx, Focus_Version_FullMethodName, in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, Focus_Version_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -78,16 +86,25 @@ func (c *focusClient) Version(ctx context.Context, in *emptypb.Empty, opts ...gr
|
||||
|
||||
// FocusServer is the server API for Focus service.
|
||||
// All implementations must embed UnimplementedFocusServer
|
||||
// for forward compatibility
|
||||
// for forward compatibility.
|
||||
//
|
||||
// **********************************************************************************************************************
|
||||
//
|
||||
// Service Declaration
|
||||
//
|
||||
// **********************************************************************************************************************≠––
|
||||
type FocusServer interface {
|
||||
Raise(context.Context, *wrapperspb.StringValue) (*emptypb.Empty, error)
|
||||
Version(context.Context, *emptypb.Empty) (*VersionResponse, error)
|
||||
mustEmbedUnimplementedFocusServer()
|
||||
}
|
||||
|
||||
// UnimplementedFocusServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedFocusServer struct {
|
||||
}
|
||||
// UnimplementedFocusServer 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 UnimplementedFocusServer struct{}
|
||||
|
||||
func (UnimplementedFocusServer) Raise(context.Context, *wrapperspb.StringValue) (*emptypb.Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Raise not implemented")
|
||||
@ -96,6 +113,7 @@ func (UnimplementedFocusServer) Version(context.Context, *emptypb.Empty) (*Versi
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Version not implemented")
|
||||
}
|
||||
func (UnimplementedFocusServer) mustEmbedUnimplementedFocusServer() {}
|
||||
func (UnimplementedFocusServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeFocusServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to FocusServer will
|
||||
@ -105,6 +123,13 @@ type UnsafeFocusServer interface {
|
||||
}
|
||||
|
||||
func RegisterFocusServer(s grpc.ServiceRegistrar, srv FocusServer) {
|
||||
// If the following call pancis, it indicates UnimplementedFocusServer 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(&Focus_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user