Skip to content
This repository has been archived by the owner on Sep 14, 2022. It is now read-only.

thycotic/tss-sdk-ruby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PUBLIC ARCHIVE

NOTE This repo is archived. This is still available under the licensing terms, but is not being actively developed or updated any further. Please see DelineaXPM for active projects.

tss-sdk-ruby

Tests Documentation RubyGems GitHub

Installation

Usage

Initialize via env variables (best practice)

Vault will initialize easily if the following environment variables are defined:

  • TSS_USERNAME
  • TSS_PASSWORD
  • TSS_TENANT
require 'vault'
# initialize from ENV variables
server = Server.new({
    username: ENV['TSS_USERNAME'].to_s,
    password: ENV['TSS_PASSWORD'],
    tenant: ENV['TSS_TENANT']
})

begin
    secret = Server::Secret.fetch(@server, 1)
rescue AccessDeniedException
    puts "Whoops, looks like we're unauthorized"
rescue  Exception => e
    puts "Something went wrong: #{e.to_s}"
end

puts "The password is: #{secret["data"]["password"]}"