rottweiler 0.1.0 → 0.2.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
  SHA256:
3
- metadata.gz: 85bed1ab72dd8951ec40afe16afa8563f9cecd62e8eb858b6a5257546f4e0119
4
- data.tar.gz: 5a7db89fb990b531ce4bb3da83ade63e314bbdb208740efa2d6dd86cff0643a3
3
+ metadata.gz: 3c168adefd023647e716ea26926b56a2638d891ff0aa1dd8688addd88a20a4ca
4
+ data.tar.gz: 2b2b56b75d112dc7eade9a30f70af065e1ca1cb97f7d91459c73b11f12cb20ca
5
5
  SHA512:
6
- metadata.gz: d310bc733fd05dbc6f03440f3be7cab4a50e7f70d79d7f17477da217893ed6a773e46f22f28a26d7c53d20afe26723f3fa79e4fd8fc722b5ad72addf983d3207
7
- data.tar.gz: 5599b8cf15ace519f006b74294ca324ccc2a65306a4f1221d1c7aeb0ca8f93c52ba34297c4e653e0d8ba957c60da0c3690e4a3471b0ee6f1501ab124c7e63eca
6
+ metadata.gz: 2735ce8274ce05879a251631052737cc601f7a528baf74d0716d27bcf5ee69fbcf89a47d53aad94d5aadee4352bf5e4732412873c569dcac61a13a88bdd3b773
7
+ data.tar.gz: 7ddfacb3026d5f91c98349f76bfb0fac012db5f759f0910cc76d35d3b671bbaf753bd5dd2e2146186754715b11ef33db44aa793af29bf46749ff56df44695607
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.2.0] - 2023-02-22
4
+
5
+ - [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.
6
+ - [NEW] Better default response body on authentication failure.
7
+
3
8
  ## [0.1.0] - 2023-02-22
4
9
 
5
10
  - 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.0)
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
@@ -65,12 +65,8 @@ module Rottweiler
65
65
  elsif rottweiler.auth_failed_cbk
66
66
  send(rottweiler.auth_failed_cbk, errors)
67
67
  else
68
- render json: { errors: errors }
68
+ render json: { status: response.status, path: request.path, errors: errors }
69
69
  end
70
70
  end
71
-
72
- def force_rottweiler_auth_failure_status!
73
- response.status = Rottweiler.config.unauthorized_status
74
- 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.0'
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.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Demetra Opinioni.net S.r.l.