castle-rb 1.2.4 → 1.2.5

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
  SHA1:
3
- metadata.gz: 50a424d997b3d45198e82346d397d55273e41801
4
- data.tar.gz: 8a62a7a1fdcda8f9398cabcc51791d0833670b33
3
+ metadata.gz: af121c5d1d3c642d3435268c16941c87379b2994
4
+ data.tar.gz: 5b38a50048cef8e962a8491e9146b8ca61f90ee1
5
5
  SHA512:
6
- metadata.gz: a8103ce836ba42ca80349de89ccf01db37f9858b8b5976032a2c8a806a2f76642bee7e0b3c589b05751f54ae107a95635403b6b61ce543c8f30f3cf174c9409f
7
- data.tar.gz: 59cc626d91aa80d8433005008e6cfc0dd702b7fadbdd0a9cded48fac76e9f28a73d01d3b651f5eba77a271dfe59e4cde94178163da4769e27c912d4db9aeb441
6
+ metadata.gz: 2819e4740c9cd3b61c10c1d7256ef7e0d1eec0279f23f57820177ad6dd2bd381b149a8fcc31ce37498ffffb0d217f18da57c2216a4cd330be03df92374aaee12
7
+ data.tar.gz: 527db83f6d74a97f64e5643653e56cd3b57862d2429dc79a9f6757c879dedfcb63f4a327ce899857324adf7d3708b015015365a83555995ca585481ed89b11fd
data/README.md CHANGED
@@ -23,7 +23,19 @@ Castle.api_secret = 'YOUR_API_SECRET'
23
23
 
24
24
  A Castle client instance will automatically be made available as `castle` in your Rails, Sinatra or Padrino controllers.
25
25
 
26
- ## Tracking security events
26
+ ## Identifying users
27
+
28
+ Call `identify` when a user logs in or updates their information.
29
+
30
+ ```ruby
31
+ castle.identify(user.id, {
32
+ created_at: user.created_at,
33
+ email: user.email,
34
+ name: user.name
35
+ })
36
+ ```
37
+
38
+ ## Tracking events
27
39
 
28
40
  `track` lets you record the security-related actions your users perform. The more actions you track, the more accurate Castle is in identifying fraudsters.
29
41
 
@@ -54,6 +66,9 @@ castle.track(
54
66
  - `$logout.succeeded`: Record when a user logs out.
55
67
  - `$registration.succeeded`: Capture account creation, both when a user signs up as well as when created manually by an administrator.
56
68
  - `$registration.failed`: Record when an account failed to be created.
69
+ - `$email_change.requested`: An attempt was made to change a user’s email.
70
+ - `$email_change.succeeded`: The user completed all of the steps in the email address change process and the email was successfully changed.
71
+ - `$email_change.failed`: Use to record when a user failed to change their email address.
57
72
  - `$challenge.requested`: Record when a user is prompted with additional verification, such as two-factor authentication or a captcha.
58
73
  - `$challenge.succeeded`: Record when additional verification was successful.
59
74
  - `$challenge.failed`: Record when additional verification failed.
@@ -16,6 +16,10 @@ module Castle
16
16
  }
17
17
  end
18
18
 
19
+ def identify(user_id, opts = {})
20
+ Castle::User.save_existing(user_id, opts)
21
+ end
22
+
19
23
  def track(opts = {})
20
24
  Castle::Event.create(opts)
21
25
  end
@@ -0,0 +1,7 @@
1
+ module Castle
2
+ class Authentication < Model
3
+ instance_post :ok
4
+ instance_post :bad
5
+ instance_post :reset
6
+ end
7
+ end
@@ -1,3 +1,3 @@
1
1
  module Castle
2
- VERSION = "1.2.4"
2
+ VERSION = "1.2.5"
3
3
  end
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
4
+ version: 1.2.5
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-09-08 00:00:00.000000000 Z
11
+ date: 2015-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: her
@@ -163,6 +163,7 @@ files:
163
163
  - lib/castle-rb/errors.rb
164
164
  - lib/castle-rb/ext/her.rb
165
165
  - lib/castle-rb/models/account.rb
166
+ - lib/castle-rb/models/authentication.rb
166
167
  - lib/castle-rb/models/context.rb
167
168
  - lib/castle-rb/models/event.rb
168
169
  - lib/castle-rb/models/location.rb
@@ -205,7 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
205
206
  version: '0'
206
207
  requirements: []
207
208
  rubyforge_project:
208
- rubygems_version: 2.4.3
209
+ rubygems_version: 2.4.5.1
209
210
  signing_key:
210
211
  specification_version: 4
211
212
  summary: Castle