notable 0.3.1 → 0.3.2

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: b698c7c6e4b8d027912deb4740e3713b61acac0eb56130d4e917bd55752b12b8
4
- data.tar.gz: 66dd7ddb28daf9422772e23db13acf401c53b33a7acdb017909e66df3aa6db8d
3
+ metadata.gz: 97e610b1e6274a603bf4404cad75d7fb024b265b2ccad352916940e3f1b81dd1
4
+ data.tar.gz: 0b7b71c06fcf86d5b9cf5b3aa10439d7902d3c9a185ce52ae50ce43a63aa8030
5
5
  SHA512:
6
- metadata.gz: 7f3c6625ffe35bf197a0110071bda6d76c0f00c4de99921e39d8e24dacf940015a597c1437b4ac8100ef744b3af343f7fef9c84c3783969a666389f642efc39b
7
- data.tar.gz: d67e694ebb51daae26242fe59e7a3b43178b44f33b77e6d0dbbd639106cc4a6b20d4bcc8f7a6b068338f01b3c0c4cd2df9e22f7c19fe703e57f2197c72af97ad
6
+ metadata.gz: 24736ec76486d7f1dc515bbf7d45da6c0d4328f56b27232ace17df78f5899b9dd1230b4f11a4c62baa5ac729df2d113b595f038467d9099a0f62d5d111dabcb8
7
+ data.tar.gz: a2af6018e63f62f886be2212b6349909ee3d36f15aaa16063508d0420366921afd12b8b27e914ebcc889f0af4287dad87e8fa7dd956729341a976bb1b3c2c3af
@@ -1,3 +1,8 @@
1
+ ## 0.3.2 (2020-07-24)
2
+
3
+ - Added support for Rails API
4
+ - Fixed blocked requests with Rack::Attack
5
+
1
6
  ## 0.3.1 (2020-05-20)
2
7
 
3
8
  - Fixed deprecation warning in Ruby 2.7
@@ -1,4 +1,4 @@
1
- Copyright (c) 2014-2019 Andrew Kane
1
+ Copyright (c) 2014-2020 Andrew Kane
2
2
 
3
3
  MIT License
4
4
 
data/README.md CHANGED
@@ -23,6 +23,8 @@ You can track custom notes as well.
23
23
 
24
24
  :tangerine: Battle-tested at [Instacart](https://www.instacart.com/opensource)
25
25
 
26
+ [![Build Status](https://travis-ci.org/ankane/notable.svg?branch=master)](https://travis-ci.org/ankane/notable)
27
+
26
28
  ## Installation
27
29
 
28
30
  Add this line to your application’s Gemfile:
@@ -165,4 +167,5 @@ To get started with development:
165
167
  git clone https://github.com/ankane/notable.git
166
168
  cd notable
167
169
  bundle install
170
+ bundle exec rake test
168
171
  ```
@@ -3,8 +3,7 @@ class <%= migration_class_name %> < ActiveRecord::Migration<%= migration_version
3
3
  create_table :notable_requests do |t|
4
4
  t.string :note_type
5
5
  t.text :note
6
- t.integer :user_id
7
- t.string :user_type
6
+ t.references :user, polymorphic: true
8
7
  t.text :action
9
8
  t.integer :status
10
9
  t.text :url
@@ -16,7 +15,5 @@ class <%= migration_class_name %> < ActiveRecord::Migration<%= migration_version
16
15
  t.float :request_time
17
16
  t.timestamp :created_at
18
17
  end
19
-
20
- add_index :notable_requests, [:user_id, :user_type]
21
18
  end
22
19
  end
@@ -1,7 +1,7 @@
1
1
  ActiveSupport::Notifications.subscribe "rack.attack" do |_name, _start, _finish, _request_id, req|
2
2
  request = req.is_a?(Hash) ? req[:request] : req
3
3
 
4
- if [:blacklist, :throttle].include?(request.env["rack.attack.match_type"])
4
+ if [:blacklist, :blocklist, :throttle].include?(request.env["rack.attack.match_type"])
5
5
  Notable.track "Throttle", request.env["rack.attack.matched"]
6
6
  end
7
7
  end
@@ -7,7 +7,7 @@ module Notable
7
7
  end
8
8
 
9
9
  def track_unverified_request
10
- if !verified_request?
10
+ if respond_to?(:verified_request?, true) && !verified_request?
11
11
  expected = form_authenticity_token
12
12
  actual = form_authenticity_param || request.headers["X-CSRF-Token"]
13
13
  Notable.track "Unverified Request", "#{actual || "nil"} != #{expected}"
@@ -1,3 +1,3 @@
1
1
  module Notable
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: notable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-20 00:00:00.000000000 Z
11
+ date: 2020-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -66,6 +66,90 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: minitest
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '5'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '5'
83
+ - !ruby/object:Gem::Dependency
84
+ name: combustion
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rails
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: sqlite3
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: rack-attack
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: slowpoke
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
69
153
  description:
70
154
  email: andrew@chartkick.com
71
155
  executables: []