feat(security): add approved rooms/users/domains as env variables #277

Merged
luketainton merged 5 commits from 276-add-approved-usersdomains-as-an-environment-variable into main 2024-08-30 20:38:57 +02:00
luketainton commented 2024-08-30 20:18:38 +02:00 (Migrated from github.com)

Resolves #276

Resolves #276
luketainton commented 2024-08-30 20:19:12 +02:00 (Migrated from github.com)

Google Gemini AI Review

Decision: Reject
Change Score: 50%

  • Issue: Importing untested module

    • The code imports app.utils.helpers, but there are no tests for this module.
  • Issue: approved_users in tests

    • The test case for config contains the key approved_users, but this key is not present in the config class.
  • Issue: version in tests

    • The test case for config contains the key version, but this key is not present in the config class.
  • Issue: .env settings not used

    • The test.sh script loads .env instead of .env.test. Consequently, the test environment is not properly configured.
  • Issue: Pytest-related dependency missing

    • pytest-monkeypatch is required for testing, but it is not currently installed.

Suggestions:

  • Add tests for app.utils.helpers.
  • Remove approved_users and version from tests/test_config.py.
  • Update test.sh to load .env.test.
  • Install pytest-monkeypatch.
*Google Gemini AI Review* **Decision: Reject** **Change Score: 50%** - **Issue: Importing untested module** - The code imports `app.utils.helpers`, but there are no tests for this module. - **Issue: `approved_users` in tests** - The test case for `config` contains the key `approved_users`, but this key is not present in the `config` class. - **Issue: `version` in tests** - The test case for `config` contains the key `version`, but this key is not present in the `config` class. - **Issue: `.env` settings not used** - The `test.sh` script loads `.env` instead of `.env.test`. Consequently, the test environment is not properly configured. - **Issue: Pytest-related dependency missing** - `pytest-monkeypatch` is required for testing, but it is not currently installed. **Suggestions:** - Add tests for `app.utils.helpers`. - Remove `approved_users` and `version` from `tests/test_config.py`. - Update `test.sh` to load `.env.test`. - Install `pytest-monkeypatch`.
sonarqubecloud[bot] commented 2024-08-30 20:37:25 +02:00 (Migrated from github.com)
## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=luketainton_roboluke-tasks&pullRequest=277) **Quality Gate passed** Issues ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=luketainton_roboluke-tasks&pullRequest=277&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true) ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=luketainton_roboluke-tasks&pullRequest=277&issueStatuses=ACCEPTED) Measures ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=luketainton_roboluke-tasks&pullRequest=277&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true) ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [97.3% Coverage on New Code](https://sonarcloud.io/component_measures?id=luketainton_roboluke-tasks&pullRequest=277&metric=new_coverage&view=list) ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=luketainton_roboluke-tasks&pullRequest=277&metric=new_duplicated_lines_density&view=list) [See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=luketainton_roboluke-tasks&pullRequest=277)
Sign in to join this conversation.
No description provided.