infosimples-data 1.9.9 → 2.0.0

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
  SHA256:
3
- metadata.gz: d83424a916e3be9da4398fb9ba56f2b41973d9f0bb27af8f09644a5f96ef8309
4
- data.tar.gz: 2fdb00bd61cf634ba65efbecd773d0291eb69ed4bef73699eafa0df2f0a12ada
3
+ metadata.gz: 4c546c0f64bf90e83df7c8afdcf313af1e9157234d95a210290f9d3fd99ddcfc
4
+ data.tar.gz: b11c2bb83b91f455bf8f5082ab66028e2d329e5b6cd2d082691f4884938627ba
5
5
  SHA512:
6
- metadata.gz: 367980365caa9f98a76cad22f3930a43f33d3b5f1dbf8b605d835c59cb6c44608da189bc910aa92e1e70dd9d085778cb7211885a1609ffc5b08ccfb7d50221f4
7
- data.tar.gz: 7c4893b2bec42aac7751c7540ef859f01152d04c554c36f2c31ab2ff4a7e9c18084b16f75cbd656832e8828dd1c811da72b2d74b725a8d18583fc45f0dc2b37b
6
+ metadata.gz: 68aa0de7ca989f7ddcf518c4ee4c540fe7e5d0dc14649617ee526b0a11142394674bdc1ae491e829df3bbcd8d45684359ed4d947ba6fc2bd395007253ea29a65
7
+ data.tar.gz: 3abec8904e1f47959cf04e322ec0dcbc0696c673fa81655572bef8e18e5ea6bee8898092cd5e8853235c90f5e2eca6163c2a0fc0f4aa64f8b58d02043f315ac5
@@ -1,26 +1,26 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- infosimples-data (1.9.9)
4
+ infosimples-data (2.0.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- diff-lcs (1.3)
9
+ diff-lcs (1.4.4)
10
10
  rake (10.5.0)
11
- rspec (3.8.0)
12
- rspec-core (~> 3.8.0)
13
- rspec-expectations (~> 3.8.0)
14
- rspec-mocks (~> 3.8.0)
15
- rspec-core (3.8.0)
16
- rspec-support (~> 3.8.0)
17
- rspec-expectations (3.8.1)
11
+ rspec (3.9.0)
12
+ rspec-core (~> 3.9.0)
13
+ rspec-expectations (~> 3.9.0)
14
+ rspec-mocks (~> 3.9.0)
15
+ rspec-core (3.9.2)
16
+ rspec-support (~> 3.9.3)
17
+ rspec-expectations (3.9.2)
18
18
  diff-lcs (>= 1.2.0, < 2.0)
19
- rspec-support (~> 3.8.0)
20
- rspec-mocks (3.8.0)
19
+ rspec-support (~> 3.9.0)
20
+ rspec-mocks (3.9.1)
21
21
  diff-lcs (>= 1.2.0, < 2.0)
22
- rspec-support (~> 3.8.0)
23
- rspec-support (3.8.0)
22
+ rspec-support (~> 3.9.0)
23
+ rspec-support (3.9.3)
24
24
 
25
25
  PLATFORMS
26
26
  ruby
@@ -32,4 +32,4 @@ DEPENDENCIES
32
32
  rspec (~> 3.0)
33
33
 
34
34
  BUNDLED WITH
35
- 1.16.6
35
+ 1.17.3
@@ -17,5 +17,4 @@ require 'infosimples/data/client'
17
17
  require 'infosimples/data/code'
18
18
  require 'infosimples/data/errors'
19
19
  require 'infosimples/data/http'
20
- require 'infosimples/data/symmetric_encryption'
21
20
  require 'infosimples/data/version'
@@ -2,9 +2,6 @@ module Infosimples::Data
2
2
  # Infosimples::Data::Client is a client for the Infosimples Data API.
3
3
  class Client
4
4
  BASE_URL = 'https://data.infosimples.com/api/v1/:service.json'
5
- ENCRYPTABLE_ARGS = ['pkcs12_cert', 'pkcs12_pass', 'pass'].map {
6
- |arg| [arg, true]
7
- }.to_h
8
5
 
9
6
  attr_accessor :token, :timeout, :max_age
10
7
 
@@ -32,11 +29,6 @@ module Infosimples::Data
32
29
  #
33
30
  # @return [Hash] Response according to https://data.infosimples.com/docs.
34
31
  def automate(service, args = {})
35
- args.keys.each do |key|
36
- if ENCRYPTABLE_ARGS[key.to_s]
37
- args[key] = encrypt(args[key])
38
- end
39
- end
40
32
  request(service, :multipart, args)
41
33
  end
42
34
 
@@ -69,16 +61,6 @@ module Infosimples::Data
69
61
 
70
62
  private
71
63
 
72
- # Apply symmetric encryption to data.
73
- #
74
- # @param [String] data The original data that will be encrypted.
75
- #
76
- # @return [String] encrypted data.
77
- def encrypt(data)
78
- @crypt ||= Infosimples::Data::SymmetricEncryption.new(token)
79
- @crypt.encrypt(data)
80
- end
81
-
82
64
  # Perform an HTTP request to the Infosimples Data API.
83
65
  #
84
66
  # @param [String] service API method name.
@@ -1,6 +1,6 @@
1
1
  module Infosimples
2
2
  module Data
3
- VERSION = "1.9.9" # https://data.infosimples.com/docs/changelog
3
+ VERSION = "2.0.0" # https://data.infosimples.com/docs/changelog
4
4
  USER_AGENT = "Infosimples::Data/Ruby v#{VERSION}"
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: infosimples-data
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.9
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Infosimples
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-10-23 00:00:00.000000000 Z
11
+ date: 2020-07-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -76,7 +76,6 @@ files:
76
76
  - lib/infosimples/data/code.rb
77
77
  - lib/infosimples/data/errors.rb
78
78
  - lib/infosimples/data/http.rb
79
- - lib/infosimples/data/symmetric_encryption.rb
80
79
  - lib/infosimples/data/version.rb
81
80
  homepage: https://github.com/infosimples/infosimples-data
82
81
  licenses:
@@ -97,8 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
97
96
  - !ruby/object:Gem::Version
98
97
  version: '0'
99
98
  requirements: []
100
- rubyforge_project:
101
- rubygems_version: 2.7.7
99
+ rubygems_version: 3.0.6
102
100
  signing_key:
103
101
  specification_version: 4
104
102
  summary: Ruby API for Infosimples::Data (https://infosimples.com/)
@@ -1,25 +0,0 @@
1
- module Infosimples::Data
2
- class SymmetricEncryption
3
- attr_accessor :key
4
- def initialize(key)
5
- fail("INVALID KEY SIZE: #{key}") if key.size < 32
6
- self.key = key[0, 32]
7
- end
8
-
9
- def encrypt(data, to_base64=true)
10
- aes = OpenSSL::Cipher.new('AES-256-CBC')
11
- aes.encrypt
12
- aes.key = Digest::SHA256.digest(key)
13
- encrypted_data = aes.update(data) + aes.final
14
- to_base64 ? Base64.encode64(encrypted_data) : encrypted_data
15
- end
16
-
17
- def decrypt(data, from_base64=true)
18
- data = Base64.decode64(data) if from_base64
19
- aes = OpenSSL::Cipher.new('AES-256-CBC')
20
- aes.decrypt
21
- aes.key = Digest::SHA256.digest(key)
22
- aes.update(data) + aes.final
23
- end
24
- end
25
- end