bjond-api 0.3.6 → 0.3.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6233aca9691d51f8bb56fc751e4265b01ac23514
4
- data.tar.gz: 9eeffbc67ef255cc405804599c59b7a46e2d2486
3
+ metadata.gz: 82a0156fdf8e39b37d70a3c3b1c14080cbb95bad
4
+ data.tar.gz: 4a4b1322de078979b37d0463371a0e73c408ff45
5
5
  SHA512:
6
- metadata.gz: 017ddc9c3ce3e0b1006aec1180870d20bd368946267c5507a0e46b2abe204608845e459322d4e2abd4814f88a298f96cc6073aca62ef044589fd0cc2a2b96570
7
- data.tar.gz: 2773cc89b11292d6d0cb3e87a0e0193a28d481b3ca058198e0f351a5d52743f5fcb5452928c4fa4d0c746a8c1abd15f9a1eb3841b2c79f380aceec954da514c5
6
+ metadata.gz: 927d3e18556a622c48e7a888878fc9419792a0c24207863797746b6cf44f3950579a7c8f068805130ce1e0b578801870d09a72e0ce63485e4c71a2ad9b4b1d8b
7
+ data.tar.gz: a4a10a435810f450de2ca2d81db4b44ad61d728afb904f5329c111b158f22a6b474534288dd3a3d51b19e9b69d4389c2b10421f2aecafc7040387db21b765c8c
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
-
1
+ source 'https://rubygems.org'
2
2
  gem 'rails', '~> 4.2', '>= 4.2.4'
3
3
 
4
4
  group :development, :test do
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.6
1
+ 0.3.9
@@ -11,6 +11,19 @@ class BjondservicesController < ApplicationController
11
11
  @app_info = BjondApi::BjondAppConfig.instance.active_definition
12
12
  end
13
13
 
14
+ def edit
15
+ @bjondservice = BjondService.find(params[:id])
16
+ end
17
+
18
+ def update
19
+ @bjondservice = BjondService.find(params[:id])
20
+ if @bjondservice.update(bjondservices_params)
21
+ redirect_to @bjondservice.bjond_registration, notice: 'Bjond services was successfully updated.'
22
+ else
23
+ render @bjondservice.bjond_registration
24
+ end
25
+ end
26
+
14
27
  def register
15
28
  registration = BjondRegistration.find_by_id(params[:id])
16
29
  if (!registration.nil?)
@@ -80,4 +93,10 @@ class BjondservicesController < ApplicationController
80
93
  return registration
81
94
  end
82
95
 
96
+ # Only allow a trusted parameter "white list" through.
97
+ private
98
+ def bjondservices_params
99
+ params.require(:bjond_service).permit(:group_id, :endpoint_id,)
100
+ end
101
+
83
102
  end
@@ -32,7 +32,7 @@
32
32
 
33
33
  <div class="field">
34
34
  <span class="label">
35
- Encryption Key
35
+ API Key / Encryption Key
36
36
  </span>
37
37
  <%= f.text_field :encryption_key %>
38
38
  </div>
@@ -24,7 +24,7 @@
24
24
  <%- if (@bjond_registration.encrypted_encryption_key) %>
25
25
  <div class="encryption-key-found">
26
26
  <p>
27
- <strong>Encryption Key (encrypted):</strong>
27
+ <strong>API Key / Encryption Key (encrypted):</strong>
28
28
  <%= @bjond_registration.encrypted_encryption_key %>
29
29
  </p>
30
30
  </div>
@@ -54,6 +54,21 @@
54
54
  Bjond Services associated with this Registration
55
55
  </h3>
56
56
 
57
+ <div class="bjond-info">
58
+ <p>
59
+ <strong>Note:</strong></br>
60
+ Please verify that the service endpoints below have the correct host.
61
+ If the host (preceeding /server-core/services..) is incorrect, the Bjond Server
62
+ may need to set its OPENSHIFT_PUBLIC_URL environment variable. Once this
63
+ environment variable is re-set (and the Bjond Server restarted), please
64
+ re-register the affected services.
65
+ </p>
66
+ <p>
67
+ The endpoints may also be manually updated by modifying the Bjond Service.
68
+ Please exercise caution when modifying these fields.
69
+ </p>
70
+ </div>
71
+
57
72
  <%- @services.each do |service| %>
58
73
  <div class="bjond-service">
59
74
  <p>
@@ -70,6 +85,10 @@
70
85
  <%= service.endpoint %>
71
86
  </p>
72
87
 
88
+ <p>
89
+ <%= link_to "Modify Bjond Service", "/bjond-app/services/edit/#{service.id}"%>
90
+ </p>
91
+
73
92
  </div>
74
93
  <% end %>
75
94
  <% end %>
@@ -0,0 +1,36 @@
1
+ <div class="edit-registrations">
2
+ <h1 class="app-info-header">Editing Bjond Bjond Service</h1>
3
+
4
+ <%= form_for(@bjondservice, :url => "/bjond-app/services/#{@bjondservice.id}") do |f| %>
5
+ <% if @bjondservice.errors.any? %>
6
+ <div id="error_explanation">
7
+ <h2><%= pluralize(@bjondservice.errors.count, "error") %> prohibited this bjondservice from being saved:</h2>
8
+
9
+ <ul>
10
+ <% @bjondservice.errors.full_messages.each do |message| %>
11
+ <li><%= message %></li>
12
+ <% end %>
13
+ </ul>
14
+ </div>
15
+ <% end %>
16
+
17
+ <div class="field">
18
+ <span class="label">
19
+ Group ID:
20
+ </span>
21
+ <%= f.text_field :group_id %>
22
+ </div>
23
+ <div class="field">
24
+ <span class="label">
25
+ Endpoint:
26
+ </span>
27
+ <%= f.text_field :endpoint %>
28
+ </div>
29
+
30
+ <div class="actions">
31
+ <%= f.submit %>
32
+ </div>
33
+ <% end %>
34
+
35
+
36
+ </div>
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.3.6 ruby lib
5
+ # stub: bjond-api 0.3.9 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "bjond-api".freeze
9
- s.version = "0.3.6"
9
+ s.version = "0.3.9"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib".freeze]
13
13
  s.authors = ["Blake Rego".freeze]
14
- s.date = "2016-09-12"
14
+ s.date = "2016-12-20"
15
15
  s.description = "Rails engine that provides communication between Bj\u{f6}nd Server Core and a client app.".freeze
16
16
  s.email = "blake.rego@bjondinc.com".freeze
17
17
  s.executables = ["rails".freeze]
@@ -58,6 +58,7 @@ Gem::Specification.new do |s|
58
58
  "app/views/bjond_registrations/index.html.erb",
59
59
  "app/views/bjond_registrations/new.html.erb",
60
60
  "app/views/bjond_registrations/show.html.erb",
61
+ "app/views/bjondservices/edit.html.erb",
61
62
  "app/views/bjondservices/index.html.erb",
62
63
  "app/views/shared/_app_info.html.erb",
63
64
  "bin/rails",
@@ -85,7 +86,7 @@ Gem::Specification.new do |s|
85
86
  ]
86
87
  s.homepage = "http://github.com/Bjond/bjond-integration-gem".freeze
87
88
  s.licenses = ["GPL".freeze]
88
- s.rubygems_version = "2.6.6".freeze
89
+ s.rubygems_version = "2.6.7".freeze
89
90
  s.summary = "Interface that facilitates communication with Bj\u{f6}nd servers.".freeze
90
91
 
91
92
  if s.respond_to? :specification_version then
data/config/routes.rb CHANGED
@@ -1,10 +1,15 @@
1
1
  Rails.application.routes.draw do
2
2
 
3
3
  resources :bjond_registrations
4
- get '/bjond-app/services/' => 'bjondservices#index'
5
- get '/bjond-app/services/schema' => 'bjondservices#get_schema'
6
- get '/bjond-app/services/register' => 'bjondservices#register'
7
- post '/bjond-app/services/:groupid/register' => 'bjondservices#register_group_endpoint'
8
- get '/bjond-app/services/:groupid/read' => 'bjondservices#get_group_configuration'
9
- post '/bjond-app/services/:groupid/configure' => 'bjondservices#configure_group_endpoint'
4
+
5
+ scope '/bjond-app' do
6
+ get '/services/' => 'bjondservices#index'
7
+ get '/services/edit/:id' => 'bjondservices#edit'
8
+ patch '/services/:id' => 'bjondservices#update'
9
+ get '/services/schema' => 'bjondservices#get_schema'
10
+ get '/services/register' => 'bjondservices#register'
11
+ post '/services/:groupid/register' => 'bjondservices#register_group_endpoint'
12
+ get '/services/:groupid/read' => 'bjondservices#get_group_configuration'
13
+ post '/services/:groupid/configure' => 'bjondservices#configure_group_endpoint'
14
+ end
10
15
  end
data/lib/bjond-api.rb CHANGED
@@ -32,6 +32,7 @@ module BjondApi
32
32
  services.each do |bjond_svc|
33
33
  url = bjond_svc.endpoint + "/#{event_id}"
34
34
  puts "Creating connection to " + url
35
+ puts BjondJwt::jwt_encode_payload(payload, bjond_registration)
35
36
  conn = Faraday.new(:url => url)
36
37
  conn.post do |req|
37
38
  req.headers['Content-Type'] = 'application/json'
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.3.6
4
+ version: 0.3.9
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-09-12 00:00:00.000000000 Z
11
+ date: 2016-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -146,6 +146,7 @@ files:
146
146
  - app/views/bjond_registrations/index.html.erb
147
147
  - app/views/bjond_registrations/new.html.erb
148
148
  - app/views/bjond_registrations/show.html.erb
149
+ - app/views/bjondservices/edit.html.erb
149
150
  - app/views/bjondservices/index.html.erb
150
151
  - app/views/shared/_app_info.html.erb
151
152
  - bin/rails
@@ -190,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
190
191
  version: '0'
191
192
  requirements: []
192
193
  rubyforge_project:
193
- rubygems_version: 2.6.6
194
+ rubygems_version: 2.6.7
194
195
  signing_key:
195
196
  specification_version: 4
196
197
  summary: Interface that facilitates communication with Bjönd servers.