active_record_api-rest 1.0.43 → 1.0.44

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: a63d982c445e69d392589015e8b053d447a40aa2e651053069ae2674c2355786
4
- data.tar.gz: 5f29711e23d39fe4ed7e146f7872d32a4fad3529bbbf7b929f8391ba58357d07
3
+ metadata.gz: 6c5037fad9b8ba42dcde80b97396663e82657b8aecef286632a7a96a1771ee3a
4
+ data.tar.gz: a657cb92a3f4aeb6afda72011668d0ceac2c2f19170b4ec4e4baad2884be3908
5
5
  SHA512:
6
- metadata.gz: 6fe3f6683af532ee995299384592c9e8efedf175c14ce1a28624cef8219ae063ffec2c2bc7c3d8593572fd8040acd94a3b5d0ac436f990de66797f63169bd03a
7
- data.tar.gz: 629b3ebd264515c24d1acbcb07d1a041a366dc01b1170764921b5e03439a406fcd5e63b4cc148b8557e1ae5815c24caa1b23a2a56a64a197c3c332dd67350faa
6
+ metadata.gz: 96766390d33f1f317e8a9fe7ff692e0bf09fc33826ad83430acb1f72847b12a98fadb0cc157626af1591726f9b639df574406ef6c22020432acc016e5ee61628
7
+ data.tar.gz: 281a6b56c4c86e0598c24fba47386ca57e0e68a600df4996de77205b19eef5dc71c273086919ddae01a3e5f1eea4c12776f7a297d9becb7d085dcbb9e3ab9f99
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- active_record_api-rest (1.0.41)
4
+ active_record_api-rest (1.0.43)
5
5
  active_attr
6
6
  active_model_serializers
7
7
  rails (>= 5.1)
@@ -32,7 +32,8 @@ GEM
32
32
  erubi (~> 1.4)
33
33
  rails-dom-testing (~> 2.0)
34
34
  rails-html-sanitizer (~> 1.0, >= 1.0.3)
35
- active_attr (0.13.1)
35
+ active_attr (0.15.0)
36
+ actionpack (>= 3.0.2, < 6.1)
36
37
  activemodel (>= 3.0.2, < 6.1)
37
38
  activesupport (>= 3.0.2, < 6.1)
38
39
  active_model_serializers (0.10.9)
@@ -100,11 +101,11 @@ GEM
100
101
  mimemagic (~> 0.3.2)
101
102
  method_source (0.9.2)
102
103
  mimemagic (0.3.3)
103
- mini_mime (1.0.1)
104
+ mini_mime (1.0.2)
104
105
  mini_portile2 (2.4.0)
105
106
  minitest (5.11.3)
106
107
  multi_json (1.13.1)
107
- nio4r (2.3.1)
108
+ nio4r (2.4.0)
108
109
  nokogiri (1.10.3)
109
110
  mini_portile2 (~> 2.4.0)
110
111
  pg (1.1.4)
@@ -185,9 +186,9 @@ GEM
185
186
  addressable (>= 2.3.6)
186
187
  crack (>= 0.3.2)
187
188
  hashdiff
188
- websocket-driver (0.7.0)
189
+ websocket-driver (0.7.1)
189
190
  websocket-extensions (>= 0.1.0)
190
- websocket-extensions (0.1.3)
191
+ websocket-extensions (0.1.4)
191
192
 
192
193
  PLATFORMS
193
194
  ruby
@@ -0,0 +1,15 @@
1
+ module ActiveRecordApi
2
+ module Rest
3
+ module Auth
4
+ class BadRequestException < StandardError
5
+ attr_reader :action
6
+ attr_reader :controller
7
+ def initialize(controller, action, message)
8
+ super("#{message} on #{action} #{controller}")
9
+ @action = action
10
+ @controller = controller
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -8,6 +8,10 @@ module ActiveRecordApi
8
8
  render status: :not_found, json: { base: exception.message }
9
9
  end
10
10
 
11
+ rescue_from ActiveRecordApi::Rest::Auth::BadRequest do |exception|
12
+ render status: :bad_request, json: { base: 'Bad Request', message: exception.message }
13
+ end
14
+
11
15
  rescue_from ActiveRecordApi::Rest::Auth::BadSessionException do |exception|
12
16
  render status: :unauthorized, json: { base: "No user for fullmeasure_session on #{exception.action} #{exception.controller}", message: exception.message }
13
17
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ActiveRecordApi
4
4
  module Rest
5
- VERSION = '1.0.43'.freeze
5
+ VERSION = '1.0.44'.freeze
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_record_api-rest
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.43
4
+ version: 1.0.44
5
5
  platform: ruby
6
6
  authors:
7
7
  - Full Measure Education
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-07-15 00:00:00.000000000 Z
11
+ date: 2019-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -145,6 +145,7 @@ files:
145
145
  - bin/setup
146
146
  - lib/active_record_api-rest.rb
147
147
  - lib/active_record_api/rest/auth/access_denied_exception.rb
148
+ - lib/active_record_api/rest/auth/bad_request_exception.rb
148
149
  - lib/active_record_api/rest/auth/bad_session_exception.rb
149
150
  - lib/active_record_api/rest/auth/controller.rb
150
151
  - lib/active_record_api/rest/auth/policy.rb