@noction/tacacs-plus
v0.0.9
Published
Node.js Tacacs+ client
Downloads
33
Readme
@noction/tacacs-plus
Description
Node.js Tacacs+ client.
Install
npm
npm i @noction/tacacs-plus
yarn
yarn add @noction/tacacs-plus
pnpm
pnpm add @noction/tacacs-plus
Usage
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)
}
Supporting
- Authentication
- Authorization
Authentication types supported
- TAC_PLUS_AUTHEN_TYPE_ASCII
- TAC_PLUS_AUTHEN_TYPE_PAP
- TAC_PLUS_AUTHEN_TYPE_CHAP
Not supporting
- Accounting