Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
Package: azkit
Title: Azure storage authentication toolkit
Version: 0.2.0
Version: 0.2.1
Authors@R:
person(
c(person(
"Fran", "Barton",
email = "[email protected]",
role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-5650-1176")
)
),
person(
"Tom", "Jemmett",
email = "[email protected]",
role = "ctb"
))
Description: Handles authentication and basic tasks with Azure blob storage.
License: MIT + file LICENSE
Config/testthat/edition: 3
Expand Down
7 changes: 6 additions & 1 deletion R/get_auth_token.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
#' @export
get_auth_token <- function(
resource = "https://storage.azure.com",
tenant = "common",
tenant = "organizations",
client_id = NULL,
auth_method = "authorization_code",
force_refresh = FALSE,
Expand Down Expand Up @@ -158,3 +158,8 @@ get_client_id <- function() {
}
client_id
}

#' Use the token's internal refresh() method to refresh it
#' @param token An Azure authentication token
#' @returns An Azure authentication token
refresh_token <- \(token) token$refresh()
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<img src="man/figures/logo.png" align="right" height="138" alt="azkit badge" />

# `{azkit}` 🌊🔑📂📦![R](https://www.r-project.org/favicon-32x32.png)

<!-- badges: start -->
Expand All @@ -18,14 +20,13 @@ has not yet been a stable release][repostatus_svg]][repostatus_info]
[cmd_yaml]: https://github.com/The-Strategy-Unit/azkit/actions/workflows/R-CMD-check.yaml
<!-- badges: end -->

<img src="man/figures/logo.png" align="right" height="138" alt="azkit badge" />
R package to handle Azure authentication and basic tasks with blob storage.
An R package to handle Azure authentication and some basic tasks accessing
blob and table storage and reading in data from files.

## Status

The package is in development.
Please leave an issue or raise a pull request if you have ideas for its
improvement.
Please [create an issue][issues] if you have ideas for its improvement.

## Installation

Expand All @@ -44,18 +45,17 @@ A primary function in `{azkit}` enables access to an Azure blob container:
data_container <- azkit::get_container()

```
Authentication is handled "under the hood" by the `get_container()` function,
but if you need to, you can explicitly return an authentication token for
inspection or testing:
Authentication is handled automatically by `get_container()`, but if you need
to, you can explicitly return an authentication token for inspection or re-use:

```r
my_token <- azkit::get_auth_token()

```

The container returned will be set by the name stored in the `AZ_CONTAINER`
environment variable, if any, by default, but you can override this by supplying
a container name to the function:
The container returned will be defined by the name stored in the
`AZ_CONTAINER` environment variable, by default, but you can override this by
supplying a container name to the function:

```r
custom_container <- azkit::get_container("custom")
Expand Down
2 changes: 1 addition & 1 deletion man/get_auth_token.Rd

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

17 changes: 17 additions & 0 deletions man/refresh_token.Rd

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

Loading