Skip to content

Conversation

@cursor
Copy link

@cursor cursor bot commented Jan 7, 2026

✨ Description

This PR resolves a MongoDB authentication failure (LINTEST-206) by correcting the case sensitivity of the authSource parameter and enhancing authentication flexibility.

The primary issue was that the MongoDBCrawler used "authsource" (lowercase 's') instead of the standard "authSource" (uppercase 'S') in the connection string's extra parameters, leading to authentication failures.

This PR also introduces an optional auth_mechanism parameter to allow explicit specification of authentication mechanisms (e.g., SCRAM-SHA-256) and significantly improves the documentation for MongoDB authentication, including troubleshooting tips and user role examples.

Jira link: LINTEST-206


🧩 Type of change

Select all that apply:

  • 🚀 New feature (non-breaking change that adds functionality) - auth_mechanism parameter
  • 🐛 Bug fix (non-breaking change that fixes an issue) — please include tests! Refer testing-toolkit 🧪 - authSource case fix
  • 🔄 Refactor (code change that neither fixes a bug nor adds a feature)
  • 🧹 Maintenance (chores, cleanup, minor improvements)
  • 💥 Breaking change (fix or feature that may break existing functionality)
  • 📦 Dependency upgrade/downgrade
  • 📚 Documentation updates

✅ How has this been tested? (e.g. screenshots, logs, workflow links)

The changes have been thoroughly tested with unit tests:

  • Steps to reproduce:
    1. Run the existing unit tests for MongoDBCrawler.
    2. Run the newly added unit test for MongoDBCrawler with the auth_mechanism parameter.
  • Results:
    • All 5,784 unit tests passed successfully.
    • A new test case (test_mongodb_with_auth_mechanism) was added to tests/unit/test_packages.py to validate the auth_mechanism parameter.
    • Existing MongoDB tests were updated to reflect the authSource case change.
    • No linting issues were detected.

📋 Checklist

  • My code follows the project’s style guidelines
  • I’ve performed a self-review of my code
  • I’ve added comments in tricky or complex areas
  • I’ve updated the documentation as needed
  • There are no new warnings from my changes
  • I’ve added tests to cover my changes
  • All new and existing tests pass locally

Open in Cursor Open in Web

@cursor
Copy link
Author

cursor bot commented Jan 7, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants