cloudant / python-cloudant

A Python library for Cloudant and CouchDB
Apache License 2.0
163 stars 55 forks source link

fix #387 #455

Closed schferbe closed 4 years ago

schferbe commented 4 years ago

Checklist

Description

Fixes #387

Approach

added auth parameters to login request

Schema & API Changes

No change

Security and Privacy

No change

Testing

No new tests because specific CouchDB configuration would be needed.

Monitoring and Logging

No change

ricellis commented 4 years ago

Just an FYI that this problem was recently corrected for CouchDB 3, so should be going away server-side from that release.

schferbe commented 4 years ago

Thank you! That is good to know. CouchDB doesn't seem to release on a weekly base though so it might be nice to have it here as well.

bessbd commented 4 years ago

Hi @schferbe , Thank you for the patch! For us to merge this change, we’d need more tests so that we can be confident it does not break other things accidentally and that this would not get removed accidentally. Looking at https://lists.apache.org/thread.html/5c81b88c60ce81506d650893c61cd9228f4c1c0fab777e55a4f5c27a@%3Cdev.couchdb.apache.org%3E , it seems couchdb3 is very close to a release. Can you wait until couchdb3 is released or would you like to put more efforts into having automated tests for this change?

Also, have you tried using basic auth when require_valid_user is enabled as a workaround?

schferbe commented 4 years ago

Now CouchDB 3 is released in their own apt repository. I will close this PR.

vlad88sv commented 4 years ago

I just ran into this situation, and the fix provided worked really fine!

Any chance this could still get merged? (pretty please?)

ricellis commented 4 years ago

You can workaround require_valid_user blocking the _session endpoint in CouchDB 2.x by making python-cloudant use basic auth instead. This is done by initializing with the use_basic_auth=True kwarg e.g.

CouchDB(user, pass, url=url, use_basic_auth=True)
vlad88sv commented 4 years ago

Thank you! that parameter worked fine!