API documentation¶
This is the tacacs_plus API documentation. It contains the documentation extracted from the docstrings of the various classes, methods, and functions in the tacacs_plus package. If you want to know what a certain function/method does, this is the place to look.
Contents
tacacs_plus.client
module¶
source: https://github.com/ansible/tacacs_plus/blob/master/tacacs_plus/client.py
-
class
tacacs_plus.client.
TACACSClient
(host, port, secret, timeout=10, session_id=None, family=2, version_max=12, version_min=0)¶ A TACACS+ authentication client. https://datatracker.ietf.org/doc/draft-ietf-opsawg-tacacs
An open source TACACS+ server daemon is available at http://www.shrubbery.net/tac_plus/
-
account
(username, flags, arguments=[], authen_type=1, priv_lvl=0, rem_addr='python_device', port='python_tty0')¶ Account with a TACACS+ server.
Parameters: - username –
- flags – TAC_PLUS_ACCT_FLAG_START, TAC_PLUS_ACCT_FLAG_WATCHDOG, TAC_PLUS_ACCT_FLAG_STOP
- arguments – The authorization arguments
- authen_type – TAC_PLUS_AUTHEN_TYPE_ASCII, TAC_PLUS_AUTHEN_TYPE_PAP, TAC_PLUS_AUTHEN_TYPE_CHAP
- priv_lvl – Minimal Required priv_lvl.
- rem_addr – AAA request source, default to TAC_PLUS_VIRTUAL_REM_ADDR
- port – AAA port, default to TAC_PLUS_VIRTUAL_PORT
Returns: TACACSAccountingReply
Raises: socket.timeout, socket.error
-
authenticate
(username, password, priv_lvl=0, authen_type=1, chap_ppp_id=None, chap_challenge=None, rem_addr='python_device', port='python_tty0')¶ Authenticate to a TACACS+ server with a username and password.
Parameters: - username –
- password –
- priv_lvl –
- authen_type – TAC_PLUS_AUTHEN_TYPE_ASCII, TAC_PLUS_AUTHEN_TYPE_PAP, TAC_PLUS_AUTHEN_TYPE_CHAP
- chap_ppp_id – PPP ID when authen_type == ‘chap’
- chap_challenge – challenge value when authen_type == ‘chap’
- rem_addr – AAA request source, default to TAC_PLUS_VIRTUAL_REM_ADDR
- port – AAA port, default to TAC_PLUS_VIRTUAL_PORT
Returns: TACACSAuthenticationReply
Raises: socket.timeout, socket.error
Authorize with a TACACS+ server.
Parameters: - username –
- arguments – The authorization arguments
- authen_type – TAC_PLUS_AUTHEN_TYPE_ASCII, TAC_PLUS_AUTHEN_TYPE_PAP, TAC_PLUS_AUTHEN_TYPE_CHAP
- priv_lvl – Minimal Required priv_lvl.
- rem_addr – AAA request source, default to TAC_PLUS_VIRTUAL_REM_ADDR
- port – AAA port, default to TAC_PLUS_VIRTUAL_PORT
Returns: TACACSAuthenticationReply
Raises: socket.timeout, socket.error
-
closing
(**kwds)¶
-
send
(body, req_type, seq_no=1)¶ Send a TACACS+ message body
Parameters: - body – packed bytes, i.e., struct.pack(…)
- req_type – TAC_PLUS_AUTHEN, TAC_PLUS_AUTHOR, TAC_PLUS_ACCT
- seq_no – The sequence number of the current packet. The first packet in a session MUST have the sequence number 1 and each subsequent packet will increment the sequence number by one. Thus clients only send packets containing odd sequence numbers, and TACACS+ servers only send packets containing even sequence numbers.
Returns: TACACSPacket
Raises: socket.timeout, socket.error
-
sock
¶
-
version
¶
-
tacacs_plus.packet
module¶
source: https://github.com/ansible/tacacs_plus/blob/master/tacacs_plus/packet.py
tacacs_plus.authentication
module¶
source: https://github.com/ansible/tacacs_plus/blob/master/tacacs_plus/authentication.py
tacacs_plus.authorization
module¶
source: https://github.com/ansible/tacacs_plus/blob/master/tacacs_plus/authorization.py
tacacs_plus.accounting
module¶
source: https://github.com/ansible/tacacs_plus/blob/master/tacacs_plus/accounting.py
tacacs_plus.flags
module¶
source: https://github.com/ansible/tacacs_plus/blob/master/tacacs_plus/flags.py
this module contains all the constant flags used to implement the tacacs+ RFC.