bjond-api 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/app/controllers/bjondservices_controller.rb +2 -7
- data/app/models/bjond_registration.rb +3 -1
- data/bjond-api.gemspec +2 -2
- data/lib/bjond-jwt.rb +0 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6803d3d8e6d6e79422a272e2557cafc46d40fa33
|
4
|
+
data.tar.gz: 35f19cfb3463a39e99ab80ec0cfdbdb55b4aafc4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 724a3ca71b7c2320ff1401a42ffe81c6609fc27cc0e2e3518011e1f6cd5d18bb537c3b5090658e56ecf0ca6cf42019237d2978ef4a7b4f2a1055d6a97b5d4fb5
|
7
|
+
data.tar.gz: 01a639916bd8b67ecc7f32c609adfba7476457210e5a0dc8219cf1f396e8a1bbec31b9c193acb8f035c24579c8750bbff03cb1e0bf5ecb224ad952b99f171c5c
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.6
|
@@ -43,10 +43,8 @@ class BjondservicesController < ApplicationController
|
|
43
43
|
|
44
44
|
################ Encrypted Communication w Bjond servers ################
|
45
45
|
def configure_group_endpoint
|
46
|
-
puts '
|
46
|
+
puts 'configure_group_endpoint'
|
47
47
|
bjond_registration = BjondRegistration.find_registration_by_remote_ip(request.remote_ip)
|
48
|
-
puts 'Registratin: '
|
49
|
-
ap bjond_registration
|
50
48
|
result = jwt_decode_payload_and_return_json(request.raw_post, bjond_registration)
|
51
49
|
BjondApi::BjondAppConfig.instance.configure_group(result, bjond_registration)
|
52
50
|
render :json => {
|
@@ -55,10 +53,7 @@ class BjondservicesController < ApplicationController
|
|
55
53
|
end
|
56
54
|
|
57
55
|
def get_schema
|
58
|
-
puts 'get_schema
|
59
|
-
puts request.remote_ip
|
60
|
-
puts 'Registration:'
|
61
|
-
ap BjondRegistration.find_registration_by_remote_ip(request.remote_ip)
|
56
|
+
puts 'get_schema'
|
62
57
|
render :json => jwt_encode_payload(BjondApi::BjondAppConfig.instance.group_configuration_schema,
|
63
58
|
BjondRegistration.find_registration_by_remote_ip(request.remote_ip))
|
64
59
|
end
|
@@ -19,7 +19,9 @@ class BjondRegistration < ActiveRecord::Base
|
|
19
19
|
return host_result
|
20
20
|
end
|
21
21
|
|
22
|
-
|
22
|
+
puts 'Warning! No BjondRegistration found for ip: ' + ip + '. This IP resolves to ' + host. 'Trying most recent registration. '
|
23
|
+
|
24
|
+
return BjondRegistration.last
|
23
25
|
end
|
24
26
|
|
25
27
|
end
|
data/bjond-api.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
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.2.
|
5
|
+
# stub: bjond-api 0.2.6 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "bjond-api".freeze
|
9
|
-
s.version = "0.2.
|
9
|
+
s.version = "0.2.6"
|
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]
|
data/lib/bjond-jwt.rb
CHANGED
@@ -11,8 +11,6 @@ module BjondJwt
|
|
11
11
|
:sub => ENV['BJOND_ADAPTER_SUBJECT']
|
12
12
|
}.to_json
|
13
13
|
header = {:alg => 'A128KW', :enc => 'A128CBC-HS256'}
|
14
|
-
ap payload
|
15
|
-
puts payload
|
16
14
|
return SyrupPay::JsonEncryptionCompactSerialization.serialization(Base64.decode64(bjond_registration.encryption_key), header, payload)
|
17
15
|
end
|
18
16
|
|