diff --git a/packages/tacacs-plus/LICENSE b/packages/tacacs-plus/LICENSE new file mode 100644 index 0000000..e21075e --- /dev/null +++ b/packages/tacacs-plus/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Noction + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/tacacs-plus/README.md b/packages/tacacs-plus/README.md new file mode 100644 index 0000000..de2b112 --- /dev/null +++ b/packages/tacacs-plus/README.md @@ -0,0 +1,106 @@ +# @noction/tacacs-plus + +[![npm version][npm-version-src]][npm-version-href] +[![npm downloads][npm-downloads-src]][npm-downloads-href] +[![bundle][bundle-src]][bundle-href] +[![License][license-src]][license-href] + +# Description + +Node.js Tacacs+ client. + +## Install + +***npm*** +```bash +npm i @noction/vue-highcharts +``` + +***yarn*** +```bash +yarn add @noction/vue-highcharts +``` + +***pnpm*** +```bash +pnpm add @noction/vue-highcharts +``` + +## Usage +```js +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 + +1. Authentication +2. Authorization + +## Authentication types supported + +- TAC_PLUS_AUTHEN_TYPE_ASCII +- TAC_PLUS_AUTHEN_TYPE_PAP +- TAC_PLUS_AUTHEN_TYPE_CHAP + +## Not supporting + +1. Accounting + +## License + +[MIT](./LICENSE) License © 2024-PRESENT [Noction](https://github.com/Noction) + +[npm-version-src]: https://img.shields.io/npm/v/@noction/tacacs-plus?style=flat&colorA=080f12&colorB=1fa669 +[npm-version-href]: https://npmjs.com/package/@noction/tacacs-plus +[npm-downloads-src]: https://img.shields.io/npm/dm/@noction/tacacs-plus?style=flat&colorA=080f12&colorB=1fa669 +[npm-downloads-href]: https://npmjs.com/package/@noction/tacacs-plus +[bundle-src]: https://img.shields.io/bundlephobia/minzip/@noction/tacacs-plus?style=flat&colorA=080f12&colorB=1fa669&label=minzip +[bundle-href]: https://bundlephobia.com/result?p=@noction/tacacs-plus +[license-src]: https://img.shields.io/github/license/Noction/@noction/tacacs-plus.svg?style=flat&colorA=080f12&colorB=1fa669 +[license-href]: https://github.com/Noction/tacacs-plus/blob/main/LICENSE diff --git a/packages/tacacs-plus/package.json b/packages/tacacs-plus/package.json index bbf6953..5b75253 100644 --- a/packages/tacacs-plus/package.json +++ b/packages/tacacs-plus/package.json @@ -6,12 +6,12 @@ "description": "Node.js Tacacs+ client", "author": "Noction", "license": "MIT", - "homepage": "https://github.com/Noction/@noction/tacacs-plus#readme", + "homepage": "https://github.com/Noction/tacacs-plus#readme", "repository": { "type": "git", - "url": "git+https://github.com/Noction/@noction/tacacs-plus.git" + "url": "https://github.com/Noction/tacacs-plus.git" }, - "bugs": "https://github.com/Noction/@noction/tacacs-plus/issues", + "bugs": "https://github.com/Noction/tacacs-plus/issues", "keywords": [ "node", "tacacs-plus", @@ -49,7 +49,7 @@ "dev": "unbuild --stub", "lint": "eslint .", "prepublishOnly": "nr build", - "release": "bumpp && npm publish", + "release": " bumpp package.json ../playground/package.json ../../package.json --commit --push --tag && npm publish", "start": "esno src/index.ts", "test": "vitest", "typecheck": "tsc --noEmit"