NabuCasa / pycognito

Python library for using AWS Cognito. With support for SRP.
Apache License 2.0
129 stars 39 forks source link

[#173] Boto3 client kwargs passthrough #176

Closed nk9 closed 1 year ago

nk9 commented 1 year ago

I have not tested this! I don't have an SRP setup.

Please test it @Amejonah1200 and let me know if this will do what you need.

Amejonah1200 commented 1 year ago

It looks functional, but this solution doesn't allow IDEs to check for parameters (also mo auto-complete) and it has a sideeffect of modifying input dictionary.

nk9 commented 1 year ago

This is true. Here is the list of parameters accepted by the function. And these are the ones missing right now:

So this PR would allow all 5 of those to be set as needed, and with a minimum of code changes, but at the expense of missing IDE sugar. I could also do it with **kwargs in the signature, but that won't improve the experience for IDE users.

Thoughts @pvizeli?

Amejonah1200 commented 1 year ago

You can also just make them return default values, this would also not require code changes (add also type hints).

nk9 commented 1 year ago

I understand what you're suggesting, but I'm saying it's a larger change because then we have to declare all the variables twice, pass them into the utils function, and then conditionally pack them into the dictionary to be unpacked again into the client function call. I'm looking for guidance from the maintainer as to what approach he'd prefer.

nk9 commented 1 year ago

Great, thanks. BTW, I've run the code now and verified that it's succesfully passing values through.

Amejonah1200 commented 1 year ago

Thanks everyone!