api

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2016 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package api is a generated protocol buffer package.

It is generated from these files:

dfss/dfssp/api/platform.proto

It has these top-level messages:

RegisterRequest
ErrorCode
AuthRequest
RegisteredUser
Empty
PostContractRequest
GetContractRequest
Contract
JoinSignatureRequest
UserConnected
User
ReadySignRequest
LaunchSignature

Index

Constants

This section is empty.

Variables

View Source
var ErrorCode_Code_name = map[int32]string{
	0:  "SUCCESS",
	1:  "INVARG",
	2:  "BADAUTH",
	3:  "WARNING",
	-1: "INTERR",
	-2: "TIMEOUT",
}
View Source
var ErrorCode_Code_value = map[string]int32{
	"SUCCESS": 0,
	"INVARG":  1,
	"BADAUTH": 2,
	"WARNING": 3,
	"INTERR":  -1,
	"TIMEOUT": -2,
}

Functions

func RegisterPlatformServer

func RegisterPlatformServer(s *grpc.Server, srv PlatformServer)

Types

type AuthRequest

type AuthRequest struct {
	// / User email
	Email string `protobuf:"bytes,1,opt,name=email" json:"email,omitempty"`
	// / User authentication token
	Token string `protobuf:"bytes,2,opt,name=token" json:"token,omitempty"`
}

func (*AuthRequest) Descriptor

func (*AuthRequest) Descriptor() ([]byte, []int)

func (*AuthRequest) ProtoMessage

func (*AuthRequest) ProtoMessage()

func (*AuthRequest) Reset

func (m *AuthRequest) Reset()

func (*AuthRequest) String

func (m *AuthRequest) String() string

type Contract

type Contract struct {
	// / The result code
	ErrorCode *ErrorCode `protobuf:"bytes,1,opt,name=errorCode" json:"errorCode,omitempty"`
	// / 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"`
}

/ The fetched contract when using GetContract

func (*Contract) Descriptor

func (*Contract) Descriptor() ([]byte, []int)

func (*Contract) GetErrorCode

func (m *Contract) GetErrorCode() *ErrorCode

func (*Contract) ProtoMessage

func (*Contract) ProtoMessage()

func (*Contract) Reset

func (m *Contract) Reset()

func (*Contract) String

func (m *Contract) String() string

type Empty

type Empty struct {
}

/ An empty message, used when no parameters are required for a query or an answer.

func (*Empty) Descriptor

func (*Empty) Descriptor() ([]byte, []int)

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) Reset

func (m *Empty) Reset()

func (*Empty) String

func (m *Empty) String() string

type ErrorCode

type ErrorCode struct {
	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"`
}

/ ErrorCode message contains an error code and a message.

Above or zero : target-side error

Less than 0 : local error

func (*ErrorCode) Descriptor

func (*ErrorCode) Descriptor() ([]byte, []int)

func (*ErrorCode) ProtoMessage

func (*ErrorCode) ProtoMessage()

func (*ErrorCode) Reset

func (m *ErrorCode) Reset()

func (*ErrorCode) String

func (m *ErrorCode) String() string

type ErrorCode_Code

type ErrorCode_Code int32
const (
	// / the error code for a successful request
	ErrorCode_SUCCESS ErrorCode_Code = 0
	// / the error code for an invalid argument
	ErrorCode_INVARG ErrorCode_Code = 1
	// / the error code for a bad authentication
	ErrorCode_BADAUTH ErrorCode_Code = 2
	// / the error code for a success state containing a specific warning message
	ErrorCode_WARNING ErrorCode_Code = 3
	// / the error code for an internal server error
	ErrorCode_INTERR ErrorCode_Code = -1
	// / the error code for a timeout or unreacheable target
	ErrorCode_TIMEOUT ErrorCode_Code = -2
)

func (ErrorCode_Code) EnumDescriptor

func (ErrorCode_Code) EnumDescriptor() ([]byte, []int)

func (ErrorCode_Code) String

func (x ErrorCode_Code) String() string

type GetContractRequest

type GetContractRequest struct {
	// / UUID of the requested contract
	Uuid string `protobuf:"bytes,1,opt,name=uuid" json:"uuid,omitempty"`
}

func (*GetContractRequest) Descriptor

func (*GetContractRequest) Descriptor() ([]byte, []int)

func (*GetContractRequest) ProtoMessage

func (*GetContractRequest) ProtoMessage()

func (*GetContractRequest) Reset

func (m *GetContractRequest) Reset()

func (*GetContractRequest) String

func (m *GetContractRequest) String() string

type JoinSignatureRequest

type JoinSignatureRequest struct {
	// / The contract UUID to join
	ContractUuid string `protobuf:"bytes,1,opt,name=contractUuid" json:"contractUuid,omitempty"`
	// / The open port for P2P communication of the client
	Port uint32 `protobuf:"varint,2,opt,name=port" json:"port,omitempty"`
	// / The offered ips for P2P communication of the client
	Ip []string `protobuf:"bytes,3,rep,name=ip" json:"ip,omitempty"`
}

func (*JoinSignatureRequest) Descriptor

func (*JoinSignatureRequest) Descriptor() ([]byte, []int)

func (*JoinSignatureRequest) ProtoMessage

func (*JoinSignatureRequest) ProtoMessage()

func (*JoinSignatureRequest) Reset

func (m *JoinSignatureRequest) Reset()

func (*JoinSignatureRequest) String

func (m *JoinSignatureRequest) String() string

type LaunchSignature

type LaunchSignature struct {
	// / 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"`
	// / The SHA-512 hash of the contract document
	DocumentHash []byte `protobuf:"bytes,3,opt,name=documentHash,proto3" json:"documentHash,omitempty"`
	// / A confirmation of client hashes for communication authentication
	KeyHash [][]byte `protobuf:"bytes,4,rep,name=keyHash,proto3" json:"keyHash,omitempty"`
	// / The signing sequence generated on-the-fly by the platform
	Sequence []uint32 `protobuf:"varint,5,rep,name=sequence" json:"sequence,omitempty"`
	// / 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"`
	// / The cryptographic object of the signature of this structure (seal and errorCode excepted) by the platform, for data certification.
	// / The signature is computed using auth.SignStructure function:
	// / PKCS1v15 + SHA512 hash of the string representation of the structure
	Seal []byte `protobuf:"bytes,10,opt,name=seal,proto3" json:"seal,omitempty"`
}

/ LaunchSignature is emitted by the platform when every signers of a specific contract are ready.

func (*LaunchSignature) Descriptor

func (*LaunchSignature) Descriptor() ([]byte, []int)

func (*LaunchSignature) GetErrorCode

func (m *LaunchSignature) GetErrorCode() *ErrorCode

func (*LaunchSignature) GetTtp added in v0.3.0

func (m *LaunchSignature) GetTtp() *LaunchSignature_TTP

func (*LaunchSignature) ProtoMessage

func (*LaunchSignature) ProtoMessage()

func (*LaunchSignature) Reset

func (m *LaunchSignature) Reset()

func (*LaunchSignature) String

func (m *LaunchSignature) String() string

type LaunchSignature_TTP added in v0.3.0

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"`
}

/ TTP is the ttp associated to this signature, that should be contacted in case of error

func (*LaunchSignature_TTP) Descriptor added in v0.3.0

func (*LaunchSignature_TTP) Descriptor() ([]byte, []int)

func (*LaunchSignature_TTP) ProtoMessage added in v0.3.0

func (*LaunchSignature_TTP) ProtoMessage()

func (*LaunchSignature_TTP) Reset added in v0.3.0

func (m *LaunchSignature_TTP) Reset()

func (*LaunchSignature_TTP) String added in v0.3.0

func (m *LaunchSignature_TTP) String() string

type PlatformClient

type PlatformClient interface {
	// / Register a new user, no authentication required.
	Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*ErrorCode, error)
	// / Authenticate a previously registered user, no authentication required.
	Auth(ctx context.Context, in *AuthRequest, opts ...grpc.CallOption) (*RegisteredUser, error)
	// / Unregister a new user, authentication required.
	Unregister(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ErrorCode, error)
	// / Create a new contract, authentication required.
	PostContract(ctx context.Context, in *PostContractRequest, opts ...grpc.CallOption) (*ErrorCode, error)
	// / Fetch a previously create contract, authentication required.
	GetContract(ctx context.Context, in *GetContractRequest, opts ...grpc.CallOption) (*Contract, error)
	// / Join a signature discovery room, authentication required.
	// The stream is triggered for each new user connected in this channel.
	JoinSignature(ctx context.Context, in *JoinSignatureRequest, opts ...grpc.CallOption) (Platform_JoinSignatureClient, error)
	// / 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.
	ReadySign(ctx context.Context, in *ReadySignRequest, opts ...grpc.CallOption) (*LaunchSignature, error)
}

func NewPlatformClient

func NewPlatformClient(cc *grpc.ClientConn) PlatformClient

type PlatformServer

type PlatformServer interface {
	// / Register a new user, no authentication required.
	Register(context.Context, *RegisterRequest) (*ErrorCode, error)
	// / Authenticate a previously registered user, no authentication required.
	Auth(context.Context, *AuthRequest) (*RegisteredUser, error)
	// / Unregister a new user, authentication required.
	Unregister(context.Context, *Empty) (*ErrorCode, error)
	// / Create a new contract, authentication required.
	PostContract(context.Context, *PostContractRequest) (*ErrorCode, error)
	// / Fetch a previously create contract, authentication required.
	GetContract(context.Context, *GetContractRequest) (*Contract, error)
	// / Join a signature discovery room, authentication required.
	// The stream is triggered for each new user connected in this channel.
	JoinSignature(*JoinSignatureRequest, Platform_JoinSignatureServer) error
	// / 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.
	ReadySign(context.Context, *ReadySignRequest) (*LaunchSignature, error)
}

type Platform_JoinSignatureClient

type Platform_JoinSignatureClient interface {
	Recv() (*UserConnected, error)
	grpc.ClientStream
}

type Platform_JoinSignatureServer

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

type PostContractRequest

type PostContractRequest struct {
	// / 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"`
}

func (*PostContractRequest) Descriptor

func (*PostContractRequest) Descriptor() ([]byte, []int)

func (*PostContractRequest) ProtoMessage

func (*PostContractRequest) ProtoMessage()

func (*PostContractRequest) Reset

func (m *PostContractRequest) Reset()

func (*PostContractRequest) String

func (m *PostContractRequest) String() string

type ReadySignRequest

type ReadySignRequest struct {
	// / The contract UUID to be ready for
	ContractUuid string `protobuf:"bytes,1,opt,name=contractUuid" json:"contractUuid,omitempty"`
}

func (*ReadySignRequest) Descriptor

func (*ReadySignRequest) Descriptor() ([]byte, []int)

func (*ReadySignRequest) ProtoMessage

func (*ReadySignRequest) ProtoMessage()

func (*ReadySignRequest) Reset

func (m *ReadySignRequest) Reset()

func (*ReadySignRequest) String

func (m *ReadySignRequest) String() string

type RegisterRequest

type RegisterRequest struct {
	// / User mail
	Email string `protobuf:"bytes,1,opt,name=email" json:"email,omitempty"`
	// / Certificate request (CSR) as PEM
	Request string `protobuf:"bytes,2,opt,name=request" json:"request,omitempty"`
}

func (*RegisterRequest) Descriptor

func (*RegisterRequest) Descriptor() ([]byte, []int)

func (*RegisterRequest) ProtoMessage

func (*RegisterRequest) ProtoMessage()

func (*RegisterRequest) Reset

func (m *RegisterRequest) Reset()

func (*RegisterRequest) String

func (m *RegisterRequest) String() string

type RegisteredUser

type RegisteredUser struct {
	// / User certificate, as generated by the platform (PEM)
	ClientCert string `protobuf:"bytes,1,opt,name=clientCert" json:"clientCert,omitempty"`
}

func (*RegisteredUser) Descriptor

func (*RegisteredUser) Descriptor() ([]byte, []int)

func (*RegisteredUser) ProtoMessage

func (*RegisteredUser) ProtoMessage()

func (*RegisteredUser) Reset

func (m *RegisteredUser) Reset()

func (*RegisteredUser) String

func (m *RegisteredUser) String() string

type User

type User struct {
	// / The certificate hash of the user
	KeyHash []byte `protobuf:"bytes,1,opt,name=keyHash,proto3" json:"keyHash,omitempty"`
	Email   string `protobuf:"bytes,2,opt,name=email" json:"email,omitempty"`
	// / The IP offered by the user for P2P
	Ip []string `protobuf:"bytes,3,rep,name=ip" json:"ip,omitempty"`
	// / The port offered by the user for P2P
	Port uint32 `protobuf:"varint,4,opt,name=port" json:"port,omitempty"`
}

func (*User) Descriptor

func (*User) Descriptor() ([]byte, []int)

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (*User) Reset

func (m *User) Reset()

func (*User) String

func (m *User) String() string

type UserConnected

type UserConnected struct {
	// / 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"`
}

/ 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.

func (*UserConnected) Descriptor

func (*UserConnected) Descriptor() ([]byte, []int)

func (*UserConnected) GetErrorCode

func (m *UserConnected) GetErrorCode() *ErrorCode

func (*UserConnected) GetUser

func (m *UserConnected) GetUser() *User

func (*UserConnected) ProtoMessage

func (*UserConnected) ProtoMessage()

func (*UserConnected) Reset

func (m *UserConnected) Reset()

func (*UserConnected) String

func (m *UserConnected) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL