apress-api 1.23.0 → 1.24.0

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
  SHA1:
3
- metadata.gz: 43a748096b021dd156152b6a5ee52c0c703f35f1
4
- data.tar.gz: 68962ab9f9bd963895bc9d2e1a3f2793c9ef68be
3
+ metadata.gz: 94df686686e25123a2ebb3730ea3c572a8c43043
4
+ data.tar.gz: 285221061f1816e795c6a256aaa071029ce942ed
5
5
  SHA512:
6
- metadata.gz: 3b29d9678ced4f182c973217a8cf40e2c653dfc5923965e4cb572c6952014d5797f6def7ca11d7c9a491578a852015102d5c5215710bdf6afe4f6030dd233329
7
- data.tar.gz: 797a2899d08241da697020f25bc4cf90ea655ad44df6a2d518e8b942ec33e410933a4d6837e9b48dfdca712677e838646bf6821bdef16cdb87bbe44f2ba771cb
6
+ metadata.gz: f7febab7293f6b314c4ad4dd07061e659efa4c6b569e2466ed5370f9d7b6537ee68e2384dfe9c9aecbe8db6b273ab7ca86280595100561cba843972d2bbe189b
7
+ data.tar.gz: '09ba9c12e3a7f968422c13d90e8b6a6094c5f7d7d7c5cbe9c3267edb5d763c1b92a35104652e3c9f9c185c5404c5d620a875210b0bdc41fdf3e354fd859a4138'
@@ -1,6 +1,11 @@
1
+ # v1.24.0
2
+
3
+ * 2019-09-19 [46e6337](../../commit/46e6337) - __(Andrew N. Shalaev)__ Release v1.24.0
4
+ * 2019-09-19 [d2ec039](../../commit/d2ec039) - __(Andrew N. Shalaev)__ fix: send 401 Unathorized instead 403
5
+ https://jira.railsc.ru/browse/BPC-15268
6
+
1
7
  # v1.23.0
2
8
 
3
- * 2018-10-01 [c235b5e](../../commit/c235b5e) - __(Artem Napolskih)__ Release 1.23.0
4
9
  * 2018-10-01 [d0e5a8e](../../commit/d0e5a8e) - __(Artem Napolskih)__ feat: adds ability to configure root page
5
10
 
6
11
  # v1.22.1
@@ -25,7 +25,7 @@ module Apress
25
25
  end
26
26
 
27
27
  def authenticate
28
- forbidden unless @current_api_client
28
+ unauthorized unless @current_api_client
29
29
  end
30
30
  end
31
31
  end
@@ -41,6 +41,10 @@ module Apress
41
41
  render_error(400, exception)
42
42
  end
43
43
 
44
+ def unauthorized(exception = nil)
45
+ render_error(401, exception)
46
+ end
47
+
44
48
  def unprocessable(exception_or_errors)
45
49
  @status = 422
46
50
 
@@ -1,5 +1,5 @@
1
1
  module Apress
2
2
  module Api
3
- VERSION = '1.23.0'.freeze
3
+ VERSION = '1.24.0'.freeze
4
4
  end
5
5
  end
@@ -28,9 +28,9 @@ describe Apress::Api::ApiController::Base, type: :controller do
28
28
  context "when auth failed" do
29
29
  let(:auth_service) { double("auth_service", call: false, client: nil) }
30
30
 
31
- it "returns 403" do
31
+ it "returns 401" do
32
32
  get :index
33
- expect(response.status).to eq 403
33
+ expect(response.status).to eq 401
34
34
  expect(controller.current_api_client).to be nil
35
35
  end
36
36
  end
@@ -24,7 +24,7 @@ def jbuild(source_key, collection)
24
24
  end
25
25
 
26
26
  def view_prefix
27
- if Rails::VERSION::MAJOR > 4
27
+ if Rails::VERSION::MAJOR == 5 && Rails::VERSION::MINOR >= 2
28
28
  'jbuilder/views'
29
29
  else
30
30
  'jbuilder'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apress-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.23.0
4
+ version: 1.24.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - merkushin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-02 00:00:00.000000000 Z
11
+ date: 2019-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails