castle-rb 1.2.5 → 1.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -1
- data/lib/castle-rb.rb +1 -1
- data/lib/castle-rb/client.rb +4 -4
- data/lib/castle-rb/models/authentication.rb +4 -2
- data/lib/castle-rb/models/model.rb +1 -1
- data/lib/castle-rb/version.rb +1 -1
- data/spec/models/{verification_spec.rb → authentication_spec.rb} +2 -2
- metadata +4 -5
- data/lib/castle-rb/models/verification.rb +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23c20cc08887d01d3640a1c8004710710e9c1b83
|
4
|
+
data.tar.gz: 67d047155bedfc36caeaec197dc87de6b46ea2bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24421a993d804166f108cc856632c9efcd32046ae5f74543b69ed59a6b07d7a8294808f7e69dd348fda267f87b74e3ac629ee1db070085c1b35643310fd21f74
|
7
|
+
data.tar.gz: ddde41d13106997c4a18a6b606284cad78b39560df254a4cf58b5e8178e34ce328d0b368466ca7b1a102bc40b1931d4103220b0ddf6733a02692d1b5236ca25f
|
data/README.md
CHANGED
@@ -31,10 +31,16 @@ Call `identify` when a user logs in or updates their information.
|
|
31
31
|
castle.identify(user.id, {
|
32
32
|
created_at: user.created_at,
|
33
33
|
email: user.email,
|
34
|
-
name: user.name
|
34
|
+
name: user.name,
|
35
|
+
custom_attributes: {
|
36
|
+
company_name: 'Acme',
|
37
|
+
age: 28
|
38
|
+
}
|
35
39
|
})
|
36
40
|
```
|
37
41
|
|
42
|
+
Read more about the available fields in the [API docs](https://api.castle.io/docs#users).
|
43
|
+
|
38
44
|
## Tracking events
|
39
45
|
|
40
46
|
`track` lets you record the security-related actions your users perform. The more actions you track, the more accurate Castle is in identifying fraudsters.
|
data/lib/castle-rb.rb
CHANGED
data/lib/castle-rb/client.rb
CHANGED
@@ -24,12 +24,12 @@ module Castle
|
|
24
24
|
Castle::Event.create(opts)
|
25
25
|
end
|
26
26
|
|
27
|
-
def
|
28
|
-
Castle::
|
27
|
+
def authenticate(user_id)
|
28
|
+
Castle::Authentication.create(user_id: user_id)
|
29
29
|
end
|
30
30
|
|
31
|
-
def
|
32
|
-
Castle::
|
31
|
+
def authentication(authentication_id)
|
32
|
+
Castle::Authentication.find(authentication_id)
|
33
33
|
end
|
34
34
|
|
35
35
|
private
|
@@ -53,7 +53,7 @@ module Castle
|
|
53
53
|
# Add method call to instance: user.enable_something
|
54
54
|
#
|
55
55
|
class_eval <<-RUBY, __FILE__, __LINE__ + 1
|
56
|
-
def #{action}(params={})
|
56
|
+
def #{action}!(params={})
|
57
57
|
self.class.#{method}("\#{request_path}/#{action.to_s.delete('!')}", params)
|
58
58
|
end
|
59
59
|
RUBY
|
data/lib/castle-rb/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: castle-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Johan Brissmyr
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: her
|
@@ -170,7 +170,6 @@ files:
|
|
170
170
|
- lib/castle-rb/models/model.rb
|
171
171
|
- lib/castle-rb/models/user.rb
|
172
172
|
- lib/castle-rb/models/user_agent.rb
|
173
|
-
- lib/castle-rb/models/verification.rb
|
174
173
|
- lib/castle-rb/request.rb
|
175
174
|
- lib/castle-rb/support/cookie_store.rb
|
176
175
|
- lib/castle-rb/support/padrino.rb
|
@@ -179,12 +178,12 @@ files:
|
|
179
178
|
- lib/castle-rb/utils.rb
|
180
179
|
- lib/castle-rb/version.rb
|
181
180
|
- spec/models/account_spec.rb
|
181
|
+
- spec/models/authentication_spec.rb
|
182
182
|
- spec/models/context_spec.rb
|
183
183
|
- spec/models/event_spec.rb
|
184
184
|
- spec/models/location_spec.rb
|
185
185
|
- spec/models/user_agent_spec.rb
|
186
186
|
- spec/models/user_spec.rb
|
187
|
-
- spec/models/verification_spec.rb
|
188
187
|
- spec/spec_helper.rb
|
189
188
|
homepage: https://castle.io
|
190
189
|
licenses:
|
@@ -212,10 +211,10 @@ specification_version: 4
|
|
212
211
|
summary: Castle
|
213
212
|
test_files:
|
214
213
|
- spec/models/account_spec.rb
|
214
|
+
- spec/models/authentication_spec.rb
|
215
215
|
- spec/models/context_spec.rb
|
216
216
|
- spec/models/event_spec.rb
|
217
217
|
- spec/models/location_spec.rb
|
218
218
|
- spec/models/user_agent_spec.rb
|
219
219
|
- spec/models/user_spec.rb
|
220
|
-
- spec/models/verification_spec.rb
|
221
220
|
- spec/spec_helper.rb
|