duosecurity / duo_client_python

Python library for interacting with the Duo Auth, Admin, and Accounts APIs
https://duo.com/docs/
Other
136 stars 136 forks source link

get_authentication_log clearing out Params #223

Closed gertnerbot closed 1 year ago

gertnerbot commented 1 year ago

From examples/Log_Examples.py, regardless of the params you set in the args, the duo_client/admin.py get_authentication_log method will strip out those set params due to the failed iteration over the kwargs. I tried fixing it myself but gave up and just passed the values into the method directly. for k in kwargs: if kwargs[k] is not None and k in VALID_AUTHLOG_REQUEST_PARAMS: params[k] = kwargs[k]

You'll have to add log/print statements to see the before and after of the params.

AaronAtDuo commented 1 year ago

@gertnerbot I'm not sure I'm following you. Can you give me a set of steps (and/or code) that demonstrates the issue?

The intent of the loop over the kwargs in the get_authentication_log method is simply to ignore parameters that don't apply to the API call, but ideally that won't cause any problems or interfere with anything.

AaronAtDuo commented 1 year ago

@gertnerbot have you had a chance to define some steps to reproduce? I've not been able to recreate any flow where keys are removed from the parameters, since we only manipulate a copy in the api call method, and the original dict is not altered as far as I can tell.

AaronAtDuo commented 1 year ago

@gertnerbot I've still not been able to cause any problem like this. Feel free to reopen this with steps to reproduce and we'll look into it.