-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathipsec_remote_auth.go
398 lines (325 loc) · 15.9 KB
/
ipsec_remote_auth.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
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
package objects
// THIS FILE IS AUTO GENERATED BY bin/gen.go! DO NOT EDIT!
import (
"fmt"
"github.com/esurdam/go-sophos"
)
// IpsecRemoteAuth is a generated struct representing the Sophos IpsecRemoteAuth Endpoint
// GET /api/nodes/ipsec_remote_auth
type IpsecRemoteAuth struct {
IpsecRemoteAuthCa IpsecRemoteAuthCa `json:"ipsec_remote_auth_ca"`
IpsecRemoteAuthGroup IpsecRemoteAuthGroup `json:"ipsec_remote_auth_group"`
IpsecRemoteAuthPsk IpsecRemoteAuthPsk `json:"ipsec_remote_auth_psk"`
IpsecRemoteAuthRsa IpsecRemoteAuthRsa `json:"ipsec_remote_auth_rsa"`
IpsecRemoteAuthX509 IpsecRemoteAuthX509 `json:"ipsec_remote_auth_x509"`
}
var _ sophos.Endpoint = &IpsecRemoteAuth{}
var defsIpsecRemoteAuth = map[string]sophos.RestObject{
"IpsecRemoteAuthCa": &IpsecRemoteAuthCa{},
"IpsecRemoteAuthGroup": &IpsecRemoteAuthGroup{},
"IpsecRemoteAuthPsk": &IpsecRemoteAuthPsk{},
"IpsecRemoteAuthRsa": &IpsecRemoteAuthRsa{},
"IpsecRemoteAuthX509": &IpsecRemoteAuthX509{},
}
// RestObjects implements the sophos.Node interface and returns a map of IpsecRemoteAuth's Objects
func (IpsecRemoteAuth) RestObjects() map[string]sophos.RestObject { return defsIpsecRemoteAuth }
// GetPath implements sophos.RestGetter
func (*IpsecRemoteAuth) GetPath() string { return "/api/nodes/ipsec_remote_auth" }
// RefRequired implements sophos.RestGetter
func (*IpsecRemoteAuth) RefRequired() (string, bool) { return "", false }
var defIpsecRemoteAuth = &sophos.Definition{Description: "ipsec_remote_auth", Name: "ipsec_remote_auth", Link: "/api/definitions/ipsec_remote_auth"}
// Definition returns the /api/definitions struct of IpsecRemoteAuth
func (IpsecRemoteAuth) Definition() sophos.Definition { return *defIpsecRemoteAuth }
// ApiRoutes returns all known IpsecRemoteAuth Paths
func (IpsecRemoteAuth) ApiRoutes() []string {
return []string{
"/api/objects/ipsec_remote_auth/ca/",
"/api/objects/ipsec_remote_auth/ca/{ref}",
"/api/objects/ipsec_remote_auth/ca/{ref}/usedby",
"/api/objects/ipsec_remote_auth/group/",
"/api/objects/ipsec_remote_auth/group/{ref}",
"/api/objects/ipsec_remote_auth/group/{ref}/usedby",
"/api/objects/ipsec_remote_auth/psk/",
"/api/objects/ipsec_remote_auth/psk/{ref}",
"/api/objects/ipsec_remote_auth/psk/{ref}/usedby",
"/api/objects/ipsec_remote_auth/rsa/",
"/api/objects/ipsec_remote_auth/rsa/{ref}",
"/api/objects/ipsec_remote_auth/rsa/{ref}/usedby",
"/api/objects/ipsec_remote_auth/x509/",
"/api/objects/ipsec_remote_auth/x509/{ref}",
"/api/objects/ipsec_remote_auth/x509/{ref}/usedby",
}
}
// References returns the IpsecRemoteAuth's references. These strings serve no purpose other than to demonstrate which
// Reference keys are used for this Endpoint
func (IpsecRemoteAuth) References() []string {
return []string{
"REF_IpsecRemoteAuthCa",
"REF_IpsecRemoteAuthGroup",
"REF_IpsecRemoteAuthPsk",
"REF_IpsecRemoteAuthRsa",
"REF_IpsecRemoteAuthX509",
}
}
// IpsecRemoteAuthCas is an Sophos Endpoint subType and implements sophos.RestObject
type IpsecRemoteAuthCas []IpsecRemoteAuthCa
// IpsecRemoteAuthCa represents a UTM X509 CA and DN match
type IpsecRemoteAuthCa struct {
Locked string `json:"_locked"`
ObjectType string `json:"_type"`
Reference string `json:"_ref"`
// Certificate description: REF(ca/signing_ca), REF(ca/verification_ca)
Certificate string `json:"certificate"`
Comment string `json:"comment"`
Name string `json:"name"`
// VpnId default value is "C=*, ST=*, L=*, O=*, OU=*, CN=*, E=*"
VpnId string `json:"vpn_id"`
}
var _ sophos.RestGetter = &IpsecRemoteAuthCa{}
// GetPath implements sophos.RestObject and returns the IpsecRemoteAuthCas GET path
// Returns all available ipsec_remote_auth/ca objects
func (*IpsecRemoteAuthCas) GetPath() string { return "/api/objects/ipsec_remote_auth/ca/" }
// RefRequired implements sophos.RestObject
func (*IpsecRemoteAuthCas) RefRequired() (string, bool) { return "", false }
// GetPath implements sophos.RestObject and returns the IpsecRemoteAuthCas GET path
// Returns all available ca types
func (i *IpsecRemoteAuthCa) GetPath() string {
return fmt.Sprintf("/api/objects/ipsec_remote_auth/ca/%s", i.Reference)
}
// RefRequired implements sophos.RestObject
func (i *IpsecRemoteAuthCa) RefRequired() (string, bool) { return i.Reference, true }
// DeletePath implements sophos.RestObject and returns the IpsecRemoteAuthCa DELETE path
// Creates or updates the complete object ca
func (*IpsecRemoteAuthCa) DeletePath(ref string) string {
return fmt.Sprintf("/api/objects/ipsec_remote_auth/ca/%s", ref)
}
// PatchPath implements sophos.RestObject and returns the IpsecRemoteAuthCa PATCH path
// Changes to parts of the object ca types
func (*IpsecRemoteAuthCa) PatchPath(ref string) string {
return fmt.Sprintf("/api/objects/ipsec_remote_auth/ca/%s", ref)
}
// PostPath implements sophos.RestObject and returns the IpsecRemoteAuthCa POST path
// Create a new ipsec_remote_auth/ca object
func (*IpsecRemoteAuthCa) PostPath() string {
return "/api/objects/ipsec_remote_auth/ca/"
}
// PutPath implements sophos.RestObject and returns the IpsecRemoteAuthCa PUT path
// Creates or updates the complete object ca
func (*IpsecRemoteAuthCa) PutPath(ref string) string {
return fmt.Sprintf("/api/objects/ipsec_remote_auth/ca/%s", ref)
}
// UsedByPath implements sophos.RestObject
// Returns the objects and the nodes that use the object with the given ref
func (*IpsecRemoteAuthCa) UsedByPath(ref string) string {
return fmt.Sprintf("/api/objects/ipsec_remote_auth/ca/%s/usedby", ref)
}
// IpsecRemoteAuthGroups is an Sophos Endpoint subType and implements sophos.RestObject
type IpsecRemoteAuthGroups []IpsecRemoteAuthGroup
// IpsecRemoteAuthGroup represents a UTM group
type IpsecRemoteAuthGroup struct {
Locked string `json:"_locked"`
ObjectType string `json:"_type"`
Reference string `json:"_ref"`
Comment string `json:"comment"`
Name string `json:"name"`
}
var _ sophos.RestGetter = &IpsecRemoteAuthGroup{}
// GetPath implements sophos.RestObject and returns the IpsecRemoteAuthGroups GET path
// Returns all available ipsec_remote_auth/group objects
func (*IpsecRemoteAuthGroups) GetPath() string { return "/api/objects/ipsec_remote_auth/group/" }
// RefRequired implements sophos.RestObject
func (*IpsecRemoteAuthGroups) RefRequired() (string, bool) { return "", false }
// GetPath implements sophos.RestObject and returns the IpsecRemoteAuthGroups GET path
// Returns all available group types
func (i *IpsecRemoteAuthGroup) GetPath() string {
return fmt.Sprintf("/api/objects/ipsec_remote_auth/group/%s", i.Reference)
}
// RefRequired implements sophos.RestObject
func (i *IpsecRemoteAuthGroup) RefRequired() (string, bool) { return i.Reference, true }
// DeletePath implements sophos.RestObject and returns the IpsecRemoteAuthGroup DELETE path
// Creates or updates the complete object group
func (*IpsecRemoteAuthGroup) DeletePath(ref string) string {
return fmt.Sprintf("/api/objects/ipsec_remote_auth/group/%s", ref)
}
// PatchPath implements sophos.RestObject and returns the IpsecRemoteAuthGroup PATCH path
// Changes to parts of the object group types
func (*IpsecRemoteAuthGroup) PatchPath(ref string) string {
return fmt.Sprintf("/api/objects/ipsec_remote_auth/group/%s", ref)
}
// PostPath implements sophos.RestObject and returns the IpsecRemoteAuthGroup POST path
// Create a new ipsec_remote_auth/group object
func (*IpsecRemoteAuthGroup) PostPath() string {
return "/api/objects/ipsec_remote_auth/group/"
}
// PutPath implements sophos.RestObject and returns the IpsecRemoteAuthGroup PUT path
// Creates or updates the complete object group
func (*IpsecRemoteAuthGroup) PutPath(ref string) string {
return fmt.Sprintf("/api/objects/ipsec_remote_auth/group/%s", ref)
}
// UsedByPath implements sophos.RestObject
// Returns the objects and the nodes that use the object with the given ref
func (*IpsecRemoteAuthGroup) UsedByPath(ref string) string {
return fmt.Sprintf("/api/objects/ipsec_remote_auth/group/%s/usedby", ref)
}
// IpsecRemoteAuthPsks is an Sophos Endpoint subType and implements sophos.RestObject
type IpsecRemoteAuthPsks []IpsecRemoteAuthPsk
// IpsecRemoteAuthPsk represents a UTM preshared key
type IpsecRemoteAuthPsk struct {
Locked string `json:"_locked"`
ObjectType string `json:"_type"`
Reference string `json:"_ref"`
Comment string `json:"comment"`
Name string `json:"name"`
Psk string `json:"psk"`
// VpnId default value is ""
VpnId string `json:"vpn_id"`
// VpnIdType can be one of: []string{"ipv4_address", "fqdn", "user_fqdn"}
VpnIdType string `json:"vpn_id_type"`
}
var _ sophos.RestGetter = &IpsecRemoteAuthPsk{}
// GetPath implements sophos.RestObject and returns the IpsecRemoteAuthPsks GET path
// Returns all available ipsec_remote_auth/psk objects
func (*IpsecRemoteAuthPsks) GetPath() string { return "/api/objects/ipsec_remote_auth/psk/" }
// RefRequired implements sophos.RestObject
func (*IpsecRemoteAuthPsks) RefRequired() (string, bool) { return "", false }
// GetPath implements sophos.RestObject and returns the IpsecRemoteAuthPsks GET path
// Returns all available psk types
func (i *IpsecRemoteAuthPsk) GetPath() string {
return fmt.Sprintf("/api/objects/ipsec_remote_auth/psk/%s", i.Reference)
}
// RefRequired implements sophos.RestObject
func (i *IpsecRemoteAuthPsk) RefRequired() (string, bool) { return i.Reference, true }
// DeletePath implements sophos.RestObject and returns the IpsecRemoteAuthPsk DELETE path
// Creates or updates the complete object psk
func (*IpsecRemoteAuthPsk) DeletePath(ref string) string {
return fmt.Sprintf("/api/objects/ipsec_remote_auth/psk/%s", ref)
}
// PatchPath implements sophos.RestObject and returns the IpsecRemoteAuthPsk PATCH path
// Changes to parts of the object psk types
func (*IpsecRemoteAuthPsk) PatchPath(ref string) string {
return fmt.Sprintf("/api/objects/ipsec_remote_auth/psk/%s", ref)
}
// PostPath implements sophos.RestObject and returns the IpsecRemoteAuthPsk POST path
// Create a new ipsec_remote_auth/psk object
func (*IpsecRemoteAuthPsk) PostPath() string {
return "/api/objects/ipsec_remote_auth/psk/"
}
// PutPath implements sophos.RestObject and returns the IpsecRemoteAuthPsk PUT path
// Creates or updates the complete object psk
func (*IpsecRemoteAuthPsk) PutPath(ref string) string {
return fmt.Sprintf("/api/objects/ipsec_remote_auth/psk/%s", ref)
}
// UsedByPath implements sophos.RestObject
// Returns the objects and the nodes that use the object with the given ref
func (*IpsecRemoteAuthPsk) UsedByPath(ref string) string {
return fmt.Sprintf("/api/objects/ipsec_remote_auth/psk/%s/usedby", ref)
}
// IpsecRemoteAuthRsas is an Sophos Endpoint subType and implements sophos.RestObject
type IpsecRemoteAuthRsas []IpsecRemoteAuthRsa
// IpsecRemoteAuthRsa represents a UTM RSA public key
type IpsecRemoteAuthRsa struct {
Locked string `json:"_locked"`
ObjectType string `json:"_type"`
Reference string `json:"_ref"`
Comment string `json:"comment"`
Name string `json:"name"`
Pubkey string `json:"pubkey"`
// VpnId default value is ""
VpnId string `json:"vpn_id"`
// VpnIdType can be one of: []string{"ipv4_address", "fqdn", "user_fqdn"}
VpnIdType string `json:"vpn_id_type"`
}
var _ sophos.RestGetter = &IpsecRemoteAuthRsa{}
// GetPath implements sophos.RestObject and returns the IpsecRemoteAuthRsas GET path
// Returns all available ipsec_remote_auth/rsa objects
func (*IpsecRemoteAuthRsas) GetPath() string { return "/api/objects/ipsec_remote_auth/rsa/" }
// RefRequired implements sophos.RestObject
func (*IpsecRemoteAuthRsas) RefRequired() (string, bool) { return "", false }
// GetPath implements sophos.RestObject and returns the IpsecRemoteAuthRsas GET path
// Returns all available rsa types
func (i *IpsecRemoteAuthRsa) GetPath() string {
return fmt.Sprintf("/api/objects/ipsec_remote_auth/rsa/%s", i.Reference)
}
// RefRequired implements sophos.RestObject
func (i *IpsecRemoteAuthRsa) RefRequired() (string, bool) { return i.Reference, true }
// DeletePath implements sophos.RestObject and returns the IpsecRemoteAuthRsa DELETE path
// Creates or updates the complete object rsa
func (*IpsecRemoteAuthRsa) DeletePath(ref string) string {
return fmt.Sprintf("/api/objects/ipsec_remote_auth/rsa/%s", ref)
}
// PatchPath implements sophos.RestObject and returns the IpsecRemoteAuthRsa PATCH path
// Changes to parts of the object rsa types
func (*IpsecRemoteAuthRsa) PatchPath(ref string) string {
return fmt.Sprintf("/api/objects/ipsec_remote_auth/rsa/%s", ref)
}
// PostPath implements sophos.RestObject and returns the IpsecRemoteAuthRsa POST path
// Create a new ipsec_remote_auth/rsa object
func (*IpsecRemoteAuthRsa) PostPath() string {
return "/api/objects/ipsec_remote_auth/rsa/"
}
// PutPath implements sophos.RestObject and returns the IpsecRemoteAuthRsa PUT path
// Creates or updates the complete object rsa
func (*IpsecRemoteAuthRsa) PutPath(ref string) string {
return fmt.Sprintf("/api/objects/ipsec_remote_auth/rsa/%s", ref)
}
// UsedByPath implements sophos.RestObject
// Returns the objects and the nodes that use the object with the given ref
func (*IpsecRemoteAuthRsa) UsedByPath(ref string) string {
return fmt.Sprintf("/api/objects/ipsec_remote_auth/rsa/%s/usedby", ref)
}
// IpsecRemoteAuthX509s is an Sophos Endpoint subType and implements sophos.RestObject
type IpsecRemoteAuthX509s []IpsecRemoteAuthX509
// IpsecRemoteAuthX509 represents a UTM X509 certificate
type IpsecRemoteAuthX509 struct {
Locked string `json:"_locked"`
ObjectType string `json:"_type"`
Reference string `json:"_ref"`
// Certificate description: REF(ca/host_cert), REF(ca/host_key_cert)
// Certificate default value is ""
Certificate string `json:"certificate"`
Comment string `json:"comment"`
Name string `json:"name"`
// VpnId default value is ""
VpnId string `json:"vpn_id"`
// VpnIdType can be one of: []string{"from_certificate", "ipv4_address", "fqdn", "user_fqdn", "der_asn1_dn"}
// VpnIdType default value is "from_certificate"
VpnIdType string `json:"vpn_id_type"`
}
var _ sophos.RestGetter = &IpsecRemoteAuthX509{}
// GetPath implements sophos.RestObject and returns the IpsecRemoteAuthX509s GET path
// Returns all available ipsec_remote_auth/x509 objects
func (*IpsecRemoteAuthX509s) GetPath() string { return "/api/objects/ipsec_remote_auth/x509/" }
// RefRequired implements sophos.RestObject
func (*IpsecRemoteAuthX509s) RefRequired() (string, bool) { return "", false }
// GetPath implements sophos.RestObject and returns the IpsecRemoteAuthX509s GET path
// Returns all available x509 types
func (i *IpsecRemoteAuthX509) GetPath() string {
return fmt.Sprintf("/api/objects/ipsec_remote_auth/x509/%s", i.Reference)
}
// RefRequired implements sophos.RestObject
func (i *IpsecRemoteAuthX509) RefRequired() (string, bool) { return i.Reference, true }
// DeletePath implements sophos.RestObject and returns the IpsecRemoteAuthX509 DELETE path
// Creates or updates the complete object x509
func (*IpsecRemoteAuthX509) DeletePath(ref string) string {
return fmt.Sprintf("/api/objects/ipsec_remote_auth/x509/%s", ref)
}
// PatchPath implements sophos.RestObject and returns the IpsecRemoteAuthX509 PATCH path
// Changes to parts of the object x509 types
func (*IpsecRemoteAuthX509) PatchPath(ref string) string {
return fmt.Sprintf("/api/objects/ipsec_remote_auth/x509/%s", ref)
}
// PostPath implements sophos.RestObject and returns the IpsecRemoteAuthX509 POST path
// Create a new ipsec_remote_auth/x509 object
func (*IpsecRemoteAuthX509) PostPath() string {
return "/api/objects/ipsec_remote_auth/x509/"
}
// PutPath implements sophos.RestObject and returns the IpsecRemoteAuthX509 PUT path
// Creates or updates the complete object x509
func (*IpsecRemoteAuthX509) PutPath(ref string) string {
return fmt.Sprintf("/api/objects/ipsec_remote_auth/x509/%s", ref)
}
// UsedByPath implements sophos.RestObject
// Returns the objects and the nodes that use the object with the given ref
func (*IpsecRemoteAuthX509) UsedByPath(ref string) string {
return fmt.Sprintf("/api/objects/ipsec_remote_auth/x509/%s/usedby", ref)
}