authsignal-ruby 2.1.1 → 2.1.3

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: 5ca1d4818fc1ff9c662b04b0fce7b3ad532b081826d8418ea6d359e681bcd0cc
4
- data.tar.gz: de37f34d38fc6e63ef6011c86f363b05f60121ddb9fb4ed65401578ef189b55f
3
+ metadata.gz: 261ad3aa9e626f62f4b8ec843b0ec4516a157b083980cae0ed7c8641f16b5088
4
+ data.tar.gz: 56d2f9ad45e5f6330999034ee7ac4667f5864bd0a2a745941f11edca0e840395
5
5
  SHA512:
6
- metadata.gz: 5b4b25771cbe3d0ed5a7614a72822dd8dc4b63c1919bfed01fe63c2771b107b552c637aceee4a4c0253b6cf7f4cea1be18243843297e8909e907ab7d9d3931e7
7
- data.tar.gz: fc07cba6d3564da885b71b4883df830fb08c91cba961b0d07d76a71d513e6c5175514ba5f0a749cb65a971b9a3606a7f63dadd437628d0a795ebf98428a02a12
6
+ metadata.gz: eac78f4ddab0dbb2d042c2d77ce424b512524cb0c1b31c5c956793e651441a4b2d93c1611a195eadfe53b4d377c1ad404a2190ee2b88add9a5867c40ba5c396e
7
+ data.tar.gz: a0178eda449c5707522d441d680fd7ea7586fa21694a4ca7ea14a24b83543b9cfbcdf0613a00c2ad7d5f9cc10465ac3d767c8449dad6a18aaa44e85298fe96cd
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- authsignal-ruby (2.1.1)
4
+ authsignal-ruby (2.1.3)
5
5
  httparty (~> 0.21.0)
6
6
 
7
7
  GEM
@@ -48,6 +48,10 @@ module Authsignal
48
48
  post("/users/#{ERB::Util.url_encode(user_id)}", body: JSON.generate(user))
49
49
  end
50
50
 
51
+ def delete_user(user_id:)
52
+ delete("/users/#{ERB::Util.url_encode(user_id)}")
53
+ end
54
+
51
55
  def validate_challenge(user_id: nil, token:)
52
56
  path = "/validate"
53
57
 
@@ -68,6 +72,10 @@ module Authsignal
68
72
  post("/users/#{ERB::Util.url_encode(user_id)}/authenticators", body: JSON.generate(authenticator))
69
73
  end
70
74
 
75
+ def delete_user_authenticator(user_id:, user_authenticator_id:)
76
+ delete("/users/#{ERB::Util.url_encode(user_id)}/authenticators/#{ERB::Util.url_encode(user_authenticator_id)}")
77
+ end
78
+
71
79
  def get(path, query: {})
72
80
  self.class.get(path, headers: @headers, basic_auth: {username: @api_key})
73
81
  end
@@ -76,6 +84,10 @@ module Authsignal
76
84
  self.class.post(path, headers: @headers, body: body, basic_auth: {username: @api_key})
77
85
  end
78
86
 
87
+ def delete(path, query: {}, body: {})
88
+ self.class.delete(path, headers: @headers, body: body, basic_auth: {username: @api_key})
89
+ end
90
+
79
91
  private
80
92
 
81
93
  def version
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Authsignal
4
- VERSION = "2.1.1"
4
+ VERSION = "2.1.3"
5
5
  end
data/lib/authsignal.rb CHANGED
@@ -31,6 +31,11 @@ module Authsignal
31
31
  response.transform_keys { |key| underscore(key) }.transform_keys(&:to_sym)
32
32
  end
33
33
 
34
+ def delete_user(user_id:)
35
+ response = Client.new.delete_user(user_id: user_id)
36
+ response.transform_keys { |key| underscore(key) }.transform_keys(&:to_sym)
37
+ end
38
+
34
39
  def get_action(user_id:, action:, idempotency_key:)
35
40
  response = Client.new.get_action(user_id, action, idempotency_key)
36
41
  response.transform_keys { |key| underscore(key) }.transform_keys(&:to_sym)
@@ -49,6 +54,11 @@ module Authsignal
49
54
  response
50
55
  end
51
56
 
57
+ def delete_user_authenticator(user_id:, user_authenticator_id: )
58
+ response = Client.new.delete_user_authenticator(user_id: user_id, user_authenticator_id: user_authenticator_id)
59
+ response.transform_keys { |key| underscore(key) }.transform_keys(&:to_sym)
60
+ end
61
+
52
62
  def track(event, options={})
53
63
  raise ArgumentError, "Action Code is required" unless event[:action].to_s.length > 0
54
64
  raise ArgumentError, "User ID value" unless event[:user_id].to_s.length > 0
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: authsignal-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - justinsoong
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-07-12 00:00:00.000000000 Z
11
+ date: 2024-10-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -109,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  requirements: []
112
- rubygems_version: 3.5.11
112
+ rubygems_version: 3.5.16
113
113
  signing_key:
114
114
  specification_version: 4
115
115
  summary: The Authsignal ruby server side signal API.