bjond-api 0.4.0 → 1.0.0
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 +4 -4
- data/VERSION +1 -1
- data/app/controllers/bjondservices_controller.rb +15 -2
- data/bjond-api.gemspec +3 -3
- data/config/routes.rb +2 -0
- data/lib/bjond-app-config.rb +7 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a5b3db67dbf4500674196ded38c4b97a22e3f07c
|
4
|
+
data.tar.gz: 93c429a9bfe01519b53d41cad3ca4ae42d29567f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 432dc0948fe277538454148223c798a791df0a19b94ca98a06b054b0157b71394b687b2da0b9cf3a7087fc7a0424ff97397d05e4aeb8ee83b3ad5bda2f769496
|
7
|
+
data.tar.gz: 15bb9d4fce680837b61d231d01d31e1e5fe55220590a3a922e40aafc803d97161244dd1505260481a11a25ec688c3db2f633ff89053c654c0f4f282acd55f3af
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
1.0.0
|
@@ -59,7 +59,7 @@ class BjondservicesController < ApplicationController
|
|
59
59
|
puts 'configure_group_endpoint'
|
60
60
|
bjond_registration = get_registration
|
61
61
|
result = jwt_decode_payload_and_return_json(request.raw_post, bjond_registration)
|
62
|
-
BjondApi::BjondAppConfig.instance.configure_group(result, bjond_registration)
|
62
|
+
BjondApi::BjondAppConfig.instance.configure_group(result, bjond_registration, params[:groupid])
|
63
63
|
render :json => {
|
64
64
|
:status => 'OK'
|
65
65
|
}.to_json
|
@@ -73,7 +73,7 @@ class BjondservicesController < ApplicationController
|
|
73
73
|
|
74
74
|
def get_group_configuration
|
75
75
|
bjond_registration = get_registration
|
76
|
-
payload = BjondApi::BjondAppConfig.instance.get_group_configuration(bjond_registration)
|
76
|
+
payload = BjondApi::BjondAppConfig.instance.get_group_configuration(bjond_registration, params[:groupid])
|
77
77
|
render :json => jwt_encode_payload(payload.to_json, bjond_registration)
|
78
78
|
end
|
79
79
|
|
@@ -93,6 +93,19 @@ class BjondservicesController < ApplicationController
|
|
93
93
|
return registration
|
94
94
|
end
|
95
95
|
|
96
|
+
def get_user_configuration
|
97
|
+
bjond_registration = get_registration
|
98
|
+
payload = BjondApi::BjondAppConfig.instance.get_user_configuration(bjond_registration)
|
99
|
+
render :json => jwt_encode_payload(payload.to_json, bjond_registration)
|
100
|
+
end
|
101
|
+
|
102
|
+
def get_user_schema
|
103
|
+
puts 'get_user_schema'
|
104
|
+
bjond_registration = get_registration
|
105
|
+
payload = jwt_encode_payload(BjondApi::BjondAppConfig.instance.user_configuration_schema, bjond_registration)
|
106
|
+
render :json => payload
|
107
|
+
end
|
108
|
+
|
96
109
|
# Only allow a trusted parameter "white list" through.
|
97
110
|
private
|
98
111
|
def bjondservices_params
|
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.
|
5
|
+
# stub: bjond-api 1.0.0 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "bjond-api".freeze
|
9
|
-
s.version = "0.
|
9
|
+
s.version = "1.0.0"
|
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 = "2017-
|
14
|
+
s.date = "2017-05-04"
|
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]
|
data/config/routes.rb
CHANGED
@@ -11,5 +11,7 @@ Rails.application.routes.draw do
|
|
11
11
|
post '/services/:groupid/register' => 'bjondservices#register_group_endpoint'
|
12
12
|
get '/services/:groupid/read' => 'bjondservices#get_group_configuration'
|
13
13
|
post '/services/:groupid/configure' => 'bjondservices#configure_group_endpoint'
|
14
|
+
get '/services/:groupid/:userid/read' => 'bjondservices#get_user_configuration'
|
15
|
+
get '/services/schema/user' => 'bjondservices#get_user_schema'
|
14
16
|
end
|
15
17
|
end
|
data/lib/bjond-app-config.rb
CHANGED
@@ -4,16 +4,20 @@ module BjondApi
|
|
4
4
|
class BjondAppConfig
|
5
5
|
include Singleton
|
6
6
|
|
7
|
-
attr_accessor :active_definition, :group_configuration_schema, :group_configuration, :encryption_key_name
|
7
|
+
attr_accessor :active_definition, :group_configuration_schema, :group_configuration, :encryption_key_name, :user_configuration_schema
|
8
8
|
|
9
9
|
self.instance.encryption_key_name = 'APP_ENCRYPTION_KEY'
|
10
10
|
|
11
|
-
def configure_group(config, bjond_registration)
|
11
|
+
def configure_group(config, bjond_registration, group_id)
|
12
12
|
puts '[ App group configuration method not implemented. This can be set via BjondAppConfig.instance.configure_group ]'
|
13
13
|
end
|
14
14
|
|
15
|
-
def get_group_configuration(bjond_registration)
|
15
|
+
def get_group_configuration(bjond_registration, group_id)
|
16
16
|
puts '[ get_group_configuration method not implemented. This can be set via BjondAppConfig.instance.get_group_configuration ]'
|
17
17
|
end
|
18
|
+
|
19
|
+
def get_user_configuration(bjond_registration)
|
20
|
+
puts '[ get_user_configuration method not implemented. This can be set via BjondAppConfig.instance.get_user_configuration ]'
|
21
|
+
end
|
18
22
|
end
|
19
23
|
end
|
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.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Blake Rego
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|