Skip to content

Commit

Permalink
rename host() to arc_host() to avoid recursion
Browse files Browse the repository at this point in the history
  • Loading branch information
JosiahParry committed Nov 8, 2023
1 parent 8e8596c commit 86194f8
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ S3method(has_m,sfg)
S3method(has_z,sfc)
S3method(has_z,sfg)
export("%||%")
export(arc_host)
export(as_esri_features)
export(as_esri_featureset)
export(as_esri_geometry)
Expand All @@ -44,7 +45,6 @@ export(from_esri_date)
export(get_ptype)
export(has_m)
export(has_z)
export(host)
export(infer_esri_type)
export(is_date)
export(parse_esri_json)
Expand Down
14 changes: 7 additions & 7 deletions R/arc-auth.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#' @returns an `httr2_token`
auth_code <- function(
client = Sys.getenv("ARCGIS_CLIENT"),
host = host()
host = arc_host()
) {

token_url <- paste(
Expand Down Expand Up @@ -96,7 +96,7 @@ auth_code <- function(
#' @rdname auth
auth_client <- function(client = Sys.getenv("ARCGIS_CLIENT"),
secret = Sys.getenv("ARCGIS_SECRET"),
host = host(),
host = arc_host(),
expiration = 120) {
# https://developers.arcgis.com/documentation/mapping-apis-and-services/security/application-credentials/
token_url <- paste(
Expand Down Expand Up @@ -142,7 +142,7 @@ auth_binding <- function() {
auth_user <- function(
username = Sys.getenv("ARCGIS_USER"),
password = Sys.getenv("ARCGIS_PASSWORD"),
host = host(),
host = arc_host(),
expiration = 60
) {

Expand Down Expand Up @@ -207,7 +207,7 @@ set_auth_token <- function(token, quietly = FALSE) {
refresh_token <- function(
token,
client = Sys.getenv("ARCGIS_CLIENT"),
host = host()
host = arc_host()
) {

token_url <- paste(
Expand Down Expand Up @@ -246,7 +246,7 @@ refresh_token <- function(
validate_or_refresh_token <- function(
token,
client = Sys.getenv("ARCGIS_CLIENT"),
host = host(),
host = arc_host(),
refresh_threshold = 0
) {

Expand All @@ -272,10 +272,10 @@ validate_or_refresh_token <- function(
#'
#' @export
#' @examples
#' host()
#' arc_host()
#' @returns
#' A scalar character, `"https://www.arcgis.com"` by default.
host <- function() {
arc_host <- function() {
host <- Sys.getenv("ARCGIS_HOST")

if (host == "") {
Expand Down
8 changes: 4 additions & 4 deletions man/host.Rd → man/arc_host.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions man/auth.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 86194f8

Please sign in to comment.