thevahidal / soul

🕉 A SQLite REST and realtime server
https://thevahidal.github.io/soul/
MIT License
1.45k stars 50 forks source link

Multiple role feature + Create initial user feature #158

Closed AbegaM closed 4 months ago

AbegaM commented 4 months ago

Modifications

  1. Added a feature to create an initial user when soul boots up

    • A function named createInitialUser is called when soul boots up and this function checks if there is an initial user in the DB and if there is none then it will create an initial user by taking the username and the password values either from the environment or from the CLI
  2. Added a feature to handle multiple roles for the users

    • In the previous PRs we were using a logic where one user can only have one role but in this PR this issue is fixed
gitguardian[bot] commented 4 months ago

⚠️ GitGuardian has uncovered 32 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | | | -------------- | ------------------ | ------------------------------ | ---------------- | --------------- | -------------------- | | [9693625](https://dashboard.gitguardian.com/incidents/9693625?occurrence=125637127) | Triggered | Username Password | f4c90f5a2aa68bc162db239cf7413a7f478f4d9e | .env.sample | [View secret](https://github.com/thevahidal/soul/commit/f4c90f5a2aa68bc162db239cf7413a7f478f4d9e#diff-088d9f35d23a4347d221d71dd49b02b95001dff4abe637a40fe0bc04d502049cL16) | | [9693625](https://dashboard.gitguardian.com/incidents/9693625?occurrence=125628929) | Triggered | Username Password | 23e6230fe8e6a67d422517d2b675057bd374a082 | .env.sample | [View secret](https://github.com/thevahidal/soul/commit/23e6230fe8e6a67d422517d2b675057bd374a082#diff-088d9f35d23a4347d221d71dd49b02b95001dff4abe637a40fe0bc04d502049cR16) | | [9756676](https://dashboard.gitguardian.com/incidents/9756676?occurrence=125990117) | Triggered | Username Password | ff632facd38633a7e499b8f30c77f2ab0531fbb5 | src/tests/testData.js | [View secret](https://github.com/thevahidal/soul/commit/ff632facd38633a7e499b8f30c77f2ab0531fbb5#diff-30f99d9586b218337b8da9b053c476452ef2937ad01f117c493276abf50f7b83R64) | | [9756676](https://dashboard.gitguardian.com/incidents/9756676?occurrence=126653373) | Triggered | Username Password | 7cd7163d8e664d8da514f2b8a8de65280b3ffa10 | src/tests/testData.js | [View secret](https://github.com/thevahidal/soul/commit/7cd7163d8e664d8da514f2b8a8de65280b3ffa10#diff-30f99d9586b218337b8da9b053c476452ef2937ad01f117c493276abf50f7b83R64) | | [9756676](https://dashboard.gitguardian.com/incidents/9756676?occurrence=126653735) | Triggered | Username Password | caea10728c11c7871f1e016f767059530ae93bc7 | src/tests/testData.js | [View secret](https://github.com/thevahidal/soul/commit/caea10728c11c7871f1e016f767059530ae93bc7#diff-30f99d9586b218337b8da9b053c476452ef2937ad01f117c493276abf50f7b83R64) | | [9756676](https://dashboard.gitguardian.com/incidents/9756676?occurrence=126653945) | Triggered | Username Password | 3699a814a4247463cfa50d3e6a6fc3e30c42a64c | src/tests/testData.js | [View secret](https://github.com/thevahidal/soul/commit/3699a814a4247463cfa50d3e6a6fc3e30c42a64c#diff-30f99d9586b218337b8da9b053c476452ef2937ad01f117c493276abf50f7b83R64) | | [9756677](https://dashboard.gitguardian.com/incidents/9756677?occurrence=125990116) | Triggered | Generic Password | ff632facd38633a7e499b8f30c77f2ab0531fbb5 | src/tests/testData.js | [View secret](https://github.com/thevahidal/soul/commit/ff632facd38633a7e499b8f30c77f2ab0531fbb5#diff-30f99d9586b218337b8da9b053c476452ef2937ad01f117c493276abf50f7b83R63) | | [9756677](https://dashboard.gitguardian.com/incidents/9756677?occurrence=126653374) | Triggered | Generic Password | 7cd7163d8e664d8da514f2b8a8de65280b3ffa10 | src/tests/testData.js | [View secret](https://github.com/thevahidal/soul/commit/7cd7163d8e664d8da514f2b8a8de65280b3ffa10#diff-30f99d9586b218337b8da9b053c476452ef2937ad01f117c493276abf50f7b83R63) | | [9756677](https://dashboard.gitguardian.com/incidents/9756677?occurrence=126653738) | Triggered | Generic Password | caea10728c11c7871f1e016f767059530ae93bc7 | src/tests/testData.js | [View secret](https://github.com/thevahidal/soul/commit/caea10728c11c7871f1e016f767059530ae93bc7#diff-30f99d9586b218337b8da9b053c476452ef2937ad01f117c493276abf50f7b83R63) | | [9756677](https://dashboard.gitguardian.com/incidents/9756677?occurrence=126653943) | Triggered | Generic Password | 3699a814a4247463cfa50d3e6a6fc3e30c42a64c | src/tests/testData.js | [View secret](https://github.com/thevahidal/soul/commit/3699a814a4247463cfa50d3e6a6fc3e30c42a64c#diff-30f99d9586b218337b8da9b053c476452ef2937ad01f117c493276abf50f7b83R63) | | [9863580](https://dashboard.gitguardian.com/incidents/9863580?occurrence=126421864) | Triggered | Generic Password | fc2f01157f5ed7da8d0c4bd6241f2fa69c97e92d | src/swagger/index.js | [View secret](https://github.com/thevahidal/soul/commit/fc2f01157f5ed7da8d0c4bd6241f2fa69c97e92d#diff-ef7d90439bd409c744bf0f9cbb06565b7f7294573fc4d1ac62c58dc4a6c46d0dR177) | | [9863580](https://dashboard.gitguardian.com/incidents/9863580?occurrence=126653370) | Triggered | Generic Password | 5bd553f0ca0e782ba185070cc0f0ee6e1f304625 | src/swagger/index.js | [View secret](https://github.com/thevahidal/soul/commit/5bd553f0ca0e782ba185070cc0f0ee6e1f304625#diff-ef7d90439bd409c744bf0f9cbb06565b7f7294573fc4d1ac62c58dc4a6c46d0dR177) | | [9863580](https://dashboard.gitguardian.com/incidents/9863580?occurrence=126653375) | Triggered | Generic Password | 7cd7163d8e664d8da514f2b8a8de65280b3ffa10 | src/swagger/index.js | [View secret](https://github.com/thevahidal/soul/commit/7cd7163d8e664d8da514f2b8a8de65280b3ffa10#diff-ef7d90439bd409c744bf0f9cbb06565b7f7294573fc4d1ac62c58dc4a6c46d0dR177) | | [9863580](https://dashboard.gitguardian.com/incidents/9863580?occurrence=126653736) | Triggered | Generic Password | caea10728c11c7871f1e016f767059530ae93bc7 | src/swagger/index.js | [View secret](https://github.com/thevahidal/soul/commit/caea10728c11c7871f1e016f767059530ae93bc7#diff-ef7d90439bd409c744bf0f9cbb06565b7f7294573fc4d1ac62c58dc4a6c46d0dR177) | | [9863580](https://dashboard.gitguardian.com/incidents/9863580?occurrence=126653944) | Triggered | Generic Password | 3699a814a4247463cfa50d3e6a6fc3e30c42a64c | src/swagger/index.js | [View secret](https://github.com/thevahidal/soul/commit/3699a814a4247463cfa50d3e6a6fc3e30c42a64c#diff-ef7d90439bd409c744bf0f9cbb06565b7f7294573fc4d1ac62c58dc4a6c46d0dR177) | | [9863581](https://dashboard.gitguardian.com/incidents/9863581?occurrence=126421862) | Triggered | Generic Password | fc2f01157f5ed7da8d0c4bd6241f2fa69c97e92d | src/swagger/index.js | [View secret](https://github.com/thevahidal/soul/commit/fc2f01157f5ed7da8d0c4bd6241f2fa69c97e92d#diff-ef7d90439bd409c744bf0f9cbb06565b7f7294573fc4d1ac62c58dc4a6c46d0dR176) | | [9863581](https://dashboard.gitguardian.com/incidents/9863581?occurrence=126421863) | Triggered | Generic Password | fc2f01157f5ed7da8d0c4bd6241f2fa69c97e92d | src/swagger/index.js | [View secret](https://github.com/thevahidal/soul/commit/fc2f01157f5ed7da8d0c4bd6241f2fa69c97e92d#diff-ef7d90439bd409c744bf0f9cbb06565b7f7294573fc4d1ac62c58dc4a6c46d0dR150) | | [9863581](https://dashboard.gitguardian.com/incidents/9863581?occurrence=126421865) | Triggered | Generic Password | fc2f01157f5ed7da8d0c4bd6241f2fa69c97e92d | src/swagger/index.js | [View secret](https://github.com/thevahidal/soul/commit/fc2f01157f5ed7da8d0c4bd6241f2fa69c97e92d#diff-ef7d90439bd409c744bf0f9cbb06565b7f7294573fc4d1ac62c58dc4a6c46d0dR132) | | [9863581](https://dashboard.gitguardian.com/incidents/9863581?occurrence=126653367) | Triggered | Generic Password | 5bd553f0ca0e782ba185070cc0f0ee6e1f304625 | src/swagger/index.js | [View secret](https://github.com/thevahidal/soul/commit/5bd553f0ca0e782ba185070cc0f0ee6e1f304625#diff-ef7d90439bd409c744bf0f9cbb06565b7f7294573fc4d1ac62c58dc4a6c46d0dR150) | | [9863581](https://dashboard.gitguardian.com/incidents/9863581?occurrence=126653368) | Triggered | Generic Password | 5bd553f0ca0e782ba185070cc0f0ee6e1f304625 | src/swagger/index.js | [View secret](https://github.com/thevahidal/soul/commit/5bd553f0ca0e782ba185070cc0f0ee6e1f304625#diff-ef7d90439bd409c744bf0f9cbb06565b7f7294573fc4d1ac62c58dc4a6c46d0dR132) | | [9863581](https://dashboard.gitguardian.com/incidents/9863581?occurrence=126653369) | Triggered | Generic Password | 5bd553f0ca0e782ba185070cc0f0ee6e1f304625 | src/swagger/index.js | [View secret](https://github.com/thevahidal/soul/commit/5bd553f0ca0e782ba185070cc0f0ee6e1f304625#diff-ef7d90439bd409c744bf0f9cbb06565b7f7294573fc4d1ac62c58dc4a6c46d0dR176) | | [9863581](https://dashboard.gitguardian.com/incidents/9863581?occurrence=126653376) | Triggered | Generic Password | 7cd7163d8e664d8da514f2b8a8de65280b3ffa10 | src/swagger/index.js | [View secret](https://github.com/thevahidal/soul/commit/7cd7163d8e664d8da514f2b8a8de65280b3ffa10#diff-ef7d90439bd409c744bf0f9cbb06565b7f7294573fc4d1ac62c58dc4a6c46d0dR150) | | [9863581](https://dashboard.gitguardian.com/incidents/9863581?occurrence=126653377) | Triggered | Generic Password | 7cd7163d8e664d8da514f2b8a8de65280b3ffa10 | src/swagger/index.js | [View secret](https://github.com/thevahidal/soul/commit/7cd7163d8e664d8da514f2b8a8de65280b3ffa10#diff-ef7d90439bd409c744bf0f9cbb06565b7f7294573fc4d1ac62c58dc4a6c46d0dR176) | | [9863581](https://dashboard.gitguardian.com/incidents/9863581?occurrence=126653378) | Triggered | Generic Password | 7cd7163d8e664d8da514f2b8a8de65280b3ffa10 | src/swagger/index.js | [View secret](https://github.com/thevahidal/soul/commit/7cd7163d8e664d8da514f2b8a8de65280b3ffa10#diff-ef7d90439bd409c744bf0f9cbb06565b7f7294573fc4d1ac62c58dc4a6c46d0dR132) | | [9863581](https://dashboard.gitguardian.com/incidents/9863581?occurrence=126653733) | Triggered | Generic Password | caea10728c11c7871f1e016f767059530ae93bc7 | src/swagger/index.js | [View secret](https://github.com/thevahidal/soul/commit/caea10728c11c7871f1e016f767059530ae93bc7#diff-ef7d90439bd409c744bf0f9cbb06565b7f7294573fc4d1ac62c58dc4a6c46d0dR132) | | [9863581](https://dashboard.gitguardian.com/incidents/9863581?occurrence=126653734) | Triggered | Generic Password | caea10728c11c7871f1e016f767059530ae93bc7 | src/swagger/index.js | [View secret](https://github.com/thevahidal/soul/commit/caea10728c11c7871f1e016f767059530ae93bc7#diff-ef7d90439bd409c744bf0f9cbb06565b7f7294573fc4d1ac62c58dc4a6c46d0dR150) | | [9863581](https://dashboard.gitguardian.com/incidents/9863581?occurrence=126653737) | Triggered | Generic Password | caea10728c11c7871f1e016f767059530ae93bc7 | src/swagger/index.js | [View secret](https://github.com/thevahidal/soul/commit/caea10728c11c7871f1e016f767059530ae93bc7#diff-ef7d90439bd409c744bf0f9cbb06565b7f7294573fc4d1ac62c58dc4a6c46d0dR176) | | [9863581](https://dashboard.gitguardian.com/incidents/9863581?occurrence=126653940) | Triggered | Generic Password | 3699a814a4247463cfa50d3e6a6fc3e30c42a64c | src/swagger/index.js | [View secret](https://github.com/thevahidal/soul/commit/3699a814a4247463cfa50d3e6a6fc3e30c42a64c#diff-ef7d90439bd409c744bf0f9cbb06565b7f7294573fc4d1ac62c58dc4a6c46d0dR132) | | [9863581](https://dashboard.gitguardian.com/incidents/9863581?occurrence=126653941) | Triggered | Generic Password | 3699a814a4247463cfa50d3e6a6fc3e30c42a64c | src/swagger/index.js | [View secret](https://github.com/thevahidal/soul/commit/3699a814a4247463cfa50d3e6a6fc3e30c42a64c#diff-ef7d90439bd409c744bf0f9cbb06565b7f7294573fc4d1ac62c58dc4a6c46d0dR150) | | [9863581](https://dashboard.gitguardian.com/incidents/9863581?occurrence=126653942) | Triggered | Generic Password | 3699a814a4247463cfa50d3e6a6fc3e30c42a64c | src/swagger/index.js | [View secret](https://github.com/thevahidal/soul/commit/3699a814a4247463cfa50d3e6a6fc3e30c42a64c#diff-ef7d90439bd409c744bf0f9cbb06565b7f7294573fc4d1ac62c58dc4a6c46d0dR176) | | [9884708](https://dashboard.gitguardian.com/incidents/9884708?occurrence=126466301) | Triggered | Username Password | 879fb1d99e382381f6bae7634318f240327cd8cf | .env.sample | [View secret](https://github.com/thevahidal/soul/commit/879fb1d99e382381f6bae7634318f240327cd8cf#diff-088d9f35d23a4347d221d71dd49b02b95001dff4abe637a40fe0bc04d502049cR27) | | [9884708](https://dashboard.gitguardian.com/incidents/9884708?occurrence=126474156) | Triggered | Username Password | f097363bd9134d9ac74c69fbd5e083c837a7144f | .env.sample | [View secret](https://github.com/thevahidal/soul/commit/f097363bd9134d9ac74c69fbd5e083c837a7144f#diff-088d9f35d23a4347d221d71dd49b02b95001dff4abe637a40fe0bc04d502049cL27) |
🛠 Guidelines to remediate hardcoded secrets
1. Understand the implications of revoking this secret by investigating where it is used in your code. 2. Replace and store your secrets safely. [Learn here](https://blog.gitguardian.com/secrets-api-management?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment) the best practices. 3. Revoke and [rotate these secrets](https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/generics/username_password#revoke-the-secret?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment). 4. If possible, [rewrite git history](https://blog.gitguardian.com/rewriting-git-history-cheatsheet?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment). Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data. To avoid such incidents in the future consider - following these [best practices](https://blog.gitguardian.com/secrets-api-management/?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment) for managing and storing secrets including API keys and other credentials - install [secret detection on pre-commit](https://docs.gitguardian.com/ggshield-docs/integrations/git-hooks/pre-commit?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment) to catch secret before it leaves your machine and ease remediation.

🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!