blob: 31efcf2069cf3b7eab444c3fdf6c8c8365ca1e99 [file] [log] [blame]
Srikanth Vavilapalli1725e492014-12-01 17:50:52 -08001#
2# Copyright (c) 2013 Big Switch Networks, Inc.
3#
4# Licensed under the Eclipse Public License, Version 1.0 (the
5# "License"); you may not use this file except in compliance with the
6# License. You may obtain a copy of the License at
7#
8# http://www.eclipse.org/legal/epl-v10.html
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13# implied. See the License for the specific language governing
14# permissions and limitations under the License.
15#
16"""
17TACACS_SERVER_HOST_COMMAND_DESCRIPTION = {
18 'name' : 'tacacs',
19 'mode' : 'config*',
20 'short-help' : 'TACACS timeout, ip server address',
21 'doc' : 'tacacs|tacacs',
22 'doc-example' : 'tacacs|tacacs-example',
23 'command-type' : 'config-object',
24 'obj-type' : 'tacacs-plus-host',
25 'parent-field' : None,
26 'args' : (
27 'server',
28 {
29 'choices' : (
30 (
31 {
32 'token' : 'timeout',
33 'data' : {
34 'id' : 'tacacs',
35 'timeout' : 0
36 },
37 'obj-type' : 'tacacs-plus-config',
38 'no-action' : 'write-object',
39 'short-help' : 'configure timeout',
40 'doc' : 'tacacs|tacacs-timeout',
41 },
42 {
43 'field' : 'timeout',
44 'type' : 'integer',
45 'data' : {
46 'id' : 'tacacs'
47 },
48 'obj-type' : 'tacacs-plus-config',
49 'action' : 'write-object',
50 'optional-for-no' : True,
51 },
52 ),
53 (
54 {
55 'token' : 'key',
56 'data' : {
57 'id' : 'tacacs',
58 'key' : '',
59 },
60 'no-action' : 'write-object',
61 'obj-type' : 'tacacs-plus-config',
62 'short-help' : 'set shared TACACS server key',
63 'doc' : 'tacacs|tacacs-key',
64 },
65 {
66 'field' : 'key',
67 'type' : 'string',
68 'data' : { 'id' : 'tacacs' },
69 'obj-type' : 'tacacs-plus-config',
70 'action' : 'write-object',
71 'optional-for-no' : True,
72 },
73 ),
74 (
75 {
76 'field' : 'ip',
77 'tag' : 'host',
78 'type' : 'ip-address-not-mask',
79 'completion' : 'complete-object-field',
80 'short-help' : 'set specific TACACS host properties',
81 'doc' : 'tacacs|tacacs-host',
82 },
83 {
84 'optional' : True,
85 'optional-for-no' : True,
86 'args' : (
87 {
88 'token' : 'key',
89 'no-action' : 'reset-fields-explicit',
90 'data' : { 'key' : '' },
91 'obj-type' : 'tacacs-plus-host',
92 'short-help' : 'set shared TACACS server key',
93 'doc' : 'tacacs|tacacs-host-key',
94 },
95 {
96 'optional-for-no' : True,
97 'args' : {
98 'field' : 'key',
99 'type' : 'string',
100 'obj-type' : 'tacacs-plus-host',
101 },
102 }
103 ),
104 },
105 ),
106 ),
107 },
108 )
109}
110
111TACACS_AAA_AUTHORIZATION_EXEC_COMMAND_DESCRIPTION = {
112 'name' : 'aaa',
113 'mode' : 'config*',
114 'short-help' : 'Configure authorization parameters',
115 'command-type' : 'config',
116 'doc' : 'aaa|aaa-authorization',
117 'doc-example' : 'aaa|aaa-authorization-example',
118 'obj-type' : 'tacacs-plus-config',
119 'no-action' : 'reset-fields-explicit',
120 'fields' : [ 'tacacs-plus-authz', 'local-authz' ],
121 'args' : (
122 'authorization',
123 {
124 'token' : 'exec',
125 'short-help' : 'Configure authorization for starting a shell',
126 'doc' : 'aaa|aaa-authorization-exec',
127 },
128 {
129 'token' : 'default',
130 'short-help' : 'Configure authorization for the default channel',
131 'doc' : 'aaa|aaa-authorization-exec-use-default',
132 },
133 {
134 'optional-for-no' : True,
135 'choices' : (
136 {
137 'token' : 'local',
138 'short-help' : 'Use local database for authorization',
139 'doc' : 'aaa|aaa-authorization-exec-use-local',
140 'action' : {
141 'proc' : 'write-object',
142 'data' : {
143 'id' : 'tacacs',
144 'local-authz' : True,
145 'tacacs-plus-authz' : False,
146 },
147 },
148 },
149 (
150 {
151 'token' : 'group',
152 'short-help' : 'Use a server-group',
153 },
154 {
155 'token' : 'tacacs+',
156 'short-help' : 'Use list of all defined TACACS+ hosts',
157 'doc' : 'aaa|aaa-authorization-exec-use-tacacs',
158 'action' : {
159 'proc' : 'write-object',
160 'data' : {
161 'id' : 'tacacs',
162 'local-authz' : False,
163 'tacacs-plus-authz' : True,
164 },
165 },
166 },
167 {
168 'token' : 'local',
169 'short-help' : 'Use local database for authorization',
170 'doc' : 'aaa|aaa-authorization-exec-use-local',
171 'optional' : True,
172 'action' : {
173 'proc' : 'write-object',
174 'data' : {
175 'id' : 'tacacs',
176 'local-authz' : True,
177 'tacacs-plus-authz' : True,
178 },
179 },
180 },
181 ),
182 ),
183 },
184 ),
185}
186
187TACACS_AAA_AUTHENTICATION_LOGIN_COMMAND_DESCRIPTION = {
188 'name' : 'aaa',
189 'mode' : 'config*',
190 'short-help' : 'Configure authentication parameters',
191 'doc' : 'aaa|aaa-authentication',
192 'doc-example' : 'aaa|aaa-authentication-example',
193 'command-type' : 'config',
194 'no-action' : 'reset-fields-explicit',
195 'obj-type' : 'tacacs-plus-config',
196 'fields' : [ 'tacacs-plus-authn', 'local-authn' ],
197 'args' : (
198 'authentication',
199 {
200 'token' : 'login',
201 'short-help' : 'Configure authentication for starting a shell',
202 'doc' : 'aaa|aaa-authentication-login',
203 },
204 {
205 'token' : 'default',
206 'short-help' : 'Configure authentication via the default channel',
207 'doc' : 'aaa|aaa-authentication-login-use-default',
208 },
209 {
210 'optional-for-no' : True,
211 'choices' : (
212 (
213 {
214 'token' : 'local',
215 'short-help' : 'Use local database for authentication',
216 'doc' : 'aaa|aaa-authentication-login-use-local',
217 'action' : {
218 'proc' : 'write-object',
219 'data' : {
220 'id' : 'tacacs',
221 'local-authn' : True,
222 'tacacs-plus-authn' : False,
223 },
224 },
225 },
226 ),
227 (
228 'group',
229 {
230 'token' : 'tacacs+',
231 'short-help' : 'Use list of all defined TACACS+ hosts',
232 'doc' : 'aaa|aaa-authentication-login-use-tacacs',
233 'action' : {
234 'proc' : 'write-object',
235 'data' : {
236 'id' : 'tacacs',
237 'local-authn' : False,
238 'tacacs-plus-authn' : True,
239 },
240 },
241 },
242 {
243 'token' : 'local',
244 'optional' : True,
245 'short-help' : 'Use local database for authentication',
246 'doc' : 'aaa|aaa-authentication-login-use-local',
247 'action' : {
248 'proc' : 'write-object',
249 'data' : {
250 'id' : 'tacacs',
251 'local-authn' : True,
252 'tacacs-plus-authn' : True,
253 },
254 },
255 },
256 ),
257 ),
258 },
259 ),
260}
261
262TACACS_AAA_ACCOUNTING_EXEC_COMMAND_DESCRIPTION = {
263 'name' : 'aaa',
264 'mode' : 'config*',
265 'short-help' : 'Configure accounting parameters',
266 'doc' : 'aaa|aaa-accounting',
267 'doc-example' : 'aaa|aaa-accounting-example',
268 'all-help' : 'Authentication, Authorization, and Accounting',
269 'command-type' : 'config',
270 'obj-type' : 'tacacs-plus-config',
271 'no-action' : 'reset-fields-explicit',
272 'fields' : [ 'tacacs-plus-acct' ],
273 'args' : (
274 'accounting',
275 {
276 'token' : 'exec',
277 'short-help' : 'Configure accounting for starting a shell',
278 'doc' : 'aaa|aaa-accounting-exec',
279 },
280 {
281 'token' : 'default',
282 'short-help' : 'Configure accounting for the default channel',
283 'doc' : 'aaa|aaa-authorization-exec-use-default',
284 },
285 {
286 'optional-for-no' : True,
287 'choices' : (
288 (
289 {
290 'token' : 'none',
291 'short-help' : 'No accounting',
292 'doc' : 'aaa|aaa-accounting-exec-use-none',
293 'action' : {
294 'proc' : 'write-object',
295 'data' : {
296 'id' : 'tacacs',
297 'tacacs-plus-acct' : False,
298 },
299 },
300 },
301 ),
302 (
303 {
304 'token' : 'start-stop',
305 'short-help' : 'Record start and stop',
306 'doc' : 'aaa|aaa-accounting-exec-use-start-stop',
307 },
308 {
309 'token' : 'group',
310 'short-help' : 'Use a server-group',
311 'doc' : 'aaa|aaa-accounting-exec-use-server-group',
312 },
313 {
314 'token' : 'tacacs+',
315 'short-help' : 'Use list of all defined TACACS+ hosts',
316 'doc' : 'aaa|aaa-accounting-exec-use-tacacs',
317 'action' : {
318 'proc' : 'write-object',
319 'data' : {
320 'id' : 'tacacs',
321 'tacacs-plus-acct' : True,
322 },
323 },
324 },
325 ),
326 ),
327 },
328 ),
329 }
330
331SHOW_TACACS_COMMAND_DESCRIPTION = {
332 'name' : 'show',
333 'mode' : 'login',
334 'short-help' : 'Show TACACS operational state',
335 'doc' : 'tacacs|show',
336 'doc-example' : 'tacacs|show-example',
337 'command-type' : 'display-table',
338 'obj-type' : 'tacacs-plus-config',
339 'parent-field' : None,
340 'args' : (
341 'tacacs',
342 ),
343 'action' : (
344 {
345 'proc' : 'display-table',
346 },
347 {
348 'proc' : 'display-table',
349 'title' : '\nTACACS Server Hosts\n',
350 'sort' : 'timestamp',
351 'obj-type' : 'tacacs-plus-host',
352 },
353 ),
354}
355
356SHOW_TACACS_PLUS_CONFIG_FORMAT = {
357 'tacacs-plus-config' : {
358 'field-orderings' : {
359 'default' : [ 'Idx',
360 'tacacs-plus-authn',
361 'tacacs-plus-authz',
362 'tacacs-plus-acct',
363 'local-authn',
364 'local-authz',
365 'timeout',
366 'key',
367 ],
368 },
369 },
370}
371
372SHOW_TACACS_PLUS_HOST_FORMAT = {
373 'tacacs-plus-host' : {
374 'field-orderings' : {
375 'default' : [ 'Idx', 'ip', 'key',
376 ],
377 },
378 'fields' : {
379 'Idx' : {
380 'verbose-name' : '#',
381 },
382 'ip' : {
383 'verbose-name' : 'Ip Address',
384 },
385 'key' : {
386 },
387
388 }
389 }
390}
391"""