Skip to content

Commit 6c262c6

Browse files
Merge pull request #11 from The-Strategy-Unit/francisbarton/issue6
Rename get token function
2 parents b1cf422 + 6b3bf71 commit 6c262c6

File tree

8 files changed

+34
-30
lines changed

8 files changed

+34
-30
lines changed

DESCRIPTION

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,18 @@ Authors@R:
1111
Description: Handles Azure storage authentication and basic tasks with blob
1212
storage.
1313
License: MIT + file LICENSE
14-
Depends: R (>= 4.1)
15-
Suggests: testthat (>= 3.0.0)
1614
Config/testthat/edition: 3
1715
Encoding: UTF-8
1816
Roxygen: list(markdown = TRUE)
1917
RoxygenNote: 7.3.2
20-
Imports:
18+
Depends: R (>= 4.1)
19+
Imports:
2120
AzureAuth,
2221
AzureRMR,
22+
AzureStor,
2323
cli,
24-
purrr
24+
purrr,
25+
rlang,
26+
withr
27+
Suggests:
28+
testthat (>= 3.0.0)

NAMESPACE

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# Generated by roxygen2: do not edit by hand
22

3-
export(get_azure_token)
3+
export(get_auth_token)
4+
export(get_container)
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,19 @@
3939
#' @examples
4040
#' \dontrun{
4141
#' # Get a token for the default resource
42-
#' token <- get_azure_token()
42+
#' token <- get_auth_token()
4343
#'
4444
#' # Get a token for a specific resource and tenant
45-
#' token <- get_azure_token(
45+
#' token <- get_auth_token(
4646
#' resource = "https://graph.microsoft.com",
4747
#' tenant = "my-tenant-id"
4848
#' )
4949
#'
5050
#' # Get a token using a specific app ID
51-
#' token <- get_azure_token(client_id = "my-app-id")
51+
#' token <- get_auth_token(client_id = "my-app-id")
5252
#' }
5353
#' @export
54-
get_azure_token <- function(
54+
get_auth_token <- function(
5555
resource = "https://storage.azure.com",
5656
managed_resource = "https://management.azure.com",
5757
tenant = "organizations",
@@ -117,8 +117,9 @@ get_azure_token <- function(
117117
}
118118
}
119119

120-
#' Sub-routine for `get_azure_token()`
121-
#' Mainly to tidy up the code a bit
120+
#' Sub-routine for `get_auth_token()`
121+
#'
122+
#' Pulled out mainly to tidy up the main function code a bit
122123
#' @returns A string (the client ID)
123124
get_client_id <- function() {
124125
pluck_client_id <- function() {

R/get_container.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
#'
33
#' `r lifecycle::badge("experimental")`
44
#' @param container_name string: name of the container
5-
#' @param ... arguments to be passed through to `get_azure_token()`
5+
#' @param ... arguments to be passed through to `get_auth_token()`
66
#' @export
77
get_container <- function(container_name, ...) {
88
endpoint_uri <- Sys.getenv("AZ_STORAGE_EP")
9-
token <- get_azure_token(...)
9+
token <- get_auth_token(...)
1010
err_msg <- "{.fn check_val}: {.var AZ_STORAGE_EP} env var is not set"
1111
endpoint_uri |>
1212
check_val(nzchar, err_msg) |>
Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/get_client_id.Rd

Lines changed: 3 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)