Skip to content

Add MongoDB settings to appsettings.json#151

Open
annsayuri wants to merge 5 commits intofencer-so:mainfrom
annsayuri:main
Open

Add MongoDB settings to appsettings.json#151
annsayuri wants to merge 5 commits intofencer-so:mainfrom
annsayuri:main

Conversation

@annsayuri
Copy link
Copy Markdown

No description provided.

Copilot AI review requested due to automatic review settings March 30, 2026 12:52
@gitguardian
Copy link
Copy Markdown

gitguardian bot commented Mar 30, 2026

⚠️ GitGuardian has uncovered 1 secret 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.

Since your pull request originates from a forked repository, GitGuardian is not able to associate the secrets uncovered with secret incidents on your GitGuardian dashboard.
Skipping this check run and merging your pull request will create secret incidents on your GitGuardian dashboard.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
- - MongoDB Credentials 16009be CommBank-Server/appsettings.json View secret
🛠 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 secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. 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


🦉 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.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds MongoDB configuration values to CommBank-Server/appsettings.json to support connecting to the CommBank Mongo database.

Changes:

  • Introduces a new MongoDbSettings configuration section with connection string and database name in appsettings.json.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -6,5 +6,9 @@
}
},
"AllowedHosts": "*"
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
"AllowedHosts": "*"
"AllowedHosts": "*",

Copilot uses AI. Check for mistakes.
Comment on lines 8 to +10
"AllowedHosts": "*"
"MongoDbSettings": {
"ConnectionString": "mongodb+srv://sayuri_db:12@shkeD23#5@cluster0.hxv4jem.mongodb.net/?appName=Cluster0",
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
"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",

Copilot uses AI. Check for mistakes.
Comment on lines +9 to +12
"MongoDbSettings": {
"ConnectionString": "mongodb+srv://sayuri_db:12@shkeD23#5@cluster0.hxv4jem.mongodb.net/?appName=Cluster0",
"DatabaseName": "CommBank"
}
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
"MongoDbSettings": {
"ConnectionString": "mongodb+srv://sayuri_db:12@shkeD23#5@cluster0.hxv4jem.mongodb.net/?appName=Cluster0",
"DatabaseName": "CommBank"
}

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants