Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add in capability to supply user and password with mongodb #1795

Merged
merged 13 commits into from Jul 14, 2021
Merged

Add in capability to supply user and password with mongodb #1795

merged 13 commits into from Jul 14, 2021

Conversation

ajitdsa
Copy link
Contributor

@ajitdsa ajitdsa commented Jul 12, 2021

Description

Some mongodb environments require user and password to be supplied in order to properly connect. This change allows this while not breaking current functionality where this does not need to be provided.

Add documentation to support user and password functionality for mongodb.

Status

READY

Type of change

  • New feature (non-breaking change which adds functionality)
  • Documentation (fix or adds documentation)

How Has This Been Tested?

  • Manually connected to mongodb that required user/password to be set without the params set up in my configuration file to make sure that failed.
  • Manually connected to mongodb that required user/password to be set with the params set up in my configuration file to make sure that failed.
  • Ran existing tests to make sure current connect functionality still ran.
  • Added a new test that passed in user and password when initializing the database

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation (if applicable)
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Ajit D'Sa and others added 10 commits June 30, 2021 15:19
…espond method

- Added in kwargs to the respond method
- Set response_type variable based on kwarg with same name
- Set response_type based on value passed in for the case where
  response_event is a str
Add ephemeral response_type to the Slack connector InteractiveAction respond method
Some mongodb environments require username and password to be supplied
in order to properly connect. This change allows this while not
breaking current functionality where this does not need to be
provided.
@codecov
Copy link

codecov bot commented Jul 12, 2021

Codecov Report

Merging #1795 (917118b) into master (7615eaa) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1795   +/-   ##
=======================================
  Coverage   99.28%   99.28%           
=======================================
  Files          77       77           
  Lines        4630     4634    +4     
=======================================
+ Hits         4597     4601    +4     
  Misses         33       33           
Impacted Files Coverage Δ
opsdroid/database/mongo/__init__.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7615eaa...917118b. Read the comment docs.

Copy link
Contributor

@Cadair Cadair left a comment

Choose a reason for hiding this comment

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

Seems sane.

Copy link
Member

@jacobtomlinson jacobtomlinson left a comment

Choose a reason for hiding this comment

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

This looks great, thank you so much.

Could I ask you to also update the config schema?

CONFIG_SCHEMA = {"host": str, "port": Any(int, str), "database": str}

@ajitdsa
Copy link
Contributor Author

ajitdsa commented Jul 12, 2021

This looks great, thank you so much.

Could I ask you to also update the config schema?

CONFIG_SCHEMA = {"host": str, "port": Any(int, str), "database": str}

@jacobtomlinson Done!

@jacobtomlinson
Copy link
Member

Awesome work thanks @ajitdsa

@jacobtomlinson jacobtomlinson merged commit d890de2 into opsdroid:master Jul 14, 2021
Dissonant-Tech pushed a commit to Dissonant-Tech/opsdroid that referenced this pull request Aug 12, 2021
…oid#1795)

* Add documentation for the matchers for match_event from previous PR.

This is the previous PR:
opsdroid#1788

* Add ephemeral response_type to the Slack connector IneractiveAction respond method

- Added in kwargs to the respond method
- Set response_type variable based on kwarg with same name
- Set response_type based on value passed in for the case where
  response_event is a str

* Add in capability to supply user and password with mongodb

Some mongodb environments require username and password to be supplied
in order to properly connect. This change allows this while not
breaking current functionality where this does not need to be
provided.

* Add documentation to support user and password functionality for mongodb

* do not use user/password if they are not supplied

* Add test for user/password mongo connection functionality

* Revert "Add ephemeral response_type to the Slack connector IneractiveAction respond method"

This reverts commit 193133a.

* Format using black

* Fixed test

* Update CONFIG_SCHEMA
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.

None yet

3 participants