зеркало из https://github.com/Azure/AzureKeyVault.git
more than one type of vault
This commit is contained in:
Родитель
e7908b08d5
Коммит
95366a246c
|
@ -2,7 +2,7 @@ add_methods <- function()
|
|||
{
|
||||
## extending AzureRMR classes
|
||||
|
||||
AzureRMR::az_resource_group$set("public", "create_vault", overwrite=TRUE,
|
||||
AzureRMR::az_resource_group$set("public", "create_key_vault", overwrite=TRUE,
|
||||
function(name, location=self$location, initial_access=default_access(), sku="Standard", ..., wait=TRUE)
|
||||
{
|
||||
creds <- decode_jwt(self$token$credentials$access_token)
|
||||
|
@ -28,23 +28,23 @@ add_methods <- function()
|
|||
list(...)
|
||||
)
|
||||
|
||||
AzureKeyVault::az_vault$new(self$token, self$subscription, self$name,
|
||||
AzureKeyVault::az_key_vault$new(self$token, self$subscription, self$name,
|
||||
type="Microsoft.KeyVault/vaults", name=name, location=location,
|
||||
properties=props, wait=wait)
|
||||
})
|
||||
|
||||
|
||||
AzureRMR::az_resource_group$set("public", "get_vault", overwrite=TRUE,
|
||||
AzureRMR::az_resource_group$set("public", "get_key_vault", overwrite=TRUE,
|
||||
function(name)
|
||||
{
|
||||
AzureKeyVault::az_vault$new(self$token, self$subscription, self$name,
|
||||
AzureKeyVault::az_key_vault$new(self$token, self$subscription, self$name,
|
||||
type="Microsoft.KeyVault/vaults", name=name)
|
||||
})
|
||||
|
||||
|
||||
AzureRMR::az_resource_group$set("public", "delete_vault", overwrite=TRUE,
|
||||
AzureRMR::az_resource_group$set("public", "delete_key_vault", overwrite=TRUE,
|
||||
function(name, confirm=TRUE, wait=FALSE)
|
||||
{
|
||||
self$get_vault(name)$delete(confirm=confirm, wait=wait)
|
||||
self$get_key_vault(name)$delete(confirm=confirm, wait=wait)
|
||||
})
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#' @export
|
||||
az_vault=R6::R6Class("az_vault", inherit=AzureRMR::az_resource,
|
||||
az_key_vault=R6::R6Class("az_key_vault", inherit=AzureRMR::az_resource,
|
||||
|
||||
public=list(
|
||||
|
||||
|
@ -59,7 +59,7 @@ public=list(
|
|||
password=self$token$client$client_secret, ...)
|
||||
{
|
||||
url <- self$properties$vaultUri
|
||||
vault_endpoint$new(url=url, tenant=tenant, app=app, password=password, ...)
|
||||
key_vault_endpoint$new(url=url, tenant=tenant, app=app, password=password, ...)
|
||||
}
|
||||
))
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#' @export
|
||||
vault_endpoint <- R6::R6Class("vault_endpoint", public=list(
|
||||
key_vault_endpoint <- R6::R6Class("key_vault_endpoint", public=list(
|
||||
|
||||
token=NULL,
|
||||
url=NULL,
|
||||
|
@ -10,7 +10,7 @@ vault_endpoint <- R6::R6Class("vault_endpoint", public=list(
|
|||
certificates=NULL,
|
||||
storage_accounts=NULL,
|
||||
|
||||
initialize=function(url, tenant, app, password, ..., token=NULL)
|
||||
initialize=function(url, tenant, app, password=NULL, ..., token=NULL)
|
||||
{
|
||||
self$url <- httr::parse_url(url)
|
||||
self$tenant <- tenant
|
||||
|
|
Загрузка…
Ссылка в новой задаче