bjond-api 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cfa48bc91eada1997c7e299f4389bd127d33da6b
4
- data.tar.gz: 9bf03ebe91a0fac5128f187f48e96418a342cb24
3
+ metadata.gz: f9d296807adf4698291ae98e1116a3fc77bf68b6
4
+ data.tar.gz: 70b85c21eff3b5f9a0737ba35ec5fcfa9310e68e
5
5
  SHA512:
6
- metadata.gz: 5366b860b54804788314865909f22937aab97827ec2d5d767d494f909095db5d9af7f9f1cf686c2e62f640ff0d3c7924e59f2202732eb39f9334f32ab9aa109d
7
- data.tar.gz: d80ae1f847944b2b78d1f731235d3fe7c385e76fe8e9e39f842333a36bbff726f0e7fea5ce3af0940b190dab64386174e44aa52ed1d6d6aed15a04d68768be55
6
+ metadata.gz: 4439cc5746bfc9d16f827c6e641ea22846c6679587b9abc6ebd56a56d785253d2c1dc817dd63604c0f747f416fcc713061a406a9ccbd64c546dd7ea8cbb55d2d
7
+ data.tar.gz: c1ea26ec077947ff935eb9914c084d5e89e31633a4e5f6467cdc184a0d7c11ba7ddca5fa3dbe1c538e3ac57188b44875884290f59c6b3d3e136ee15f63aa6693
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.1.4
@@ -2,7 +2,7 @@ include BjondApi
2
2
  require 'attr_encrypted'
3
3
 
4
4
  class BjondRegistration < ActiveRecord::Base
5
- has_many :BjondServices
5
+ has_many :bjond_services
6
6
 
7
7
 
8
8
  attr_encrypted :encryption_key, key: ENV[BjondApi::BjondAppConfig.instance.encryption_key_name]
@@ -1,3 +1,3 @@
1
1
  class BjondService < ActiveRecord::Base
2
- belongs_to :BjondRegistration
2
+ belongs_to :bjond_registration
3
3
  end
data/bjond-api.gemspec CHANGED
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: bjond-api 0.1.3 ruby lib
5
+ # stub: bjond-api 0.1.4 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "bjond-api"
9
- s.version = "0.1.3"
9
+ s.version = "0.1.4"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Blake Rego"]
14
- s.date = "2016-08-03"
14
+ s.date = "2016-08-04"
15
15
  s.description = "Rails engine that provides communication between Bj\u{f6}nd Server Core and a client app."
16
16
  s.email = "blake.rego@bjondinc.com"
17
17
  s.executables = ["rails"]
@@ -25,6 +25,7 @@ Gem::Specification.new do |s|
25
25
  "Rakefile",
26
26
  "VERSION",
27
27
  "app/assets/images/bjond-api/.keep",
28
+ "app/assets/images/bjond-api/BjondHealth-BackgroundALT_20140724.png",
28
29
  "app/assets/javascripts/bjond-api/.keep",
29
30
  "app/assets/javascripts/bjond_api.js",
30
31
  "app/assets/stylesheets/bjond-api/.keep",
data/lib/bjond-api.rb CHANGED
@@ -14,6 +14,7 @@ module BjondApi
14
14
  # Registers the given integration_app with a bjond-server.
15
15
  def self.register_app(integration_app, bjondhost=ENV['BJOND_SERVER'])
16
16
  conn = Faraday.new(:url => bjondhost)
17
+ puts integration_app.to_json
17
18
  return conn.post do |req|
18
19
  req.url '/server-core/services/integrationmanager/register'
19
20
  req.headers['Content-Type'] = 'application/json'
@@ -23,11 +24,11 @@ module BjondApi
23
24
 
24
25
  ##
25
26
  # Fires events to all bjond_registrations
26
- def fire_event(bjond_registration, payload)
27
+ def fire_event(bjond_registration, payload, event_id)
27
28
  services = BjondService.where(:bjond_registration_id => bjond_registration.id)
28
29
  connections = []
29
30
  services.each do |bjond_svc|
30
- conn = Faraday.new(:url => bjond_svc.endpoint)
31
+ conn = Faraday.new(:url => bjond_svc.endpoint + "/#{event_id}")
31
32
  conn.post do |req|
32
33
  req.headers['Content-Type'] = 'application/json'
33
34
  req.body = BjondJwt::jwt_encode_payload(payload, bjond_registration)
data/lib/bjond-jwt.rb CHANGED
@@ -3,7 +3,7 @@ require 'syruppay_jose'
3
3
  module BjondJwt
4
4
  def jwt_encode_payload(json, bjond_registration)
5
5
  payload = {
6
- :json => json,
6
+ :json => json.to_json,
7
7
  :iss => 'Bjönd, Inc.',
8
8
  :aud => ENV['BJOND_ADAPTER_AUDIENCE'],
9
9
  :exp => Time.now.to_i + 10*3600,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bjond-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Blake Rego
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-03 00:00:00.000000000 Z
11
+ date: 2016-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -113,6 +113,7 @@ files:
113
113
  - Rakefile
114
114
  - VERSION
115
115
  - app/assets/images/bjond-api/.keep
116
+ - app/assets/images/bjond-api/BjondHealth-BackgroundALT_20140724.png
116
117
  - app/assets/javascripts/bjond-api/.keep
117
118
  - app/assets/javascripts/bjond_api.js
118
119
  - app/assets/stylesheets/bjond-api/.keep