darjeelink 0.14.4 → 0.14.5

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: e0f395d01b733415c7836867132dd888ac5f5dcd567a338e8d1d845d5e12a952
4
- data.tar.gz: fdf3c1b4f775a88169adacd74ae43529a00c1ae16f05df0e7f904226ae95d6e4
3
+ metadata.gz: 11b58c6d79e63e250e80fccc4dc0ab8aa6e1daf8848e51e14afd9a3637a6dea2
4
+ data.tar.gz: 2ab545a7e59ac4a248f773ead73aeb4e35b3937afd3ffb37b912a1c537c6c8ea
5
5
  SHA512:
6
- metadata.gz: 67c05cf3fab55ab937a75a511d55f231aef131b21fbb9baabcae3ba0819014346532e91d321b1674231e9bdce32f4bef7d52bf2e1eecc92635e62b6902fed322
7
- data.tar.gz: 914f84301d2cdd53df3501180082dc556b7bae47a415c4775fd750a07343a2f7fd466be5d49c37761bf76d653df4e003ac0e0f4c52fd6ca4c7d9d9b35cbf80a1
6
+ metadata.gz: 92311cceed07587d5e2ba80c25849e1e7a39d4f7e37351482bd6eaa2d65b47bf712ff25600acae1b6508cab6ed65dc792cf9506b94093d8275005027e620bd75
7
+ data.tar.gz: ed319fe3f5aaded52f783defcaedeb9efa2e199cf1a6e060cc23ad68318c872de5b95d49af7146ec4b2c0b2c9758e0afb493edf156c92dea947d8b61ccfcbdf1
data/README.md CHANGED
@@ -131,6 +131,10 @@ Note that if you are running in a vagrant VM, most of these steps can be done fr
131
131
  - Run `gem build darjeelink.gemspec` this will output a file `darjeelink-X.X.X.gem` the version should match what version.rb and github.
132
132
  - Run `gem push darjeelink-X.X.X.gem`
133
133
 
134
+ ## TODOs
135
+
136
+ We have a few TODOs in the project. Please grep for TODO in the codebase to see them, and consider picking one up during maintainance.
137
+
134
138
  ## GDPR
135
139
  No personally identifiable data is stored about the public by this gem.
136
140
  It does not store information on individual clicks, only a counter of how many times a link has been clicked.
@@ -53,7 +53,7 @@ module Darjeelink
53
53
  def valid_authorization_token?(username_token)
54
54
  username, token = username_token.split ':'
55
55
 
56
- stored_token = ApiToken.find_by(username: username, active: true)&.token
56
+ stored_token = ApiToken.find_by(username:, active: true)&.token
57
57
  return false if stored_token.nil?
58
58
 
59
59
  ActiveSupport::SecurityUtils.secure_compare(
@@ -9,15 +9,20 @@ module Darjeelink
9
9
 
10
10
  private
11
11
 
12
+ def determine_ip_to_verify
13
+ if Rails.application.client_ip_header
14
+ request.headers[Rails.application.client_ip_header]
15
+ else
16
+ request.ip
17
+ end
18
+ end
19
+
12
20
  # Check user IP address against whitelist from ENV
13
21
  def check_ip_whitelist
14
22
  return unless Rails.env.production?
15
23
  return unless Rails.application.config.permitted_ips
16
- ip_to_verify = if Rails.application.config.respond_to?(:client_ip_header) && Rails.application.config.client_ip_header.present?
17
- request.headers[Rails.application.config.client_ip_header]
18
- else
19
- request.ip
20
- end
24
+
25
+ ip_to_verify = determine_ip_to_verify
21
26
 
22
27
  return if Rails.application.config.permitted_ips.split(',').include? ip_to_verify
23
28
 
@@ -24,7 +24,7 @@ module Darjeelink
24
24
 
25
25
  def create_short_link(url, auto_generated_key, custom_key)
26
26
  shortened_path = custom_key.present? ? custom_key : auto_generated_key
27
- ::Darjeelink::ShortLink.create!(url: url, shortened_path: shortened_path)
27
+ ::Darjeelink::ShortLink.create!(url:, shortened_path:)
28
28
  rescue ActiveRecord::RecordNotUnique
29
29
  duplicates << "#{url}/#{custom_key || auto_generated_key}"
30
30
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Darjeelink
4
- VERSION = '0.14.4'
4
+ VERSION = '0.14.5'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: darjeelink
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.4
4
+ version: 0.14.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Hulme
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-28 00:00:00.000000000 Z
11
+ date: 2024-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth
@@ -17,6 +17,9 @@ dependencies:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.9'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '3.0'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -24,6 +27,9 @@ dependencies:
24
27
  - - "~>"
25
28
  - !ruby/object:Gem::Version
26
29
  version: '1.9'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '3.0'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: omniauth-google-oauth2
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -58,14 +64,14 @@ dependencies:
58
64
  requirements:
59
65
  - - "~>"
60
66
  - !ruby/object:Gem::Version
61
- version: '6'
67
+ version: 6.1.7
62
68
  type: :runtime
63
69
  prerelease: false
64
70
  version_requirements: !ruby/object:Gem::Requirement
65
71
  requirements:
66
72
  - - "~>"
67
73
  - !ruby/object:Gem::Version
68
- version: '6'
74
+ version: 6.1.7
69
75
  - !ruby/object:Gem::Dependency
70
76
  name: rebrandly
71
77
  requirement: !ruby/object:Gem::Requirement
@@ -192,7 +198,7 @@ dependencies:
192
198
  - - ">="
193
199
  - !ruby/object:Gem::Version
194
200
  version: '0'
195
- description:
201
+ description:
196
202
  email:
197
203
  - james@38degrees.org.uk
198
204
  executables: []
@@ -244,8 +250,9 @@ files:
244
250
  homepage: https://github.com/38degrees/darjeelink
245
251
  licenses:
246
252
  - MIT
247
- metadata: {}
248
- post_install_message:
253
+ metadata:
254
+ rubygems_mfa_required: 'true'
255
+ post_install_message:
249
256
  rdoc_options: []
250
257
  require_paths:
251
258
  - lib
@@ -260,8 +267,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
260
267
  - !ruby/object:Gem::Version
261
268
  version: '0'
262
269
  requirements: []
263
- rubygems_version: 3.3.21
264
- signing_key:
270
+ rubygems_version: 3.3.26
271
+ signing_key:
265
272
  specification_version: 4
266
273
  summary: URL Shortener
267
274
  test_files: []