rottweiler 0.1.0 → 0.2.1

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: 85bed1ab72dd8951ec40afe16afa8563f9cecd62e8eb858b6a5257546f4e0119
4
- data.tar.gz: 5a7db89fb990b531ce4bb3da83ade63e314bbdb208740efa2d6dd86cff0643a3
3
+ metadata.gz: 99a396d0910e32f92ddfc8bd99666f14aa48e3d0b353b557825e698a0159cb26
4
+ data.tar.gz: 76a396c1a3a93d87bc2a6c590b5e5190174fca143f5d469520c775a35c007319
5
5
  SHA512:
6
- metadata.gz: d310bc733fd05dbc6f03440f3be7cab4a50e7f70d79d7f17477da217893ed6a773e46f22f28a26d7c53d20afe26723f3fa79e4fd8fc722b5ad72addf983d3207
7
- data.tar.gz: 5599b8cf15ace519f006b74294ca324ccc2a65306a4f1221d1c7aeb0ca8f93c52ba34297c4e653e0d8ba957c60da0c3690e4a3471b0ee6f1501ab124c7e63eca
6
+ metadata.gz: af765e0dae58623a680030b40b444a1224d2f344da6889eb333fa98370235e719d10139f3dbab5c9c3cb7d7941e1cc75bbf421d7911639189f1f4d9a66adaf9f
7
+ data.tar.gz: 998b6286ea7f1aa54860289e9300a22b3dc831bbef083053f37b74b3e61c96ec971a823e7422481b2a2d287b465f453a65ed8d30f0187efaf130fec8a333a38a
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.2.1] - 2023-02-22
4
+
5
+ - [FIX] Correctly set the response body on authentication failure when `on_authentication_failed` is set but `render` is not called from inside the block.
6
+
7
+ ## [0.2.0] - 2023-02-22
8
+
9
+ - [NEW] Changed the way response status is set on authentication failure, which now gives more controll over response status when using `on_authentication_failed` helper.
10
+ - [NEW] Better default response body on authentication failure.
11
+
3
12
  ## [0.1.0] - 2023-02-22
4
13
 
5
14
  - Initial release
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rottweiler (0.1.0)
4
+ rottweiler (0.2.1)
5
5
  jwt (>= 2.0)
6
6
  rails (>= 5.0)
7
7
 
@@ -86,7 +86,7 @@ GEM
86
86
  i18n (1.12.0)
87
87
  concurrent-ruby (~> 1.0)
88
88
  json (2.6.3)
89
- jwt (2.6.0)
89
+ jwt (2.7.0)
90
90
  loofah (2.19.1)
91
91
  crass (~> 1.0.2)
92
92
  nokogiri (>= 1.5.9)
data/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  [![Maintainability](https://api.codeclimate.com/v1/badges/abc07c78d5a9ece0340a/maintainability)](https://codeclimate.com/github/demetra-it/rottweiler/maintainability)
4
4
  [![Test Coverage](https://api.codeclimate.com/v1/badges/abc07c78d5a9ece0340a/test_coverage)](https://codeclimate.com/github/demetra-it/rottweiler/test_coverage)
5
+ [![CI Test](https://github.com/demetra-it/rottweiler/actions/workflows/ci-test.yml/badge.svg)](https://github.com/demetra-it/rottweiler/actions/workflows/ci-test.yml)
6
+ [![Gem Version](https://badge.fury.io/rb/rottweiler.svg)](https://badge.fury.io/rb/rottweiler)
5
7
 
6
8
  Rottweiler is a Ruby gem that provides functionality for verifying JSON Web Tokens (JWTs).
7
9
  It allows you to easily verify the authenticity and integrity of JWTs, making it an essential tool for applications
@@ -150,7 +152,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
150
152
 
151
153
  ## Contributing
152
154
 
153
- Bug reports and pull requests are welcome on GitHub at https://github.com/demetra-it/rottweiler. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/rottweiler/blob/master/CODE_OF_CONDUCT.md).
155
+ Bug reports and pull requests are welcome on GitHub at [https://github.com/demetra-it/rottweiler](https://github.com/demetra-it/rottweiler). This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/demetra-it/rottweiler/blob/master/CODE_OF_CONDUCT.md).
154
156
 
155
157
  ## License
156
158
 
@@ -158,4 +160,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
158
160
 
159
161
  ## Code of Conduct
160
162
 
161
- Everyone interacting in the Rottweiler project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/rottweiler/blob/master/CODE_OF_CONDUCT.md).
163
+ Everyone interacting in the Rottweiler project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/demetra-it/rottweiler/blob/master/CODE_OF_CONDUCT.md).
@@ -16,8 +16,8 @@ module Rottweiler
16
16
  if authentication.valid?
17
17
  rottweiler_on_authentication_success!(authentication.data)
18
18
  else
19
+ response.status = Rottweiler.config.unauthorized_status
19
20
  rottweiler_on_authentication_failed!(authentication.errors)
20
- force_rottweiler_auth_failure_status!
21
21
  end
22
22
  end
23
23
  end
@@ -64,13 +64,9 @@ module Rottweiler
64
64
  instance_exec(errors, &rottweiler.auth_failed_cbk)
65
65
  elsif rottweiler.auth_failed_cbk
66
66
  send(rottweiler.auth_failed_cbk, errors)
67
- else
68
- render json: { errors: errors }
69
67
  end
70
- end
71
68
 
72
- def force_rottweiler_auth_failure_status!
73
- response.status = Rottweiler.config.unauthorized_status
69
+ render json: { status: response.status, path: request.path, errors: errors } unless performed?
74
70
  end
75
71
  end
76
72
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rottweiler
4
- VERSION = '0.1.0'
4
+ VERSION = '0.2.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rottweiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Demetra Opinioni.net S.r.l.