salestation 5.2.0 → 5.3.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: 2e5fcc23d8c9f54b0aaa72e76f5f38d791c92330a462427bf5a16e8abe18a14b
4
- data.tar.gz: fe02f21991d869abd3c6eb71c2bbc7163c36a61f0e7850384fe9b4030a01f868
3
+ metadata.gz: a6df52858cd7f5226e95ecf1336818ed60f021222f749e6f3a4969e6c05c309b
4
+ data.tar.gz: 2221e592b6070e403ef763f94834ae142ec03ac7277674c9dc16668a54bbbecb
5
5
  SHA512:
6
- metadata.gz: c877ea4130f851227bb93461deef52e72b27c92c504cd8bc837d866d43be045ae632036772a571c8dbc01239afa455d8440bdcd90bcbad52732fcc2cd732b3dd
7
- data.tar.gz: a74f378182c0306e5b88b13adf8c25a48ba6bb4efc13ae1e5392b97c3392ede261bb0445cef7e36110fc11e78adda79fe000896769e9c300a19329a48a469b5b
6
+ metadata.gz: c10039d2261c8bfdec7a434de314d2152b59f8b50a55b4d12d0f47e59b14417f40181332be990924673dbb13131e4453267f352f0a63daa94e3ab0ccc3a08f16
7
+ data.tar.gz: e9691491f6c13690129f5297b411d49034eb8fd628869e7b6b71c0f07551e477c5ca288beea2d0c679ca2ae98b334ebb441d12412946e7f2f6e41e2161eb2371
@@ -15,7 +15,7 @@ jobs:
15
15
  runs-on: ubuntu-latest
16
16
  strategy:
17
17
  matrix:
18
- ruby-version: ['2.6', '2.7']
18
+ ruby-version: ['2.6', '2.7', '3.0']
19
19
 
20
20
  steps:
21
21
  - uses: actions/checkout@v2
@@ -7,7 +7,7 @@ module Salestation
7
7
 
8
8
  ERROR_TO_RESPONSE_DEFAULTS = {
9
9
  App::Errors::InvalidInput => -> (error) {
10
- Responses::UnprocessableEntityFromSchemaErrors.create(error)
10
+ Responses::UnprocessableEntityFromSchemaErrors.create(**error)
11
11
  },
12
12
  App::Errors::DependencyCurrentlyUnavailable => -> (error) {
13
13
  Responses::ServiceUnavailable.new(
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Salestation
4
+ class Web < Module
5
+ module IPAddress
6
+ def self.extract(request)
7
+ if request['HTTP_X_FORWARDED_FOR'].nil?
8
+ request['REMOTE_ADDR']
9
+ else
10
+ request['HTTP_X_FORWARDED_FOR'].split(',').first
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -44,6 +44,7 @@ module Salestation
44
44
  end
45
45
 
46
46
  require_relative './web/extractors'
47
+ require_relative './web/ip_address'
47
48
  require_relative './web/responses'
48
49
  require_relative './web/error_mapper'
49
50
  require_relative './result_helper'
data/salestation.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "salestation"
7
- spec.version = "5.2.0"
7
+ spec.version = "5.3.1"
8
8
  spec.authors = ["Glia TechMovers"]
9
9
  spec.email = ["techmovers@glia.com"]
10
10
 
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
24
24
  spec.add_development_dependency "rspec", "~> 3.0"
25
25
  spec.add_development_dependency "pry", "~> 0.10.4"
26
26
  spec.add_development_dependency "glia-errors", "~> 0.11.4"
27
- spec.add_development_dependency "dry-validation", "~> 1.7.0"
27
+ spec.add_development_dependency "dry-validation", "~> 1.7"
28
28
 
29
29
  spec.add_dependency 'deterministic'
30
30
  spec.add_dependency 'dry-struct'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: salestation
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.2.0
4
+ version: 5.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Glia TechMovers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-30 00:00:00.000000000 Z
11
+ date: 2023-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 1.7.0
89
+ version: '1.7'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 1.7.0
96
+ version: '1.7'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: deterministic
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -195,6 +195,7 @@ files:
195
195
  - lib/salestation/web/input_validator.rb
196
196
  - lib/salestation/web/input_validators/accept_header.rb
197
197
  - lib/salestation/web/input_validators/content_type_header.rb
198
+ - lib/salestation/web/ip_address.rb
198
199
  - lib/salestation/web/request_logger.rb
199
200
  - lib/salestation/web/responses.rb
200
201
  - lib/salestation/web/statsd_middleware.rb