bjond-api 0.2.4 → 0.2.5
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 +7 -0
 - data/bjond-api.gemspec +2 -2
 - data/lib/bjond-jwt.rb +2 -0
 - 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: 7bee4aa22c05b5ddf7843071e1360d979a2ea041
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: adfd227b6579e09a84cf922ce870a33ca6d91e0f
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 3b12219f92523e9f61f692e1832cae54f7b6979c45a063eab6f91bd9b42570440189a5e09ad4615441681ca06730ff2bc7e3577eb0953be4a48a73e3a40273a9
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 1af284031eb4cdf219d4962dcdec275f2364620554a8851d5529f638a06720cb55fbd02f07fa082dc525739d2ba42370ff1d0a9e2a4258886e6f7c76218bdcfc
         
     | 
    
        data/VERSION
    CHANGED
    
    | 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            0.2. 
     | 
| 
      
 1 
     | 
    
         
            +
            0.2.5
         
     | 
| 
         @@ -43,7 +43,10 @@ class BjondservicesController < ApplicationController 
     | 
|
| 
       43 
43 
     | 
    
         | 
| 
       44 
44 
     | 
    
         
             
              ################ Encrypted Communication w Bjond servers ################
         
     | 
| 
       45 
45 
     | 
    
         
             
              def configure_group_endpoint
         
     | 
| 
      
 46 
     | 
    
         
            +
                puts 'Configure Group Endpoint'
         
     | 
| 
       46 
47 
     | 
    
         
             
                bjond_registration = BjondRegistration.find_registration_by_remote_ip(request.remote_ip)
         
     | 
| 
      
 48 
     | 
    
         
            +
                puts 'Registratin: '
         
     | 
| 
      
 49 
     | 
    
         
            +
                ap bjond_registration
         
     | 
| 
       47 
50 
     | 
    
         
             
                result = jwt_decode_payload_and_return_json(request.raw_post, bjond_registration)
         
     | 
| 
       48 
51 
     | 
    
         
             
                BjondApi::BjondAppConfig.instance.configure_group(result, bjond_registration)
         
     | 
| 
       49 
52 
     | 
    
         
             
                render :json => {
         
     | 
| 
         @@ -52,6 +55,10 @@ class BjondservicesController < ApplicationController 
     | 
|
| 
       52 
55 
     | 
    
         
             
              end
         
     | 
| 
       53 
56 
     | 
    
         | 
| 
       54 
57 
     | 
    
         
             
              def get_schema
         
     | 
| 
      
 58 
     | 
    
         
            +
                puts 'get_schema. request.remote_ip: '
         
     | 
| 
      
 59 
     | 
    
         
            +
                puts request.remote_ip
         
     | 
| 
      
 60 
     | 
    
         
            +
                puts 'Registration:'
         
     | 
| 
      
 61 
     | 
    
         
            +
                ap BjondRegistration.find_registration_by_remote_ip(request.remote_ip)
         
     | 
| 
       55 
62 
     | 
    
         
             
                render :json => jwt_encode_payload(BjondApi::BjondAppConfig.instance.group_configuration_schema,
         
     | 
| 
       56 
63 
     | 
    
         
             
                                                   BjondRegistration.find_registration_by_remote_ip(request.remote_ip))
         
     | 
| 
       57 
64 
     | 
    
         
             
              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.5 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.5"
         
     | 
| 
       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,6 +11,8 @@ 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
         
     | 
| 
       14 
16 
     | 
    
         
             
                return SyrupPay::JsonEncryptionCompactSerialization.serialization(Base64.decode64(bjond_registration.encryption_key), header, payload)
         
     | 
| 
       15 
17 
     | 
    
         
             
              end
         
     | 
| 
       16 
18 
     | 
    
         |