Sha256: 61ea4b52cd6f3209f4534e4a2c6ccc4f3768c23a98d8a381d2e83a2e57574ce8

Contents?: true

Size: 1.54 KB

Versions: 5

Compression:

Stored size: 1.54 KB

Contents

# IntegrationPal
This engine is meant to contain the elements of big_sis that can be shared across sis integrations such as
- access token
- job starting
- job monitoring
- error capturing
- cas authentication

## Usage
  1) Create an active job
    `bin/rails generate job example_job`

## Installation
Add this line to your application's Gemfile:

```ruby
gem 'integration_pal'
```

And then execute:
```bash
$ bundle
```

Or install it yourself as:
```bash
$ gem install integration_pal
```

1) SET ENV VARS
  ENV['ENCRYPTION_KEY'] # this must be 32 chars
  ENV['SALT_KEY'] # this must be 32 chars

2) run `bundle exec rails g integration_pal:install`

3)set active job
  config.active_job.queue_adapter = :sidekiq # If you are using sidekiq

## License
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).

## EXAMPLE API REQUEST
# Note how we sign the requesting using ApiAuth

require "uri"
require "net/https"
require "time"
require "rubygems"
require "api_auth"
require 'active_record'

JOB_URL = "http://localhost:3000/api/v1/jobs"

access_key_id = "test"
secret_access_key = "test"

uri = URI.parse(JOB_URL)
http = Net::HTTP.new(uri.host, uri.port)

request = Net::HTTP::Post.new(uri.request_uri, 'Content-Type' => 'application/json')
request.body = {
  job: {
    worker_id: 1,
    job_params: {
      start_date: "2016-05-25T19:57:16Z",
      end_date: "2017-05-25T13:57:59-06:00"
    }
  }
}.to_json

ApiAuth.sign!(request, access_key_id, secret_access_key)

response = http.request(request)
puts response.body

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
integration_pal-0.1.6 README.md
integration_pal-0.1.5 README.md
integration_pal-0.1.4 README.md
integration_pal-0.1.3 README.md
integration_pal-0.1.2 README.md