-
Notifications
You must be signed in to change notification settings - Fork 4
/
ca.go
854 lines (709 loc) · 30.7 KB
/
ca.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
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
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
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
package objects
// THIS FILE IS AUTO GENERATED BY bin/gen.go! DO NOT EDIT!
import (
"fmt"
"github.com/esurdam/go-sophos"
)
// Ca is a generated struct representing the Sophos Ca Endpoint
// GET /api/nodes/ca
type Ca struct {
CaGost string `json:"ca_gost"`
CaIpsec string `json:"ca_ipsec"`
CaProxies string `json:"ca_proxies"`
CaRed string `json:"ca_red"`
DefKeysize int64 `json:"def_keysize"`
GlobalCas struct {
EmailEncryption struct {
TrustNewCas int64 `json:"trust_new_cas"`
Trusted []interface{} `json:"trusted"`
Untrusted []interface{} `json:"untrusted"`
} `json:"email_encryption"`
HTTPProxy struct {
TrustNewCas int64 `json:"trust_new_cas"`
Trusted []interface{} `json:"trusted"`
Untrusted []interface{} `json:"untrusted"`
} `json:"http_proxy"`
} `json:"global_cas"`
Letsencrypt struct {
AccountID string `json:"account_id"`
AccountKey string `json:"account_key"`
AcmeServer string `json:"acme_server"`
Debug int64 `json:"debug"`
ErrorInfo string `json:"error_info"`
ErrorMessage string `json:"error_message"`
RegistrationInfo string `json:"registration_info"`
Status int64 `json:"status"`
TosURL string `json:"tos_url"`
} `json:"letsencrypt"`
}
var _ sophos.Endpoint = &Ca{}
var defsCa = map[string]sophos.RestObject{
"CaCrl": &CaCrl{},
"CaCsr": &CaCsr{},
"CaGroup": &CaGroup{},
"CaHostCert": &CaHostCert{},
"CaHostKeyCert": &CaHostKeyCert{},
"CaHttpVerificationCa": &CaHttpVerificationCa{},
"CaMetaCrl": &CaMetaCrl{},
"CaMetaX509": &CaMetaX509{},
"CaRsa": &CaRsa{},
"CaSigningCa": &CaSigningCa{},
"CaVerificationCa": &CaVerificationCa{},
}
// RestObjects implements the sophos.Node interface and returns a map of Ca's Objects
func (Ca) RestObjects() map[string]sophos.RestObject { return defsCa }
// GetPath implements sophos.RestGetter
func (*Ca) GetPath() string { return "/api/nodes/ca" }
// RefRequired implements sophos.RestGetter
func (*Ca) RefRequired() (string, bool) { return "", false }
var defCa = &sophos.Definition{Description: "ca", Name: "ca", Link: "/api/definitions/ca"}
// Definition returns the /api/definitions struct of Ca
func (Ca) Definition() sophos.Definition { return *defCa }
// ApiRoutes returns all known Ca Paths
func (Ca) ApiRoutes() []string {
return []string{
"/api/objects/ca/crl/",
"/api/objects/ca/crl/{ref}",
"/api/objects/ca/crl/{ref}/usedby",
"/api/objects/ca/csr/",
"/api/objects/ca/csr/{ref}",
"/api/objects/ca/csr/{ref}/usedby",
"/api/objects/ca/group/",
"/api/objects/ca/group/{ref}",
"/api/objects/ca/group/{ref}/usedby",
"/api/objects/ca/host_cert/",
"/api/objects/ca/host_cert/{ref}",
"/api/objects/ca/host_cert/{ref}/usedby",
"/api/objects/ca/host_key_cert/",
"/api/objects/ca/host_key_cert/{ref}",
"/api/objects/ca/host_key_cert/{ref}/usedby",
"/api/objects/ca/http_verification_ca/",
"/api/objects/ca/http_verification_ca/{ref}",
"/api/objects/ca/http_verification_ca/{ref}/usedby",
"/api/objects/ca/meta_crl/",
"/api/objects/ca/meta_crl/{ref}",
"/api/objects/ca/meta_crl/{ref}/usedby",
"/api/objects/ca/meta_x509/",
"/api/objects/ca/meta_x509/{ref}",
"/api/objects/ca/meta_x509/{ref}/usedby",
"/api/objects/ca/rsa/",
"/api/objects/ca/rsa/{ref}",
"/api/objects/ca/rsa/{ref}/usedby",
"/api/objects/ca/signing_ca/",
"/api/objects/ca/signing_ca/{ref}",
"/api/objects/ca/signing_ca/{ref}/usedby",
"/api/objects/ca/verification_ca/",
"/api/objects/ca/verification_ca/{ref}",
"/api/objects/ca/verification_ca/{ref}/usedby",
}
}
// References returns the Ca's references. These strings serve no purpose other than to demonstrate which
// Reference keys are used for this Endpoint
func (Ca) References() []string {
return []string{
"REF_CaCrl",
"REF_CaCsr",
"REF_CaGroup",
"REF_CaHostCert",
"REF_CaHostKeyCert",
"REF_CaHttpVerificationCa",
"REF_CaMetaCrl",
"REF_CaMetaX509",
"REF_CaRsa",
"REF_CaSigningCa",
"REF_CaVerificationCa",
}
}
// CaCrls is an Sophos Endpoint subType and implements sophos.RestObject
type CaCrls []CaCrl
// CaCrl represents a UTM certificate revocation list
type CaCrl struct {
Locked string `json:"_locked"`
ObjectType string `json:"_type"`
Reference string `json:"_ref"`
Comment string `json:"comment"`
Crl string `json:"crl"`
// Meta description: REF(ca/meta_crl)
Meta string `json:"meta"`
Name string `json:"name"`
}
var _ sophos.RestGetter = &CaCrl{}
// GetPath implements sophos.RestObject and returns the CaCrls GET path
// Returns all available ca/crl objects
func (*CaCrls) GetPath() string { return "/api/objects/ca/crl/" }
// RefRequired implements sophos.RestObject
func (*CaCrls) RefRequired() (string, bool) { return "", false }
// GetPath implements sophos.RestObject and returns the CaCrls GET path
// Returns all available crl types
func (c *CaCrl) GetPath() string { return fmt.Sprintf("/api/objects/ca/crl/%s", c.Reference) }
// RefRequired implements sophos.RestObject
func (c *CaCrl) RefRequired() (string, bool) { return c.Reference, true }
// DeletePath implements sophos.RestObject and returns the CaCrl DELETE path
// Creates or updates the complete object crl
func (*CaCrl) DeletePath(ref string) string {
return fmt.Sprintf("/api/objects/ca/crl/%s", ref)
}
// PatchPath implements sophos.RestObject and returns the CaCrl PATCH path
// Changes to parts of the object crl types
func (*CaCrl) PatchPath(ref string) string {
return fmt.Sprintf("/api/objects/ca/crl/%s", ref)
}
// PostPath implements sophos.RestObject and returns the CaCrl POST path
// Create a new ca/crl object
func (*CaCrl) PostPath() string {
return "/api/objects/ca/crl/"
}
// PutPath implements sophos.RestObject and returns the CaCrl PUT path
// Creates or updates the complete object crl
func (*CaCrl) PutPath(ref string) string {
return fmt.Sprintf("/api/objects/ca/crl/%s", ref)
}
// UsedByPath implements sophos.RestObject
// Returns the objects and the nodes that use the object with the given ref
func (*CaCrl) UsedByPath(ref string) string {
return fmt.Sprintf("/api/objects/ca/crl/%s/usedby", ref)
}
// CaCsrs is an Sophos Endpoint subType and implements sophos.RestObject
type CaCsrs []CaCsr
// CaCsr represents a UTM Let's Encrypt certificate
type CaCsr struct {
Locked string `json:"_locked"`
ObjectType string `json:"_type"`
Reference string `json:"_ref"`
// Address description: REF(network/interface_address)
Address string `json:"address"`
// Certificate description: REF(ca/host_key_cert)
// Certificate default value is ""
Certificate string `json:"certificate"`
Comment string `json:"comment"`
Domain []string `json:"domain"`
// ErrorInfo default value is ""
ErrorInfo string `json:"error_info"`
// ErrorMessage default value is ""
ErrorMessage string `json:"error_message"`
Name string `json:"name"`
// Renew default value is false
Renew bool `json:"renew"`
// TemporaryCert default value is false
TemporaryCert bool `json:"temporary_cert"`
}
var _ sophos.RestGetter = &CaCsr{}
// GetPath implements sophos.RestObject and returns the CaCsrs GET path
// Returns all available ca/csr objects
func (*CaCsrs) GetPath() string { return "/api/objects/ca/csr/" }
// RefRequired implements sophos.RestObject
func (*CaCsrs) RefRequired() (string, bool) { return "", false }
// GetPath implements sophos.RestObject and returns the CaCsrs GET path
// Returns all available csr types
func (c *CaCsr) GetPath() string { return fmt.Sprintf("/api/objects/ca/csr/%s", c.Reference) }
// RefRequired implements sophos.RestObject
func (c *CaCsr) RefRequired() (string, bool) { return c.Reference, true }
// DeletePath implements sophos.RestObject and returns the CaCsr DELETE path
// Creates or updates the complete object csr
func (*CaCsr) DeletePath(ref string) string {
return fmt.Sprintf("/api/objects/ca/csr/%s", ref)
}
// PatchPath implements sophos.RestObject and returns the CaCsr PATCH path
// Changes to parts of the object csr types
func (*CaCsr) PatchPath(ref string) string {
return fmt.Sprintf("/api/objects/ca/csr/%s", ref)
}
// PostPath implements sophos.RestObject and returns the CaCsr POST path
// Create a new ca/csr object
func (*CaCsr) PostPath() string {
return "/api/objects/ca/csr/"
}
// PutPath implements sophos.RestObject and returns the CaCsr PUT path
// Creates or updates the complete object csr
func (*CaCsr) PutPath(ref string) string {
return fmt.Sprintf("/api/objects/ca/csr/%s", ref)
}
// UsedByPath implements sophos.RestObject
// Returns the objects and the nodes that use the object with the given ref
func (*CaCsr) UsedByPath(ref string) string {
return fmt.Sprintf("/api/objects/ca/csr/%s/usedby", ref)
}
// CaGroups is an Sophos Endpoint subType and implements sophos.RestObject
type CaGroups []CaGroup
// CaGroup represents a UTM group
type CaGroup struct {
Locked string `json:"_locked"`
ObjectType string `json:"_type"`
Reference string `json:"_ref"`
Comment string `json:"comment"`
Name string `json:"name"`
}
var _ sophos.RestGetter = &CaGroup{}
// GetPath implements sophos.RestObject and returns the CaGroups GET path
// Returns all available ca/group objects
func (*CaGroups) GetPath() string { return "/api/objects/ca/group/" }
// RefRequired implements sophos.RestObject
func (*CaGroups) RefRequired() (string, bool) { return "", false }
// GetPath implements sophos.RestObject and returns the CaGroups GET path
// Returns all available group types
func (c *CaGroup) GetPath() string { return fmt.Sprintf("/api/objects/ca/group/%s", c.Reference) }
// RefRequired implements sophos.RestObject
func (c *CaGroup) RefRequired() (string, bool) { return c.Reference, true }
// DeletePath implements sophos.RestObject and returns the CaGroup DELETE path
// Creates or updates the complete object group
func (*CaGroup) DeletePath(ref string) string {
return fmt.Sprintf("/api/objects/ca/group/%s", ref)
}
// PatchPath implements sophos.RestObject and returns the CaGroup PATCH path
// Changes to parts of the object group types
func (*CaGroup) PatchPath(ref string) string {
return fmt.Sprintf("/api/objects/ca/group/%s", ref)
}
// PostPath implements sophos.RestObject and returns the CaGroup POST path
// Create a new ca/group object
func (*CaGroup) PostPath() string {
return "/api/objects/ca/group/"
}
// PutPath implements sophos.RestObject and returns the CaGroup PUT path
// Creates or updates the complete object group
func (*CaGroup) PutPath(ref string) string {
return fmt.Sprintf("/api/objects/ca/group/%s", ref)
}
// UsedByPath implements sophos.RestObject
// Returns the objects and the nodes that use the object with the given ref
func (*CaGroup) UsedByPath(ref string) string {
return fmt.Sprintf("/api/objects/ca/group/%s/usedby", ref)
}
// CaHostCerts is an Sophos Endpoint subType and implements sophos.RestObject
type CaHostCerts []CaHostCert
// CaHostCert represents a UTM X509 certificate
type CaHostCert struct {
Locked string `json:"_locked"`
ObjectType string `json:"_type"`
Reference string `json:"_ref"`
Certificate string `json:"certificate"`
Comment string `json:"comment"`
// Meta description: REF(ca/meta_x509)
Meta string `json:"meta"`
Name string `json:"name"`
}
var _ sophos.RestGetter = &CaHostCert{}
// GetPath implements sophos.RestObject and returns the CaHostCerts GET path
// Returns all available ca/host_cert objects
func (*CaHostCerts) GetPath() string { return "/api/objects/ca/host_cert/" }
// RefRequired implements sophos.RestObject
func (*CaHostCerts) RefRequired() (string, bool) { return "", false }
// GetPath implements sophos.RestObject and returns the CaHostCerts GET path
// Returns all available host_cert types
func (c *CaHostCert) GetPath() string {
return fmt.Sprintf("/api/objects/ca/host_cert/%s", c.Reference)
}
// RefRequired implements sophos.RestObject
func (c *CaHostCert) RefRequired() (string, bool) { return c.Reference, true }
// DeletePath implements sophos.RestObject and returns the CaHostCert DELETE path
// Creates or updates the complete object host_cert
func (*CaHostCert) DeletePath(ref string) string {
return fmt.Sprintf("/api/objects/ca/host_cert/%s", ref)
}
// PatchPath implements sophos.RestObject and returns the CaHostCert PATCH path
// Changes to parts of the object host_cert types
func (*CaHostCert) PatchPath(ref string) string {
return fmt.Sprintf("/api/objects/ca/host_cert/%s", ref)
}
// PostPath implements sophos.RestObject and returns the CaHostCert POST path
// Create a new ca/host_cert object
func (*CaHostCert) PostPath() string {
return "/api/objects/ca/host_cert/"
}
// PutPath implements sophos.RestObject and returns the CaHostCert PUT path
// Creates or updates the complete object host_cert
func (*CaHostCert) PutPath(ref string) string {
return fmt.Sprintf("/api/objects/ca/host_cert/%s", ref)
}
// UsedByPath implements sophos.RestObject
// Returns the objects and the nodes that use the object with the given ref
func (*CaHostCert) UsedByPath(ref string) string {
return fmt.Sprintf("/api/objects/ca/host_cert/%s/usedby", ref)
}
// CaHostKeyCerts is an Sophos Endpoint subType and implements sophos.RestObject
type CaHostKeyCerts []CaHostKeyCert
// CaHostKeyCert represents a UTM X509 certificate with private key
type CaHostKeyCert struct {
Locked string `json:"_locked"`
ObjectType string `json:"_type"`
Reference string `json:"_ref"`
// Ca description: REF(ca/signing_ca), REF(ca/verification_ca)
Ca string `json:"ca"`
Certificate string `json:"certificate"`
Comment string `json:"comment"`
// Encrypted default value is false
Encrypted bool `json:"encrypted"`
// Key default value is ""
Key string `json:"key"`
// Meta description: REF(ca/meta_x509)
Meta string `json:"meta"`
Name string `json:"name"`
}
var _ sophos.RestGetter = &CaHostKeyCert{}
// GetPath implements sophos.RestObject and returns the CaHostKeyCerts GET path
// Returns all available ca/host_key_cert objects
func (*CaHostKeyCerts) GetPath() string { return "/api/objects/ca/host_key_cert/" }
// RefRequired implements sophos.RestObject
func (*CaHostKeyCerts) RefRequired() (string, bool) { return "", false }
// GetPath implements sophos.RestObject and returns the CaHostKeyCerts GET path
// Returns all available host_key_cert types
func (c *CaHostKeyCert) GetPath() string {
return fmt.Sprintf("/api/objects/ca/host_key_cert/%s", c.Reference)
}
// RefRequired implements sophos.RestObject
func (c *CaHostKeyCert) RefRequired() (string, bool) { return c.Reference, true }
// DeletePath implements sophos.RestObject and returns the CaHostKeyCert DELETE path
// Creates or updates the complete object host_key_cert
func (*CaHostKeyCert) DeletePath(ref string) string {
return fmt.Sprintf("/api/objects/ca/host_key_cert/%s", ref)
}
// PatchPath implements sophos.RestObject and returns the CaHostKeyCert PATCH path
// Changes to parts of the object host_key_cert types
func (*CaHostKeyCert) PatchPath(ref string) string {
return fmt.Sprintf("/api/objects/ca/host_key_cert/%s", ref)
}
// PostPath implements sophos.RestObject and returns the CaHostKeyCert POST path
// Create a new ca/host_key_cert object
func (*CaHostKeyCert) PostPath() string {
return "/api/objects/ca/host_key_cert/"
}
// PutPath implements sophos.RestObject and returns the CaHostKeyCert PUT path
// Creates or updates the complete object host_key_cert
func (*CaHostKeyCert) PutPath(ref string) string {
return fmt.Sprintf("/api/objects/ca/host_key_cert/%s", ref)
}
// UsedByPath implements sophos.RestObject
// Returns the objects and the nodes that use the object with the given ref
func (*CaHostKeyCert) UsedByPath(ref string) string {
return fmt.Sprintf("/api/objects/ca/host_key_cert/%s/usedby", ref)
}
// CaHttpVerificationCas is an Sophos Endpoint subType and implements sophos.RestObject
type CaHttpVerificationCas []CaHttpVerificationCa
// CaHttpVerificationCa represents a UTM HTTPS verification CA
type CaHttpVerificationCa struct {
Locked string `json:"_locked"`
ObjectType string `json:"_type"`
Reference string `json:"_ref"`
Certificate string `json:"certificate"`
Comment string `json:"comment"`
// Meta description: REF(ca/meta_x509)
Meta string `json:"meta"`
Name string `json:"name"`
// Trust default value is false
Trust bool `json:"trust"`
}
var _ sophos.RestGetter = &CaHttpVerificationCa{}
// GetPath implements sophos.RestObject and returns the CaHttpVerificationCas GET path
// Returns all available ca/http_verification_ca objects
func (*CaHttpVerificationCas) GetPath() string { return "/api/objects/ca/http_verification_ca/" }
// RefRequired implements sophos.RestObject
func (*CaHttpVerificationCas) RefRequired() (string, bool) { return "", false }
// GetPath implements sophos.RestObject and returns the CaHttpVerificationCas GET path
// Returns all available http_verification_ca types
func (c *CaHttpVerificationCa) GetPath() string {
return fmt.Sprintf("/api/objects/ca/http_verification_ca/%s", c.Reference)
}
// RefRequired implements sophos.RestObject
func (c *CaHttpVerificationCa) RefRequired() (string, bool) { return c.Reference, true }
// DeletePath implements sophos.RestObject and returns the CaHttpVerificationCa DELETE path
// Creates or updates the complete object http_verification_ca
func (*CaHttpVerificationCa) DeletePath(ref string) string {
return fmt.Sprintf("/api/objects/ca/http_verification_ca/%s", ref)
}
// PatchPath implements sophos.RestObject and returns the CaHttpVerificationCa PATCH path
// Changes to parts of the object http_verification_ca types
func (*CaHttpVerificationCa) PatchPath(ref string) string {
return fmt.Sprintf("/api/objects/ca/http_verification_ca/%s", ref)
}
// PostPath implements sophos.RestObject and returns the CaHttpVerificationCa POST path
// Create a new ca/http_verification_ca object
func (*CaHttpVerificationCa) PostPath() string {
return "/api/objects/ca/http_verification_ca/"
}
// PutPath implements sophos.RestObject and returns the CaHttpVerificationCa PUT path
// Creates or updates the complete object http_verification_ca
func (*CaHttpVerificationCa) PutPath(ref string) string {
return fmt.Sprintf("/api/objects/ca/http_verification_ca/%s", ref)
}
// UsedByPath implements sophos.RestObject
// Returns the objects and the nodes that use the object with the given ref
func (*CaHttpVerificationCa) UsedByPath(ref string) string {
return fmt.Sprintf("/api/objects/ca/http_verification_ca/%s/usedby", ref)
}
// CaMetaCrls is an Sophos Endpoint subType and implements sophos.RestObject
type CaMetaCrls []CaMetaCrl
// CaMetaCrl represents a UTM CRL meta information
type CaMetaCrl struct {
Locked string `json:"_locked"`
ObjectType string `json:"_type"`
Reference string `json:"_ref"`
Comment string `json:"comment"`
Hash string `json:"hash"`
Issuer string `json:"issuer"`
Lastupdate string `json:"lastupdate"`
Name string `json:"name"`
Nextupdate string `json:"nextupdate"`
}
var _ sophos.RestGetter = &CaMetaCrl{}
// GetPath implements sophos.RestObject and returns the CaMetaCrls GET path
// Returns all available ca/meta_crl objects
func (*CaMetaCrls) GetPath() string { return "/api/objects/ca/meta_crl/" }
// RefRequired implements sophos.RestObject
func (*CaMetaCrls) RefRequired() (string, bool) { return "", false }
// GetPath implements sophos.RestObject and returns the CaMetaCrls GET path
// Returns all available meta_crl types
func (c *CaMetaCrl) GetPath() string { return fmt.Sprintf("/api/objects/ca/meta_crl/%s", c.Reference) }
// RefRequired implements sophos.RestObject
func (c *CaMetaCrl) RefRequired() (string, bool) { return c.Reference, true }
// DeletePath implements sophos.RestObject and returns the CaMetaCrl DELETE path
// Creates or updates the complete object meta_crl
func (*CaMetaCrl) DeletePath(ref string) string {
return fmt.Sprintf("/api/objects/ca/meta_crl/%s", ref)
}
// PatchPath implements sophos.RestObject and returns the CaMetaCrl PATCH path
// Changes to parts of the object meta_crl types
func (*CaMetaCrl) PatchPath(ref string) string {
return fmt.Sprintf("/api/objects/ca/meta_crl/%s", ref)
}
// PostPath implements sophos.RestObject and returns the CaMetaCrl POST path
// Create a new ca/meta_crl object
func (*CaMetaCrl) PostPath() string {
return "/api/objects/ca/meta_crl/"
}
// PutPath implements sophos.RestObject and returns the CaMetaCrl PUT path
// Creates or updates the complete object meta_crl
func (*CaMetaCrl) PutPath(ref string) string {
return fmt.Sprintf("/api/objects/ca/meta_crl/%s", ref)
}
// UsedByPath implements sophos.RestObject
// Returns the objects and the nodes that use the object with the given ref
func (*CaMetaCrl) UsedByPath(ref string) string {
return fmt.Sprintf("/api/objects/ca/meta_crl/%s/usedby", ref)
}
// CaMetaX509s is an Sophos Endpoint subType and implements sophos.RestObject
type CaMetaX509s []CaMetaX509
// CaMetaX509 represents a UTM certificate meta information
type CaMetaX509 struct {
Locked string `json:"_locked"`
ObjectType string `json:"_type"`
Reference string `json:"_ref"`
Comment string `json:"comment"`
Enddate string `json:"enddate"`
Fingerprint string `json:"fingerprint"`
// Issuer default value is ""
Issuer string `json:"issuer"`
// IssuerHash default value is ""
IssuerHash string `json:"issuer_hash"`
Name string `json:"name"`
PublicKeyAlgorithm string `json:"public_key_algorithm"`
Serial string `json:"serial"`
Startdate string `json:"startdate"`
// Subject default value is ""
Subject string `json:"subject"`
SubjectAltNames []string `json:"subject_alt_names"`
// SubjectHash default value is ""
SubjectHash string `json:"subject_hash"`
// VpnId default value is ""
VpnId string `json:"vpn_id"`
// VpnIdType can be one of: []string{"ipv4_address", "fqdn", "user_fqdn", "der_asn1_dn"}
VpnIdType string `json:"vpn_id_type"`
}
var _ sophos.RestGetter = &CaMetaX509{}
// GetPath implements sophos.RestObject and returns the CaMetaX509s GET path
// Returns all available ca/meta_x509 objects
func (*CaMetaX509s) GetPath() string { return "/api/objects/ca/meta_x509/" }
// RefRequired implements sophos.RestObject
func (*CaMetaX509s) RefRequired() (string, bool) { return "", false }
// GetPath implements sophos.RestObject and returns the CaMetaX509s GET path
// Returns all available meta_x509 types
func (c *CaMetaX509) GetPath() string {
return fmt.Sprintf("/api/objects/ca/meta_x509/%s", c.Reference)
}
// RefRequired implements sophos.RestObject
func (c *CaMetaX509) RefRequired() (string, bool) { return c.Reference, true }
// DeletePath implements sophos.RestObject and returns the CaMetaX509 DELETE path
// Creates or updates the complete object meta_x509
func (*CaMetaX509) DeletePath(ref string) string {
return fmt.Sprintf("/api/objects/ca/meta_x509/%s", ref)
}
// PatchPath implements sophos.RestObject and returns the CaMetaX509 PATCH path
// Changes to parts of the object meta_x509 types
func (*CaMetaX509) PatchPath(ref string) string {
return fmt.Sprintf("/api/objects/ca/meta_x509/%s", ref)
}
// PostPath implements sophos.RestObject and returns the CaMetaX509 POST path
// Create a new ca/meta_x509 object
func (*CaMetaX509) PostPath() string {
return "/api/objects/ca/meta_x509/"
}
// PutPath implements sophos.RestObject and returns the CaMetaX509 PUT path
// Creates or updates the complete object meta_x509
func (*CaMetaX509) PutPath(ref string) string {
return fmt.Sprintf("/api/objects/ca/meta_x509/%s", ref)
}
// UsedByPath implements sophos.RestObject
// Returns the objects and the nodes that use the object with the given ref
func (*CaMetaX509) UsedByPath(ref string) string {
return fmt.Sprintf("/api/objects/ca/meta_x509/%s/usedby", ref)
}
// CaRsas is an Sophos Endpoint subType and implements sophos.RestObject
type CaRsas []CaRsa
// CaRsa represents a UTM RSA key
type CaRsa struct {
Locked string `json:"_locked"`
ObjectType string `json:"_type"`
Reference string `json:"_ref"`
Comment string `json:"comment"`
Key string `json:"key"`
KeySize int `json:"key_size"`
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 = &CaRsa{}
// GetPath implements sophos.RestObject and returns the CaRsas GET path
// Returns all available ca/rsa objects
func (*CaRsas) GetPath() string { return "/api/objects/ca/rsa/" }
// RefRequired implements sophos.RestObject
func (*CaRsas) RefRequired() (string, bool) { return "", false }
// GetPath implements sophos.RestObject and returns the CaRsas GET path
// Returns all available rsa types
func (c *CaRsa) GetPath() string { return fmt.Sprintf("/api/objects/ca/rsa/%s", c.Reference) }
// RefRequired implements sophos.RestObject
func (c *CaRsa) RefRequired() (string, bool) { return c.Reference, true }
// DeletePath implements sophos.RestObject and returns the CaRsa DELETE path
// Creates or updates the complete object rsa
func (*CaRsa) DeletePath(ref string) string {
return fmt.Sprintf("/api/objects/ca/rsa/%s", ref)
}
// PatchPath implements sophos.RestObject and returns the CaRsa PATCH path
// Changes to parts of the object rsa types
func (*CaRsa) PatchPath(ref string) string {
return fmt.Sprintf("/api/objects/ca/rsa/%s", ref)
}
// PostPath implements sophos.RestObject and returns the CaRsa POST path
// Create a new ca/rsa object
func (*CaRsa) PostPath() string {
return "/api/objects/ca/rsa/"
}
// PutPath implements sophos.RestObject and returns the CaRsa PUT path
// Creates or updates the complete object rsa
func (*CaRsa) PutPath(ref string) string {
return fmt.Sprintf("/api/objects/ca/rsa/%s", ref)
}
// UsedByPath implements sophos.RestObject
// Returns the objects and the nodes that use the object with the given ref
func (*CaRsa) UsedByPath(ref string) string {
return fmt.Sprintf("/api/objects/ca/rsa/%s/usedby", ref)
}
// CaSigningCas is an Sophos Endpoint subType and implements sophos.RestObject
type CaSigningCas []CaSigningCa
// CaSigningCa represents a UTM X509 signing CA
type CaSigningCa struct {
Locked string `json:"_locked"`
ObjectType string `json:"_type"`
Reference string `json:"_ref"`
Certificate string `json:"certificate"`
Comment string `json:"comment"`
Config string `json:"config"`
// Encrypted default value is false
Encrypted bool `json:"encrypted"`
Index string `json:"index"`
Key string `json:"key"`
// Meta description: REF(ca/meta_x509)
Meta string `json:"meta"`
Name string `json:"name"`
Serial string `json:"serial"`
}
var _ sophos.RestGetter = &CaSigningCa{}
// GetPath implements sophos.RestObject and returns the CaSigningCas GET path
// Returns all available ca/signing_ca objects
func (*CaSigningCas) GetPath() string { return "/api/objects/ca/signing_ca/" }
// RefRequired implements sophos.RestObject
func (*CaSigningCas) RefRequired() (string, bool) { return "", false }
// GetPath implements sophos.RestObject and returns the CaSigningCas GET path
// Returns all available signing_ca types
func (c *CaSigningCa) GetPath() string {
return fmt.Sprintf("/api/objects/ca/signing_ca/%s", c.Reference)
}
// RefRequired implements sophos.RestObject
func (c *CaSigningCa) RefRequired() (string, bool) { return c.Reference, true }
// DeletePath implements sophos.RestObject and returns the CaSigningCa DELETE path
// Creates or updates the complete object signing_ca
func (*CaSigningCa) DeletePath(ref string) string {
return fmt.Sprintf("/api/objects/ca/signing_ca/%s", ref)
}
// PatchPath implements sophos.RestObject and returns the CaSigningCa PATCH path
// Changes to parts of the object signing_ca types
func (*CaSigningCa) PatchPath(ref string) string {
return fmt.Sprintf("/api/objects/ca/signing_ca/%s", ref)
}
// PostPath implements sophos.RestObject and returns the CaSigningCa POST path
// Create a new ca/signing_ca object
func (*CaSigningCa) PostPath() string {
return "/api/objects/ca/signing_ca/"
}
// PutPath implements sophos.RestObject and returns the CaSigningCa PUT path
// Creates or updates the complete object signing_ca
func (*CaSigningCa) PutPath(ref string) string {
return fmt.Sprintf("/api/objects/ca/signing_ca/%s", ref)
}
// UsedByPath implements sophos.RestObject
// Returns the objects and the nodes that use the object with the given ref
func (*CaSigningCa) UsedByPath(ref string) string {
return fmt.Sprintf("/api/objects/ca/signing_ca/%s/usedby", ref)
}
// CaVerificationCas is an Sophos Endpoint subType and implements sophos.RestObject
type CaVerificationCas []CaVerificationCa
// CaVerificationCa represents a UTM X509 verification CA
type CaVerificationCa struct {
Locked string `json:"_locked"`
ObjectType string `json:"_type"`
Reference string `json:"_ref"`
Certificate string `json:"certificate"`
Comment string `json:"comment"`
// Meta description: REF(ca/meta_x509)
Meta string `json:"meta"`
Name string `json:"name"`
}
var _ sophos.RestGetter = &CaVerificationCa{}
// GetPath implements sophos.RestObject and returns the CaVerificationCas GET path
// Returns all available ca/verification_ca objects
func (*CaVerificationCas) GetPath() string { return "/api/objects/ca/verification_ca/" }
// RefRequired implements sophos.RestObject
func (*CaVerificationCas) RefRequired() (string, bool) { return "", false }
// GetPath implements sophos.RestObject and returns the CaVerificationCas GET path
// Returns all available verification_ca types
func (c *CaVerificationCa) GetPath() string {
return fmt.Sprintf("/api/objects/ca/verification_ca/%s", c.Reference)
}
// RefRequired implements sophos.RestObject
func (c *CaVerificationCa) RefRequired() (string, bool) { return c.Reference, true }
// DeletePath implements sophos.RestObject and returns the CaVerificationCa DELETE path
// Creates or updates the complete object verification_ca
func (*CaVerificationCa) DeletePath(ref string) string {
return fmt.Sprintf("/api/objects/ca/verification_ca/%s", ref)
}
// PatchPath implements sophos.RestObject and returns the CaVerificationCa PATCH path
// Changes to parts of the object verification_ca types
func (*CaVerificationCa) PatchPath(ref string) string {
return fmt.Sprintf("/api/objects/ca/verification_ca/%s", ref)
}
// PostPath implements sophos.RestObject and returns the CaVerificationCa POST path
// Create a new ca/verification_ca object
func (*CaVerificationCa) PostPath() string {
return "/api/objects/ca/verification_ca/"
}
// PutPath implements sophos.RestObject and returns the CaVerificationCa PUT path
// Creates or updates the complete object verification_ca
func (*CaVerificationCa) PutPath(ref string) string {
return fmt.Sprintf("/api/objects/ca/verification_ca/%s", ref)
}
// UsedByPath implements sophos.RestObject
// Returns the objects and the nodes that use the object with the given ref
func (*CaVerificationCa) UsedByPath(ref string) string {
return fmt.Sprintf("/api/objects/ca/verification_ca/%s/usedby", ref)
}