-
Notifications
You must be signed in to change notification settings - Fork 4
/
aaa.go
247 lines (210 loc) · 8.78 KB
/
aaa.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
package objects
// THIS FILE IS AUTO GENERATED BY bin/gen.go! DO NOT EDIT!
import (
"fmt"
"github.com/esurdam/go-sophos"
)
// Aaa is a generated struct representing the Sophos Aaa Endpoint
// GET /api/nodes/aaa
type Aaa struct {
AaaGroup AaaGroup `json:"aaa_group"`
AaaUser AaaUser `json:"aaa_user"`
}
var _ sophos.Endpoint = &Aaa{}
var defsAaa = map[string]sophos.RestObject{
"AaaGroup": &AaaGroup{},
"AaaUser": &AaaUser{},
}
// RestObjects implements the sophos.Node interface and returns a map of Aaa's Objects
func (Aaa) RestObjects() map[string]sophos.RestObject { return defsAaa }
// GetPath implements sophos.RestGetter
func (*Aaa) GetPath() string { return "/api/nodes/aaa" }
// RefRequired implements sophos.RestGetter
func (*Aaa) RefRequired() (string, bool) { return "", false }
var defAaa = &sophos.Definition{Description: "aaa", Name: "aaa", Link: "/api/definitions/aaa"}
// Definition returns the /api/definitions struct of Aaa
func (Aaa) Definition() sophos.Definition { return *defAaa }
// ApiRoutes returns all known Aaa Paths
func (Aaa) ApiRoutes() []string {
return []string{
"/api/objects/aaa/group/",
"/api/objects/aaa/group/{ref}",
"/api/objects/aaa/group/{ref}/usedby",
"/api/objects/aaa/user/",
"/api/objects/aaa/user/{ref}",
"/api/objects/aaa/user/{ref}/usedby",
}
}
// References returns the Aaa's references. These strings serve no purpose other than to demonstrate which
// Reference keys are used for this Endpoint
func (Aaa) References() []string {
return []string{
"REF_AaaGroup",
"REF_AaaUser",
}
}
// AaaGroups is an Sophos Endpoint subType and implements sophos.RestObject
type AaaGroups []AaaGroup
// AaaGroup represents a UTM user group
type AaaGroup struct {
Locked string `json:"_locked"`
ObjectType string `json:"_type"`
Reference string `json:"_ref"`
AdirectoryGroups []string `json:"adirectory_groups"`
// AdirectoryGroupsSids description: (HASH)
AdirectoryGroupsSids interface{} `json:"adirectory_groups_sids"`
// BackendMatch can be one of: []string{"none", "adirectory", "edirectory", "radius", "tacacs", "ldap"}
// BackendMatch default value is "none"
BackendMatch string `json:"backend_match"`
Comment string `json:"comment"`
// Dynamic can be one of: []string{"none", "ipsec_dn", "directory_groups"}
// Dynamic default value is "none"
Dynamic string `json:"dynamic"`
EdirectoryGroups []string `json:"edirectory_groups"`
// IpsecDn default value is ""
IpsecDn string `json:"ipsec_dn"`
// LdapAttribute default value is ""
LdapAttribute string `json:"ldap_attribute"`
// LdapAttributeValue default value is ""
LdapAttributeValue string `json:"ldap_attribute_value"`
Members []string `json:"members"`
Name string `json:"name"`
// Network description: REF(network/aaa)
// Network default value is ""
Network string `json:"network"`
RadiusGroups []string `json:"radius_groups"`
TacacsGroups []string `json:"tacacs_groups"`
}
var _ sophos.RestGetter = &AaaGroup{}
// GetPath implements sophos.RestObject and returns the AaaGroups GET path
// Returns all available aaa/group objects
func (*AaaGroups) GetPath() string { return "/api/objects/aaa/group/" }
// RefRequired implements sophos.RestObject
func (*AaaGroups) RefRequired() (string, bool) { return "", false }
// GetPath implements sophos.RestObject and returns the AaaGroups GET path
// Returns all available group types
func (a *AaaGroup) GetPath() string { return fmt.Sprintf("/api/objects/aaa/group/%s", a.Reference) }
// RefRequired implements sophos.RestObject
func (a *AaaGroup) RefRequired() (string, bool) { return a.Reference, true }
// DeletePath implements sophos.RestObject and returns the AaaGroup DELETE path
// Creates or updates the complete object group
func (*AaaGroup) DeletePath(ref string) string {
return fmt.Sprintf("/api/objects/aaa/group/%s", ref)
}
// PatchPath implements sophos.RestObject and returns the AaaGroup PATCH path
// Changes to parts of the object group types
func (*AaaGroup) PatchPath(ref string) string {
return fmt.Sprintf("/api/objects/aaa/group/%s", ref)
}
// PostPath implements sophos.RestObject and returns the AaaGroup POST path
// Create a new aaa/group object
func (*AaaGroup) PostPath() string {
return "/api/objects/aaa/group/"
}
// PutPath implements sophos.RestObject and returns the AaaGroup PUT path
// Creates or updates the complete object group
func (*AaaGroup) PutPath(ref string) string {
return fmt.Sprintf("/api/objects/aaa/group/%s", ref)
}
// UsedByPath implements sophos.RestObject
// Returns the objects and the nodes that use the object with the given ref
func (*AaaGroup) UsedByPath(ref string) string {
return fmt.Sprintf("/api/objects/aaa/group/%s/usedby", ref)
}
// AaaUsers is an Sophos Endpoint subType and implements sophos.RestObject
type AaaUsers []AaaUser
// AaaUser represents a UTM user
type AaaUser struct {
Locked string `json:"_locked"`
ObjectType string `json:"_type"`
Reference string `json:"_ref"`
// AccManaged default value is false
AccManaged bool `json:"acc_managed"`
AllowedNetworks []string `json:"allowed_networks"`
// Authentication can be one of: []string{"none", "local", "remote"}
// Authentication default value is "local"
Authentication string `json:"authentication"`
// BackendUpdate default value is false
BackendUpdate bool `json:"backend_update"`
// Clearpass default value is ""
Clearpass string `json:"clearpass"`
Comment string `json:"comment"`
// EmailPrimary description: (EMAIL)
// EmailPrimary default value is ""
EmailPrimary string `json:"email_primary"`
EmailSecondary []string `json:"email_secondary"`
// Enabled default value is false
Enabled bool `json:"enabled"`
// LastauthBackend default value is ""
LastauthBackend string `json:"lastauth_backend"`
// LastauthFacility default value is ""
LastauthFacility string `json:"lastauth_facility"`
LastauthTime int `json:"lastauth_time"`
// Loc default value is "english"
Loc string `json:"loc"`
// Md4Hash default value is ""
Md4Hash string `json:"md4hash"`
Name string `json:"name"`
// Network description: REF(network/aaa)
// Network default value is ""
Network string `json:"network"`
Pop3Accounts []string `json:"pop3_accounts"`
// RasIp description: (IPADDR)
// RasIp default value is "0.0.0.0"
RasIp string `json:"ras_ip"`
// RasOnline default value is false
RasOnline bool `json:"ras_online"`
// Realname default value is ""
Realname string `json:"realname"`
SenderBlacklist []string `json:"sender_blacklist"`
SenderWhitelist []string `json:"sender_whitelist"`
// Status default value is false
Status bool `json:"status"`
// UseRasIp default value is false
UseRasIp bool `json:"use_ras_ip"`
// UserPreferences description: REF(user_preferences/webadmin)
// UserPreferences default value is ""
UserPreferences string `json:"user_preferences"`
// X509Cert description: REF(ipsec_remote_auth/x509)
// X509Cert default value is ""
X509Cert string `json:"x509_cert"`
// X509CertGost description: REF(ipsec_remote_auth/x509)
// X509CertGost default value is ""
X509CertGost string `json:"x509_cert_gost"`
}
var _ sophos.RestGetter = &AaaUser{}
// GetPath implements sophos.RestObject and returns the AaaUsers GET path
// Returns all available aaa/user objects
func (*AaaUsers) GetPath() string { return "/api/objects/aaa/user/" }
// RefRequired implements sophos.RestObject
func (*AaaUsers) RefRequired() (string, bool) { return "", false }
// GetPath implements sophos.RestObject and returns the AaaUsers GET path
// Returns all available user types
func (a *AaaUser) GetPath() string { return fmt.Sprintf("/api/objects/aaa/user/%s", a.Reference) }
// RefRequired implements sophos.RestObject
func (a *AaaUser) RefRequired() (string, bool) { return a.Reference, true }
// DeletePath implements sophos.RestObject and returns the AaaUser DELETE path
// Creates or updates the complete object user
func (*AaaUser) DeletePath(ref string) string {
return fmt.Sprintf("/api/objects/aaa/user/%s", ref)
}
// PatchPath implements sophos.RestObject and returns the AaaUser PATCH path
// Changes to parts of the object user types
func (*AaaUser) PatchPath(ref string) string {
return fmt.Sprintf("/api/objects/aaa/user/%s", ref)
}
// PostPath implements sophos.RestObject and returns the AaaUser POST path
// Create a new aaa/user object
func (*AaaUser) PostPath() string {
return "/api/objects/aaa/user/"
}
// PutPath implements sophos.RestObject and returns the AaaUser PUT path
// Creates or updates the complete object user
func (*AaaUser) PutPath(ref string) string {
return fmt.Sprintf("/api/objects/aaa/user/%s", ref)
}
// UsedByPath implements sophos.RestObject
// Returns the objects and the nodes that use the object with the given ref
func (*AaaUser) UsedByPath(ref string) string {
return fmt.Sprintf("/api/objects/aaa/user/%s/usedby", ref)
}