Sha256: 9efe3043db580e2742ecacacc8a3e7ca8cb5bd96004784e9f4ef1646e6f33e43
Contents?: true
Size: 811 Bytes
Versions: 5
Compression:
Stored size: 811 Bytes
Contents
# frozen_string_literal: true module UmbrellioUtils module Vault extend self def secret_engine_present?(engine_path) ::Vault.logical.read("sys/mounts").data.key?(:"#{engine_path}/") end def create_kv_engine(path) ::Vault.logical.write( "sys/mounts/#{path}", config: {}, generate_signing_key: true, options: { version: 2 }, path: path.to_s, type: "kv", ) end def write_to_kv(engine_path:, secret_path:, data:) full_data_path = File.join(engine_path, "data", secret_path) full_meta_path = File.join(engine_path, "metadata", secret_path) ::Vault.logical.write(full_data_path, data:) ::Vault.logical.write(full_meta_path, id: secret_path, max_versions: 1, cas_required: false) end end end
Version data entries
5 entries across 5 versions & 1 rubygems