-
Notifications
You must be signed in to change notification settings - Fork 5
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
deprecate connect_to_etn()
instead of not exporting
#303
Comments
I suppose |
Yeah, I guess:
|
Soft or hard deprecationAt the moment, the SQL versions of the functions themselves use connection <- do.call(connect_to_etn, get_credentials()) So:
What do you prefer? Leaking credentialsCredentials are can be leaked via RHistory or scripts because people are encouraged to enter their password directly:
I'm currently still storing credentials as environmental variables, just like rgbif, but i'd prefer to use something like keyring in the future. This is why the new functions prompt the user, instead of allowing them to enter directly. I'm also using a dependency (askpass) for the password, using the RStudio API so this vital secret can't end up captured somewhere where it doesn't belong. Any root/sudo user, or any child processes of the current user can access these credentials. It's non trivial for other users to get to them, but environmental variables still aren't a good place to store passwords in my opinion. |
Users that currently experience: library(etn)
con <- connect_to_etn()
con
#> <OdbcConnection> peter.desmet@inbo.be@pgetn.vliz.be
#> Database: ETN
#> PostgreSQL Version: 14.0.13
animals <- get_animals(con, animal_id = 305) Should get something like: library(etn)
con <- connect_to_etn()
#> Deprecation warning:
#> connect_to_etn() has been deprecated since etn 2.3.0.
#> You will be prompted for credentials instead.
con
#> NULL
animals <- get_animals(con, animal_id = 305)
#> Deprecation warning:
#> `connection` has been deprecated since etn 2.3.0.
#> You will be prompted for credentials instead. So I prefer:
This will also make it clearer to us developers to no longer rely on |
I agree, that seems to be the cleanest way forward! |
connection
is no longer used in deprecation message #301TODO
connect_to_etn()
connect_to_etn()
to NULLconnect_to_etn()
: should provide deprecation messageconnect_to_etn()
connect_to_etn()
connect_to_etn()
only fail in test package on RStudio VLIZAll examples work again, but they still need to be updated: #308
I'm having a strange issue where the new tests for the deprecation message for
connect_to_etn()
fail on the RStudio VLIZ server, but only when I call test package ordevtools::test(filter = "connect_to_etn")
, not when running the tests directly or clicking run tests. Very strange. I also can't replicate it locally. Visually the warning message looks fine.The text was updated successfully, but these errors were encountered: