rstudio / pins-python

https://rstudio.github.io/pins-python/
MIT License
50 stars 12 forks source link

connect: get_user() calls non-API user/{guid} #236

Closed aronatkins closed 1 month ago

aronatkins commented 3 months ago

The Connect get_user() function takes an optional guid parameter, which is used to call /v1/user/{guid}. That endpoint does not exist.

https://github.com/rstudio/pins-python/blob/2b7bebbc0687323830f06ec7345192452f12dacf/pins/rsconnect/api.py#L264-L269

The endpoint should be /v1/users/{guid}. That said, it does not appear that there are any callers to get_user() which provide a guid, so get_user() could be simplified to always call /v1/user, returning details for the user associated with the available credentials.

aronatkins commented 3 months ago

Note: I found this while enumerating which Connect APIs are called by this package (code-reading), not by running the code.