# NOT RUN {
# Try and start a server; if one is not enabled (see details
# above) then this will return \code{NULL}
server <- vault_test_server(if_disabled = message)
if (!is.null(server)) {
# We now have a server running on an arbitrary high port - note
# that we are running over http and in dev mode: this is not at
# all suitable for production use, just for tests
server$addr
# Create clients using the client method - by default these are
# automatically authenticated against the server
client <- server$client()
client$write("/secret/password", list(value = "s3cret!"))
client$read("/secret/password")
# The server stops automatically when the server object is
# garbage collected, or it can be turned off with the
# \code{kill} method:
server$kill()
tryCatch(client$status(), error = function(e) message(e$message))
}
# }
Run the code above in your browser using DataLab