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

Allow password as a callable when using Postgres backend #250

Merged
merged 2 commits into from Nov 23, 2020

Conversation

nwillems
Copy link
Contributor

@nwillems nwillems commented Oct 8, 2020

This change is intended for a case where you have changing passwords for the database, eg when using short-lived tokens.

Specifically, this allows one to use databases together with RDS IAM access, where a token is generated for new connections.

@nwillems
Copy link
Contributor Author

nwillems commented Oct 8, 2020

I'm at a loss here - not quite sure how to get to those 100% coverage. Any help would be greatly appreciated :-)

@nwillems
Copy link
Contributor Author

nwillems commented Oct 8, 2020

I'm at a loss here - not quite sure how to get to those 100% coverage. Any help would be greatly appreciated :-)

Found out that it was coverage of the supplied function that was missing.

Typing is now also added.

Should be golden :-)

Copy link
Contributor

@vmarkovtsev vmarkovtsev left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution!

databases/backends/postgres.py Show resolved Hide resolved
Nicolai Willems added 2 commits November 20, 2020 11:24
Removes the explicit naming of the password parameter for asyncpg, and
moves the setting of the password to the kwargs. Further adds tests to
ensure that the password argument is preserved.
@nwillems
Copy link
Contributor Author

@vmarkovtsev I've updated the code and it should be good - thanks for the review. Hope it fits :-)

@vmarkovtsev
Copy link
Contributor

Great, thanks for the ping 👍

Copy link
Contributor

@vmarkovtsev vmarkovtsev left a comment

Choose a reason for hiding this comment

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

Glad that it worked!

@vmarkovtsev vmarkovtsev merged commit 8cd5514 into encode:master Nov 23, 2020
@nwillems nwillems deleted the postgress_password_callable branch November 23, 2020 12:39
@ugtar
Copy link

ugtar commented Jan 12, 2021

looks like the fix for this actually also fixes a regression that makes it impossible to connect to a postgres db over a unix socket (#257 ). The PR I wrote for that is nearly identical to this. I guess I can close that issue and the associated PR.

@vmarkovtsev
Copy link
Contributor

Thank you @ugtar 👍

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.

None yet

3 participants