salestation 5.3.2 → 5.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +3 -5
- data/CONTRIBUTING.md +9 -0
- data/lib/salestation/app/errors.rb +5 -0
- data/lib/salestation/app.rb +1 -6
- data/lib/salestation/web/error_mapper.rb +3 -0
- data/lib/salestation/web/request_logger.rb +16 -12
- data/lib/salestation/web/responses.rb +1 -0
- data/lib/salestation/web.rb +1 -6
- data/salestation.gemspec +2 -2
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd50a9f9fe461dc0d4fe8e4fea4153d1d361eb0f19a4e727ad74f33719fb043b
|
4
|
+
data.tar.gz: 630f442282e5b19ecae156ab11f672ac3e8159ef7256ea6d2de8b1413ff8e7c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c58774b66069bd350a63381752d18dc4dd6e6f374a741730010ed756678f5c6c19df5bb88fcbb4a87a31d2c5ebc319341c603c6dd646416835278723d760a1f5
|
7
|
+
data.tar.gz: 6303f98fdb4269192c70c9123eae98d82821751da0b695425dd24c896af1dcca9f26600d95f9ed58a41a744408aa923acfec09eaaa66214cba634c2be77ab0a6
|
data/.github/workflows/ruby.yml
CHANGED
@@ -15,15 +15,13 @@ jobs:
|
|
15
15
|
runs-on: ubuntu-latest
|
16
16
|
strategy:
|
17
17
|
matrix:
|
18
|
-
ruby-version: ['2.7', '3.0']
|
18
|
+
ruby-version: ['2.7', '3.0', '3.1', '3.2']
|
19
19
|
|
20
20
|
steps:
|
21
21
|
- uses: actions/checkout@v2
|
22
22
|
- name: Set up Ruby
|
23
|
-
|
24
|
-
|
25
|
-
# uses: ruby/setup-ruby@v1
|
26
|
-
uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
|
23
|
+
# Automatically get bug fixes and new Ruby versions for ruby/setup-ruby
|
24
|
+
uses: ruby/setup-ruby@v1
|
27
25
|
with:
|
28
26
|
ruby-version: ${{ matrix.ruby-version }}
|
29
27
|
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
# Contributing to salestation
|
2
|
+
|
3
|
+
We currently do not accept any contributions from external sources.
|
4
|
+
|
5
|
+
The code is still open source and if you wish to add any changes, feel free to fork it and add changes to your fork.
|
6
|
+
|
7
|
+
Issues for any security-related bugs found are still welcome, but we offer no guarantees on whether or when they will be acted upon.
|
8
|
+
|
9
|
+
For any exceptional cases, please contact us at open-source@glia.com.
|
@@ -52,6 +52,11 @@ module Salestation
|
|
52
52
|
attribute? :message, Types::Strict::String
|
53
53
|
attribute? :debug_message, Types::Strict::String
|
54
54
|
end
|
55
|
+
|
56
|
+
class BadRequest < Error
|
57
|
+
attribute? :message, Types::Strict::String
|
58
|
+
attribute? :debug_message, Types::Strict::String
|
59
|
+
end
|
55
60
|
end
|
56
61
|
end
|
57
62
|
end
|
data/lib/salestation/app.rb
CHANGED
@@ -7,12 +7,7 @@ require 'dry-types'
|
|
7
7
|
module Salestation
|
8
8
|
class App
|
9
9
|
module Types
|
10
|
-
|
11
|
-
if dry_types_version < Gem::Version.new('0.15.0')
|
12
|
-
include Dry::Types.module
|
13
|
-
else
|
14
|
-
include Dry::Types()
|
15
|
-
end
|
10
|
+
include Dry::Types()
|
16
11
|
end
|
17
12
|
|
18
13
|
def initialize(env:, hooks: {})
|
@@ -31,6 +31,9 @@ module Salestation
|
|
31
31
|
App::Errors::UnsupportedMediaType => -> (error) {
|
32
32
|
Responses::UnsupportedMediaType.new(message: error.message, debug_message: error.debug_message, base_error: error.base_error)
|
33
33
|
},
|
34
|
+
App::Errors::BadRequest => -> (error) {
|
35
|
+
Responses::BadRequest.new(message: error.message, debug_message: error.debug_message, base_error: error.base_error)
|
36
|
+
},
|
34
37
|
App::Errors::RequestEntityTooLarge => -> (error) {
|
35
38
|
Responses::RequestEntityTooLarge.new(message: error.message, debug_message: error.debug_message, base_error: error.base_error)
|
36
39
|
}
|
@@ -13,6 +13,8 @@ module Salestation
|
|
13
13
|
HTTP_ACCEPT = 'HTTP_ACCEPT'
|
14
14
|
HTTP_ORIGIN = 'HTTP_ORIGIN'
|
15
15
|
SERVER_NAME = 'SERVER_NAME'
|
16
|
+
GLIA_ACCOUNT_ID = 'HTTP_GLIA_ACCOUNT_ID'
|
17
|
+
GLIA_USER_ID = 'HTTP_GLIA_USER_ID'
|
16
18
|
|
17
19
|
def initialize(app, logger, log_response_body: false, level: :info)
|
18
20
|
@app = app
|
@@ -47,18 +49,20 @@ module Salestation
|
|
47
49
|
|
48
50
|
def response_log(env, status, headers, body, began_at)
|
49
51
|
log = {
|
50
|
-
remote_addr:
|
51
|
-
method:
|
52
|
-
path:
|
53
|
-
query:
|
54
|
-
content_type:
|
55
|
-
http_agent:
|
56
|
-
http_accept:
|
57
|
-
http_origin:
|
58
|
-
server_name:
|
59
|
-
status:
|
60
|
-
duration:
|
61
|
-
|
52
|
+
remote_addr: env[REMOTE_ADDR],
|
53
|
+
method: env[REQUEST_METHOD],
|
54
|
+
path: env[REQUEST_URI],
|
55
|
+
query: env[QUERY_STRING],
|
56
|
+
content_type: env[CONTENT_TYPE],
|
57
|
+
http_agent: env[HTTP_USER_AGENT],
|
58
|
+
http_accept: env[HTTP_ACCEPT],
|
59
|
+
http_origin: env[HTTP_ORIGIN],
|
60
|
+
server_name: env[SERVER_NAME],
|
61
|
+
status: status,
|
62
|
+
duration: duration(from: began_at),
|
63
|
+
glia_account_id: env[GLIA_ACCOUNT_ID],
|
64
|
+
glia_user_id: env[GLIA_USER_ID],
|
65
|
+
headers: headers
|
62
66
|
}
|
63
67
|
|
64
68
|
if status >= 400
|
data/lib/salestation/web.rb
CHANGED
@@ -8,12 +8,7 @@ require 'json'
|
|
8
8
|
module Salestation
|
9
9
|
class Web < Module
|
10
10
|
module Types
|
11
|
-
|
12
|
-
if dry_types_version < Gem::Version.new('0.15.0')
|
13
|
-
include Dry::Types.module
|
14
|
-
else
|
15
|
-
include Dry::Types()
|
16
|
-
end
|
11
|
+
include Dry::Types()
|
17
12
|
end
|
18
13
|
|
19
14
|
def initialize(errors: {})
|
data/salestation.gemspec
CHANGED
@@ -4,9 +4,9 @@ $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.
|
7
|
+
spec.version = "5.4.0"
|
8
8
|
spec.authors = ["Glia TechMovers"]
|
9
|
-
spec.email = ["
|
9
|
+
spec.email = ["open-source@glia.com"]
|
10
10
|
|
11
11
|
spec.summary = %q{}
|
12
12
|
spec.description = %q{}
|
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.
|
4
|
+
version: 5.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Glia TechMovers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-05-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -180,7 +180,7 @@ dependencies:
|
|
180
180
|
version: '0'
|
181
181
|
description: ''
|
182
182
|
email:
|
183
|
-
-
|
183
|
+
- open-source@glia.com
|
184
184
|
executables: []
|
185
185
|
extensions: []
|
186
186
|
extra_rdoc_files: []
|
@@ -190,6 +190,7 @@ files:
|
|
190
190
|
- ".gitignore"
|
191
191
|
- ".rspec"
|
192
192
|
- ".yardopts"
|
193
|
+
- CONTRIBUTING.md
|
193
194
|
- Gemfile
|
194
195
|
- LICENSE.txt
|
195
196
|
- README.md
|
@@ -234,7 +235,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
234
235
|
- !ruby/object:Gem::Version
|
235
236
|
version: '0'
|
236
237
|
requirements: []
|
237
|
-
rubygems_version: 3.
|
238
|
+
rubygems_version: 3.5.9
|
238
239
|
signing_key:
|
239
240
|
specification_version: 4
|
240
241
|
summary: ''
|