feat: Major updates to backend structure and security enhancements
- Removed `COMMON_ERRORS.md` file to streamline documentation. - Added `Flask-Limiter` for rate limiting and `redis` for session management in `requirements.txt`. - Expanded `ROADMAP.md` to include completed security features and planned enhancements for version 2.2. - Enhanced `setup_myp.sh` for ultra-secure kiosk installation, including system hardening and security configurations. - Updated `app.py` to integrate CSRF protection and improved logging setup. - Refactored user model to include username and active status for better user management. - Improved job scheduler with uptime tracking and task management features. - Updated various templates for a more cohesive user interface and experience.
This commit is contained in:
76
backend/app/node_modules/dlv/README.md
generated
vendored
Normal file
76
backend/app/node_modules/dlv/README.md
generated
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
# `dlv(obj, keypath)` [](https://npmjs.com/package/dlv) [](https://travis-ci.org/developit/dlv)
|
||||
|
||||
> Safely get a dot-notated path within a nested object, with ability to return a default if the full key path does not exist or the value is undefined
|
||||
|
||||
|
||||
### Why?
|
||||
|
||||
Smallest possible implementation: only **130 bytes.**
|
||||
|
||||
You could write this yourself, but then you'd have to write [tests].
|
||||
|
||||
Supports ES Modules, CommonJS and globals.
|
||||
|
||||
|
||||
### Installation
|
||||
|
||||
`npm install --save dlv`
|
||||
|
||||
|
||||
### Usage
|
||||
|
||||
`delve(object, keypath, [default])`
|
||||
|
||||
```js
|
||||
import delve from 'dlv';
|
||||
|
||||
let obj = {
|
||||
a: {
|
||||
b: {
|
||||
c: 1,
|
||||
d: undefined,
|
||||
e: null
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//use string dot notation for keys
|
||||
delve(obj, 'a.b.c') === 1;
|
||||
|
||||
//or use an array key
|
||||
delve(obj, ['a', 'b', 'c']) === 1;
|
||||
|
||||
delve(obj, 'a.b') === obj.a.b;
|
||||
|
||||
//returns undefined if the full key path does not exist and no default is specified
|
||||
delve(obj, 'a.b.f') === undefined;
|
||||
|
||||
//optional third parameter for default if the full key in path is missing
|
||||
delve(obj, 'a.b.f', 'foo') === 'foo';
|
||||
|
||||
//or if the key exists but the value is undefined
|
||||
delve(obj, 'a.b.d', 'foo') === 'foo';
|
||||
|
||||
//Non-truthy defined values are still returned if they exist at the full keypath
|
||||
delve(obj, 'a.b.e', 'foo') === null;
|
||||
|
||||
//undefined obj or key returns undefined, unless a default is supplied
|
||||
delve(undefined, 'a.b.c') === undefined;
|
||||
delve(undefined, 'a.b.c', 'foo') === 'foo';
|
||||
delve(obj, undefined, 'foo') === 'foo';
|
||||
```
|
||||
|
||||
|
||||
### Setter Counterparts
|
||||
|
||||
- [dset](https://github.com/lukeed/dset) by [@lukeed](https://github.com/lukeed) is the spiritual "set" counterpart of `dlv` and very fast.
|
||||
- [bury](https://github.com/kalmbach/bury) by [@kalmbach](https://github.com/kalmbach) does the opposite of `dlv` and is implemented in a very similar manner.
|
||||
|
||||
|
||||
### License
|
||||
|
||||
[MIT](https://oss.ninja/mit/developit/)
|
||||
|
||||
|
||||
[preact]: https://github.com/developit/preact
|
||||
[tests]: https://github.com/developit/dlv/blob/master/test.js
|
||||
7
backend/app/node_modules/dlv/index.js
generated
vendored
Normal file
7
backend/app/node_modules/dlv/index.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
export default function dlv(obj, key, def, p, undef) {
|
||||
key = key.split ? key.split('.') : key;
|
||||
for (p = 0; p < key.length; p++) {
|
||||
obj = obj ? obj[key[p]] : undef;
|
||||
}
|
||||
return obj === undef ? def : obj;
|
||||
}
|
||||
30
backend/app/node_modules/dlv/package.json
generated
vendored
Normal file
30
backend/app/node_modules/dlv/package.json
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"name": "dlv",
|
||||
"version": "1.1.3",
|
||||
"description": "Safely get a dot-notated property within an object.",
|
||||
"main": "dist/dlv.js",
|
||||
"browser": "dist/dlv.umd.js",
|
||||
"module": "dist/dlv.es.js",
|
||||
"scripts": {
|
||||
"dev": "microbundle watch",
|
||||
"build": "microbundle",
|
||||
"prepublish": "npm run build",
|
||||
"test": "node test",
|
||||
"release": "npm run build && npm test && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish"
|
||||
},
|
||||
"keywords": [
|
||||
"delve",
|
||||
"dot notation",
|
||||
"dot"
|
||||
],
|
||||
"files": [
|
||||
"index.js",
|
||||
"dist"
|
||||
],
|
||||
"author": "Jason Miller <jason@developit.ca> (http://jasonformat.com)",
|
||||
"repository": "developit/dlv",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"microbundle": "^0.11.0"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user