Add MongoDB settings to appsettings.json#151
Add MongoDB settings to appsettings.json#151annsayuri wants to merge 5 commits intofencer-so:mainfrom
Conversation
|
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
|---|---|---|---|---|---|
| - | - | MongoDB Credentials | 16009be | CommBank-Server/appsettings.json | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secret safely. Learn here the best practices.
- Revoke and rotate this secret.
- If possible, rewrite git history. 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 for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit 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.
There was a problem hiding this comment.
Pull request overview
Adds MongoDB configuration values to CommBank-Server/appsettings.json to support connecting to the CommBank Mongo database.
Changes:
- Introduces a new
MongoDbSettingsconfiguration section with connection string and database name inappsettings.json.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -6,5 +6,9 @@ | |||
| } | |||
| }, | |||
| "AllowedHosts": "*" | |||
There was a problem hiding this comment.
The JSON is invalid: after "AllowedHosts": "*" you need a trailing comma before adding the new "MongoDbSettings" property. As written, the file will fail to parse at startup/config load.
| "AllowedHosts": "*" | |
| "AllowedHosts": "*", |
| "AllowedHosts": "*" | ||
| "MongoDbSettings": { | ||
| "ConnectionString": "mongodb+srv://sayuri_db:12@shkeD23#5@cluster0.hxv4jem.mongodb.net/?appName=Cluster0", |
There was a problem hiding this comment.
The MongoDB connection string includes credentials and is being committed to source control. Move secrets to a secrets store (e.g., the existing Secrets.json placeholder/user-secrets or environment variables) and keep appsettings.json free of real usernames/passwords.
| "AllowedHosts": "*" | |
| "MongoDbSettings": { | |
| "ConnectionString": "mongodb+srv://sayuri_db:12@shkeD23#5@cluster0.hxv4jem.mongodb.net/?appName=Cluster0", | |
| "AllowedHosts": "*", | |
| "MongoDbSettings": { | |
| "ConnectionString": "mongodb+srv://<username>:<password>@cluster0.hxv4jem.mongodb.net/?appName=Cluster0", |
| "MongoDbSettings": { | ||
| "ConnectionString": "mongodb+srv://sayuri_db:12@shkeD23#5@cluster0.hxv4jem.mongodb.net/?appName=Cluster0", | ||
| "DatabaseName": "CommBank" | ||
| } |
There was a problem hiding this comment.
This repo currently configures Mongo via builder.Configuration.GetConnectionString("CommBank") (loaded from Secrets.json). The new "MongoDbSettings" section is not referenced anywhere, so it will be unused and may diverge from the actual runtime configuration. Either update Program.cs to bind/use MongoDbSettings (and remove the hard-coded database name) or keep using ConnectionStrings consistently.
| "MongoDbSettings": { | |
| "ConnectionString": "mongodb+srv://sayuri_db:12@shkeD23#5@cluster0.hxv4jem.mongodb.net/?appName=Cluster0", | |
| "DatabaseName": "CommBank" | |
| } |
Add MIT License to the project
Add README.md with project details and license
No description provided.