Install

Add to Gemfile: gem 'x1-sat-support'

Generate config file by: rake x1_sat_support:generate_config

Edit x1_sat_support.yml: key_url: #url with public key sat_token_url: #url with serviceAccessToken path_to_store_keys: #path where public keys will be stored keys_expiration_time: #lifetime for public key in seconds numbers_of_keys_to_keep: #limit count public keys in storage (optional)

credentials: principal: #header X-Codebig-Principal client_id: #header X-Client-Id client_secret: #header X-Client-Secret

Run rake task: rake x1_sat_support:update_keys

For manual use:

require 'x1-sat-support'

config = { "key_url"=>"...", "sat_token_url"=>"...", "path_to_store_keys"=>"...",
           "keys_expiration_time"=>..., "numbers_of_keys_to_keep"=>...,
           "credentials"=>{"principal"=>"...", "client_id"=>"...", "client_secret"=>"..."}}

X1SatSupport::Client.new(config).update_keys