eivo-rails-api 0.1.7 → 0.1.12

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: 68cf7500268c801629af5a8c10222713fab22d99520b5179ec646a57bf64bddc
4
- data.tar.gz: 8aa67940587d8d536f35f430d064070f14aabd66a67eac9233d29c5e07184d3c
3
+ metadata.gz: 0e1fe806702976c10a68369fa78dd2ce3b4fb693e80f8d37e20d592fc1871956
4
+ data.tar.gz: e652fc339b44cd44ab680cab8e510f90655bb74538bdff657cea66bf4d415f2b
5
5
  SHA512:
6
- metadata.gz: 2446b288dfb42d01ddb5f16d07ce53cafa13aaae22129980b03620e26a4d443f20b453096badf308e129dc99f4023f628a072cde779b3536e0130ff9e3382fb8
7
- data.tar.gz: 8bf0c5947b598f629eb5a1d6089d6d516f9ab2ed4f31b0e9f52a0175fc8c351663f0a7a715979f7b1a7aed08a4659e179cc33db1516483be207bbed3082a59ad
6
+ metadata.gz: cfff26599d151a387f26500c3898993055d704360b17e2b477a172d7de775bb6cea53844057bda5ce4643f1dbabfafce143c6fdffe44527c62e651d3c891d30f
7
+ data.tar.gz: adeed7317b7c66c0c12104aec73d24fbaa4d56e69a0e702a711dc6cc37bb05dffa232457317a9397b1e05b8dd81f494f2964fb87a68e3bfbc643408094773e64
@@ -44,9 +44,6 @@ Naming/PredicateName:
44
44
  Naming/VariableNumber:
45
45
  EnforcedStyle: snake_case
46
46
 
47
- Style/BracesAroundHashParameters:
48
- EnforcedStyle: context_dependent
49
-
50
47
  Style/Documentation:
51
48
  Enabled: false
52
49
 
data/README.md CHANGED
@@ -37,10 +37,6 @@ sentry:
37
37
  dsn: ""
38
38
  ```
39
39
 
40
- ### Warning
41
-
42
- `force_ssl` option is not enabled, for performance reasons SSL / TLS should be managed by the web server (nginx, Apache).
43
-
44
40
  ## License
45
41
 
46
42
  This project is released under the MIT license. See the LICENSE file for more info.
@@ -52,9 +52,11 @@ module EIVO
52
52
  render_errors json_errors.flatten
53
53
  end
54
54
 
55
- def render_error(code, status: :bad_request, source: nil)
55
+ def render_error(code, status: :bad_request, title: nil, detail: nil, source: nil)
56
56
  render_errors([{
57
57
  code: code,
58
+ title: title,
59
+ detail: detail,
58
60
  source: source,
59
61
  status: ::Rack::Utils::SYMBOL_TO_STATUS_CODE[status].to_s
60
62
  }.compact], status: status)
@@ -16,13 +16,11 @@ if Rails.env.staging? || Rails.env.production?
16
16
  config.lograge.ignore_actions = ['EIVO::StatusController#index']
17
17
 
18
18
  config.lograge.custom_options = ->(event) do
19
- result = {
20
- params: event.payload[:params].except('controller', 'action', 'format'),
21
- request_id: event.payload[:request_id]
22
- }
19
+ result = event.payload || {}
23
20
 
24
- result[:user_id] = event.payload[:user_id] if event.payload[:user_id]
25
- result[:organization_id] = event.payload[:organization_id] if event.payload[:organization_id]
21
+ if result[:params]
22
+ result[:params] = result[:params].except('controller', 'action', 'format')
23
+ end
26
24
 
27
25
  # https://github.com/roidrage/lograge/pull/307
28
26
  if event.respond_to?(:allocations)
@@ -4,7 +4,7 @@ $LOAD_PATH.push File.expand_path('lib', __dir__)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'eivo-rails-api'
7
- spec.version = '0.1.7'
7
+ spec.version = '0.1.12'
8
8
  spec.authors = ['Jonathan VUKOVICH-TRIBOUHARET']
9
9
  spec.email = ['jonathan@eivo.co']
10
10
 
@@ -27,8 +27,8 @@ Gem::Specification.new do |spec|
27
27
 
28
28
  spec.add_dependency 'kaminari'
29
29
 
30
- spec.add_dependency 'sentry-raven'
31
30
  spec.add_dependency 'lograge'
31
+ spec.add_dependency 'sentry-raven'
32
32
 
33
33
  spec.add_development_dependency 'bundler'
34
34
  spec.add_development_dependency 'rake'
@@ -39,7 +39,7 @@ module EIVO
39
39
  # Highlight code that triggered database queries in logs.
40
40
  config.active_record.verbose_query_logs = true
41
41
 
42
- # Raises error for missing translations
42
+ # Raises error for missing translations.
43
43
  # config.action_view.raise_on_missing_translations = true
44
44
 
45
45
  # Use an evented file watcher to asynchronously detect changes in source code,
@@ -16,7 +16,7 @@ module EIVO
16
16
  config.eager_load = true
17
17
 
18
18
  # Full error reports are disabled and caching is turned on.
19
- config.consider_all_requests_local = false
19
+ config.consider_all_requests_local = false
20
20
 
21
21
  # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"]
22
22
  # or in config/master.key. This key is used to decrypt credentials (and other encrypted files).
@@ -31,10 +31,11 @@ module EIVO
31
31
 
32
32
  # Specifies the header that your server uses for sending files.
33
33
  # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
34
- config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
34
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
35
35
 
36
36
  # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
37
- # config.force_ssl = true
37
+ config.force_ssl = true
38
+ config.ssl_options = { redirect: { exclude: ->(request) { request.path == '/status' } } }
38
39
 
39
40
  # Use the lowest log level to ensure availability of diagnostic information
40
41
  # when problems arise.
@@ -46,7 +47,7 @@ module EIVO
46
47
  # Use a different cache store in production.
47
48
  # config.cache_store = :mem_cache_store
48
49
 
49
- # Use a real queuing backend for Active Job (and separate queues per environment)
50
+ # Use a real queuing backend for Active Job (and separate queues per environment).
50
51
  # config.active_job.queue_adapter = :resque
51
52
  # config.active_job.queue_name_prefix = "example_#{Rails.env}"
52
53
 
@@ -73,7 +74,7 @@ module EIVO
73
74
  logger = ActiveSupport::Logger.new(STDOUT)
74
75
  logger.formatter = config.log_formatter
75
76
  config.log_level = :info
76
- config.logger = logger
77
+ config.logger = logger
77
78
  end
78
79
 
79
80
  # Do not dump schema after migrations.
@@ -3,6 +3,10 @@
3
3
  module EIVO
4
4
  class Environment
5
5
  def self.test
6
+ # The test environment is used exclusively to run your application's
7
+ # test suite. You never need to work with it otherwise. Remember that
8
+ # your test database is "scratch space" for the test suite and is wiped
9
+ # and recreated between test runs. Don't rely on the data there!
6
10
  Rails.application.configure do
7
11
  # Settings specified here will take precedence over those in config/application.rb.
8
12
 
@@ -33,7 +37,7 @@ module EIVO
33
37
  # Print deprecation notices to the stderr.
34
38
  config.active_support.deprecation = :stderr
35
39
 
36
- # Raises error for missing translations
40
+ # Raises error for missing translations.
37
41
  # config.action_view.raise_on_missing_translations = true
38
42
  end
39
43
  end
@@ -3,9 +3,9 @@
3
3
  source 'https://rubygems.org'
4
4
  git_source(:github) { |repo| "https://github.com/#{repo}.git" }
5
5
 
6
- ruby '2.6.3'
6
+ ruby '2.7.1'
7
7
 
8
- gem 'rails', '~> 6.0.2', '>= 6.0.2.1'
8
+ gem 'rails', '~> 6.0.3', '>= 6.0.3.1'
9
9
  gem 'pg', '>= 0.18', '< 2.0'
10
10
  gem 'puma', '~> 4.1'
11
11
 
@@ -14,7 +14,7 @@ group :development, :test do
14
14
  end
15
15
 
16
16
  group :development do
17
- gem 'listen', '>= 3.0.5', '< 3.2'
17
+ gem 'listen', '~> 3.2'
18
18
  end
19
19
 
20
20
  gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- workers ENV.fetch('WEB_CONCURRENCY') { 0 }
4
- threads_count = ENV.fetch('RAILS_MAX_THREADS') { 5 }
3
+ workers ENV.fetch('WEB_CONCURRENCY') { 0 }.to_i
4
+ threads_count = ENV.fetch('RAILS_MAX_THREADS') { 5 }.to_i
5
5
  threads threads_count, threads_count
6
6
 
7
7
  environment ENV.fetch('RAILS_ENV') { 'development' }
@@ -9,7 +9,7 @@ environment ENV.fetch('RAILS_ENV') { 'development' }
9
9
  if %w[production staging].include?(ENV['RAILS_ENV'])
10
10
  pidfile 'tmp/pids/puma.pid'
11
11
  state_path 'tmp/pids/puma.state'
12
- daemonize ENV.fetch('RAILS_DAEMONIZE') { false }
12
+ daemonize ActiveModel::Type::Boolean.new.cast(ENV.fetch('RAILS_DAEMONIZE') { false })
13
13
 
14
14
  if ENV['PORT']
15
15
  bind "tcp://0.0.0.0:#{ENV['PORT']}"
@@ -17,7 +17,7 @@ if %w[production staging].include?(ENV['RAILS_ENV'])
17
17
  bind 'unix://tmp/sockets/puma.sock'
18
18
  end
19
19
  else
20
- port ENV.fetch('PORT') { 3000 }
20
+ port ENV.fetch('PORT') { 3000 }.to_i
21
21
  end
22
22
 
23
23
  before_fork do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eivo-rails-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan VUKOVICH-TRIBOUHARET
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-01 00:00:00.000000000 Z
11
+ date: 2020-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -81,7 +81,7 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: sentry-raven
84
+ name: lograge
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - ">="
@@ -95,7 +95,7 @@ dependencies:
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
- name: lograge
98
+ name: sentry-raven
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - ">="