nubank_sdk 0.7.1 → 0.7.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4e6aaa0047c7851123791cc437134505bf04b655c080f21697882c604a706cd2
4
- data.tar.gz: 552a50d9b7e1baf80231de4f0e7fd2f0db9d0014f541bb5a77a59b51ffda37fa
3
+ metadata.gz: acb3d7fcfc4212b5b535b127b93caf6659da30a516adf5a339078a9b2571a3e9
4
+ data.tar.gz: 9fa55b75d3076c6251a709cb065f70752e27765dbaa0a1c7eb0f11cdb653248c
5
5
  SHA512:
6
- metadata.gz: 8be041a0742e7eb8dc54d9dad86788cf9f960b632ea4e9179e11055dd2c0354e20666f4489f7e7aee9905376ed8eacbc9b3a018cc92b8dbb788f2a9f2c135274
7
- data.tar.gz: cd642897726264a36cb6d97c5c767aecf7d6525d45611ac685d97d04b90be29c6602c2451d0868da336169d74eab892c79ec1426bc745607d1317a86a17fd533
6
+ metadata.gz: f0701f569a4dac7ac8060eecefe458d842233ae4a35c1687aeb29f444a0b1919575a55f5f781c15e37f29976967bbf96c8b9a1414f61b6353d068becdf1044ae
7
+ data.tar.gz: f196c47c07437300f91d1f5d4d08b30c070bf5bbc822b5526b2b6d794d89ed91d8e797d618b03ee2eab2cc633e720f21b06acba495b6876f05805e946caa811c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nubank_sdk (0.7.1)
4
+ nubank_sdk (0.7.2)
5
5
  faraday (~> 2.7.1)
6
6
  json (~> 2.3)
7
7
 
@@ -7,7 +7,7 @@ module NubankSdk
7
7
  # Auth method to connect with the nubank api
8
8
  #
9
9
  class Auth
10
- attr_accessor :refresh_token, :refresh_before, :access_token
10
+ attr_accessor :refresh_token, :refresh_before, :access_token, :encrypted_code, :p_key
11
11
 
12
12
  #
13
13
  # Auth method to connect with the nubank api
@@ -22,6 +22,7 @@ module NubankSdk
22
22
  @api_routes = api_routes || ApiRoutes.new
23
23
 
24
24
  @connection_adapter = connection_adapter
25
+ @p_key = OpenSSL::PKey::RSA.new 2048
25
26
  end
26
27
 
27
28
  #
@@ -75,7 +76,7 @@ module NubankSdk
75
76
  response = default_connection.post(@gen_certificate_path, new_payload)
76
77
 
77
78
  response_data = Client.get_body(response)
78
- certificate.process_decoded(key, response_data[:certificate])
79
+ certificate.process_decoded(@p_key, response_data[:certificate])
79
80
  end
80
81
 
81
82
  private
@@ -110,7 +111,7 @@ module NubankSdk
110
111
  {
111
112
  login: @cpf,
112
113
  password: password,
113
- public_key: key.public_key.to_pem,
114
+ public_key: @p_key.public_key.to_pem,
114
115
  device_id: @device_id,
115
116
  model: "NubankSdk Client (#{@device_id})"
116
117
  }
@@ -132,14 +133,6 @@ module NubankSdk
132
133
  }
133
134
  end
134
135
 
135
- # @!visibility private
136
- # Generates a new key for the certificate communication
137
- #
138
- # @return [OpenSSL::PKey::RSA] a new key
139
- def generate_key
140
- OpenSSL::PKey::RSA.new 2048
141
- end
142
-
143
136
  # @!visibility private
144
137
  # Add the new links to the api routes
145
138
  #
@@ -202,14 +195,6 @@ module NubankSdk
202
195
  @ssl_connection ||= Client::HTTPS.new(certificate.encoded, @connection_adapter)
203
196
  end
204
197
 
205
- # @!visibility private
206
- # return the key of the certificate communication
207
- #
208
- # @return [OpenSSL::PKey::RSA] the key of the certificate
209
- def key
210
- @key ||= generate_key
211
- end
212
-
213
198
  # @!visibility private
214
199
  # Generates a random device id
215
200
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NubankSdk
4
- VERSION = '0.7.1'
4
+ VERSION = '0.7.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nubank_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Viserion77
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-01-10 00:00:00.000000000 Z
11
+ date: 2023-01-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler