The Akeyless SDK for Ruby makes it easy for you to integrate your Ruby applications, libraries, or scripts with the Akeyless Vault secret management services.
The below Ruby code examples shows a typical sequence of how to integrate secrets into your application.


Build a gem
To build the Ruby code into a gem:

gem build swagger_client.gemspec

Then either install the gem locally:

gem install ./swagger_client-1.0.0.gem

(for development, run gem install --dev ./swagger_client-1.0.0.gem to install the development dependencies) or publish the gem to a gem hosting service, e.g. RubyGems.
Finally add this to the Gemfile:

gem 'swagger_client', '~> 1.0.0'

Install from Git
If the Ruby gem is hosted at a git repository:, then add the following in the Gemfile:

gem 'swagger_client', :git => ''

Include the Ruby code directly
Include the Ruby code directly using -I as follows:

ruby -Ilib script.rb

Getting Started

Please follow the installation procedure and then run the following code:

# Load the gem
require 'swagger_client'

api_instance =

role_name = 'role_name_example' # String | The role name to associate

am_name = 'am_name_example' # String | The auth method name to associate

token = 'token_example' # String | Access token

opts = { 
  sub_claims: 'sub_claims_example' # String | key/val of sub claims, ex. group=admins,developers

  #Create an association between role and auth method
  result = api_instance.assoc_role_am(role_name, am_name, token, opts)
  p result
rescue SwaggerClient::ApiError => e
  puts "Exception when calling DefaultApi->assoc_role_am: #{e}"


Documentation for API calls