platform.pb.go 28.2 KB
Newer Older
1
// Code generated by protoc-gen-go.
Caro Axel's avatar
Caro Axel committed
2
// source: dfss/dfssp/api/platform.proto
3 4 5 6 7 8
// DO NOT EDIT!

/*
Package api is a generated protocol buffer package.

It is generated from these files:
Caro Axel's avatar
Caro Axel committed
9
	dfss/dfssp/api/platform.proto
10 11 12 13 14 15 16 17

It has these top-level messages:
	RegisterRequest
	ErrorCode
	AuthRequest
	RegisteredUser
	Empty
	PostContractRequest
Loïck Bonniot's avatar
Loïck Bonniot committed
18 19
	GetContractRequest
	Contract
20
	JoinSignatureRequest
21
	UserConnected
Loïck Bonniot's avatar
Loïck Bonniot committed
22
	User
23
	ReadySignRequest
24
	LaunchSignature
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
*/
package api

import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"

import (
	context "golang.org/x/net/context"
	grpc "google.golang.org/grpc"
)

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
const _ = proto.ProtoPackageIsVersion1

46 47 48
type ErrorCode_Code int32

const (
Loïck Bonniot's avatar
Loïck Bonniot committed
49
	// / the error code for a successful request
50
	ErrorCode_SUCCESS ErrorCode_Code = 0
Loïck Bonniot's avatar
Loïck Bonniot committed
51
	// / the error code for an invalid argument
52
	ErrorCode_INVARG ErrorCode_Code = 1
Loïck Bonniot's avatar
Loïck Bonniot committed
53
	// / the error code for a bad authentication
54
	ErrorCode_BADAUTH ErrorCode_Code = 2
Loïck Bonniot's avatar
Loïck Bonniot committed
55
	// / the error code for a success state containing a specific warning message
56
	ErrorCode_WARNING ErrorCode_Code = 3
Loïck Bonniot's avatar
Loïck Bonniot committed
57
	// / the error code for an internal server error
58
	ErrorCode_INTERR ErrorCode_Code = -1
Loïck Bonniot's avatar
Loïck Bonniot committed
59
	// / the error code for a timeout or unreacheable target
60
	ErrorCode_TIMEOUT ErrorCode_Code = -2
61 62 63 64 65 66 67 68
)

var ErrorCode_Code_name = map[int32]string{
	0:  "SUCCESS",
	1:  "INVARG",
	2:  "BADAUTH",
	3:  "WARNING",
	-1: "INTERR",
69
	-2: "TIMEOUT",
70 71 72 73 74 75 76
}
var ErrorCode_Code_value = map[string]int32{
	"SUCCESS": 0,
	"INVARG":  1,
	"BADAUTH": 2,
	"WARNING": 3,
	"INTERR":  -1,
77
	"TIMEOUT": -2,
78 79 80 81 82 83 84
}

func (x ErrorCode_Code) String() string {
	return proto.EnumName(ErrorCode_Code_name, int32(x))
}
func (ErrorCode_Code) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{1, 0} }

85
type RegisterRequest struct {
Loïck Bonniot's avatar
Loïck Bonniot committed
86 87 88
	// / User mail
	Email string `protobuf:"bytes,1,opt,name=email" json:"email,omitempty"`
	// / Certificate request (CSR) as PEM
89
	Request string `protobuf:"bytes,2,opt,name=request" json:"request,omitempty"`
90 91 92 93 94 95 96
}

func (m *RegisterRequest) Reset()                    { *m = RegisterRequest{} }
func (m *RegisterRequest) String() string            { return proto.CompactTextString(m) }
func (*RegisterRequest) ProtoMessage()               {}
func (*RegisterRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }

Loïck Bonniot's avatar
Loïck Bonniot committed
97 98
// / ErrorCode message contains an error code and a message.
//
99
// Above or zero : target-side error
Loïck Bonniot's avatar
Loïck Bonniot committed
100
//
101
// Less than 0   : local error
102
type ErrorCode struct {
Loïck Bonniot's avatar
Loïck Bonniot committed
103 104 105
	Code ErrorCode_Code `protobuf:"varint,1,opt,name=code,enum=api.ErrorCode_Code" json:"code,omitempty"`
	// / An additional message, if needed
	Message string `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"`
106 107 108 109 110 111 112 113
}

func (m *ErrorCode) Reset()                    { *m = ErrorCode{} }
func (m *ErrorCode) String() string            { return proto.CompactTextString(m) }
func (*ErrorCode) ProtoMessage()               {}
func (*ErrorCode) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }

type AuthRequest struct {
Loïck Bonniot's avatar
Loïck Bonniot committed
114
	// / User email
115
	Email string `protobuf:"bytes,1,opt,name=email" json:"email,omitempty"`
Loïck Bonniot's avatar
Loïck Bonniot committed
116
	// / User authentication token
117 118 119 120 121 122 123 124 125
	Token string `protobuf:"bytes,2,opt,name=token" json:"token,omitempty"`
}

func (m *AuthRequest) Reset()                    { *m = AuthRequest{} }
func (m *AuthRequest) String() string            { return proto.CompactTextString(m) }
func (*AuthRequest) ProtoMessage()               {}
func (*AuthRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }

type RegisteredUser struct {
Loïck Bonniot's avatar
Loïck Bonniot committed
126
	// / User certificate, as generated by the platform (PEM)
127
	ClientCert string `protobuf:"bytes,1,opt,name=clientCert" json:"clientCert,omitempty"`
128 129 130 131 132 133 134
}

func (m *RegisteredUser) Reset()                    { *m = RegisteredUser{} }
func (m *RegisteredUser) String() string            { return proto.CompactTextString(m) }
func (*RegisteredUser) ProtoMessage()               {}
func (*RegisteredUser) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }

Loïck Bonniot's avatar
Loïck Bonniot committed
135
// / An empty message, used when no parameters are required for a query or an answer.
136 137 138 139 140 141 142 143 144
type Empty struct {
}

func (m *Empty) Reset()                    { *m = Empty{} }
func (m *Empty) String() string            { return proto.CompactTextString(m) }
func (*Empty) ProtoMessage()               {}
func (*Empty) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} }

type PostContractRequest struct {
Loïck Bonniot's avatar
Loïck Bonniot committed
145 146 147 148 149 150 151 152
	// / Contract SHA-512 hash
	Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"`
	// / Contract filename
	Filename string `protobuf:"bytes,2,opt,name=filename" json:"filename,omitempty"`
	// / List of signers emails
	Signer []string `protobuf:"bytes,3,rep,name=signer" json:"signer,omitempty"`
	// / Additional comment
	Comment string `protobuf:"bytes,4,opt,name=comment" json:"comment,omitempty"`
153 154 155 156 157 158 159
}

func (m *PostContractRequest) Reset()                    { *m = PostContractRequest{} }
func (m *PostContractRequest) String() string            { return proto.CompactTextString(m) }
func (*PostContractRequest) ProtoMessage()               {}
func (*PostContractRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} }

Loïck Bonniot's avatar
Loïck Bonniot committed
160
type GetContractRequest struct {
Loïck Bonniot's avatar
Loïck Bonniot committed
161
	// / UUID of the requested contract
Loïck Bonniot's avatar
Loïck Bonniot committed
162 163 164 165 166 167 168 169
	Uuid string `protobuf:"bytes,1,opt,name=uuid" json:"uuid,omitempty"`
}

func (m *GetContractRequest) Reset()                    { *m = GetContractRequest{} }
func (m *GetContractRequest) String() string            { return proto.CompactTextString(m) }
func (*GetContractRequest) ProtoMessage()               {}
func (*GetContractRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} }

Loïck Bonniot's avatar
Loïck Bonniot committed
170
// / The fetched contract when using GetContract
Loïck Bonniot's avatar
Loïck Bonniot committed
171
type Contract struct {
Loïck Bonniot's avatar
Loïck Bonniot committed
172
	// / The result code
Loïck Bonniot's avatar
Loïck Bonniot committed
173
	ErrorCode *ErrorCode `protobuf:"bytes,1,opt,name=errorCode" json:"errorCode,omitempty"`
Loïck Bonniot's avatar
Loïck Bonniot committed
174 175
	// / The JSON object of the contract, equivalent to the one that was sent by mail to signers
	Json []byte `protobuf:"bytes,2,opt,name=json,proto3" json:"json,omitempty"`
Loïck Bonniot's avatar
Loïck Bonniot committed
176 177 178 179 180 181 182 183 184 185 186 187 188 189
}

func (m *Contract) Reset()                    { *m = Contract{} }
func (m *Contract) String() string            { return proto.CompactTextString(m) }
func (*Contract) ProtoMessage()               {}
func (*Contract) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} }

func (m *Contract) GetErrorCode() *ErrorCode {
	if m != nil {
		return m.ErrorCode
	}
	return nil
}

190
type JoinSignatureRequest struct {
Loïck Bonniot's avatar
Loïck Bonniot committed
191
	// / The contract UUID to join
192
	ContractUuid string `protobuf:"bytes,1,opt,name=contractUuid" json:"contractUuid,omitempty"`
Loïck Bonniot's avatar
Loïck Bonniot committed
193 194
	// / The open port for P2P communication of the client
	Port uint32 `protobuf:"varint,2,opt,name=port" json:"port,omitempty"`
195 196
	// / The offered ips for P2P communication of the client
	Ip []string `protobuf:"bytes,3,rep,name=ip" json:"ip,omitempty"`
197 198 199 200 201
}

func (m *JoinSignatureRequest) Reset()                    { *m = JoinSignatureRequest{} }
func (m *JoinSignatureRequest) String() string            { return proto.CompactTextString(m) }
func (*JoinSignatureRequest) ProtoMessage()               {}
Loïck Bonniot's avatar
Loïck Bonniot committed
202
func (*JoinSignatureRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} }
203

Loïck Bonniot's avatar
Loïck Bonniot committed
204 205
// / UserConnected is emitted by the platform to the client to announce a new client connection, through a stream.
// Previously connected clients are also emitted one by one just after the beginning of the stream.
206
type UserConnected struct {
Loïck Bonniot's avatar
Loïck Bonniot committed
207 208 209 210 211 212 213
	// / The result code.
	// Very bad if not equals to SUCCESS, in this case the client should close the connection
	ErrorCode *ErrorCode `protobuf:"bytes,1,opt,name=errorCode" json:"errorCode,omitempty"`
	// / A confirmation about the contract UUID
	ContractUuid string `protobuf:"bytes,2,opt,name=contractUuid" json:"contractUuid,omitempty"`
	// / One user connecting to this contract's room
	User *User `protobuf:"bytes,3,opt,name=user" json:"user,omitempty"`
214 215 216 217 218
}

func (m *UserConnected) Reset()                    { *m = UserConnected{} }
func (m *UserConnected) String() string            { return proto.CompactTextString(m) }
func (*UserConnected) ProtoMessage()               {}
Loïck Bonniot's avatar
Loïck Bonniot committed
219
func (*UserConnected) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} }
220 221 222 223 224 225 226 227

func (m *UserConnected) GetErrorCode() *ErrorCode {
	if m != nil {
		return m.ErrorCode
	}
	return nil
}

Loïck Bonniot's avatar
Loïck Bonniot committed
228 229 230 231 232 233 234 235
func (m *UserConnected) GetUser() *User {
	if m != nil {
		return m.User
	}
	return nil
}

type User struct {
Loïck Bonniot's avatar
Loïck Bonniot committed
236
	// / The certificate hash of the user
Loïck Bonniot's avatar
Loïck Bonniot committed
237
	KeyHash []byte `protobuf:"bytes,1,opt,name=keyHash,proto3" json:"keyHash,omitempty"`
238
	Email   string `protobuf:"bytes,2,opt,name=email" json:"email,omitempty"`
Loïck Bonniot's avatar
Loïck Bonniot committed
239
	// / The IP offered by the user for P2P
240
	Ip []string `protobuf:"bytes,3,rep,name=ip" json:"ip,omitempty"`
Loïck Bonniot's avatar
Loïck Bonniot committed
241 242
	// / The port offered by the user for P2P
	Port uint32 `protobuf:"varint,4,opt,name=port" json:"port,omitempty"`
243 244
}

Loïck Bonniot's avatar
Loïck Bonniot committed
245 246 247
func (m *User) Reset()                    { *m = User{} }
func (m *User) String() string            { return proto.CompactTextString(m) }
func (*User) ProtoMessage()               {}
Loïck Bonniot's avatar
Loïck Bonniot committed
248
func (*User) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} }
249

250
type ReadySignRequest struct {
Loïck Bonniot's avatar
Loïck Bonniot committed
251
	// / The contract UUID to be ready for
252 253 254 255 256 257
	ContractUuid string `protobuf:"bytes,1,opt,name=contractUuid" json:"contractUuid,omitempty"`
}

func (m *ReadySignRequest) Reset()                    { *m = ReadySignRequest{} }
func (m *ReadySignRequest) String() string            { return proto.CompactTextString(m) }
func (*ReadySignRequest) ProtoMessage()               {}
Loïck Bonniot's avatar
Loïck Bonniot committed
258
func (*ReadySignRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} }
259

Loïck Bonniot's avatar
Loïck Bonniot committed
260
// / LaunchSignature is emitted by the platform when every signers of a specific contract are ready.
261
type LaunchSignature struct {
Loïck Bonniot's avatar
Loïck Bonniot committed
262 263 264 265
	// / The result code
	ErrorCode *ErrorCode `protobuf:"bytes,1,opt,name=errorCode" json:"errorCode,omitempty"`
	// / The unique signature generated by the platform for this specific signature attempt
	SignatureUuid string `protobuf:"bytes,2,opt,name=signatureUuid" json:"signatureUuid,omitempty"`
266 267
	// / The SHA-512 hash of the contract document
	DocumentHash []byte `protobuf:"bytes,3,opt,name=documentHash,proto3" json:"documentHash,omitempty"`
Loïck Bonniot's avatar
Loïck Bonniot committed
268
	// / A confirmation of client hashes for communication authentication
269
	KeyHash [][]byte `protobuf:"bytes,4,rep,name=keyHash,proto3" json:"keyHash,omitempty"`
Loïck Bonniot's avatar
Loïck Bonniot committed
270
	// / The signing sequence generated on-the-fly by the platform
271
	Sequence []uint32 `protobuf:"varint,5,rep,name=sequence" json:"sequence,omitempty"`
272 273
	// / The ttp can be nil if no ttp is available for this signature
	Ttp *LaunchSignature_TTP `protobuf:"bytes,6,opt,name=ttp" json:"ttp,omitempty"`
274
	// / The cryptographic object of the signature of this structure (seal and errorCode excepted) by the platform, for data certification.
275 276
	// / The signature is computed using auth.SignStructure function:
	// / PKCS1v15 + SHA512 hash of the string representation of the structure
277
	Seal []byte `protobuf:"bytes,10,opt,name=seal,proto3" json:"seal,omitempty"`
278 279 280 281 282
}

func (m *LaunchSignature) Reset()                    { *m = LaunchSignature{} }
func (m *LaunchSignature) String() string            { return proto.CompactTextString(m) }
func (*LaunchSignature) ProtoMessage()               {}
Loïck Bonniot's avatar
Loïck Bonniot committed
283
func (*LaunchSignature) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} }
284 285 286 287 288 289 290

func (m *LaunchSignature) GetErrorCode() *ErrorCode {
	if m != nil {
		return m.ErrorCode
	}
	return nil
}
291

292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309
func (m *LaunchSignature) GetTtp() *LaunchSignature_TTP {
	if m != nil {
		return m.Ttp
	}
	return nil
}

// / TTP is the ttp associated to this signature, that should be contacted in case of error
type LaunchSignature_TTP struct {
	Addrport string `protobuf:"bytes,1,opt,name=addrport" json:"addrport,omitempty"`
	Hash     []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"`
}

func (m *LaunchSignature_TTP) Reset()                    { *m = LaunchSignature_TTP{} }
func (m *LaunchSignature_TTP) String() string            { return proto.CompactTextString(m) }
func (*LaunchSignature_TTP) ProtoMessage()               {}
func (*LaunchSignature_TTP) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12, 0} }

310 311 312 313 314 315 316
func init() {
	proto.RegisterType((*RegisterRequest)(nil), "api.RegisterRequest")
	proto.RegisterType((*ErrorCode)(nil), "api.ErrorCode")
	proto.RegisterType((*AuthRequest)(nil), "api.AuthRequest")
	proto.RegisterType((*RegisteredUser)(nil), "api.RegisteredUser")
	proto.RegisterType((*Empty)(nil), "api.Empty")
	proto.RegisterType((*PostContractRequest)(nil), "api.PostContractRequest")
Loïck Bonniot's avatar
Loïck Bonniot committed
317 318
	proto.RegisterType((*GetContractRequest)(nil), "api.GetContractRequest")
	proto.RegisterType((*Contract)(nil), "api.Contract")
319
	proto.RegisterType((*JoinSignatureRequest)(nil), "api.JoinSignatureRequest")
320
	proto.RegisterType((*UserConnected)(nil), "api.UserConnected")
Loïck Bonniot's avatar
Loïck Bonniot committed
321
	proto.RegisterType((*User)(nil), "api.User")
322
	proto.RegisterType((*ReadySignRequest)(nil), "api.ReadySignRequest")
323
	proto.RegisterType((*LaunchSignature)(nil), "api.LaunchSignature")
324
	proto.RegisterType((*LaunchSignature_TTP)(nil), "api.LaunchSignature.TTP")
325
	proto.RegisterEnum("api.ErrorCode_Code", ErrorCode_Code_name, ErrorCode_Code_value)
326 327 328 329 330 331
}

// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn

Loïck Bonniot's avatar
Loïck Bonniot committed
332 333
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
Loïck Bonniot's avatar
Loïck Bonniot committed
334
const _ = grpc.SupportPackageIsVersion2
Loïck Bonniot's avatar
Loïck Bonniot committed
335

336 337 338
// Client API for Platform service

type PlatformClient interface {
Loïck Bonniot's avatar
Loïck Bonniot committed
339
	// / Register a new user, no authentication required.
340
	Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*ErrorCode, error)
Loïck Bonniot's avatar
Loïck Bonniot committed
341
	// / Authenticate a previously registered user, no authentication required.
342
	Auth(ctx context.Context, in *AuthRequest, opts ...grpc.CallOption) (*RegisteredUser, error)
Loïck Bonniot's avatar
Loïck Bonniot committed
343
	// / Unregister a new user, authentication required.
344
	Unregister(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ErrorCode, error)
Loïck Bonniot's avatar
Loïck Bonniot committed
345
	// / Create a new contract, authentication required.
346
	PostContract(ctx context.Context, in *PostContractRequest, opts ...grpc.CallOption) (*ErrorCode, error)
Loïck Bonniot's avatar
Loïck Bonniot committed
347
	// / Fetch a previously create contract, authentication required.
Loïck Bonniot's avatar
Loïck Bonniot committed
348
	GetContract(ctx context.Context, in *GetContractRequest, opts ...grpc.CallOption) (*Contract, error)
Loïck Bonniot's avatar
Loïck Bonniot committed
349 350
	// / Join a signature discovery room, authentication required.
	// The stream is triggered for each new user connected in this channel.
351
	JoinSignature(ctx context.Context, in *JoinSignatureRequest, opts ...grpc.CallOption) (Platform_JoinSignatureClient, error)
Loïck Bonniot's avatar
Loïck Bonniot committed
352 353 354
	// / Join an ignition room, authentication required.
	// The response is returned when every signer is ready for a specific contract.
	// Warning, can me answered with a very high delay.
355
	ReadySign(ctx context.Context, in *ReadySignRequest, opts ...grpc.CallOption) (*LaunchSignature, error)
356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401
}

type platformClient struct {
	cc *grpc.ClientConn
}

func NewPlatformClient(cc *grpc.ClientConn) PlatformClient {
	return &platformClient{cc}
}

func (c *platformClient) Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*ErrorCode, error) {
	out := new(ErrorCode)
	err := grpc.Invoke(ctx, "/api.Platform/Register", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *platformClient) Auth(ctx context.Context, in *AuthRequest, opts ...grpc.CallOption) (*RegisteredUser, error) {
	out := new(RegisteredUser)
	err := grpc.Invoke(ctx, "/api.Platform/Auth", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *platformClient) Unregister(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ErrorCode, error) {
	out := new(ErrorCode)
	err := grpc.Invoke(ctx, "/api.Platform/Unregister", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *platformClient) PostContract(ctx context.Context, in *PostContractRequest, opts ...grpc.CallOption) (*ErrorCode, error) {
	out := new(ErrorCode)
	err := grpc.Invoke(ctx, "/api.Platform/PostContract", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

Loïck Bonniot's avatar
Loïck Bonniot committed
402 403 404 405 406 407 408 409 410
func (c *platformClient) GetContract(ctx context.Context, in *GetContractRequest, opts ...grpc.CallOption) (*Contract, error) {
	out := new(Contract)
	err := grpc.Invoke(ctx, "/api.Platform/GetContract", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

411 412
func (c *platformClient) JoinSignature(ctx context.Context, in *JoinSignatureRequest, opts ...grpc.CallOption) (Platform_JoinSignatureClient, error) {
	stream, err := grpc.NewClientStream(ctx, &_Platform_serviceDesc.Streams[0], c.cc, "/api.Platform/JoinSignature", opts...)
413 414 415
	if err != nil {
		return nil, err
	}
416 417 418 419 420 421 422 423
	x := &platformJoinSignatureClient{stream}
	if err := x.ClientStream.SendMsg(in); err != nil {
		return nil, err
	}
	if err := x.ClientStream.CloseSend(); err != nil {
		return nil, err
	}
	return x, nil
424 425
}

426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444
type Platform_JoinSignatureClient interface {
	Recv() (*UserConnected, error)
	grpc.ClientStream
}

type platformJoinSignatureClient struct {
	grpc.ClientStream
}

func (x *platformJoinSignatureClient) Recv() (*UserConnected, error) {
	m := new(UserConnected)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

func (c *platformClient) ReadySign(ctx context.Context, in *ReadySignRequest, opts ...grpc.CallOption) (*LaunchSignature, error) {
	out := new(LaunchSignature)
445 446 447 448 449 450 451 452 453 454
	err := grpc.Invoke(ctx, "/api.Platform/ReadySign", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// Server API for Platform service

type PlatformServer interface {
Loïck Bonniot's avatar
Loïck Bonniot committed
455
	// / Register a new user, no authentication required.
456
	Register(context.Context, *RegisterRequest) (*ErrorCode, error)
Loïck Bonniot's avatar
Loïck Bonniot committed
457
	// / Authenticate a previously registered user, no authentication required.
458
	Auth(context.Context, *AuthRequest) (*RegisteredUser, error)
Loïck Bonniot's avatar
Loïck Bonniot committed
459
	// / Unregister a new user, authentication required.
460
	Unregister(context.Context, *Empty) (*ErrorCode, error)
Loïck Bonniot's avatar
Loïck Bonniot committed
461
	// / Create a new contract, authentication required.
462
	PostContract(context.Context, *PostContractRequest) (*ErrorCode, error)
Loïck Bonniot's avatar
Loïck Bonniot committed
463
	// / Fetch a previously create contract, authentication required.
Loïck Bonniot's avatar
Loïck Bonniot committed
464
	GetContract(context.Context, *GetContractRequest) (*Contract, error)
Loïck Bonniot's avatar
Loïck Bonniot committed
465 466
	// / Join a signature discovery room, authentication required.
	// The stream is triggered for each new user connected in this channel.
467
	JoinSignature(*JoinSignatureRequest, Platform_JoinSignatureServer) error
Loïck Bonniot's avatar
Loïck Bonniot committed
468 469 470
	// / Join an ignition room, authentication required.
	// The response is returned when every signer is ready for a specific contract.
	// Warning, can me answered with a very high delay.
471
	ReadySign(context.Context, *ReadySignRequest) (*LaunchSignature, error)
472 473 474 475 476 477
}

func RegisterPlatformServer(s *grpc.Server, srv PlatformServer) {
	s.RegisterService(&_Platform_serviceDesc, srv)
}

Loïck Bonniot's avatar
Loïck Bonniot committed
478
func _Platform_Register_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
479 480 481 482
	in := new(RegisterRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
Loïck Bonniot's avatar
Loïck Bonniot committed
483 484
	if interceptor == nil {
		return srv.(PlatformServer).Register(ctx, in)
485
	}
Loïck Bonniot's avatar
Loïck Bonniot committed
486 487 488 489 490 491 492 493
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/api.Platform/Register",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PlatformServer).Register(ctx, req.(*RegisterRequest))
	}
	return interceptor(ctx, in, info, handler)
494 495
}

Loïck Bonniot's avatar
Loïck Bonniot committed
496
func _Platform_Auth_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
497 498 499 500
	in := new(AuthRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
Loïck Bonniot's avatar
Loïck Bonniot committed
501 502
	if interceptor == nil {
		return srv.(PlatformServer).Auth(ctx, in)
503
	}
Loïck Bonniot's avatar
Loïck Bonniot committed
504 505 506 507 508 509 510 511
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/api.Platform/Auth",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PlatformServer).Auth(ctx, req.(*AuthRequest))
	}
	return interceptor(ctx, in, info, handler)
512 513
}

Loïck Bonniot's avatar
Loïck Bonniot committed
514
func _Platform_Unregister_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
515 516 517 518
	in := new(Empty)
	if err := dec(in); err != nil {
		return nil, err
	}
Loïck Bonniot's avatar
Loïck Bonniot committed
519 520
	if interceptor == nil {
		return srv.(PlatformServer).Unregister(ctx, in)
521
	}
Loïck Bonniot's avatar
Loïck Bonniot committed
522 523 524 525 526 527 528 529
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/api.Platform/Unregister",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PlatformServer).Unregister(ctx, req.(*Empty))
	}
	return interceptor(ctx, in, info, handler)
530 531
}

Loïck Bonniot's avatar
Loïck Bonniot committed
532
func _Platform_PostContract_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
533 534 535 536
	in := new(PostContractRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
Loïck Bonniot's avatar
Loïck Bonniot committed
537 538
	if interceptor == nil {
		return srv.(PlatformServer).PostContract(ctx, in)
539
	}
Loïck Bonniot's avatar
Loïck Bonniot committed
540 541 542 543 544 545 546 547
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/api.Platform/PostContract",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PlatformServer).PostContract(ctx, req.(*PostContractRequest))
	}
	return interceptor(ctx, in, info, handler)
548 549
}

Loïck Bonniot's avatar
Loïck Bonniot committed
550
func _Platform_GetContract_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
Loïck Bonniot's avatar
Loïck Bonniot committed
551 552 553 554
	in := new(GetContractRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
Loïck Bonniot's avatar
Loïck Bonniot committed
555 556
	if interceptor == nil {
		return srv.(PlatformServer).GetContract(ctx, in)
Loïck Bonniot's avatar
Loïck Bonniot committed
557
	}
Loïck Bonniot's avatar
Loïck Bonniot committed
558 559 560 561 562 563 564 565
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/api.Platform/GetContract",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PlatformServer).GetContract(ctx, req.(*GetContractRequest))
	}
	return interceptor(ctx, in, info, handler)
Loïck Bonniot's avatar
Loïck Bonniot committed
566 567
}

568 569 570 571
func _Platform_JoinSignature_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(JoinSignatureRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
572
	}
573 574 575 576 577 578 579 580 581 582 583 584 585 586
	return srv.(PlatformServer).JoinSignature(m, &platformJoinSignatureServer{stream})
}

type Platform_JoinSignatureServer interface {
	Send(*UserConnected) error
	grpc.ServerStream
}

type platformJoinSignatureServer struct {
	grpc.ServerStream
}

func (x *platformJoinSignatureServer) Send(m *UserConnected) error {
	return x.ServerStream.SendMsg(m)
587 588
}

Loïck Bonniot's avatar
Loïck Bonniot committed
589
func _Platform_ReadySign_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
590 591 592 593
	in := new(ReadySignRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
Loïck Bonniot's avatar
Loïck Bonniot committed
594 595
	if interceptor == nil {
		return srv.(PlatformServer).ReadySign(ctx, in)
596
	}
Loïck Bonniot's avatar
Loïck Bonniot committed
597 598 599 600 601 602 603 604
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/api.Platform/ReadySign",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PlatformServer).ReadySign(ctx, req.(*ReadySignRequest))
	}
	return interceptor(ctx, in, info, handler)
605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626
}

var _Platform_serviceDesc = grpc.ServiceDesc{
	ServiceName: "api.Platform",
	HandlerType: (*PlatformServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Register",
			Handler:    _Platform_Register_Handler,
		},
		{
			MethodName: "Auth",
			Handler:    _Platform_Auth_Handler,
		},
		{
			MethodName: "Unregister",
			Handler:    _Platform_Unregister_Handler,
		},
		{
			MethodName: "PostContract",
			Handler:    _Platform_PostContract_Handler,
		},
Loïck Bonniot's avatar
Loïck Bonniot committed
627 628 629 630
		{
			MethodName: "GetContract",
			Handler:    _Platform_GetContract_Handler,
		},
631 632 633 634 635
		{
			MethodName: "ReadySign",
			Handler:    _Platform_ReadySign_Handler,
		},
	},
636 637 638 639 640 641 642
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "JoinSignature",
			Handler:       _Platform_JoinSignature_Handler,
			ServerStreams: true,
		},
	},
643 644 645
}

var fileDescriptor0 = []byte{
646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694
	// 768 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x94, 0x55, 0xdd, 0x6e, 0xd3, 0x4a,
	0x10, 0x4e, 0x62, 0x37, 0x3f, 0x93, 0x26, 0xb5, 0x36, 0x39, 0xe7, 0xf8, 0x44, 0xea, 0x51, 0xb5,
	0x3a, 0x12, 0x55, 0x85, 0x92, 0x2a, 0x08, 0x10, 0xdc, 0xa5, 0x21, 0x6a, 0x8b, 0x4a, 0xa9, 0x36,
	0x09, 0x48, 0x5c, 0x20, 0x19, 0x7b, 0xdb, 0x98, 0x26, 0xb6, 0xd9, 0xdd, 0x08, 0xf5, 0x8e, 0x47,
	0xe0, 0x61, 0x10, 0x8f, 0x07, 0xec, 0xae, 0x7f, 0xe2, 0x84, 0x08, 0xa9, 0xbd, 0x70, 0x77, 0x7e,
	0x76, 0xe6, 0x9b, 0x6f, 0x67, 0x26, 0xb0, 0xef, 0x5d, 0x73, 0xde, 0x53, 0x9f, 0xa8, 0xe7, 0x44,
	0x7e, 0x2f, 0x9a, 0x3b, 0xe2, 0x3a, 0x64, 0x8b, 0x6e, 0xc4, 0x42, 0x11, 0x22, 0x43, 0xea, 0xf0,
	0x00, 0xf6, 0x08, 0xbd, 0xf1, 0xb9, 0xa0, 0x8c, 0xd0, 0x4f, 0x4b,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