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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/authsignal/client.rb +12 -0
- data/lib/authsignal/version.rb +1 -1
- data/lib/authsignal.rb +10 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 261ad3aa9e626f62f4b8ec843b0ec4516a157b083980cae0ed7c8641f16b5088
|
4
|
+
data.tar.gz: 56d2f9ad45e5f6330999034ee7ac4667f5864bd0a2a745941f11edca0e840395
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eac78f4ddab0dbb2d042c2d77ce424b512524cb0c1b31c5c956793e651441a4b2d93c1611a195eadfe53b4d377c1ad404a2190ee2b88add9a5867c40ba5c396e
|
7
|
+
data.tar.gz: a0178eda449c5707522d441d680fd7ea7586fa21694a4ca7ea14a24b83543b9cfbcdf0613a00c2ad7d5f9cc10465ac3d767c8449dad6a18aaa44e85298fe96cd
|
data/Gemfile.lock
CHANGED
data/lib/authsignal/client.rb
CHANGED
@@ -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
|
data/lib/authsignal/version.rb
CHANGED
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.
|
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-
|
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.
|
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.
|