omniauth-rails 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (140) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +71 -0
  4. data/Rakefile +41 -0
  5. data/app/assets/config/omniauth_rails_manifest.js +1 -0
  6. data/app/assets/stylesheets/omniauth/rails/application.css +19 -0
  7. data/app/controllers/omniauth/rails/application_controller.rb +8 -0
  8. data/app/controllers/omniauth/rails/flash.rb +46 -0
  9. data/app/controllers/omniauth/rails/require_authentication.rb +26 -0
  10. data/app/controllers/omniauth/rails/require_authorization.rb +32 -0
  11. data/app/controllers/omniauth/rails/sessions_controller.rb +55 -0
  12. data/app/helpers/omniauth/rails/application_helper.rb +16 -0
  13. data/app/models/omniauth/rails/authentication_data_store.rb +31 -0
  14. data/app/models/omniauth/rails/authentication_request.rb +28 -0
  15. data/app/models/omniauth/rails/authentication_session.rb +53 -0
  16. data/app/models/omniauth/rails/authorization_checker.rb +28 -0
  17. data/app/models/omniauth/rails/authorization_types/base.rb +17 -0
  18. data/app/models/omniauth/rails/authorization_types/domains.rb +22 -0
  19. data/app/models/omniauth/rails/authorization_types/emails.rb +18 -0
  20. data/app/models/omniauth/rails/authorization_types/regex.rb +18 -0
  21. data/app/models/omniauth/rails/omni_auth_route_builder.rb +18 -0
  22. data/app/views/omniauth/rails/sessions/destroy.html.erb +6 -0
  23. data/config/initializers/omniauth_rails.rb +35 -0
  24. data/config/routes.rb +6 -0
  25. data/lib/omniauth/rails/configuration.rb +15 -0
  26. data/lib/omniauth/rails/engine.rb +22 -0
  27. data/lib/omniauth/rails/test/controller_helpers.rb +17 -0
  28. data/lib/omniauth/rails/test/request_helpers.rb +25 -0
  29. data/lib/omniauth/rails/version.rb +6 -0
  30. data/lib/omniauth/rails.rb +9 -0
  31. data/spec/controllers/application_controller_spec.rb +9 -0
  32. data/spec/examples.txt +19 -0
  33. data/spec/models/omniauth/rails/authorization_types/emails_spec.rb +28 -0
  34. data/spec/models/omniauth/rails/authorization_types/regex_spec.rb +28 -0
  35. data/spec/omniauth_rails_spec.rb +10 -0
  36. data/spec/rails_helper_for_engine.rb +62 -0
  37. data/spec/spec_helper.rb +93 -0
  38. data/spec/test_app/Rakefile +12 -0
  39. data/spec/test_app/app/assets/config/manifest.js +4 -0
  40. data/spec/test_app/app/assets/javascripts/application.js +13 -0
  41. data/spec/test_app/app/assets/stylesheets/application.css +15 -0
  42. data/spec/test_app/app/controllers/application_controller.rb +4 -0
  43. data/spec/test_app/app/controllers/private_controller.rb +9 -0
  44. data/spec/test_app/app/controllers/public_controller.rb +6 -0
  45. data/spec/test_app/app/helpers/application_helper.rb +3 -0
  46. data/spec/test_app/app/mailers/application_mailer.rb +5 -0
  47. data/spec/test_app/app/models/application_record.rb +4 -0
  48. data/spec/test_app/app/views/layouts/application.html.erb +24 -0
  49. data/spec/test_app/app/views/private/show.html.erb +1 -0
  50. data/spec/test_app/app/views/public/show.html.erb +1 -0
  51. data/spec/test_app/bin/bundle +4 -0
  52. data/spec/test_app/bin/rails +5 -0
  53. data/spec/test_app/bin/rake +5 -0
  54. data/spec/test_app/bin/setup +35 -0
  55. data/spec/test_app/bin/update +30 -0
  56. data/spec/test_app/config/application.rb +23 -0
  57. data/spec/test_app/config/boot.rb +6 -0
  58. data/spec/test_app/config/environment.rb +6 -0
  59. data/spec/test_app/config/environments/development.rb +55 -0
  60. data/spec/test_app/config/environments/production.rb +89 -0
  61. data/spec/test_app/config/environments/test.rb +43 -0
  62. data/spec/test_app/config/initializers/application_controller_renderer.rb +7 -0
  63. data/spec/test_app/config/initializers/assets.rb +12 -0
  64. data/spec/test_app/config/initializers/backtrace_silencers.rb +10 -0
  65. data/spec/test_app/config/initializers/cookies_serializer.rb +6 -0
  66. data/spec/test_app/config/initializers/filter_parameter_logging.rb +5 -0
  67. data/spec/test_app/config/initializers/inflections.rb +17 -0
  68. data/spec/test_app/config/initializers/mime_types.rb +5 -0
  69. data/spec/test_app/config/initializers/session_store.rb +4 -0
  70. data/spec/test_app/config/initializers/wrap_parameters.rb +15 -0
  71. data/spec/test_app/config/locales/en.yml +23 -0
  72. data/spec/test_app/config/omniauth_rails.yml +16 -0
  73. data/spec/test_app/config/puma.rb +48 -0
  74. data/spec/test_app/config/routes.rb +8 -0
  75. data/spec/test_app/config/secrets.yml +22 -0
  76. data/spec/test_app/config/spring.rb +7 -0
  77. data/spec/test_app/config.ru +6 -0
  78. data/spec/test_app/log/development.log +4451 -0
  79. data/spec/test_app/log/test.log +7601 -0
  80. data/spec/test_app/public/404.html +67 -0
  81. data/spec/test_app/public/422.html +67 -0
  82. data/spec/test_app/public/500.html +66 -0
  83. data/spec/test_app/public/apple-touch-icon-precomposed.png +0 -0
  84. data/spec/test_app/public/apple-touch-icon.png +0 -0
  85. data/spec/test_app/public/favicon.ico +0 -0
  86. data/spec/test_app/spec/controllers/private_controller_spec.rb +19 -0
  87. data/spec/test_app/spec/rails_helper.rb +54 -0
  88. data/spec/test_app/spec/requests/private_controller_spec.rb +26 -0
  89. data/spec/test_app/spec/requests/public_controller_spec.rb +13 -0
  90. data/spec/test_app/spec/requests/sessions_controller_spec.rb +87 -0
  91. data/spec/test_app/spec/spec_helper.rb +99 -0
  92. data/spec/test_app/tmp/cache/assets/sprockets/v3.0/-5/-528MPRmC3ByNiAzVD1hs-NG3Muhf9FsYPaDbo4qIpI.cache +1 -0
  93. data/spec/test_app/tmp/cache/assets/sprockets/v3.0/3v/3voyTxS8FmTTGPrz-QQ23N6AgGate2o7X5ZnZeTkQbs.cache +0 -0
  94. data/spec/test_app/tmp/cache/assets/sprockets/v3.0/5V/5VAABbvE5t5bCDKmKjLivvfe1CqYdD4n4vtZQiMa4I0.cache +0 -0
  95. data/spec/test_app/tmp/cache/assets/sprockets/v3.0/64/64siRwVaDPAW5fTe1O4rlGaq-0ExxAWA0-csPcik-uM.cache +0 -0
  96. data/spec/test_app/tmp/cache/assets/sprockets/v3.0/Aa/AasprW2BgqWDcmZnsPRxs-R5D0VGpL7dHYMwtsC1tmE.cache +0 -0
  97. data/spec/test_app/tmp/cache/assets/sprockets/v3.0/An/An3DVlfO1pzT7FAnm09q3Ok_2PmGYhiAvxuW9OgG9wc.cache +0 -0
  98. data/spec/test_app/tmp/cache/assets/sprockets/v3.0/C-/C-_kx_I8fFV2TrLPw8CNFy1uLrN6G4yLPg_4vOhlohQ.cache +0 -0
  99. data/spec/test_app/tmp/cache/assets/sprockets/v3.0/EG/EGN6771mS8m_7wi-Cr-GgFKv9U9IE3gpo9JQ-N3AYlQ.cache +0 -0
  100. data/spec/test_app/tmp/cache/assets/sprockets/v3.0/Hl/HlzBaGDQ4NV3ctlz-qlmStUWDCELhxzVK1-SgLkPCH0.cache +0 -0
  101. data/spec/test_app/tmp/cache/assets/sprockets/v3.0/IB/IBoXb9_P8EU8f7aPVNE8cWJybcus8fS7KGvi4HxKdMU.cache +1 -0
  102. data/spec/test_app/tmp/cache/assets/sprockets/v3.0/K2/K28c2b37N3eRA-Pckb3MO3D3BvGXfbxDGNeRYIXG8Cg.cache +1 -0
  103. data/spec/test_app/tmp/cache/assets/sprockets/v3.0/KJ/KJdFFU6zb4YpQWEm8bsXxx8kdQ01BdK0F0h6TTzpOiY.cache +0 -0
  104. data/spec/test_app/tmp/cache/assets/sprockets/v3.0/KW/KWwCiQwwI6oqiIHZg_Qg2nrs1zXJISos9799GIL5viU.cache +0 -0
  105. data/spec/test_app/tmp/cache/assets/sprockets/v3.0/Kh/KhKDGOFwOEJlSwLMaG8Yak8AktHsnEr-fUwLpl9d0tc.cache +1 -0
  106. data/spec/test_app/tmp/cache/assets/sprockets/v3.0/NX/NXZl3HljnPNJmh2CNpp0skcYvQx4eSEp6vuG5o3lqqY.cache +0 -0
  107. data/spec/test_app/tmp/cache/assets/sprockets/v3.0/NX/nxTv3sKVUQZADJyM3dPaVmUA78MIsMLD_K279yN_GsI.cache +0 -0
  108. data/spec/test_app/tmp/cache/assets/sprockets/v3.0/Ob/ObDGu7gmDzQuH86CeAdhWRPf0sfv9Qo3CoxGK3VOYWI.cache +0 -0
  109. data/spec/test_app/tmp/cache/assets/sprockets/v3.0/QG/QGjnK1OGVhAWzpma8R60Qdcr6v46sAWmpwQpeoWltX8.cache +1 -0
  110. data/spec/test_app/tmp/cache/assets/sprockets/v3.0/Qn/Qn2TRz8mMz8dPVvXgHUfqXC19EPZQgG3XDqm5W_E-A0.cache +1 -0
  111. data/spec/test_app/tmp/cache/assets/sprockets/v3.0/WC/WCTd8gm1KmkPKRB14gd1wwFv3x9NwMsmquXet4Z1DTU.cache +2 -0
  112. data/spec/test_app/tmp/cache/assets/sprockets/v3.0/Z-/Z-3hfqbx8r350iW9zFPz_OdVHX0X4Z4bMk9YbS1eha8.cache +0 -0
  113. data/spec/test_app/tmp/cache/assets/sprockets/v3.0/Z2/Z2DJdVm4jsJXg0HzuQVyAAmjJbVdzKntXlmd14iNVbU.cache +0 -0
  114. data/spec/test_app/tmp/cache/assets/sprockets/v3.0/ZA/ZAzUlqsc-uLa_zcjt1t6EBkPqI8PkEoxz40i4FgrRlQ.cache +1 -0
  115. data/spec/test_app/tmp/cache/assets/sprockets/v3.0/bN/bNCmkb6T3JKDzd6s7ZxOLn_WdC6gUnRARnBDHrMFS7o.cache +1 -0
  116. data/spec/test_app/tmp/cache/assets/sprockets/v3.0/b_/b_Itlk9QZZd7Rvf8kcA4yLP1R5Acu7jB-m1xQiSU0qE.cache +0 -0
  117. data/spec/test_app/tmp/cache/assets/sprockets/v3.0/d6/d6PosAq3dbPqxxvjAcaLgePkRuQ8w__EA-M42WarK_0.cache +1 -0
  118. data/spec/test_app/tmp/cache/assets/sprockets/v3.0/fD/fDbKpwc4jlsYlnxTT3vnhsiBcSJF3imnAGUBp9nq_Bw.cache +1 -0
  119. data/spec/test_app/tmp/cache/assets/sprockets/v3.0/fE/fEHvM7gLiXuJB6lDj2KNzgAx5L3BBn2NSsuodvPAryI.cache +0 -0
  120. data/spec/test_app/tmp/cache/assets/sprockets/v3.0/fg/fgbqfgH_CvzP2H744Q3ywDzlqLRSgSw0AH6ifkC7roo.cache +1 -0
  121. data/spec/test_app/tmp/cache/assets/sprockets/v3.0/g4/g4TbkEUbvKBMpO8z4ioPbq8ArdLl-scuF3pVaLJhmVI.cache +1 -0
  122. data/spec/test_app/tmp/cache/assets/sprockets/v3.0/id/idcyFsf20F5Vd3GC1XtM_PxlNnROM6CxO1j11NG3RWk.cache +1 -0
  123. data/spec/test_app/tmp/cache/assets/sprockets/v3.0/ih/ihflBRw1ToLzP0q8oKAJl_a6EHHbTdJUcVR5DANsIuA.cache +0 -0
  124. data/spec/test_app/tmp/cache/assets/sprockets/v3.0/jz/jzXohzOyfczV5wKfQVQWgE1H0IMN4jaxEM3XlhHNgvk.cache +0 -0
  125. data/spec/test_app/tmp/cache/assets/sprockets/v3.0/lH/lHLoBOtMavo_6UnfOn0DVLI2JQBT1W9sGR3IZzOD6o8.cache +2 -0
  126. data/spec/test_app/tmp/cache/assets/sprockets/v3.0/mD/mDmWU5fLvNY4uggphc1wqYVQDn_w_U6Jz2XRSf59jDc.cache +0 -0
  127. data/spec/test_app/tmp/cache/assets/sprockets/v3.0/mX/mX1nlsL_SWOB4y22W5FheRX0YEONKyOY7xUeIvRiHco.cache +0 -0
  128. data/spec/test_app/tmp/cache/assets/sprockets/v3.0/n5/n5FDaqgvLV4Rc1Xm6TykMEFanDhSJJ77HPuPCEgCDQM.cache +1 -0
  129. data/spec/test_app/tmp/cache/assets/sprockets/v3.0/n9/n9Nzbk_dEL3fNO-u56owqnrG7YQmhcvDgJ2fWWE_9jE.cache +0 -0
  130. data/spec/test_app/tmp/cache/assets/sprockets/v3.0/nU/nUDR2L4CaIx5IszaYaaaACw519TTTzvpxsp7NMl6KyQ.cache +1 -0
  131. data/spec/test_app/tmp/cache/assets/sprockets/v3.0/n_/n_xYqQYhwEMQknb3jFQnjlxxBE9TzMNHCdJ-bEyZFIw.cache +0 -0
  132. data/spec/test_app/tmp/cache/assets/sprockets/v3.0/pc/pcFf9fij5Xa__QoHi-QzN_0Q_UGLhv6gihTXnoFX3sg.cache +1 -0
  133. data/spec/test_app/tmp/cache/assets/sprockets/v3.0/q-/q-721tFv_0DZO9GZ_kHYUD_jn6GNRC09vb51mwyxbuI.cache +1 -0
  134. data/spec/test_app/tmp/cache/assets/sprockets/v3.0/r6/r6saZ-BJCnX2-U353od1DgtZIGy5kXrCuXatXntMcTE.cache +0 -0
  135. data/spec/test_app/tmp/cache/assets/sprockets/v3.0/wY/wYWiPwDGlToFGYId__oKg8QMPEeuRZoP1FhQahshfOo.cache +1 -0
  136. data/spec/test_app/tmp/cache/assets/sprockets/v3.0/yD/yDj60NQvsiwl1QWQXH-iC4pgF1cmHkUFo-kkXBSjsIQ.cache +1 -0
  137. data/spec/test_app/tmp/cache/assets/sprockets/v3.0/ym/ymCwqEVBkEs6bYteLf70KCA5pCKZtqjQ3TbZQzrIs3M.cache +0 -0
  138. data/spec/test_app/tmp/cache/assets/sprockets/v3.0/z0/z041WxjoEQvRhtSLORbkRlsNTgi68Rwx7XUyaDbPn0M.cache +1 -0
  139. data/spec/test_app/tmp/pids/server.pid +1 -0
  140. metadata +453 -0
@@ -0,0 +1,89 @@
1
+ # frozen_string_literal: true
2
+ # Rails.application.configure do
3
+ # # Settings specified here will take precedence over those in config/application.rb.
4
+
5
+ # # Code is not reloaded between requests.
6
+ # config.cache_classes = true
7
+
8
+ # # Eager load code on boot. This eager loads most of Rails and
9
+ # # your application in memory, allowing both threaded web servers
10
+ # # and those relying on copy on write to perform better.
11
+ # # Rake tasks automatically ignore this option for performance.
12
+ # config.eager_load = true
13
+
14
+ # # Full error reports are disabled and caching is turned on.
15
+ # config.consider_all_requests_local = false
16
+ # config.action_controller.perform_caching = true
17
+
18
+ # # Disable serving static files from the `/public` folder by default since
19
+ # # Apache or NGINX already handles this.
20
+ # config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
21
+
22
+ # # Compress JavaScripts and CSS.
23
+ # config.assets.js_compressor = :uglifier
24
+ # # config.assets.css_compressor = :sass
25
+
26
+ # # Do not fallback to assets pipeline if a precompiled asset is missed.
27
+ # config.assets.compile = false
28
+
29
+ # # `config.assets.precompile` and `config.assets.version` have moved to
30
+ # # config/initializers/assets.rb
31
+
32
+ # # Enable serving of images, stylesheets, and JavaScripts from an asset server.
33
+ # # config.action_controller.asset_host = 'http://assets.example.com'
34
+
35
+ # # Specifies the header that your server uses for sending files.
36
+ # # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
37
+ # # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
38
+
39
+ # # Mount Action Cable outside main process or domain
40
+ # # config.action_cable.mount_path = nil
41
+ # # config.action_cable.url = 'wss://example.com/cable'
42
+ # # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]
43
+
44
+ # # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
45
+ # # config.force_ssl = true
46
+
47
+ # # Use the lowest log level to ensure availability of diagnostic information
48
+ # # when problems arise.
49
+ # config.log_level = :debug
50
+
51
+ # # Prepend all log lines with the following tags.
52
+ # config.log_tags = [ :request_id ]
53
+
54
+ # # Use a different cache store in production.
55
+ # # config.cache_store = :mem_cache_store
56
+
57
+ # # Use a real queuing backend for Active Job (and separate queues per environment)
58
+ # # config.active_job.queue_adapter = :resque
59
+ # # config.active_job.queue_name_prefix = "test_app_#{Rails.env}"
60
+ # config.action_mailer.perform_caching = false
61
+
62
+ # # Ignore bad email addresses and do not raise email delivery errors.
63
+ # # Set this to true and configure the email server for immediate delivery to
64
+ # # raise delivery errors.
65
+ # # config.action_mailer.raise_delivery_errors = false
66
+
67
+ # # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
68
+ # # the I18n.default_locale when a translation cannot be found).
69
+ # config.i18n.fallbacks = true
70
+
71
+ # # Send deprecation notices to registered listeners.
72
+ # config.active_support.deprecation = :notify
73
+
74
+ # # Use default logging formatter so that PID and timestamp are not suppressed.
75
+ # config.log_formatter = ::Logger::Formatter.new
76
+
77
+ # # Use a different logger for distributed setups.
78
+ # # require 'syslog/logger'
79
+ # # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
80
+
81
+ # if ENV["RAILS_LOG_TO_STDOUT"].present?
82
+ # logger = ActiveSupport::Logger.new(STDOUT)
83
+ # logger.formatter = config.log_formatter
84
+ # config.logger = ActiveSupport::TaggedLogging.new(logger)
85
+ # end
86
+
87
+ # # Do not dump schema after migrations.
88
+ # config.active_record.dump_schema_after_migration = false
89
+ # end
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+ Rails.application.configure do
3
+ # Settings specified here will take precedence over those in config/application.rb.
4
+
5
+ # The test environment is used exclusively to run your application's
6
+ # test suite. You never need to work with it otherwise. Remember that
7
+ # your test database is "scratch space" for the test suite and is wiped
8
+ # and recreated between test runs. Don't rely on the data there!
9
+ config.cache_classes = true
10
+
11
+ # Do not eager load code on boot. This avoids loading your whole application
12
+ # just for the purpose of running a single test. If you are using a tool that
13
+ # preloads Rails for running tests, you may have to set it to true.
14
+ config.eager_load = false
15
+
16
+ # Configure public file server for tests with Cache-Control for performance.
17
+ config.public_file_server.enabled = true
18
+ config.public_file_server.headers = {
19
+ "Cache-Control" => "public, max-age=3600",
20
+ }
21
+
22
+ # Show full error reports and disable caching.
23
+ config.consider_all_requests_local = true
24
+ config.action_controller.perform_caching = false
25
+
26
+ # Raise exceptions instead of rendering exception templates.
27
+ config.action_dispatch.show_exceptions = false
28
+
29
+ # Disable request forgery protection in test environment.
30
+ config.action_controller.allow_forgery_protection = false
31
+ # config.action_mailer.perform_caching = false
32
+
33
+ # Tell Action Mailer not to deliver emails to the real world.
34
+ # The :test delivery method accumulates sent emails in the
35
+ # ActionMailer::Base.deliveries array.
36
+ # config.action_mailer.delivery_method = :test
37
+
38
+ # Print deprecation notices to the stderr.
39
+ config.active_support.deprecation = :stderr
40
+
41
+ # Raises error for missing translations
42
+ # config.action_view.raise_on_missing_translations = true
43
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+ # Be sure to restart your server when you modify this file.
3
+
4
+ # ApplicationController.renderer.defaults.merge!(
5
+ # http_host: 'example.org',
6
+ # https: false
7
+ # )
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+ # Be sure to restart your server when you modify this file.
3
+
4
+ # Version of your assets, change this if you want to expire all your assets.
5
+ Rails.application.config.assets.version = "1.0"
6
+
7
+ # Add additional assets to the asset load path
8
+ # Rails.application.config.assets.paths << Emoji.images_path
9
+
10
+ # Precompile additional assets.
11
+ # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
12
+ # Rails.application.config.assets.precompile += %w( search.js )
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+ # Be sure to restart your server when you modify this file.
3
+
4
+ # You can add backtrace silencers for libraries that you're using but don't wish to
5
+ # see in your backtraces.
6
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
7
+
8
+ # You can also remove all the silencers if you're trying to debug a problem that might
9
+ # stem from framework code.
10
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+ # Be sure to restart your server when you modify this file.
3
+
4
+ # Specify a serializer for the signed and encrypted cookie jars.
5
+ # Valid options are :json, :marshal, and :hybrid.
6
+ Rails.application.config.action_dispatch.cookies_serializer = :json
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+ # Be sure to restart your server when you modify this file.
3
+
4
+ # Configure sensitive parameters which will be filtered from the log file.
5
+ Rails.application.config.filter_parameters += [:password]
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+ # Be sure to restart your server when you modify this file.
3
+
4
+ # Add new inflection rules using the following format. Inflections
5
+ # are locale specific, and you may define rules for as many different
6
+ # locales as you wish. All of these examples are active by default:
7
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
8
+ # inflect.plural /^(ox)$/i, '\1en'
9
+ # inflect.singular /^(ox)en/i, '\1'
10
+ # inflect.irregular 'person', 'people'
11
+ # inflect.uncountable %w( fish sheep )
12
+ # end
13
+
14
+ # These inflection rules are supported but not enabled by default:
15
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
16
+ # inflect.acronym 'RESTful'
17
+ # end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+ # Be sure to restart your server when you modify this file.
3
+
4
+ # Add new mime types for use in respond_to blocks:
5
+ # Mime::Type.register "text/richtext", :rtf
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+ # Be sure to restart your server when you modify this file.
3
+
4
+ Rails.application.config.session_store :cookie_store, key: "_test_app_session"
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+ # Be sure to restart your server when you modify this file.
3
+
4
+ # This file contains settings for ActionController::ParamsWrapper which
5
+ # is enabled by default.
6
+
7
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
8
+ ActiveSupport.on_load(:action_controller) do
9
+ wrap_parameters format: [:json]
10
+ end
11
+
12
+ # To enable root element in JSON for ActiveRecord objects.
13
+ # ActiveSupport.on_load(:active_record) do
14
+ # self.include_root_in_json = true
15
+ # end
@@ -0,0 +1,23 @@
1
+ # Files in the config/locales directory are used for internationalization
2
+ # and are automatically loaded by Rails. If you want to use locales other
3
+ # than English, add the necessary files in this directory.
4
+ #
5
+ # To use the locales, use `I18n.t`:
6
+ #
7
+ # I18n.t 'hello'
8
+ #
9
+ # In views, this is aliased to just `t`:
10
+ #
11
+ # <%= t('hello') %>
12
+ #
13
+ # To use a different locale, set it with `I18n.locale`:
14
+ #
15
+ # I18n.locale = :es
16
+ #
17
+ # This would use the information in config/locales/es.yml.
18
+ #
19
+ # To learn more, please read the Rails Internationalization guide
20
+ # available at http://guides.rubyonrails.org/i18n.html.
21
+
22
+ en:
23
+ hello: "Hello world"
@@ -0,0 +1,16 @@
1
+ development:
2
+ providers:
3
+ google_oauth2:
4
+ client_id: <%= ENV["CLIENT_ID"] %>
5
+ client_secret: <%= ENV["CLIENT_SECRET"] %>
6
+ authenticated_root: "/private"
7
+ unauthenticated_root: "/public"
8
+ session_duration_in_seconds: 5 # The default is 3600 (which is 1 hour)
9
+ test:
10
+ providers:
11
+ google_oauth2:
12
+ client_id: 1
13
+ client_secret: 2
14
+ authenticated_root: "/private"
15
+ unauthenticated_root: "/public"
16
+ session_duration_in_seconds: 5 # The default is 3600 (which is 1 hour)
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+ # Puma can serve each request in a thread from an internal thread pool.
3
+ # The `threads` method setting takes two numbers a minimum and maximum.
4
+ # Any libraries that use thread pools should be configured to match
5
+ # the maximum value specified for Puma. Default is set to 5 threads for minimum
6
+ # and maximum, this matches the default thread size of Active Record.
7
+ #
8
+ threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }.to_i
9
+ threads threads_count, threads_count
10
+
11
+ # Specifies the `port` that Puma will listen on to receive requests, default is 3000.
12
+ #
13
+ port ENV.fetch("PORT") { 3000 }
14
+
15
+ # Specifies the `environment` that Puma will run in.
16
+ #
17
+ environment ENV.fetch("RAILS_ENV") { "development" }
18
+
19
+ # Specifies the number of `workers` to boot in clustered mode.
20
+ # Workers are forked webserver processes. If using threads and workers together
21
+ # the concurrency of the application would be max `threads` * `workers`.
22
+ # Workers do not work on JRuby or Windows (both of which do not support
23
+ # processes).
24
+ #
25
+ # workers ENV.fetch("WEB_CONCURRENCY") { 2 }
26
+
27
+ # Use the `preload_app!` method when specifying a `workers` number.
28
+ # This directive tells Puma to first boot the application and load code
29
+ # before forking the application. This takes advantage of Copy On Write
30
+ # process behavior so workers use less memory. If you use this option
31
+ # you need to make sure to reconnect any threads in the `on_worker_boot`
32
+ # block.
33
+ #
34
+ # preload_app!
35
+
36
+ # The code in the `on_worker_boot` will be called if you are using
37
+ # clustered mode by specifying a number of `workers`. After each worker
38
+ # process is booted this block will be run, if you are using `preload_app!`
39
+ # option you will want to use this block to reconnect to any threads
40
+ # or connections that may have been created at application boot, Ruby
41
+ # cannot share connections between processes.
42
+ #
43
+ # on_worker_boot do
44
+ # ActiveRecord::Base.establish_connection if defined?(ActiveRecord)
45
+ # end
46
+
47
+ # Allow puma to be restarted by `rails restart` command.
48
+ plugin :tmp_restart
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+ Rails.application.routes.draw do
3
+ get "/public", to: "public#show"
4
+ get "/private", to: "private#show"
5
+
6
+ # TODO: Allow the mounting to be automatic
7
+ mount Omniauth::Rails::Engine => "/auth"
8
+ end
@@ -0,0 +1,22 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key is used for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+
6
+ # Make sure the secret is at least 30 characters and all random,
7
+ # no regular words or you'll be exposed to dictionary attacks.
8
+ # You can use `rails secret` to generate a secure secret key.
9
+
10
+ # Make sure the secrets in this file are kept private
11
+ # if you're sharing your code publicly.
12
+
13
+ development:
14
+ secret_key_base: 2c733e9aed0cfac95f2b458323aaf15f38d9e4dece2056913d89e864af7c7c5d935e93896a910de3392dcc6e81c97af311d344da37e6ddd62b66b98fef504d57
15
+
16
+ test:
17
+ secret_key_base: 85520314311eaecee7d67e1bf8628608c1cba7c9a60b39b69b74d6b3be33a6eb0a9766be97ac5065720044bb315004b6040afb19924811578b051e5b1859398f
18
+
19
+ # Do not keep production secrets in the repository,
20
+ # instead read values from the environment.
21
+ production:
22
+ secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+ %w(
3
+ .ruby-version
4
+ .rbenv-vars
5
+ tmp/restart.txt
6
+ tmp/caching-dev.txt
7
+ ).each { |path| Spring.watch(path) }
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+ # This file is used by Rack-based servers to start the application.
3
+
4
+ require_relative "config/environment"
5
+
6
+ run Rails.application