model_driven_api 2.3.5 → 2.3.6

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: 315cd43dc90a24097cd08e0ee261ba26b94b8b2e1a9f640416b68b7366b0352e
4
- data.tar.gz: 47a36df93c41c8bcb0a32d832d3b7067e1b9894eda39c313fc0c18cdf17ced2d
3
+ metadata.gz: 4f077fe5622ad57731dec49be396e6a30cd59d643a56c959f7ada5d7b1515302
4
+ data.tar.gz: dd18358e8de2ed6813383ee84910b35557207c6de2f31b7244c8a222e382c8f3
5
5
  SHA512:
6
- metadata.gz: 8d121bf09e8f799dc08ba1b7a5cb5c1b17b6d810eaee6a4c32886733f1e1133a770618bcc2c31ebbf5876f377d017244ad68d63b9d76770dfdcd4e779e09c313
7
- data.tar.gz: c47b0e7fc8a63f96eb238cc8b6d8601b15e0d534b00151717ac333fff86f764998bb7857a471037c918bb25c24b89fe4ab7a63186683209c98e48eb4f18ffb4f
6
+ metadata.gz: f6a0cac8c48611a3e78f0f6fd9e6a1ce6dcb99d82d54170803cf42f638cddd7fb6a5ee3bfc0edf6c3900a0d7627e4c6936f011c1e91fb6522599a844677577d4
7
+ data.tar.gz: 046ca81694a0051a68368b52a7808ffc961c28a4d336dc5e92fcebfe4e4ec7370bd54b8dc4e0c40a0f2f9c179ae0f8ea2adfae509c0394086dc357e6c97a1213
@@ -129,7 +129,6 @@ class Api::V2::ApplicationController < ActionController::API
129
129
  # puts "Found header #{header}: #{request.headers[header.underscore.dasherize]}"
130
130
  check_authorization("Authorize#{header}".constantize.call(request.headers, request.raw_post)) if request.headers[header.underscore.dasherize]
131
131
  end
132
- return unauthenticated!(OpenStruct.new({message: @auth_errors})) unless @current_user
133
132
 
134
133
  # This is the default one, if the header doesn't have a valid form for one of the other Auth methods, then use this Auth Class
135
134
  check_authorization AuthorizeApiRequest.call(request.headers) unless @current_user
@@ -2,13 +2,15 @@ module ApiExceptionManagement
2
2
  extend ActiveSupport::Concern
3
3
 
4
4
  included do
5
- rescue_from NoMethodError, with: :not_found!
6
- rescue_from CanCan::AccessDenied, with: :unauthorized!
7
- rescue_from AuthenticateUser::AccessDenied, with: :unauthenticated!
8
- rescue_from ActionController::RoutingError, with: :not_found!
9
- rescue_from ActiveModel::ForbiddenAttributesError, with: :fivehundred!
10
- rescue_from ActiveRecord::RecordInvalid, with: :invalid!
11
- rescue_from ActiveRecord::RecordNotFound, with: :not_found!
5
+ if Rails.env.production?
6
+ rescue_from NoMethodError, with: :not_found!
7
+ rescue_from CanCan::AccessDenied, with: :unauthorized!
8
+ rescue_from AuthenticateUser::AccessDenied, with: :unauthenticated!
9
+ rescue_from ActionController::RoutingError, with: :not_found!
10
+ rescue_from ActiveModel::ForbiddenAttributesError, with: :fivehundred!
11
+ rescue_from ActiveRecord::RecordInvalid, with: :invalid!
12
+ rescue_from ActiveRecord::RecordNotFound, with: :not_found!
13
+ end
12
14
 
13
15
  def unauthenticated! exception = AuthenticateUser::AccessDenied.new
14
16
  response.headers['WWW-Authenticate'] = "Token realm=Application"
@@ -1,3 +1,3 @@
1
1
  module ModelDrivenApi
2
- VERSION = "#{`git describe --tags $(git rev-list --tags --max-count=1)`}"
2
+ VERSION = "#{`git describe --tags $(git rev-list --tags --max-count=1)`.chomp}"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: model_driven_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.5
4
+ version: 2.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriele Tassoni