Skip to content

Commit

Permalink
#54 control over keyring backends
Browse files Browse the repository at this point in the history
  • Loading branch information
eblondel committed Sep 14, 2021
1 parent 23b70a7 commit c13e92d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions R/ZenodoManager.R
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,11 @@ ZenodoManager <- R6Class("ZenodoManager",
super$initialize(logger = logger)
private$url = url
if(!is.null(token)) if(nzchar(token)){
if(!keyring_backend %in% names(keyring:::known_backends)){
errMsg <- sprintf("Backend '%s' is not a known keyring backend!", keyring_backend)
self$ERROR(errMsg)
stop(errMsg)
}
private$keyring_backend <- keyring:::known_backends[[keyring_backend]]$new()
private$keyring_service = paste0("zen4R@", url)
private$keyring_backend$set_with_value(private$keyring_service, username = "zen4R", password = token)
Expand Down

0 comments on commit c13e92d

Please sign in to comment.