authrocket 1.4.4 → 1.5.0

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: 1fa4ce2b3ff2db141f60cafe4b4b895a1e489e12
4
- data.tar.gz: 0b796599b1c91983addb2c67f0df152eab987110
3
+ metadata.gz: 48a34e5c646665a7020363a9a8ade5fb317d8699
4
+ data.tar.gz: faad858997b34e9c776a1289be6213ab33f6a1a6
5
5
  SHA512:
6
- metadata.gz: 58964c8728ca38ba00ad57431977e6490a9fc41a83e9a520c75d6c1632df4c705685b20ef6117a28c5af749ded4234f5cebad7d247a29d7d7598bb147d4c0500
7
- data.tar.gz: e2e76576332df5782e2a02e12f3bc5f9ccdfc568e46afac48a2685cf895440cb39ff5e962c2039790d2c21914dd71644f0ef5f4c8cc0197d6a1be2a5ff28bbaa
6
+ metadata.gz: b11966d0c17a23302c3cf9f4eefe409513e0bccc345dbe1f5894b17c674cb3c31def9c2ad54e3a7eacac0f120d12e31054a34b043a93d5e43526909414b91e87
7
+ data.tar.gz: ba4dbda5bb51a4a75555c380d2393e719223b0a69d96e2a07ea607f99f7b6983d96d67e5db56ed821669d00e093aa72d5553f82c00bd632bfa42c1b4c3719dfe
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ #### 1.5.0
2
+ - Update Event and add Notification
3
+
1
4
  #### 1.4.4
2
5
  - Bump to jwt 1.5
3
6
  - Enforce hmac algorithm for jwt
@@ -15,7 +18,7 @@
15
18
  - Update AppHook.event_types
16
19
 
17
20
  #### 1.4.0
18
- - Support social auth in AuthProvider and Credential.
21
+ - Support social auth in AuthProvider and Credential
19
22
 
20
23
  #### 1.3.1
21
24
  - Add Realm#api_key_minutes
@@ -37,12 +40,10 @@
37
40
 
38
41
  - Add custom attributes for Membership, Org, Realm, User
39
42
 
40
-
41
43
  #### 1.0.1
42
44
 
43
45
  - Change User#last_login_on -> #last_login_at
44
46
 
45
-
46
47
  #### 1.0.0
47
48
 
48
49
  - Initial release
data/lib/authrocket.rb CHANGED
@@ -5,7 +5,7 @@ require 'jwt'
5
5
  require "authrocket/api/#{f}"
6
6
  end
7
7
 
8
- %w(app_hook auth_provider credential event login_policy membership org realm session user user_token).each do |f|
8
+ %w(app_hook auth_provider credential event login_policy membership notification org realm session user user_token).each do |f|
9
9
  require "authrocket/#{f}"
10
10
  end
11
11
 
@@ -11,4 +11,4 @@ module AuthRocket
11
11
  end
12
12
 
13
13
  end
14
- end
14
+ end
@@ -1,3 +1,3 @@
1
1
  module AuthRocket
2
- VERSION = '1.4.4'
2
+ VERSION = '1.5.0'
3
3
  end
@@ -3,11 +3,13 @@ module AuthRocket
3
3
  crud :all, :find
4
4
 
5
5
  belongs_to :app_hook
6
+ belongs_to :auth_provider
6
7
  belongs_to :login_policy
7
8
  belongs_to :membership
8
9
  belongs_to :org
9
10
  belongs_to :realm
10
11
  belongs_to :user
12
+ has_many :notifications
11
13
 
12
14
  attr :event_type, :ip
13
15
  attr_datetime :event_at
@@ -21,5 +23,20 @@ module AuthRocket
21
23
  nil
22
24
  end
23
25
 
26
+ def notifications
27
+ reload unless @attribs[:notifications]
28
+ unless @stuffed_event
29
+ @attribs[:notifications].each do |n|
30
+ n.send :load, data: {event: self, event_id: id}
31
+ end
32
+ @stuffed_event = true
33
+ end
34
+ @attribs[:notifications]
35
+ end
36
+
37
+ def find_notification(nid)
38
+ notifications.detect{|n| n.id == nid} || raise(RecordNotFound)
39
+ end
40
+
24
41
  end
25
42
  end
@@ -0,0 +1,11 @@
1
+ module AuthRocket
2
+ class Notification < Resource
3
+
4
+ belongs_to :app_hook
5
+ belongs_to :event
6
+
7
+ attr :attempts, :last_destination, :last_result, :state
8
+ attr_datetime :last_attempt_at
9
+
10
+ end
11
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: authrocket
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.4
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - thomas morgan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-08 00:00:00.000000000 Z
11
+ date: 2015-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ncore
@@ -92,6 +92,7 @@ files:
92
92
  - lib/authrocket/event.rb
93
93
  - lib/authrocket/login_policy.rb
94
94
  - lib/authrocket/membership.rb
95
+ - lib/authrocket/notification.rb
95
96
  - lib/authrocket/org.rb
96
97
  - lib/authrocket/realm.rb
97
98
  - lib/authrocket/session.rb