Node.js Tacacs+ client.
npm
npm i @noction/tacacs-plus
yarn
yarn add @noction/tacacs-plus
pnpm
pnpm add @noction/tacacs-plus
import type { AuthenType } from '@noction/tacacs-plus'
import { AUTHEN_TYPES, Client } from '@noction/tacacs-plus'
const client = new Client({
host: '127.0.0.1',
port: 49,
secret: 'tac_test',
// Your application logger (Optional)
logger: {
log: console.log,
// If you provide a debug logger, it will log the sent and received packets
debug: console.debug,
error: console.error,
warn: console.warn,
},
})
// Example Authentication
try {
const res = await client.authenticate({
username: 'test_login',
password: 'test_login_password',
authenType: AUTHEN_TYPES.TAC_PLUS_AUTHEN_TYPE_ASCII,
})
console.log(res)
}
// Every status, except PASS will be thrown as an Error
catch (err) {
console.log(err)
}
// Example Authorization
try {
const res = await client.authorize({
username: 'test_login',
services: ['idk'],
})
console.log(res)
}
// Every status, except PASS_ADD will be thrown as an Error
catch (err) {
console.log(err)
}
- Authentication
- Authorization
- TAC_PLUS_AUTHEN_TYPE_ASCII
- TAC_PLUS_AUTHEN_TYPE_PAP
- TAC_PLUS_AUTHEN_TYPE_CHAP
- Accounting