himitsu_proxy_secretsmanager <- R6::R6Class(
classname = "himitsu_proxy_secretsmanager",
inherit = himitsu_proxy,
cloneable = FALSE,
private = list(
secret_id = NULL,
config = NULL,
cache = new.env(parent = emptyenv(), size = 1L),
read_ = function() {
# this is to suppress a specific warning from the paws package
old <- options(warnPartialMatchDollar = FALSE)
on.exit(do.call(options, old), add = TRUE)
if (is.null(private$cache$value)) {
sm <- paws::secretsmanager(private$config)
res <- sm$get_secret_value(private$secret_id)
private$cache$value <- res[["SecretString"]]
}
private$cache$value
}
),
public = list(
initialize = function(secret_id, config = list()) {
assert_package("paws")
private$secret_id <- secret_id
private$config <- config
}
)
)
#' @export
proxy_secretsmanager <- function(secret_id, config = list()) {
himitsu_proxy_secretsmanager$new(secret_id, config)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.