1.0.3 • Published 2 years ago
guacbui v1.0.3
GUACBUI?
guacbui aids in importing users, and groups (and their associations) at bulk, on guacamole instances. It also assigns permissions as specified, to users, and groups.
Usage
$ npm install guacbuiguacbui exposes three functions:
const {
convertXlsxToObj,
importer,
rollback
} = require('guacbui');convertXlsxToObj: (excelFilePathWithImportData) => importData
- Please look at the
template.xlsxfile inside theexamplefolder in this repo, to know how the data in the excel file should be structured.
importer: (baseURL, authToken, data) => void
- This function imports all entities (users, groups), associations (users of a group); and approriately assign perms as specified in the
dataobject, which can be computed using a corresponding excel file, as follows:
const data = convertXlsxToObj(excelFilePathWithImportData);baseURLis the base URL of the Guacamole instanceauthTokenis the JSON token of a logged in user with enough administrator privileges to enable guacbui in doing what it doesimportercan be safely run even if some of the entities, and associations fromdatahave already been imported;importerwill just update these
rollback: (baseURL, authToken, data) => void
- This function does the opposite of what
importerdoes — it deletes all entities (users, groups), and associations as specified in thedataobject
Example
- The code inside
examplefolder can be perused, to gain a better understanding on consuming guacbui's api. - Ensure appropriate values are populated inside
example/config.js, before running the following:
$ cd example
$ node index.jsTODO
- Fix the bug at race condition step in login.js due to incorrect username/password
- Fix DATA CONVERSION ERROR bug due to wrong (incorrect template) excel file imports