freeclimb 2.2.0 → 3.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/CHANGELOG.md +6 -1
- data/README.md +4 -4
- data/freeclimb-2.2.0.gem +0 -0
- data/lib/freeclimb.rb +1 -0
- data/lib/freeclimb/api_client.rb +1 -1
- data/lib/freeclimb/utils.rb +34 -0
- data/lib/freeclimb/version.rb +1 -1
- metadata +4 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 8822c0cb7172e4c5ff3cab045f98636e7645b842dcc7c17097fec6b2257c10a7
         | 
| 4 | 
            +
              data.tar.gz: fa3c4ec0294ec97f141a1d58dffd65034f1d664b8e4ea65e62fc4ffffb2c6911
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 1ad8968cabebe723a38432655e665764a7841aa97bb21a0275f3d6920bdc9c870ef69b922f03c69e79320e567e9f5a39cc2e6a9d521c8e38c684f793cf8dd761
         | 
| 7 | 
            +
              data.tar.gz: a8b822a510b5bed0bba1b77ea3507becc96efe65259a518a6f45d014ee4c564c24828f28d23f3bb75026ceebd40daeb8c337bb998e19373f807c13e7533c37fb
         | 
    
        data/CHANGELOG.md
    CHANGED
    
    | @@ -7,8 +7,13 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm | |
| 7 7 | 
             
            ## [Unreleased]
         | 
| 8 8 | 
             
            None
         | 
| 9 9 |  | 
| 10 | 
            +
            <a name="3.0.0"></a>
         | 
| 11 | 
            +
            ## [3.0.0] - 2021-05-03
         | 
| 12 | 
            +
            ### Added
         | 
| 13 | 
            +
            - Add `verify_request` utility function
         | 
| 14 | 
            +
             | 
| 10 15 | 
             
            <a name="2.2.0"></a>
         | 
| 11 | 
            -
            ## [2. | 
| 16 | 
            +
            ## [2.2.0] - 2021-04-12
         | 
| 12 17 | 
             
            ### Changed
         | 
| 13 18 | 
             
            - Replace any language instance of `auth_token` or similar speech to `api_key`
         | 
| 14 19 |  | 
    
        data/README.md
    CHANGED
    
    | @@ -5,7 +5,7 @@ FreeClimb is a cloud-based application programming interface (API) that puts the | |
| 5 5 | 
             
            This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
         | 
| 6 6 |  | 
| 7 7 | 
             
            - API version: 1.0.0
         | 
| 8 | 
            -
            - Package version:  | 
| 8 | 
            +
            - Package version: 3.0.0
         | 
| 9 9 | 
             
            - Build package: org.openapitools.codegen.languages.RubyClientCodegen
         | 
| 10 10 |  | 
| 11 11 | 
             
            ## Installation
         | 
| @@ -21,16 +21,16 @@ gem build freeclimb.gemspec | |
| 21 21 | 
             
            Then either install the gem locally:
         | 
| 22 22 |  | 
| 23 23 | 
             
            ```shell
         | 
| 24 | 
            -
            gem install ./freeclimb- | 
| 24 | 
            +
            gem install ./freeclimb-3.0.0.gem
         | 
| 25 25 | 
             
            ```
         | 
| 26 26 |  | 
| 27 | 
            -
            (for development, run `gem install --dev ./freeclimb- | 
| 27 | 
            +
            (for development, run `gem install --dev ./freeclimb-3.0.0.gem` to install the development dependencies)
         | 
| 28 28 |  | 
| 29 29 | 
             
            or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
         | 
| 30 30 |  | 
| 31 31 | 
             
            Finally add this to the Gemfile:
         | 
| 32 32 |  | 
| 33 | 
            -
                gem 'freeclimb', '~>  | 
| 33 | 
            +
                gem 'freeclimb', '~> 3.0.0'
         | 
| 34 34 |  | 
| 35 35 | 
             
            ### Install from Ruby gems
         | 
| 36 36 | 
             
            ```shell
         | 
    
        data/freeclimb-2.2.0.gem
    ADDED
    
    | Binary file | 
    
        data/lib/freeclimb.rb
    CHANGED
    
    
    
        data/lib/freeclimb/api_client.rb
    CHANGED
    
    | @@ -30,7 +30,7 @@ module Freeclimb | |
| 30 30 | 
             
                # @option config [Configuration] Configuration for initializing the object, default to Configuration.default
         | 
| 31 31 | 
             
                def initialize(config = Configuration.default)
         | 
| 32 32 | 
             
                  @config = config
         | 
| 33 | 
            -
                  @user_agent = "FreeClimbSDK/ | 
| 33 | 
            +
                  @user_agent = "FreeClimbSDK/3.0.0/ruby"
         | 
| 34 34 | 
             
                  @default_headers = {
         | 
| 35 35 | 
             
                    'Content-Type' => 'application/json',
         | 
| 36 36 | 
             
                    'User-Agent' => @user_agent
         | 
| @@ -0,0 +1,34 @@ | |
| 1 | 
            +
            require 'json'
         | 
| 2 | 
            +
            require 'cgi'
         | 
| 3 | 
            +
            require 'date'
         | 
| 4 | 
            +
            require 'openssl'
         | 
| 5 | 
            +
             | 
| 6 | 
            +
            module FreeClimb
         | 
| 7 | 
            +
              class Utils
         | 
| 8 | 
            +
                def self.verify_request(requestBody, signatureHeader, signingSecret, tolerance=5*60*1000)
         | 
| 9 | 
            +
                  signatureArr = signatureHeader.split(',')
         | 
| 10 | 
            +
                  signatureHash = {}
         | 
| 11 | 
            +
                  signatureArr.each { |queryStr|
         | 
| 12 | 
            +
                    hash = CGI.parse(queryStr)
         | 
| 13 | 
            +
                    if (signatureHash.key?(hash.keys[0])) 
         | 
| 14 | 
            +
                      signatureHash[hash.keys[0]] = [signatureHash[hash.keys[0]]].append(hash.values[0][0])
         | 
| 15 | 
            +
                    else
         | 
| 16 | 
            +
                      signatureHash[hash.keys[0]] = hash.values[0][0]
         | 
| 17 | 
            +
                    end
         | 
| 18 | 
            +
                  }
         | 
| 19 | 
            +
             | 
| 20 | 
            +
                  currentTime = DateTime.now.strftime('%s')
         | 
| 21 | 
            +
                  signatureAge = currentTime.to_i - signatureHash["t"].to_i
         | 
| 22 | 
            +
                  if (tolerance < signatureAge)
         | 
| 23 | 
            +
                    raise StandardError.new "Request rejected - signature's timestamp failed against current tolerance of #{tolerance} milliseconds. Signature age: #{signatureAge} milliseconds";
         | 
| 24 | 
            +
                  end
         | 
| 25 | 
            +
             | 
| 26 | 
            +
                  data = signatureHash["t"] + "." + requestBody
         | 
| 27 | 
            +
                  hmac = OpenSSL::HMAC.hexdigest('sha256', signingSecret, data)
         | 
| 28 | 
            +
             | 
| 29 | 
            +
                  if (!signatureHash["v1"].include? hmac)
         | 
| 30 | 
            +
                    raise StandardError.new "Unverified Request Signature - FreeClimb was unable to verify that this request originated from FreeClimb. If this request was unexpected, it may be from a bad actor. Please proceed with caution. If this request was expected, to fix this issue try checking for any typos or misspelling of your signing secret.";
         | 
| 31 | 
            +
                  end
         | 
| 32 | 
            +
                end
         | 
| 33 | 
            +
              end
         | 
| 34 | 
            +
            end
         | 
    
        data/lib/freeclimb/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: freeclimb
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version:  | 
| 4 | 
            +
              version: 3.0.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - OpenAPI-Generator
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2021-05- | 
| 11 | 
            +
            date: 2021-05-11 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: typhoeus
         | 
| @@ -196,6 +196,7 @@ files: | |
| 196 196 | 
             
            - freeclimb-2.1.0.gem
         | 
| 197 197 | 
             
            - freeclimb-2.1.1.gem
         | 
| 198 198 | 
             
            - freeclimb-2.1.2.gem
         | 
| 199 | 
            +
            - freeclimb-2.2.0.gem
         | 
| 199 200 | 
             
            - freeclimb.gemspec
         | 
| 200 201 | 
             
            - lib/freeclimb.rb
         | 
| 201 202 | 
             
            - lib/freeclimb/api/default_api.rb
         | 
| @@ -304,6 +305,7 @@ files: | |
| 304 305 | 
             
            - lib/freeclimb/models/update_call_request.rb
         | 
| 305 306 | 
             
            - lib/freeclimb/models/update_conference_participant_request.rb
         | 
| 306 307 | 
             
            - lib/freeclimb/models/update_conference_request.rb
         | 
| 308 | 
            +
            - lib/freeclimb/utils.rb
         | 
| 307 309 | 
             
            - lib/freeclimb/version.rb
         | 
| 308 310 | 
             
            - spec/api/default_api_spec.rb
         | 
| 309 311 | 
             
            - spec/api/web_mocks.rb
         |