
Security News
New Website “Is It Really FOSS?” Tracks Transparency in Open Source Distribution Models
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Unisender Go (https://go.unisender.ru) integration gem for Ruby
gem install unigo-ruby
This library using faraday gem for making HTTP queries along with mashify middleware for post-processing response body. So, you can use extended syntax for accessing response fields.
Example of work with responses:
require 'unigo-ruby'
unigo = UniGo::Client.new(
hostname: 'go1.unisender.ru',
lang: 'ru',
api_key: ENV['UNIGO_API_KEY']
)
response = unigo.get_dns_records("example.com")
puts response.status
puts response.body.to_h
puts response.headers
# Access fields as hash keys or as object attributes:
puts response.body['status']
puts response.body.status
By default authentication sent through X-API-KEY header.
For passing API key in parameters, use:
unigo = UniGo::Client.new(
hostname: 'go1.unisender.ru',
lang: 'ru',
api_key: ENV['UNIGO_API_KEY'],
api_key_in_params: true
)
Will raise UniGo::Client::InvalidCallbackAuth error unless `auth' field is correct.
unigo.verify_callback_auth!(params)
Use it to substitute webhook handler verification and parsing to directly get list of events.
Will raise UniGo::Client::InvalidCallbackAuth error unless `auth' field is correct.
unigo.callback_helper(params) do |events|
# [
# {
# 'event_name' => 'transactional_email_status',
# 'event_data' =>
# {
# 'email' => 'recipient.email@example.com',
# 'status' => 'sent',
# 'event_time' => '2015-11-30 15:09:42',
# ...
# }
# },
# ...
# ]
end
Library using `raise-error' middleware for handling error responses.
Example of work with errors:
require 'unigo-ruby'
begin
unigo = UniGo::Client.new(
hostname: 'go1.unisender.ru',
lang: 'ru',
api_key: ENV['UNIGO_API_KEY']
)
response = unigo.get_dns_records("example.com")
puts response.status
puts response.body.to_h
puts response.headers
rescue Faraday::Error => e
# Note that exception response has internal format which is a little
# bit different and body field is not post-processed
puts e.response[:status]
puts e.response[:body]
puts e.response[:headers]
end
Pass timeout: <seconds>
parameter on creating client, default is 5.
Pass enable_logging: true
parameter on creating client to enable logging, default false.
You can run tests through included test task and passing methods for test and data inside YAML config file:
rake test DOMAIN APIKEY WEBHOOK_URL FROM_EMAIL ./test/CONFIGFILE.yml
FAQs
Unknown package
We found that unigo-ruby demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.