
Security News
Python Adopts Standard Lock File Format for Reproducible Installs
Python has adopted a standardized lock file format to improve reproducibility, security, and tool interoperability across the packaging ecosystem.
larvituser-api
Advanced tools
REST http API module wrapper around the user library larvituser
npm i larvituser-api
In the file index.js:
const UserApi = require('larvituser-api'),
db = require('larvitdb');
let userApi;
db.setup({'db': 'options'}); // See https://github.com/larvit/larvitdb for details
userApi = new UserApi({
'db': db, // Must be a configured database instance
'appOptions': {}, // Will be passed directly to larvitbase. For more info see: https://github.com/larvit/larvitbase
'intercom': undefined, // Or instance of larvitamintercom. For more info see: https://github.com/larvit/larvitamintercom
'mode': undefined, // DataWriter mode, see larvituser for more info: https://github.com/larvit/larvituser
});
userApi.start(function (err) {
if (err) throw err;
console.log('API up and running!');
});
Then just start the file from shell:
node index.js
200 OK
[
{"someRole": "some regex string"},
{"someRole": "another regex string for the same role"},
{"anotherRole": "with some othe regex string"}
]
Create or replace one or more role rights. If a role already exists it will be replaced. If it did not exist, it will be created.
[
{"someRole": "some regex string"},
{"anotherRole": "with some othe regex string"}
]
204 No Content
Delete one or more roles rights by role and regex string.
[
{"firstRoleToBeRemoved": "firstRolesRegex"},
{"secondRoleToBeRemoved": "secondRolesRegex"}
]
204 No Content
Fetch a specific user
One, and exactly one of the following is allowed:
200 OK
{
"uuid": "uuid string",
"username": "string",
"fields": {
"fieldName1": ["field value 1", "field value 2"],
"some other field": ["other fields value"]
}
}
404 Not Found
"no matching user found"
Obtain a user by username and password. Do not use this if your connection is not secure!
{
"username": "string",
"password": "string"
}
200 OK
{
"uuid": "uuid string",
"username": "string",
"fields": {
"fieldName1": ["field value 1", "field value 2"],
"some other field": ["other fields value"]
}
}
404 Not Found
"no matching user found"
Create or replace a specific user, defined by uuid.
Some considerations:
{
"uuid": "uuid string", // If left out a new user will be created and a random uuid given to it
"username": "foo",
"password": "bar" or false,
"fields": {
"name": "Bosse",
"lastname": "Bengtsson"
}
}
200 OK
{
"uuid": "uuid string",
"username": "foo",
"fields": {
"name": ["Bosse"],
"lastname": ["Bengtsson"]
}
}
Modify an existing user
Some considerations:
{
"uuid": "uuid string",
"username": "foo",
"password": "bar" or false,
"fields": {
"name": "Bosse",
"lastname": "Bengtsson"
}
}
200 OK
{
"uuid": "uuid string",
"username": "foo",
"fields": {
"name": ["Bosse"],
"lastname": ["Bengtsson"]
}
}
Remove a user from the database
{
"uuid": "uuid string"
}
200 OK
"acknowledged"
Fetch a list of users.
This is all optional, will only fetch users that matches all criterias.
200 OK
{
"totalHits": 392,
"hits": [
{
"uuid": "uuid string",
"username": "bosse",
"fields": {
"field1": ["field value 1"]
}
},
{
"uuid": "uuid string",
"username": "bengan",
"fields": {
"field1": ["foo"],
"field": ["bar"]
}
}
]
}
FAQs
REST api built on top of larvituser
We found that larvituser-api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Python has adopted a standardized lock file format to improve reproducibility, security, and tool interoperability across the packaging ecosystem.
Security News
OpenGrep has restored fingerprint and metavariable support in JSON and SARIF outputs, making static analysis more effective for CI/CD security automation.
Security News
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.