uid2 0.2.0 → 0.2.1

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: 63c73ef45bda732e21922cc4f6a8fab9ed68471f1361cac468bef5199934ceb9
4
- data.tar.gz: 4fcdfbc699215daddd062b2032fdd5b0640817eca754ea6a584111a893f0df4a
3
+ metadata.gz: c8b2e6e0c56ef4b62d319695da3cab5a524323b3e010a39f73aa757aedbf4235
4
+ data.tar.gz: 4c92d5fe72b6f8f33590b8629528ee1d0f35669452ca39697f6163ae41c2e572
5
5
  SHA512:
6
- metadata.gz: 57d5aa6003cd365972157c588493fbb5b90508e1e681ed3ad5fa563dd814fbabad419129665c07c96b1ae10a516dfd95348de825ede173a8a03bb4f19366dd3c
7
- data.tar.gz: 838a537bce16ff6d5cb0c24a4373737a7b46dda1309b1d987d8cfcb4032a64454ddb7e8c50c8d7b81751b6a3f58c8f4e0423701c681430b32942e2a6f970f3c5
6
+ metadata.gz: 38d52c4d78f143b49290c4e7c912987cdb282efe0486418fd8ae80000727b315468bbefdf72b13dd68597ff04c4e231aba6f0fe976831699aa11398ace75dea1
7
+ data.tar.gz: 7bb0c89de55e98ef74da355d7d6a50ba0978e0032f3f5902c2ae03436a119d8886f9a9e0ab0c570795970c94f7a78f6e00a41eec43b050b8c39c85b2175a7f7c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.2.1] - 2022-07-12
4
+
5
+ - Fix middleware options compatibility and refactor
6
+
7
+ ## [0.2.0] - 2022-07-11
8
+
9
+ - Migrate to UID2 V2 API
10
+ - Add support for V2 API encryption
11
+ - Add support for API phone number params
12
+
3
13
  ## [0.1.0] - 2021-05-07
4
14
 
5
15
  - Initial release
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- uid2 (0.2.0)
4
+ uid2 (0.2.1)
5
5
  faraday (>= 1)
6
6
  faraday_middleware (>= 1)
7
7
  hashie (>= 4)
@@ -7,11 +7,11 @@ require "hashie/mash"
7
7
  module Faraday
8
8
  module Uid2
9
9
  class Middleware < Faraday::Middleware
10
- def initialize(app, secret_key, is_refresh, options = {})
11
- super(app, options)
10
+ def initialize(app, options = {})
11
+ super(app)
12
12
 
13
- @key = Base64.decode64(secret_key)
14
- @is_refresh = is_refresh
13
+ @key = Base64.decode64(options.fetch(:secret_key))
14
+ @is_refresh = options.fetch(:is_refresh, false)
15
15
  end
16
16
 
17
17
  def call(request_env)
data/lib/uid2/client.rb CHANGED
@@ -30,7 +30,7 @@ module Uid2
30
30
  end
31
31
 
32
32
  def refresh_token(refresh_token:, refresh_response_key:)
33
- http(is_refresh: true, refresh_response_key: refresh_response_key).post("token/refresh", refresh_token).body
33
+ http(refresh_response_key: refresh_response_key).post("token/refresh", refresh_token).body
34
34
  end
35
35
 
36
36
  def get_salt_buckets(since: Time.now)
@@ -54,13 +54,13 @@ module Uid2
54
54
  }
55
55
  end
56
56
 
57
- def http(is_refresh: false, refresh_response_key: nil)
57
+ def http(refresh_response_key: nil)
58
58
  Faraday.new(
59
59
  url: base_url,
60
60
  headers: credentials
61
61
  ) do |f|
62
62
  f.request :json unless refresh_response_key
63
- f.request :uid2_encryption, refresh_response_key || secret_key, is_refresh
63
+ f.request :uid2_encryption, {secret_key: (refresh_response_key || secret_key), is_refresh: !refresh_response_key.nil?}
64
64
  f.adapter :net_http_persistent
65
65
  end
66
66
  end
data/lib/uid2/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uid2
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uid2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Lee
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-10 00:00:00.000000000 Z
11
+ date: 2022-07-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -76,7 +76,6 @@ files:
76
76
  - ".github/workflows/main.yml"
77
77
  - ".gitignore"
78
78
  - ".rspec"
79
- - ".rubocop.yml"
80
79
  - CHANGELOG.md
81
80
  - CODE_OF_CONDUCT.md
82
81
  - Gemfile
data/.rubocop.yml DELETED
@@ -1,13 +0,0 @@
1
- AllCops:
2
- TargetRubyVersion: 2.7
3
-
4
- Style/StringLiterals:
5
- Enabled: true
6
- EnforcedStyle: double_quotes
7
-
8
- Style/StringLiteralsInInterpolation:
9
- Enabled: true
10
- EnforcedStyle: double_quotes
11
-
12
- Layout/LineLength:
13
- Max: 120