model_driven_api 2.3.5 → 2.3.6
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f077fe5622ad57731dec49be396e6a30cd59d643a56c959f7ada5d7b1515302
|
4
|
+
data.tar.gz: dd18358e8de2ed6813383ee84910b35557207c6de2f31b7244c8a222e382c8f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
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"
|