@zerops/zcli 1.0.0 → 8.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/package.json +12 -7
  2. package/{tools/npm → utils}/binary.js +8 -4
  3. package/{tools/npm → utils}/install.js +0 -0
  4. package/{tools/npm → utils}/run.js +0 -0
  5. package/{tools/npm → utils}/uninstall.js +0 -0
  6. package/.github/workflows/master.yml +0 -36
  7. package/.github/workflows/tag.yml +0 -67
  8. package/.golangci.yaml +0 -58
  9. package/LICENSE +0 -1
  10. package/README.md +0 -2
  11. package/bin/.gitignore +0 -2
  12. package/cmd/deploy.go +0 -65
  13. package/cmd/di.go +0 -65
  14. package/cmd/login.go +0 -48
  15. package/cmd/root.go +0 -70
  16. package/cmd/startVpn.go +0 -59
  17. package/cmd/stopVpn.go +0 -36
  18. package/go.mod +0 -21
  19. package/go.sum +0 -230
  20. package/main.go +0 -13
  21. package/src/command/deploy/handler.go +0 -43
  22. package/src/command/deploy/handler_checkProcess.go +0 -38
  23. package/src/command/deploy/handler_run.go +0 -126
  24. package/src/command/login/handler.go +0 -128
  25. package/src/command/login/handler_parseRestApiError.go +0 -48
  26. package/src/command/startVpn/handler.go +0 -150
  27. package/src/command/startVpn/handler_clean_linux.go +0 -24
  28. package/src/command/startVpn/handler_clean_linux_macos.go +0 -19
  29. package/src/command/startVpn/handler_generateKeys.go +0 -26
  30. package/src/command/startVpn/handler_isVpnAlive.go +0 -23
  31. package/src/command/startVpn/handler_setVpn_linux.go +0 -97
  32. package/src/command/startVpn/handler_setVpn_macos.go +0 -98
  33. package/src/command/startVpn/handler_startVpnClient.go +0 -27
  34. package/src/command/stopVpn/handler.go +0 -55
  35. package/src/command/stopVpn/handler_clean_linux.go +0 -24
  36. package/src/command/stopVpn/handler_clean_linux_macos.go +0 -19
  37. package/src/command/userInfo/handler.go +0 -21
  38. package/src/helpers/cmdRunner/run.go +0 -40
  39. package/src/helpers/grpcErrors.go +0 -40
  40. package/src/helpers/ip.go +0 -11
  41. package/src/service/certReader/handler.go +0 -97
  42. package/src/service/httpClient/handler.go +0 -90
  43. package/src/service/logger/handler.go +0 -32
  44. package/src/service/logger/interface.go +0 -8
  45. package/src/service/params/handler.go +0 -111
  46. package/src/service/storage/handler.go +0 -71
  47. package/src/service/sudoers/handler.go +0 -49
  48. package/src/service/tlsConfig/handler.go +0 -36
  49. package/src/service/zipClient/handler.go +0 -144
  50. package/src/service/zipClient/test/var/www/dir/file2.1.txt +0 -1
  51. package/src/service/zipClient/test/var/www/dir/file2.2.txt +0 -0
  52. package/src/service/zipClient/test/var/www/dir/subDir/file3.1.txt +0 -0
  53. package/src/service/zipClient/test/var/www/dir/subDir/file3.2.txt +0 -0
  54. package/src/service/zipClient/test/var/www/file1.1.txt +0 -0
  55. package/src/service/zipClient/test/zip_test.go +0 -289
  56. package/src/zeropsApiProtocol/build-pb +0 -13
  57. package/src/zeropsApiProtocol/build-pb-generate.go +0 -3
  58. package/src/zeropsApiProtocol/protocol_extra.go +0 -19
  59. package/src/zeropsApiProtocol/zeropsApiProtocol.pb.go +0 -5518
  60. package/src/zeropsApiProtocol/zeropsApiProtocol.proto +0 -819
  61. package/src/zeropsVpnProtocol/build-pb +0 -13
  62. package/src/zeropsVpnProtocol/build-pb-generate.go +0 -3
  63. package/src/zeropsVpnProtocol/protocol_extra.go +0 -45
  64. package/src/zeropsVpnProtocol/zeropsVpnProtocol.pb.go +0 -578
  65. package/src/zeropsVpnProtocol/zeropsVpnProtocol.proto +0 -58
  66. package/tools/gomodrun.go +0 -60
  67. package/tools/install.sh +0 -40
  68. package/tools/npm/match-version.js +0 -12
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- PTYPES=`go list -f '{{ .Dir }}' -m github.com/golang/protobuf`
4
-
5
- protoc \
6
- -I . \
7
- -I ${PTYPES}/ptypes \
8
- --go_out=plugins=grpc,paths=source_relative:. *.proto
9
-
10
- if [ $? -ne 0 ]; then
11
- echo FAIL
12
- exit 1
13
- fi
@@ -1,3 +0,0 @@
1
- package zeropsVpnProtocol
2
-
3
- //go:generate gomodrun /bin/bash build-pb
@@ -1,45 +0,0 @@
1
- package zeropsVpnProtocol
2
-
3
- import (
4
- "time"
5
-
6
- "net"
7
- )
8
-
9
- func FromProtoIP(m *IP) net.IP {
10
- return m.GetAddress()
11
- }
12
-
13
- func ToProtoIP(ip net.IP) *IP {
14
- return &IP{
15
- Address: ip,
16
- }
17
- }
18
-
19
- func ToProtoIpNet(ipNet *net.IPNet) *IPRange {
20
- return &IPRange{
21
- Ip: ipNet.IP,
22
- Mask: ipNet.Mask,
23
- }
24
- }
25
-
26
- func ToProtoTimestamp(t time.Time) *Timestamp {
27
- if t.IsZero() {
28
- return &Timestamp{}
29
- }
30
- return &Timestamp{IsSet: true, Seconds: t.Unix(), Nanos: int32(t.Nanosecond())}
31
- }
32
-
33
- func FromProtoTimestamp(t *Timestamp) time.Time {
34
- if !t.GetIsSet() {
35
- return time.Time{}
36
- }
37
- return time.Unix(t.GetSeconds(), int64(t.GetNanos()))
38
- }
39
-
40
- func FromProtoIPRange(m *IPRange) net.IPNet {
41
- return net.IPNet{
42
- IP: m.GetIp(),
43
- Mask: m.GetMask(),
44
- }
45
- }
@@ -1,578 +0,0 @@
1
- // Code generated by protoc-gen-go. DO NOT EDIT.
2
- // source: zeropsVpnProtocol.proto
3
-
4
- package zeropsVpnProtocol
5
-
6
- import (
7
- context "context"
8
- fmt "fmt"
9
- proto "github.com/golang/protobuf/proto"
10
- grpc "google.golang.org/grpc"
11
- codes "google.golang.org/grpc/codes"
12
- status "google.golang.org/grpc/status"
13
- math "math"
14
- )
15
-
16
- // Reference imports to suppress errors if they are not otherwise used.
17
- var _ = proto.Marshal
18
- var _ = fmt.Errorf
19
- var _ = math.Inf
20
-
21
- // This is a compile-time assertion to ensure that this generated file
22
- // is compatible with the proto package it is being compiled against.
23
- // A compilation error at this line likely means your copy of the
24
- // proto package needs to be updated.
25
- const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
26
-
27
- type ErrorCode int32
28
-
29
- const (
30
- ErrorCode_NO_ERROR ErrorCode = 0
31
- ErrorCode_INTERNAL_SERVER_ERROR ErrorCode = 1
32
- ErrorCode_INSTANCE_NOT_FOUND ErrorCode = 2
33
- ErrorCode_PROXY_IS_FULL ErrorCode = 3
34
- ErrorCode_INVALID_SIGNATURE ErrorCode = 4
35
- ErrorCode_EXPIRED_SIGNATURE ErrorCode = 5
36
- ErrorCode_MAX_PARALLEL_VPN_LIMIT ErrorCode = 6
37
- )
38
-
39
- var ErrorCode_name = map[int32]string{
40
- 0: "NO_ERROR",
41
- 1: "INTERNAL_SERVER_ERROR",
42
- 2: "INSTANCE_NOT_FOUND",
43
- 3: "PROXY_IS_FULL",
44
- 4: "INVALID_SIGNATURE",
45
- 5: "EXPIRED_SIGNATURE",
46
- 6: "MAX_PARALLEL_VPN_LIMIT",
47
- }
48
-
49
- var ErrorCode_value = map[string]int32{
50
- "NO_ERROR": 0,
51
- "INTERNAL_SERVER_ERROR": 1,
52
- "INSTANCE_NOT_FOUND": 2,
53
- "PROXY_IS_FULL": 3,
54
- "INVALID_SIGNATURE": 4,
55
- "EXPIRED_SIGNATURE": 5,
56
- "MAX_PARALLEL_VPN_LIMIT": 6,
57
- }
58
-
59
- func (x ErrorCode) String() string {
60
- return proto.EnumName(ErrorCode_name, int32(x))
61
- }
62
-
63
- func (ErrorCode) EnumDescriptor() ([]byte, []int) {
64
- return fileDescriptor_4e2851e98e674814, []int{0}
65
- }
66
-
67
- type Error struct {
68
- Code ErrorCode `protobuf:"varint,1,opt,name=code,proto3,enum=zeropsVpnProtocol.ErrorCode" json:"code,omitempty" yaml:"code"`
69
- Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty" yaml:"message"`
70
- XXX_NoUnkeyedLiteral struct{} `json:"-" yaml:"-"`
71
- XXX_unrecognized []byte `json:"-" yaml:"-"`
72
- XXX_sizecache int32 `json:"-" yaml:"-"`
73
- }
74
-
75
- func (m *Error) Reset() { *m = Error{} }
76
- func (m *Error) String() string { return proto.CompactTextString(m) }
77
- func (*Error) ProtoMessage() {}
78
- func (*Error) Descriptor() ([]byte, []int) {
79
- return fileDescriptor_4e2851e98e674814, []int{0}
80
- }
81
-
82
- func (m *Error) XXX_Unmarshal(b []byte) error {
83
- return xxx_messageInfo_Error.Unmarshal(m, b)
84
- }
85
- func (m *Error) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
86
- return xxx_messageInfo_Error.Marshal(b, m, deterministic)
87
- }
88
- func (m *Error) XXX_Merge(src proto.Message) {
89
- xxx_messageInfo_Error.Merge(m, src)
90
- }
91
- func (m *Error) XXX_Size() int {
92
- return xxx_messageInfo_Error.Size(m)
93
- }
94
- func (m *Error) XXX_DiscardUnknown() {
95
- xxx_messageInfo_Error.DiscardUnknown(m)
96
- }
97
-
98
- var xxx_messageInfo_Error proto.InternalMessageInfo
99
-
100
- func (m *Error) GetCode() ErrorCode {
101
- if m != nil {
102
- return m.Code
103
- }
104
- return ErrorCode_NO_ERROR
105
- }
106
-
107
- func (m *Error) GetMessage() string {
108
- if m != nil {
109
- return m.Message
110
- }
111
- return ""
112
- }
113
-
114
- type IP struct {
115
- Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty" yaml:"address"`
116
- XXX_NoUnkeyedLiteral struct{} `json:"-" yaml:"-"`
117
- XXX_unrecognized []byte `json:"-" yaml:"-"`
118
- XXX_sizecache int32 `json:"-" yaml:"-"`
119
- }
120
-
121
- func (m *IP) Reset() { *m = IP{} }
122
- func (m *IP) String() string { return proto.CompactTextString(m) }
123
- func (*IP) ProtoMessage() {}
124
- func (*IP) Descriptor() ([]byte, []int) {
125
- return fileDescriptor_4e2851e98e674814, []int{1}
126
- }
127
-
128
- func (m *IP) XXX_Unmarshal(b []byte) error {
129
- return xxx_messageInfo_IP.Unmarshal(m, b)
130
- }
131
- func (m *IP) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
132
- return xxx_messageInfo_IP.Marshal(b, m, deterministic)
133
- }
134
- func (m *IP) XXX_Merge(src proto.Message) {
135
- xxx_messageInfo_IP.Merge(m, src)
136
- }
137
- func (m *IP) XXX_Size() int {
138
- return xxx_messageInfo_IP.Size(m)
139
- }
140
- func (m *IP) XXX_DiscardUnknown() {
141
- xxx_messageInfo_IP.DiscardUnknown(m)
142
- }
143
-
144
- var xxx_messageInfo_IP proto.InternalMessageInfo
145
-
146
- func (m *IP) GetAddress() []byte {
147
- if m != nil {
148
- return m.Address
149
- }
150
- return nil
151
- }
152
-
153
- type IPRange struct {
154
- Ip []byte `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty" yaml:"ip"`
155
- Mask []byte `protobuf:"bytes,2,opt,name=mask,proto3" json:"mask,omitempty" yaml:"mask"`
156
- XXX_NoUnkeyedLiteral struct{} `json:"-" yaml:"-"`
157
- XXX_unrecognized []byte `json:"-" yaml:"-"`
158
- XXX_sizecache int32 `json:"-" yaml:"-"`
159
- }
160
-
161
- func (m *IPRange) Reset() { *m = IPRange{} }
162
- func (m *IPRange) String() string { return proto.CompactTextString(m) }
163
- func (*IPRange) ProtoMessage() {}
164
- func (*IPRange) Descriptor() ([]byte, []int) {
165
- return fileDescriptor_4e2851e98e674814, []int{2}
166
- }
167
-
168
- func (m *IPRange) XXX_Unmarshal(b []byte) error {
169
- return xxx_messageInfo_IPRange.Unmarshal(m, b)
170
- }
171
- func (m *IPRange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
172
- return xxx_messageInfo_IPRange.Marshal(b, m, deterministic)
173
- }
174
- func (m *IPRange) XXX_Merge(src proto.Message) {
175
- xxx_messageInfo_IPRange.Merge(m, src)
176
- }
177
- func (m *IPRange) XXX_Size() int {
178
- return xxx_messageInfo_IPRange.Size(m)
179
- }
180
- func (m *IPRange) XXX_DiscardUnknown() {
181
- xxx_messageInfo_IPRange.DiscardUnknown(m)
182
- }
183
-
184
- var xxx_messageInfo_IPRange proto.InternalMessageInfo
185
-
186
- func (m *IPRange) GetIp() []byte {
187
- if m != nil {
188
- return m.Ip
189
- }
190
- return nil
191
- }
192
-
193
- func (m *IPRange) GetMask() []byte {
194
- if m != nil {
195
- return m.Mask
196
- }
197
- return nil
198
- }
199
-
200
- type Timestamp struct {
201
- IsSet bool `protobuf:"varint,1,opt,name=isSet,proto3" json:"isSet,omitempty" yaml:"isSet"`
202
- Seconds int64 `protobuf:"varint,2,opt,name=seconds,proto3" json:"seconds,omitempty" yaml:"seconds"`
203
- Nanos int32 `protobuf:"varint,3,opt,name=nanos,proto3" json:"nanos,omitempty" yaml:"nanos"`
204
- XXX_NoUnkeyedLiteral struct{} `json:"-" yaml:"-"`
205
- XXX_unrecognized []byte `json:"-" yaml:"-"`
206
- XXX_sizecache int32 `json:"-" yaml:"-"`
207
- }
208
-
209
- func (m *Timestamp) Reset() { *m = Timestamp{} }
210
- func (m *Timestamp) String() string { return proto.CompactTextString(m) }
211
- func (*Timestamp) ProtoMessage() {}
212
- func (*Timestamp) Descriptor() ([]byte, []int) {
213
- return fileDescriptor_4e2851e98e674814, []int{3}
214
- }
215
-
216
- func (m *Timestamp) XXX_Unmarshal(b []byte) error {
217
- return xxx_messageInfo_Timestamp.Unmarshal(m, b)
218
- }
219
- func (m *Timestamp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
220
- return xxx_messageInfo_Timestamp.Marshal(b, m, deterministic)
221
- }
222
- func (m *Timestamp) XXX_Merge(src proto.Message) {
223
- xxx_messageInfo_Timestamp.Merge(m, src)
224
- }
225
- func (m *Timestamp) XXX_Size() int {
226
- return xxx_messageInfo_Timestamp.Size(m)
227
- }
228
- func (m *Timestamp) XXX_DiscardUnknown() {
229
- xxx_messageInfo_Timestamp.DiscardUnknown(m)
230
- }
231
-
232
- var xxx_messageInfo_Timestamp proto.InternalMessageInfo
233
-
234
- func (m *Timestamp) GetIsSet() bool {
235
- if m != nil {
236
- return m.IsSet
237
- }
238
- return false
239
- }
240
-
241
- func (m *Timestamp) GetSeconds() int64 {
242
- if m != nil {
243
- return m.Seconds
244
- }
245
- return 0
246
- }
247
-
248
- func (m *Timestamp) GetNanos() int32 {
249
- if m != nil {
250
- return m.Nanos
251
- }
252
- return 0
253
- }
254
-
255
- type StartVpnRequest struct {
256
- InstanceId string `protobuf:"bytes,1,opt,name=instanceId,proto3" json:"instanceId,omitempty" yaml:"instanceId"`
257
- UserId string `protobuf:"bytes,2,opt,name=userId,proto3" json:"userId,omitempty" yaml:"userId"`
258
- ClientPublicKey string `protobuf:"bytes,3,opt,name=clientPublicKey,proto3" json:"clientPublicKey,omitempty" yaml:"clientPublicKey"`
259
- Signature string `protobuf:"bytes,4,opt,name=signature,proto3" json:"signature,omitempty" yaml:"signature"`
260
- Expiry *Timestamp `protobuf:"bytes,5,opt,name=expiry,proto3" json:"expiry,omitempty" yaml:"expiry"`
261
- XXX_NoUnkeyedLiteral struct{} `json:"-" yaml:"-"`
262
- XXX_unrecognized []byte `json:"-" yaml:"-"`
263
- XXX_sizecache int32 `json:"-" yaml:"-"`
264
- }
265
-
266
- func (m *StartVpnRequest) Reset() { *m = StartVpnRequest{} }
267
- func (m *StartVpnRequest) String() string { return proto.CompactTextString(m) }
268
- func (*StartVpnRequest) ProtoMessage() {}
269
- func (*StartVpnRequest) Descriptor() ([]byte, []int) {
270
- return fileDescriptor_4e2851e98e674814, []int{4}
271
- }
272
-
273
- func (m *StartVpnRequest) XXX_Unmarshal(b []byte) error {
274
- return xxx_messageInfo_StartVpnRequest.Unmarshal(m, b)
275
- }
276
- func (m *StartVpnRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
277
- return xxx_messageInfo_StartVpnRequest.Marshal(b, m, deterministic)
278
- }
279
- func (m *StartVpnRequest) XXX_Merge(src proto.Message) {
280
- xxx_messageInfo_StartVpnRequest.Merge(m, src)
281
- }
282
- func (m *StartVpnRequest) XXX_Size() int {
283
- return xxx_messageInfo_StartVpnRequest.Size(m)
284
- }
285
- func (m *StartVpnRequest) XXX_DiscardUnknown() {
286
- xxx_messageInfo_StartVpnRequest.DiscardUnknown(m)
287
- }
288
-
289
- var xxx_messageInfo_StartVpnRequest proto.InternalMessageInfo
290
-
291
- func (m *StartVpnRequest) GetInstanceId() string {
292
- if m != nil {
293
- return m.InstanceId
294
- }
295
- return ""
296
- }
297
-
298
- func (m *StartVpnRequest) GetUserId() string {
299
- if m != nil {
300
- return m.UserId
301
- }
302
- return ""
303
- }
304
-
305
- func (m *StartVpnRequest) GetClientPublicKey() string {
306
- if m != nil {
307
- return m.ClientPublicKey
308
- }
309
- return ""
310
- }
311
-
312
- func (m *StartVpnRequest) GetSignature() string {
313
- if m != nil {
314
- return m.Signature
315
- }
316
- return ""
317
- }
318
-
319
- func (m *StartVpnRequest) GetExpiry() *Timestamp {
320
- if m != nil {
321
- return m.Expiry
322
- }
323
- return nil
324
- }
325
-
326
- type StartVpnResponse struct {
327
- Error *Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty" yaml:"error"`
328
- Vpn *StartVpnOutDto `protobuf:"bytes,2,opt,name=vpn,proto3" json:"vpn,omitempty" yaml:"vpn"`
329
- XXX_NoUnkeyedLiteral struct{} `json:"-" yaml:"-"`
330
- XXX_unrecognized []byte `json:"-" yaml:"-"`
331
- XXX_sizecache int32 `json:"-" yaml:"-"`
332
- }
333
-
334
- func (m *StartVpnResponse) Reset() { *m = StartVpnResponse{} }
335
- func (m *StartVpnResponse) String() string { return proto.CompactTextString(m) }
336
- func (*StartVpnResponse) ProtoMessage() {}
337
- func (*StartVpnResponse) Descriptor() ([]byte, []int) {
338
- return fileDescriptor_4e2851e98e674814, []int{5}
339
- }
340
-
341
- func (m *StartVpnResponse) XXX_Unmarshal(b []byte) error {
342
- return xxx_messageInfo_StartVpnResponse.Unmarshal(m, b)
343
- }
344
- func (m *StartVpnResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
345
- return xxx_messageInfo_StartVpnResponse.Marshal(b, m, deterministic)
346
- }
347
- func (m *StartVpnResponse) XXX_Merge(src proto.Message) {
348
- xxx_messageInfo_StartVpnResponse.Merge(m, src)
349
- }
350
- func (m *StartVpnResponse) XXX_Size() int {
351
- return xxx_messageInfo_StartVpnResponse.Size(m)
352
- }
353
- func (m *StartVpnResponse) XXX_DiscardUnknown() {
354
- xxx_messageInfo_StartVpnResponse.DiscardUnknown(m)
355
- }
356
-
357
- var xxx_messageInfo_StartVpnResponse proto.InternalMessageInfo
358
-
359
- func (m *StartVpnResponse) GetError() *Error {
360
- if m != nil {
361
- return m.Error
362
- }
363
- return nil
364
- }
365
-
366
- func (m *StartVpnResponse) GetVpn() *StartVpnOutDto {
367
- if m != nil {
368
- return m.Vpn
369
- }
370
- return nil
371
- }
372
-
373
- type StartVpnOutDto struct {
374
- Port int64 `protobuf:"varint,1,opt,name=port,proto3" json:"port,omitempty" yaml:"port"`
375
- ServerPublicKey string `protobuf:"bytes,2,opt,name=serverPublicKey,proto3" json:"serverPublicKey,omitempty" yaml:"serverPublicKey"`
376
- AssignedClientIp *IP `protobuf:"bytes,3,opt,name=assignedClientIp,proto3" json:"assignedClientIp,omitempty" yaml:"assignedClientIp"`
377
- ServerIp *IP `protobuf:"bytes,4,opt,name=serverIp,proto3" json:"serverIp,omitempty" yaml:"serverIp"`
378
- VpnIpRange *IPRange `protobuf:"bytes,5,opt,name=vpnIpRange,proto3" json:"vpnIpRange,omitempty" yaml:"vpnIpRange"`
379
- XXX_NoUnkeyedLiteral struct{} `json:"-" yaml:"-"`
380
- XXX_unrecognized []byte `json:"-" yaml:"-"`
381
- XXX_sizecache int32 `json:"-" yaml:"-"`
382
- }
383
-
384
- func (m *StartVpnOutDto) Reset() { *m = StartVpnOutDto{} }
385
- func (m *StartVpnOutDto) String() string { return proto.CompactTextString(m) }
386
- func (*StartVpnOutDto) ProtoMessage() {}
387
- func (*StartVpnOutDto) Descriptor() ([]byte, []int) {
388
- return fileDescriptor_4e2851e98e674814, []int{6}
389
- }
390
-
391
- func (m *StartVpnOutDto) XXX_Unmarshal(b []byte) error {
392
- return xxx_messageInfo_StartVpnOutDto.Unmarshal(m, b)
393
- }
394
- func (m *StartVpnOutDto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
395
- return xxx_messageInfo_StartVpnOutDto.Marshal(b, m, deterministic)
396
- }
397
- func (m *StartVpnOutDto) XXX_Merge(src proto.Message) {
398
- xxx_messageInfo_StartVpnOutDto.Merge(m, src)
399
- }
400
- func (m *StartVpnOutDto) XXX_Size() int {
401
- return xxx_messageInfo_StartVpnOutDto.Size(m)
402
- }
403
- func (m *StartVpnOutDto) XXX_DiscardUnknown() {
404
- xxx_messageInfo_StartVpnOutDto.DiscardUnknown(m)
405
- }
406
-
407
- var xxx_messageInfo_StartVpnOutDto proto.InternalMessageInfo
408
-
409
- func (m *StartVpnOutDto) GetPort() int64 {
410
- if m != nil {
411
- return m.Port
412
- }
413
- return 0
414
- }
415
-
416
- func (m *StartVpnOutDto) GetServerPublicKey() string {
417
- if m != nil {
418
- return m.ServerPublicKey
419
- }
420
- return ""
421
- }
422
-
423
- func (m *StartVpnOutDto) GetAssignedClientIp() *IP {
424
- if m != nil {
425
- return m.AssignedClientIp
426
- }
427
- return nil
428
- }
429
-
430
- func (m *StartVpnOutDto) GetServerIp() *IP {
431
- if m != nil {
432
- return m.ServerIp
433
- }
434
- return nil
435
- }
436
-
437
- func (m *StartVpnOutDto) GetVpnIpRange() *IPRange {
438
- if m != nil {
439
- return m.VpnIpRange
440
- }
441
- return nil
442
- }
443
-
444
- func init() {
445
- proto.RegisterEnum("zeropsVpnProtocol.ErrorCode", ErrorCode_name, ErrorCode_value)
446
- proto.RegisterType((*Error)(nil), "zeropsVpnProtocol.error")
447
- proto.RegisterType((*IP)(nil), "zeropsVpnProtocol.IP")
448
- proto.RegisterType((*IPRange)(nil), "zeropsVpnProtocol.IPRange")
449
- proto.RegisterType((*Timestamp)(nil), "zeropsVpnProtocol.Timestamp")
450
- proto.RegisterType((*StartVpnRequest)(nil), "zeropsVpnProtocol.startVpnRequest")
451
- proto.RegisterType((*StartVpnResponse)(nil), "zeropsVpnProtocol.startVpnResponse")
452
- proto.RegisterType((*StartVpnOutDto)(nil), "zeropsVpnProtocol.startVpnOutDto")
453
- }
454
-
455
- func init() { proto.RegisterFile("zeropsVpnProtocol.proto", fileDescriptor_4e2851e98e674814) }
456
-
457
- var fileDescriptor_4e2851e98e674814 = []byte{
458
- // 610 bytes of a gzipped FileDescriptorProto
459
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x54, 0x4f, 0x4f, 0xdb, 0x4e,
460
- 0x10, 0xfd, 0x39, 0xff, 0x48, 0x26, 0xfc, 0xc0, 0x59, 0x15, 0xea, 0x22, 0x84, 0x52, 0xf7, 0x12,
461
- 0x55, 0x2a, 0x6a, 0x43, 0x4f, 0xbd, 0x59, 0x60, 0xaa, 0x55, 0x8d, 0xe3, 0x8e, 0x43, 0x44, 0x7b,
462
- 0xb1, 0x4c, 0xbc, 0xa2, 0x56, 0xc9, 0x7a, 0xbb, 0xeb, 0xd0, 0xd2, 0x53, 0xbf, 0x4e, 0x3f, 0x49,
463
- 0xbf, 0x56, 0xe5, 0xb5, 0x03, 0x94, 0x04, 0x6e, 0x3b, 0x6f, 0xde, 0xcc, 0x78, 0xde, 0xdb, 0x35,
464
- 0x3c, 0xfd, 0xc9, 0x64, 0x26, 0xd4, 0x44, 0xf0, 0x40, 0x66, 0x79, 0x36, 0xcd, 0x2e, 0xf7, 0x45,
465
- 0x71, 0x20, 0xbd, 0xa5, 0x84, 0x1d, 0x42, 0x93, 0x49, 0x99, 0x49, 0xf2, 0x1a, 0x1a, 0xd3, 0x2c,
466
- 0x61, 0x96, 0xd1, 0x37, 0x06, 0x1b, 0xc3, 0xdd, 0xfd, 0xe5, 0x1e, 0x9a, 0x77, 0x98, 0x25, 0x0c,
467
- 0x35, 0x93, 0x58, 0xb0, 0x36, 0x63, 0x4a, 0xc5, 0x17, 0xcc, 0xaa, 0xf5, 0x8d, 0x41, 0x07, 0x17,
468
- 0xa1, 0xbd, 0x07, 0x35, 0x1a, 0x14, 0xf9, 0x38, 0x49, 0x24, 0x53, 0x4a, 0x37, 0x5d, 0xc7, 0x45,
469
- 0x68, 0xbf, 0x82, 0x35, 0x1a, 0x60, 0xcc, 0x2f, 0x18, 0xd9, 0x80, 0x5a, 0x2a, 0xaa, 0x7c, 0x2d,
470
- 0x15, 0x84, 0x40, 0x63, 0x16, 0xab, 0xaf, 0xba, 0xe3, 0x3a, 0xea, 0xb3, 0xfd, 0x11, 0x3a, 0xe3,
471
- 0x74, 0xc6, 0x54, 0x1e, 0xcf, 0x04, 0x79, 0x02, 0xcd, 0x54, 0x85, 0x2c, 0xd7, 0x35, 0x6d, 0x2c,
472
- 0x83, 0x62, 0x96, 0x62, 0xd3, 0x8c, 0x27, 0x4a, 0x57, 0xd6, 0x71, 0x11, 0x16, 0x7c, 0x1e, 0xf3,
473
- 0x4c, 0x59, 0xf5, 0xbe, 0x31, 0x68, 0x62, 0x19, 0xd8, 0x7f, 0x0c, 0xd8, 0x54, 0x79, 0x2c, 0xf3,
474
- 0x89, 0xe0, 0xc8, 0xbe, 0xcd, 0x99, 0xca, 0xc9, 0x1e, 0x40, 0xca, 0x55, 0x1e, 0xf3, 0x29, 0xa3,
475
- 0x89, 0x6e, 0xdf, 0xc1, 0x3b, 0x08, 0xd9, 0x86, 0xd6, 0x5c, 0x31, 0x49, 0x93, 0x6a, 0xdd, 0x2a,
476
- 0x22, 0x03, 0xd8, 0x9c, 0x5e, 0xa6, 0x8c, 0xe7, 0xc1, 0xfc, 0xfc, 0x32, 0x9d, 0x7e, 0x60, 0xd7,
477
- 0x7a, 0x56, 0x07, 0xef, 0xc3, 0x64, 0x17, 0x3a, 0x2a, 0xbd, 0xe0, 0x71, 0x3e, 0x97, 0xcc, 0x6a,
478
- 0x68, 0xce, 0x2d, 0x40, 0xde, 0x42, 0x8b, 0xfd, 0x10, 0xa9, 0xbc, 0xb6, 0x9a, 0x7d, 0x63, 0xd0,
479
- 0x5d, 0xe9, 0xc1, 0x8d, 0x0e, 0x58, 0x71, 0xed, 0xef, 0x60, 0xde, 0x2e, 0xa2, 0x44, 0xc6, 0x15,
480
- 0x23, 0xfb, 0x95, 0xa9, 0x7a, 0x89, 0xee, 0xd0, 0x7a, 0xc8, 0x4c, 0xac, 0xbc, 0x3f, 0x80, 0xfa,
481
- 0x95, 0xe0, 0x7a, 0xad, 0xee, 0xf0, 0xf9, 0x0a, 0xf6, 0x62, 0xc2, 0x68, 0x9e, 0x1f, 0xe5, 0x19,
482
- 0x16, 0x6c, 0xfb, 0x57, 0x0d, 0x36, 0xfe, 0xc5, 0x0b, 0xf3, 0x44, 0x26, 0x4b, 0x6b, 0xea, 0xa8,
483
- 0xcf, 0x85, 0x3a, 0x8a, 0xc9, 0x2b, 0x26, 0x6f, 0xd5, 0x29, 0xe5, 0xbb, 0x0f, 0x13, 0x07, 0xcc,
484
- 0x58, 0x15, 0x72, 0xb0, 0xe4, 0x50, 0x0b, 0x47, 0x85, 0x16, 0xb2, 0x3b, 0xdc, 0x5a, 0xf1, 0x49,
485
- 0x34, 0xc0, 0x25, 0x3a, 0x79, 0x03, 0xed, 0xb2, 0x2b, 0x15, 0x5a, 0xdf, 0x07, 0x4b, 0x6f, 0x68,
486
- 0xe4, 0x1d, 0xc0, 0x95, 0xe0, 0x54, 0xe8, 0xeb, 0x58, 0x29, 0xbf, 0xb3, 0xba, 0xa8, 0x60, 0xe0,
487
- 0x1d, 0xf6, 0xcb, 0xdf, 0x06, 0x74, 0x6e, 0x5e, 0x05, 0x59, 0x87, 0xb6, 0x3f, 0x8a, 0x5c, 0xc4,
488
- 0x11, 0x9a, 0xff, 0x91, 0x67, 0xb0, 0x45, 0xfd, 0xb1, 0x8b, 0xbe, 0xe3, 0x45, 0xa1, 0x8b, 0x13,
489
- 0x17, 0xab, 0x94, 0x41, 0xb6, 0x81, 0x50, 0x3f, 0x1c, 0x3b, 0xfe, 0xa1, 0x1b, 0xf9, 0xa3, 0x71,
490
- 0x74, 0x3c, 0x3a, 0xf5, 0x8f, 0xcc, 0x1a, 0xe9, 0xc1, 0xff, 0x01, 0x8e, 0xce, 0x3e, 0x45, 0x34,
491
- 0x8c, 0x8e, 0x4f, 0x3d, 0xcf, 0xac, 0x93, 0x2d, 0xe8, 0x51, 0x7f, 0xe2, 0x78, 0xf4, 0x28, 0x0a,
492
- 0xe9, 0x7b, 0xdf, 0x19, 0x9f, 0xa2, 0x6b, 0x36, 0x0a, 0xd8, 0x3d, 0x0b, 0x28, 0xba, 0x77, 0xe1,
493
- 0x26, 0xd9, 0x81, 0xed, 0x13, 0xe7, 0x2c, 0x0a, 0x1c, 0x74, 0x3c, 0xcf, 0xf5, 0xa2, 0x49, 0xe0,
494
- 0x47, 0x1e, 0x3d, 0xa1, 0x63, 0xb3, 0x35, 0xfc, 0x02, 0xbd, 0xcf, 0xf7, 0x97, 0x22, 0x21, 0xb4,
495
- 0x17, 0x16, 0x12, 0xfb, 0x11, 0xdf, 0xab, 0x27, 0xb2, 0xf3, 0xe2, 0x51, 0x4e, 0x79, 0xfb, 0xce,
496
- 0x5b, 0xfa, 0x67, 0x73, 0xf0, 0x37, 0x00, 0x00, 0xff, 0xff, 0x06, 0x49, 0xf2, 0x82, 0x87, 0x04,
497
- 0x00, 0x00,
498
- }
499
-
500
- // Reference imports to suppress errors if they are not otherwise used.
501
- var _ context.Context
502
- var _ grpc.ClientConn
503
-
504
- // This is a compile-time assertion to ensure that this generated file
505
- // is compatible with the grpc package it is being compiled against.
506
- const _ = grpc.SupportPackageIsVersion4
507
-
508
- // ZeropsVpnProtocolClient is the client API for ZeropsVpnProtocol service.
509
- //
510
- // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
511
- type ZeropsVpnProtocolClient interface {
512
- StartVpn(ctx context.Context, in *StartVpnRequest, opts ...grpc.CallOption) (*StartVpnResponse, error)
513
- }
514
-
515
- type zeropsVpnProtocolClient struct {
516
- cc *grpc.ClientConn
517
- }
518
-
519
- func NewZeropsVpnProtocolClient(cc *grpc.ClientConn) ZeropsVpnProtocolClient {
520
- return &zeropsVpnProtocolClient{cc}
521
- }
522
-
523
- func (c *zeropsVpnProtocolClient) StartVpn(ctx context.Context, in *StartVpnRequest, opts ...grpc.CallOption) (*StartVpnResponse, error) {
524
- out := new(StartVpnResponse)
525
- err := c.cc.Invoke(ctx, "/zeropsVpnProtocol.ZeropsVpnProtocol/startVpn", in, out, opts...)
526
- if err != nil {
527
- return nil, err
528
- }
529
- return out, nil
530
- }
531
-
532
- // ZeropsVpnProtocolServer is the server API for ZeropsVpnProtocol service.
533
- type ZeropsVpnProtocolServer interface {
534
- StartVpn(context.Context, *StartVpnRequest) (*StartVpnResponse, error)
535
- }
536
-
537
- // UnimplementedZeropsVpnProtocolServer can be embedded to have forward compatible implementations.
538
- type UnimplementedZeropsVpnProtocolServer struct {
539
- }
540
-
541
- func (*UnimplementedZeropsVpnProtocolServer) StartVpn(ctx context.Context, req *StartVpnRequest) (*StartVpnResponse, error) {
542
- return nil, status.Errorf(codes.Unimplemented, "method StartVpn not implemented")
543
- }
544
-
545
- func RegisterZeropsVpnProtocolServer(s *grpc.Server, srv ZeropsVpnProtocolServer) {
546
- s.RegisterService(&_ZeropsVpnProtocol_serviceDesc, srv)
547
- }
548
-
549
- func _ZeropsVpnProtocol_StartVpn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
550
- in := new(StartVpnRequest)
551
- if err := dec(in); err != nil {
552
- return nil, err
553
- }
554
- if interceptor == nil {
555
- return srv.(ZeropsVpnProtocolServer).StartVpn(ctx, in)
556
- }
557
- info := &grpc.UnaryServerInfo{
558
- Server: srv,
559
- FullMethod: "/zeropsVpnProtocol.ZeropsVpnProtocol/StartVpn",
560
- }
561
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
562
- return srv.(ZeropsVpnProtocolServer).StartVpn(ctx, req.(*StartVpnRequest))
563
- }
564
- return interceptor(ctx, in, info, handler)
565
- }
566
-
567
- var _ZeropsVpnProtocol_serviceDesc = grpc.ServiceDesc{
568
- ServiceName: "zeropsVpnProtocol.ZeropsVpnProtocol",
569
- HandlerType: (*ZeropsVpnProtocolServer)(nil),
570
- Methods: []grpc.MethodDesc{
571
- {
572
- MethodName: "startVpn",
573
- Handler: _ZeropsVpnProtocol_StartVpn_Handler,
574
- },
575
- },
576
- Streams: []grpc.StreamDesc{},
577
- Metadata: "zeropsVpnProtocol.proto",
578
- }
@@ -1,58 +0,0 @@
1
- syntax = "proto3";
2
-
3
- package zeropsVpnProtocol;
4
-
5
- service ZeropsVpnProtocol {
6
- rpc startVpn (startVpnRequest) returns (startVpnResponse);
7
- }
8
-
9
- message error {
10
- errorCode code = 1;
11
- string message = 2;
12
- }
13
-
14
- enum errorCode {
15
- NO_ERROR = 0;
16
- INTERNAL_SERVER_ERROR = 1;
17
- INSTANCE_NOT_FOUND = 2;
18
- PROXY_IS_FULL = 3;
19
- INVALID_SIGNATURE = 4;
20
- EXPIRED_SIGNATURE = 5;
21
- MAX_PARALLEL_VPN_LIMIT = 6;
22
- }
23
-
24
- message IP {
25
- bytes address = 1;
26
- }
27
-
28
- message IPRange {
29
- bytes ip = 1;
30
- bytes mask = 2;
31
- }
32
-
33
- message Timestamp {
34
- bool isSet = 1;
35
- int64 seconds = 2;
36
- int32 nanos = 3;
37
- }
38
-
39
- message startVpnRequest {
40
- string instanceId = 1;
41
- string userId = 2;
42
- string clientPublicKey = 3;
43
- string signature = 4;
44
- Timestamp expiry = 5;
45
- }
46
-
47
- message startVpnResponse {
48
- error error = 1;
49
- startVpnOutDto vpn = 2;
50
- }
51
-
52
- message startVpnOutDto {
53
- int64 port = 1;
54
- string serverPublicKey = 2;
55
- IP assignedClientIp = 3;
56
- IP serverIp = 4;
57
- IPRange vpnIpRange = 5;
58
- }