@existdb/node-exist
Advanced tools
@@ -6,3 +6,3 @@ function getUserInfo (client, userName) { | ||
| function list (client) { | ||
| return client.promisedMethodCall('getUsers', []) | ||
| return client.promisedMethodCall('getAccounts', []) | ||
| } | ||
@@ -9,0 +9,0 @@ |
+1
-1
@@ -58,3 +58,3 @@ { | ||
| }, | ||
| "version": "4.4.0" | ||
| "version": "4.5.0" | ||
| } |
+34
-5
@@ -402,10 +402,37 @@ # node-exist | ||
| Status: failing | ||
| Status: working | ||
| #### byName | ||
| #### getUserInfo | ||
| Will return the information about the given user. | ||
| ```js | ||
| db.users.byName(username) | ||
| db.users.getUserInfo(username) | ||
| ``` | ||
| Example: | ||
| ```js | ||
| db.users.getUserInfo('admin') | ||
| ``` | ||
| Returns: | ||
| ```js | ||
| { | ||
| uid: 1048574, | ||
| 'default-group-id': 1048575, | ||
| umask: 18, | ||
| metadata: { | ||
| 'http://exist-db.org/security/description': 'System Administrator', | ||
| 'http://axschema.org/namePerson': 'admin' | ||
| }, | ||
| 'default-group-name': 'dba', | ||
| 'default-group-realmId': 'exist', | ||
| name: 'admin', | ||
| groups: [ 'dba' ], | ||
| enabled: 'true' | ||
| } | ||
| ``` | ||
| #### list | ||
@@ -417,2 +444,4 @@ | ||
| Returns an array of user info objects (see [getUserInfo()](#getuserinfo)). | ||
| ### server | ||
@@ -487,4 +516,4 @@ | ||
| **node-exist** is tested to be compatible with **eXist-db 4 and 5**. | ||
| It should be compatible with version 3, except XAR installation. | ||
| **node-exist** is tested to be compatible with **eXist-db 4, 5 and 6**. | ||
| It should be compatible with version 3, except for the XAR installation. | ||
@@ -491,0 +520,0 @@ ## Disclaimer |
@@ -23,3 +23,3 @@ # node-exist Command Line Scripts | ||
| - Install [dotenv-cli](https://www.npmjs.com/package/dotenv-cli) globally | ||
| - Install [dotenv-cli](https://www.npmjs.com/package/dotenv-cli) globally | ||
| ```bash | ||
@@ -26,0 +26,0 @@ npm install -g dotenv-cli |
+32
-4
| const test = require('tape') | ||
| const { connect } = require('../../index') | ||
| const connectionOptions = require('../connection') | ||
| const asGuest = Object.assign({}, | ||
| connectionOptions, | ||
| { basic_auth: { user: 'guest', pass: 'guest' } } | ||
| ) | ||
| test.skip('list users', function (t) { | ||
| test('list users', function (t) { | ||
| const db = connect(connectionOptions) | ||
| db.users.list() | ||
| .then(function (r) { | ||
| console.log(r) | ||
| .then(function (list) { | ||
| t.plan(6) | ||
| t.ok(list.length, 'Returns a non-empty list of users') | ||
| const names = list.map(u => u.name) | ||
| t.true(names.includes('SYSTEM'), 'found user SYSTEM') | ||
| t.true(names.includes('admin'), 'found user admin') | ||
| t.true(names.includes('guest'), 'found user guest') | ||
| t.true(names.includes('monex'), 'found user monex') | ||
| t.true(names.includes('eXide'), 'found user eXide') | ||
| // exist 4.7.1 does not have these users | ||
| // t.true(names.includes('nobody'), 'found user nobody') | ||
| // t.true(names.includes('packageservice'), 'found user packageservice') | ||
| t.end() | ||
| }) | ||
| .catch(function (e) { | ||
| console.error(e) | ||
| t.fail() | ||
| t.end() | ||
@@ -18,2 +33,15 @@ }) | ||
| test('list users as guest', function (t) { | ||
| const db = connect(asGuest) | ||
| db.users.list() | ||
| .then(function (list) { | ||
| t.ok(list.length, 'Returns a non-empty list of users') | ||
| t.end() | ||
| }) | ||
| .catch(function (e) { | ||
| t.fail(e) | ||
| t.end() | ||
| }) | ||
| }) | ||
| test('get user info for admin', function (t) { | ||
@@ -20,0 +48,0 @@ const db = connect(connectionOptions) |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 4 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 4 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
71967
2.15%1176
2.26%523
5.87%