Introduction

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.

Installation

Install the Akeyless gem package

gem install akeyless

Getting Started

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

require 'akeyless'

# default: public API Gateway
config = Akeyless::Configuration.new

# use port 8081 exposed by the deployment:
config.server_index = nil
config.scheme = 'https'
config.host =  'gateway.company.com:8081'

# use port 8080 exposed by the deployment with /v2 prefix: 
config.server_index = nil
config.scheme = 'https'
config.host =  'gateway.company.com:8080/v2'


api = Akeyless::V2Api.new(Akeyless::ApiClient.new(config))

# auth using email and password
body = Akeyless::Auth.new
body.admin_email = '[email protected]'
body.admin_password = 'strong-password'
body.access_type = "password"

result = api.auth(body)
token = result.token

# get secret value using the token
body = Akeyless::GetSecretValue.new
body.token = tokenbody.names = ['my-secret']
result = api.get_secret_value(body)

📘

Documentation for API calls

https://github.com/akeylesslabs/akeyless-ruby


Did this page help you?