Closed juliasilge closed 1 year ago
Upon further consideration, the solution in #706 doesn't really get us enough of what folks are wanting, and is quite a big change. This more simple change results in more consistent versioning options (does require a manifest for reading different versions; otherwise reads latest) and supports more use cases.
Ideally in the long term, we will have better options on Connect like service accounts that help with some of the same user needs. I think this PR is a good option to implement now, because it fits in with several use cases and is not a burdensome change.
Partly to get some more thorough testing of whether this all works (but also because folks continue to ask), I ended up adding back in a board_connect_url()
function which is a very thin wrapper around board_url()
with the new headers arg. It only authenticates to Connect via environment variable, which SE folks say is good because it is the only method that will work went content gets deployed to Connect.
We talked about whether it is possible to catch these kind of errors and provide a more helpful error message:
library(pins)
b2 <- board_url(
c(non_public_numbers = "https://colorado.posit.co/rsc/some-nice-numbers/"),
)
b2 %>% pin_read("non_public_numbers")
#> Error in http_download(url = paste0(url, "data.txt"), path_dir = cache_dir, : Not Found (HTTP 404).
Created on 2023-04-12 with reprex v2.0.2
I don't know that we can for now, because Connect is returning a 404 where the real problem is lack of authentication (403).
This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.
This PR adds a new
add_headers()
argument toboard_url()
, mostly for authentication.Addresses #600 for private GH repos:
Created on 2023-04-10 with reprex v2.0.2
Addresses #616 for Posit Connect vanity URLs that are not set to "Anyone - no login required":
Created on 2023-04-10 with reprex v2.0.2