Repository navigation
Conversation
| connected = _create_future(loop) | ||
|
|
||
| params_input = params | ||
| if callable(params.password): |
There was a problem hiding this comment.
Please also add support for coroutines (via inspect.iscoroutinefunction()) to support async callbacks.
There was a problem hiding this comment.
Good point, updated the branch with support for async password callbacks and an additional test for that case as well.
| await self._try_connect( | ||
| user='password_user', | ||
| password=get_wrongpassword) | ||
|
|
There was a problem hiding this comment.
Looks like flake8 is unhappy about the extra newline here
| await self._try_connect( | ||
| user='password_user', | ||
| password=get_wrongpassword) | ||
|
|
elprans
left a comment
There was a problem hiding this comment.
LGTM. Please add a note about this to the connect() docstring. Thanks!
|
@HLFrye Thanks so much for this change. I have a question though regarding RDS IAM before I open a new issue. I haven't been able to get this to connect to our RDS instance despite our callable generating valid tokens. I actually can't figure out how to get asyncpg to connect using a generated auth token at all, either by passing our callable or by generating the token and passing it directly into the
I've confirmed that I can use our same connection code to connect to a different postgres database using a standard password, and also that all of the values used and the token generated are valid and can be used to connect via psycopg2 and psql. The code is about as simple as possible: where Any help would be greatly appreciated! |
Resolves this issue: #553