big_session 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.circleci/config.yml +32 -0
- data/.rubocop.yml +10 -0
- data/Gemfile +8 -0
- data/LICENSE.txt +21 -0
- data/README.md +60 -0
- data/Rakefile +8 -0
- data/big_session.gemspec +44 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/examples/landing_page_app_and_core_app/README.md +3 -0
- data/examples/landing_page_app_and_core_app/app_core/.ruby-version +1 -0
- data/examples/landing_page_app_and_core_app/app_core/Dockerfile +22 -0
- data/examples/landing_page_app_and_core_app/app_core/Gemfile +66 -0
- data/examples/landing_page_app_and_core_app/app_core/Gemfile.lock +236 -0
- data/examples/landing_page_app_and_core_app/app_core/README.md +24 -0
- data/examples/landing_page_app_and_core_app/app_core/Rakefile +6 -0
- data/examples/landing_page_app_and_core_app/app_core/app/assets/config/manifest.js +3 -0
- data/examples/landing_page_app_and_core_app/app_core/app/assets/images/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_core/app/assets/javascripts/application.js +16 -0
- data/examples/landing_page_app_and_core_app/app_core/app/assets/javascripts/cable.js +13 -0
- data/examples/landing_page_app_and_core_app/app_core/app/assets/javascripts/channels/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_core/app/assets/stylesheets/application.css +15 -0
- data/examples/landing_page_app_and_core_app/app_core/app/channels/application_cable/channel.rb +4 -0
- data/examples/landing_page_app_and_core_app/app_core/app/channels/application_cable/connection.rb +4 -0
- data/examples/landing_page_app_and_core_app/app_core/app/controllers/application_controller.rb +12 -0
- data/examples/landing_page_app_and_core_app/app_core/app/controllers/concerns/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_core/app/controllers/conversions_controller.rb +8 -0
- data/examples/landing_page_app_and_core_app/app_core/app/helpers/application_helper.rb +2 -0
- data/examples/landing_page_app_and_core_app/app_core/app/jobs/application_job.rb +2 -0
- data/examples/landing_page_app_and_core_app/app_core/app/mailers/application_mailer.rb +4 -0
- data/examples/landing_page_app_and_core_app/app_core/app/models/application_record.rb +3 -0
- data/examples/landing_page_app_and_core_app/app_core/app/models/concerns/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_core/app/views/layouts/application.html.erb +15 -0
- data/examples/landing_page_app_and_core_app/app_core/app/views/layouts/mailer.html.erb +13 -0
- data/examples/landing_page_app_and_core_app/app_core/app/views/layouts/mailer.text.erb +1 -0
- data/examples/landing_page_app_and_core_app/app_core/bin/bundle +3 -0
- data/examples/landing_page_app_and_core_app/app_core/bin/rails +9 -0
- data/examples/landing_page_app_and_core_app/app_core/bin/rake +9 -0
- data/examples/landing_page_app_and_core_app/app_core/bin/setup +36 -0
- data/examples/landing_page_app_and_core_app/app_core/bin/spring +17 -0
- data/examples/landing_page_app_and_core_app/app_core/bin/update +31 -0
- data/examples/landing_page_app_and_core_app/app_core/bin/yarn +11 -0
- data/examples/landing_page_app_and_core_app/app_core/config.ru +5 -0
- data/examples/landing_page_app_and_core_app/app_core/config/application.rb +19 -0
- data/examples/landing_page_app_and_core_app/app_core/config/boot.rb +4 -0
- data/examples/landing_page_app_and_core_app/app_core/config/cable.yml +10 -0
- data/examples/landing_page_app_and_core_app/app_core/config/credentials.yml.enc +1 -0
- data/examples/landing_page_app_and_core_app/app_core/config/database.yml +88 -0
- data/examples/landing_page_app_and_core_app/app_core/config/environment.rb +5 -0
- data/examples/landing_page_app_and_core_app/app_core/config/environments/development.rb +78 -0
- data/examples/landing_page_app_and_core_app/app_core/config/environments/production.rb +94 -0
- data/examples/landing_page_app_and_core_app/app_core/config/environments/test.rb +46 -0
- data/examples/landing_page_app_and_core_app/app_core/config/initializers/application_controller_renderer.rb +8 -0
- data/examples/landing_page_app_and_core_app/app_core/config/initializers/assets.rb +14 -0
- data/examples/landing_page_app_and_core_app/app_core/config/initializers/backtrace_silencers.rb +7 -0
- data/examples/landing_page_app_and_core_app/app_core/config/initializers/big_session.rb +7 -0
- data/examples/landing_page_app_and_core_app/app_core/config/initializers/content_security_policy.rb +25 -0
- data/examples/landing_page_app_and_core_app/app_core/config/initializers/cookies_serializer.rb +5 -0
- data/examples/landing_page_app_and_core_app/app_core/config/initializers/filter_parameter_logging.rb +4 -0
- data/examples/landing_page_app_and_core_app/app_core/config/initializers/inflections.rb +16 -0
- data/examples/landing_page_app_and_core_app/app_core/config/initializers/mime_types.rb +4 -0
- data/examples/landing_page_app_and_core_app/app_core/config/initializers/wrap_parameters.rb +14 -0
- data/examples/landing_page_app_and_core_app/app_core/config/locales/en.yml +33 -0
- data/examples/landing_page_app_and_core_app/app_core/config/puma.rb +34 -0
- data/examples/landing_page_app_and_core_app/app_core/config/routes.rb +4 -0
- data/examples/landing_page_app_and_core_app/app_core/config/spring.rb +6 -0
- data/examples/landing_page_app_and_core_app/app_core/config/storage.yml +34 -0
- data/examples/landing_page_app_and_core_app/app_core/db/seeds.rb +7 -0
- data/examples/landing_page_app_and_core_app/app_core/entrypoint.sh +8 -0
- data/examples/landing_page_app_and_core_app/app_core/lib/assets/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_core/lib/tasks/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_core/log/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_core/package.json +5 -0
- data/examples/landing_page_app_and_core_app/app_core/public/404.html +67 -0
- data/examples/landing_page_app_and_core_app/app_core/public/422.html +67 -0
- data/examples/landing_page_app_and_core_app/app_core/public/500.html +66 -0
- data/examples/landing_page_app_and_core_app/app_core/public/apple-touch-icon-precomposed.png +0 -0
- data/examples/landing_page_app_and_core_app/app_core/public/apple-touch-icon.png +0 -0
- data/examples/landing_page_app_and_core_app/app_core/public/favicon.ico +0 -0
- data/examples/landing_page_app_and_core_app/app_core/public/robots.txt +1 -0
- data/examples/landing_page_app_and_core_app/app_core/storage/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_core/test/application_system_test_case.rb +5 -0
- data/examples/landing_page_app_and_core_app/app_core/test/controllers/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_core/test/fixtures/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_core/test/fixtures/files/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_core/test/helpers/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_core/test/integration/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_core/test/mailers/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_core/test/models/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_core/test/system/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_core/test/test_helper.rb +10 -0
- data/examples/landing_page_app_and_core_app/app_core/tmp/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_core/vendor/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_lp/.ruby-version +1 -0
- data/examples/landing_page_app_and_core_app/app_lp/Dockerfile +22 -0
- data/examples/landing_page_app_and_core_app/app_lp/Gemfile +66 -0
- data/examples/landing_page_app_and_core_app/app_lp/Gemfile.lock +256 -0
- data/examples/landing_page_app_and_core_app/app_lp/README.md +24 -0
- data/examples/landing_page_app_and_core_app/app_lp/Rakefile +6 -0
- data/examples/landing_page_app_and_core_app/app_lp/app/assets/config/manifest.js +3 -0
- data/examples/landing_page_app_and_core_app/app_lp/app/assets/images/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_lp/app/assets/javascripts/application.js +16 -0
- data/examples/landing_page_app_and_core_app/app_lp/app/assets/javascripts/cable.js +13 -0
- data/examples/landing_page_app_and_core_app/app_lp/app/assets/javascripts/channels/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_lp/app/assets/stylesheets/application.css +15 -0
- data/examples/landing_page_app_and_core_app/app_lp/app/channels/application_cable/channel.rb +4 -0
- data/examples/landing_page_app_and_core_app/app_lp/app/channels/application_cable/connection.rb +4 -0
- data/examples/landing_page_app_and_core_app/app_lp/app/controllers/application_controller.rb +10 -0
- data/examples/landing_page_app_and_core_app/app_lp/app/controllers/concerns/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_lp/app/controllers/conversions_controller.rb +13 -0
- data/examples/landing_page_app_and_core_app/app_lp/app/controllers/lps_controller.rb +3 -0
- data/examples/landing_page_app_and_core_app/app_lp/app/helpers/application_helper.rb +2 -0
- data/examples/landing_page_app_and_core_app/app_lp/app/jobs/application_job.rb +2 -0
- data/examples/landing_page_app_and_core_app/app_lp/app/mailers/application_mailer.rb +4 -0
- data/examples/landing_page_app_and_core_app/app_lp/app/models/application_record.rb +3 -0
- data/examples/landing_page_app_and_core_app/app_lp/app/models/concerns/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_lp/app/views/layouts/application.html.erb +15 -0
- data/examples/landing_page_app_and_core_app/app_lp/app/views/layouts/mailer.html.erb +13 -0
- data/examples/landing_page_app_and_core_app/app_lp/app/views/layouts/mailer.text.erb +1 -0
- data/examples/landing_page_app_and_core_app/app_lp/app/views/lps/show.html.haml +5 -0
- data/examples/landing_page_app_and_core_app/app_lp/bin/bundle +3 -0
- data/examples/landing_page_app_and_core_app/app_lp/bin/rails +9 -0
- data/examples/landing_page_app_and_core_app/app_lp/bin/rake +9 -0
- data/examples/landing_page_app_and_core_app/app_lp/bin/setup +36 -0
- data/examples/landing_page_app_and_core_app/app_lp/bin/spring +17 -0
- data/examples/landing_page_app_and_core_app/app_lp/bin/update +31 -0
- data/examples/landing_page_app_and_core_app/app_lp/bin/yarn +11 -0
- data/examples/landing_page_app_and_core_app/app_lp/config.ru +5 -0
- data/examples/landing_page_app_and_core_app/app_lp/config/application.rb +19 -0
- data/examples/landing_page_app_and_core_app/app_lp/config/boot.rb +4 -0
- data/examples/landing_page_app_and_core_app/app_lp/config/cable.yml +10 -0
- data/examples/landing_page_app_and_core_app/app_lp/config/credentials.yml.enc +1 -0
- data/examples/landing_page_app_and_core_app/app_lp/config/database.yml +88 -0
- data/examples/landing_page_app_and_core_app/app_lp/config/environment.rb +5 -0
- data/examples/landing_page_app_and_core_app/app_lp/config/environments/development.rb +77 -0
- data/examples/landing_page_app_and_core_app/app_lp/config/environments/production.rb +94 -0
- data/examples/landing_page_app_and_core_app/app_lp/config/environments/test.rb +46 -0
- data/examples/landing_page_app_and_core_app/app_lp/config/initializers/application_controller_renderer.rb +8 -0
- data/examples/landing_page_app_and_core_app/app_lp/config/initializers/assets.rb +14 -0
- data/examples/landing_page_app_and_core_app/app_lp/config/initializers/backtrace_silencers.rb +7 -0
- data/examples/landing_page_app_and_core_app/app_lp/config/initializers/big_session.rb +7 -0
- data/examples/landing_page_app_and_core_app/app_lp/config/initializers/content_security_policy.rb +25 -0
- data/examples/landing_page_app_and_core_app/app_lp/config/initializers/cookies_serializer.rb +5 -0
- data/examples/landing_page_app_and_core_app/app_lp/config/initializers/filter_parameter_logging.rb +4 -0
- data/examples/landing_page_app_and_core_app/app_lp/config/initializers/inflections.rb +16 -0
- data/examples/landing_page_app_and_core_app/app_lp/config/initializers/mime_types.rb +4 -0
- data/examples/landing_page_app_and_core_app/app_lp/config/initializers/wrap_parameters.rb +14 -0
- data/examples/landing_page_app_and_core_app/app_lp/config/locales/en.yml +33 -0
- data/examples/landing_page_app_and_core_app/app_lp/config/puma.rb +34 -0
- data/examples/landing_page_app_and_core_app/app_lp/config/routes.rb +5 -0
- data/examples/landing_page_app_and_core_app/app_lp/config/spring.rb +6 -0
- data/examples/landing_page_app_and_core_app/app_lp/config/storage.yml +34 -0
- data/examples/landing_page_app_and_core_app/app_lp/db/seeds.rb +7 -0
- data/examples/landing_page_app_and_core_app/app_lp/entrypoint.sh +8 -0
- data/examples/landing_page_app_and_core_app/app_lp/lib/assets/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_lp/lib/tasks/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_lp/log/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_lp/package.json +5 -0
- data/examples/landing_page_app_and_core_app/app_lp/public/404.html +67 -0
- data/examples/landing_page_app_and_core_app/app_lp/public/422.html +67 -0
- data/examples/landing_page_app_and_core_app/app_lp/public/500.html +66 -0
- data/examples/landing_page_app_and_core_app/app_lp/public/apple-touch-icon-precomposed.png +0 -0
- data/examples/landing_page_app_and_core_app/app_lp/public/apple-touch-icon.png +0 -0
- data/examples/landing_page_app_and_core_app/app_lp/public/favicon.ico +0 -0
- data/examples/landing_page_app_and_core_app/app_lp/public/robots.txt +1 -0
- data/examples/landing_page_app_and_core_app/app_lp/storage/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_lp/test/application_system_test_case.rb +5 -0
- data/examples/landing_page_app_and_core_app/app_lp/test/controllers/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_lp/test/fixtures/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_lp/test/fixtures/files/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_lp/test/helpers/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_lp/test/integration/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_lp/test/mailers/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_lp/test/models/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_lp/test/system/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_lp/test/test_helper.rb +10 -0
- data/examples/landing_page_app_and_core_app/app_lp/tmp/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_lp/vendor/.keep +0 -0
- data/examples/landing_page_app_and_core_app/docker-compose.yml +26 -0
- data/lib/big_session.rb +15 -0
- data/lib/big_session/faraday.rb +35 -0
- data/lib/big_session/rack_middleware.rb +57 -0
- data/lib/big_session/session_id.rb +25 -0
- data/lib/big_session/version.rb +5 -0
- metadata +330 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# This file should contain all the record creation needed to seed the database with its default values.
|
|
2
|
+
# The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup).
|
|
3
|
+
#
|
|
4
|
+
# Examples:
|
|
5
|
+
#
|
|
6
|
+
# movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
|
|
7
|
+
# Character.create(name: 'Luke', movie: movies.first)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>The page you were looking for doesn't exist (404)</title>
|
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
6
|
+
<style>
|
|
7
|
+
.rails-default-error-page {
|
|
8
|
+
background-color: #EFEFEF;
|
|
9
|
+
color: #2E2F30;
|
|
10
|
+
text-align: center;
|
|
11
|
+
font-family: arial, sans-serif;
|
|
12
|
+
margin: 0;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.rails-default-error-page div.dialog {
|
|
16
|
+
width: 95%;
|
|
17
|
+
max-width: 33em;
|
|
18
|
+
margin: 4em auto 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.rails-default-error-page div.dialog > div {
|
|
22
|
+
border: 1px solid #CCC;
|
|
23
|
+
border-right-color: #999;
|
|
24
|
+
border-left-color: #999;
|
|
25
|
+
border-bottom-color: #BBB;
|
|
26
|
+
border-top: #B00100 solid 4px;
|
|
27
|
+
border-top-left-radius: 9px;
|
|
28
|
+
border-top-right-radius: 9px;
|
|
29
|
+
background-color: white;
|
|
30
|
+
padding: 7px 12% 0;
|
|
31
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.rails-default-error-page h1 {
|
|
35
|
+
font-size: 100%;
|
|
36
|
+
color: #730E15;
|
|
37
|
+
line-height: 1.5em;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.rails-default-error-page div.dialog > p {
|
|
41
|
+
margin: 0 0 1em;
|
|
42
|
+
padding: 1em;
|
|
43
|
+
background-color: #F7F7F7;
|
|
44
|
+
border: 1px solid #CCC;
|
|
45
|
+
border-right-color: #999;
|
|
46
|
+
border-left-color: #999;
|
|
47
|
+
border-bottom-color: #999;
|
|
48
|
+
border-bottom-left-radius: 4px;
|
|
49
|
+
border-bottom-right-radius: 4px;
|
|
50
|
+
border-top-color: #DADADA;
|
|
51
|
+
color: #666;
|
|
52
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
|
53
|
+
}
|
|
54
|
+
</style>
|
|
55
|
+
</head>
|
|
56
|
+
|
|
57
|
+
<body class="rails-default-error-page">
|
|
58
|
+
<!-- This file lives in public/404.html -->
|
|
59
|
+
<div class="dialog">
|
|
60
|
+
<div>
|
|
61
|
+
<h1>The page you were looking for doesn't exist.</h1>
|
|
62
|
+
<p>You may have mistyped the address or the page may have moved.</p>
|
|
63
|
+
</div>
|
|
64
|
+
<p>If you are the application owner check the logs for more information.</p>
|
|
65
|
+
</div>
|
|
66
|
+
</body>
|
|
67
|
+
</html>
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>The change you wanted was rejected (422)</title>
|
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
6
|
+
<style>
|
|
7
|
+
.rails-default-error-page {
|
|
8
|
+
background-color: #EFEFEF;
|
|
9
|
+
color: #2E2F30;
|
|
10
|
+
text-align: center;
|
|
11
|
+
font-family: arial, sans-serif;
|
|
12
|
+
margin: 0;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.rails-default-error-page div.dialog {
|
|
16
|
+
width: 95%;
|
|
17
|
+
max-width: 33em;
|
|
18
|
+
margin: 4em auto 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.rails-default-error-page div.dialog > div {
|
|
22
|
+
border: 1px solid #CCC;
|
|
23
|
+
border-right-color: #999;
|
|
24
|
+
border-left-color: #999;
|
|
25
|
+
border-bottom-color: #BBB;
|
|
26
|
+
border-top: #B00100 solid 4px;
|
|
27
|
+
border-top-left-radius: 9px;
|
|
28
|
+
border-top-right-radius: 9px;
|
|
29
|
+
background-color: white;
|
|
30
|
+
padding: 7px 12% 0;
|
|
31
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.rails-default-error-page h1 {
|
|
35
|
+
font-size: 100%;
|
|
36
|
+
color: #730E15;
|
|
37
|
+
line-height: 1.5em;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.rails-default-error-page div.dialog > p {
|
|
41
|
+
margin: 0 0 1em;
|
|
42
|
+
padding: 1em;
|
|
43
|
+
background-color: #F7F7F7;
|
|
44
|
+
border: 1px solid #CCC;
|
|
45
|
+
border-right-color: #999;
|
|
46
|
+
border-left-color: #999;
|
|
47
|
+
border-bottom-color: #999;
|
|
48
|
+
border-bottom-left-radius: 4px;
|
|
49
|
+
border-bottom-right-radius: 4px;
|
|
50
|
+
border-top-color: #DADADA;
|
|
51
|
+
color: #666;
|
|
52
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
|
53
|
+
}
|
|
54
|
+
</style>
|
|
55
|
+
</head>
|
|
56
|
+
|
|
57
|
+
<body class="rails-default-error-page">
|
|
58
|
+
<!-- This file lives in public/422.html -->
|
|
59
|
+
<div class="dialog">
|
|
60
|
+
<div>
|
|
61
|
+
<h1>The change you wanted was rejected.</h1>
|
|
62
|
+
<p>Maybe you tried to change something you didn't have access to.</p>
|
|
63
|
+
</div>
|
|
64
|
+
<p>If you are the application owner check the logs for more information.</p>
|
|
65
|
+
</div>
|
|
66
|
+
</body>
|
|
67
|
+
</html>
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>We're sorry, but something went wrong (500)</title>
|
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
6
|
+
<style>
|
|
7
|
+
.rails-default-error-page {
|
|
8
|
+
background-color: #EFEFEF;
|
|
9
|
+
color: #2E2F30;
|
|
10
|
+
text-align: center;
|
|
11
|
+
font-family: arial, sans-serif;
|
|
12
|
+
margin: 0;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.rails-default-error-page div.dialog {
|
|
16
|
+
width: 95%;
|
|
17
|
+
max-width: 33em;
|
|
18
|
+
margin: 4em auto 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.rails-default-error-page div.dialog > div {
|
|
22
|
+
border: 1px solid #CCC;
|
|
23
|
+
border-right-color: #999;
|
|
24
|
+
border-left-color: #999;
|
|
25
|
+
border-bottom-color: #BBB;
|
|
26
|
+
border-top: #B00100 solid 4px;
|
|
27
|
+
border-top-left-radius: 9px;
|
|
28
|
+
border-top-right-radius: 9px;
|
|
29
|
+
background-color: white;
|
|
30
|
+
padding: 7px 12% 0;
|
|
31
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.rails-default-error-page h1 {
|
|
35
|
+
font-size: 100%;
|
|
36
|
+
color: #730E15;
|
|
37
|
+
line-height: 1.5em;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.rails-default-error-page div.dialog > p {
|
|
41
|
+
margin: 0 0 1em;
|
|
42
|
+
padding: 1em;
|
|
43
|
+
background-color: #F7F7F7;
|
|
44
|
+
border: 1px solid #CCC;
|
|
45
|
+
border-right-color: #999;
|
|
46
|
+
border-left-color: #999;
|
|
47
|
+
border-bottom-color: #999;
|
|
48
|
+
border-bottom-left-radius: 4px;
|
|
49
|
+
border-bottom-right-radius: 4px;
|
|
50
|
+
border-top-color: #DADADA;
|
|
51
|
+
color: #666;
|
|
52
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
|
53
|
+
}
|
|
54
|
+
</style>
|
|
55
|
+
</head>
|
|
56
|
+
|
|
57
|
+
<body class="rails-default-error-page">
|
|
58
|
+
<!-- This file lives in public/500.html -->
|
|
59
|
+
<div class="dialog">
|
|
60
|
+
<div>
|
|
61
|
+
<h1>We're sorry, but something went wrong.</h1>
|
|
62
|
+
</div>
|
|
63
|
+
<p>If you are the application owner check the logs for more information.</p>
|
|
64
|
+
</div>
|
|
65
|
+
</body>
|
|
66
|
+
</html>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
ENV['RAILS_ENV'] ||= 'test'
|
|
2
|
+
require_relative '../config/environment'
|
|
3
|
+
require 'rails/test_help'
|
|
4
|
+
|
|
5
|
+
class ActiveSupport::TestCase
|
|
6
|
+
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
|
|
7
|
+
fixtures :all
|
|
8
|
+
|
|
9
|
+
# Add more helper methods to be used by all tests here...
|
|
10
|
+
end
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
version: '3'
|
|
2
|
+
services:
|
|
3
|
+
db:
|
|
4
|
+
image: postgres
|
|
5
|
+
volumes:
|
|
6
|
+
- ./tmp/db:/var/lib/postgresql/data
|
|
7
|
+
app_core:
|
|
8
|
+
build: app_core
|
|
9
|
+
command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0'"
|
|
10
|
+
volumes:
|
|
11
|
+
- ./app_core:/app
|
|
12
|
+
- ./big_session:/mnt/big_session
|
|
13
|
+
ports:
|
|
14
|
+
- "3000:3000"
|
|
15
|
+
depends_on:
|
|
16
|
+
- db
|
|
17
|
+
app_lp:
|
|
18
|
+
build: app_lp
|
|
19
|
+
command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0'"
|
|
20
|
+
volumes:
|
|
21
|
+
- ./app_lp:/app
|
|
22
|
+
- ./big_session:/mnt/big_session
|
|
23
|
+
ports:
|
|
24
|
+
- "3001:3000"
|
|
25
|
+
depends_on:
|
|
26
|
+
- db
|
data/lib/big_session.rb
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'big_session/version'
|
|
4
|
+
require 'big_session/faraday'
|
|
5
|
+
require 'big_session/rack_middleware'
|
|
6
|
+
require 'big_session/session_id'
|
|
7
|
+
|
|
8
|
+
module BigSession
|
|
9
|
+
class Error < StandardError; end
|
|
10
|
+
|
|
11
|
+
BIG_SESSION_HEADER_NAME = 'X-Bigse-SessionID'
|
|
12
|
+
BIG_SESSION_SIGNATURE_HEADER_NAME = 'X-Bigse-Sig'
|
|
13
|
+
THREAD_BIG_SESSION_ID_KEY = 'big_session_id'
|
|
14
|
+
RAILS_SESSION_BIG_SESSION_ID_KEY = 'big_session_id'
|
|
15
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'faraday'
|
|
4
|
+
require 'openssl'
|
|
5
|
+
|
|
6
|
+
module BigSession
|
|
7
|
+
# This middleware will add BigSession header to request_headers of outgoing
|
|
8
|
+
# connections done by Faraday
|
|
9
|
+
class FaradayBigSession < ::Faraday::Middleware
|
|
10
|
+
class << self
|
|
11
|
+
def activate
|
|
12
|
+
::Faraday::Middleware.register_middleware big_session: ::BigSession::FaradayBigSession
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def initialize(app, header_secret = nil)
|
|
17
|
+
@app = app
|
|
18
|
+
@header_secret = header_secret
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def call(env)
|
|
22
|
+
if SessionId.current
|
|
23
|
+
headers = { ::BigSession::BIG_SESSION_HEADER_NAME => SessionId.current, }
|
|
24
|
+
|
|
25
|
+
if @header_secret
|
|
26
|
+
sig = OpenSSL::HMAC.hexdigest('sha256', @header_secret, SessionId.current)
|
|
27
|
+
headers[::BigSession::BIG_SESSION_SIGNATURE_HEADER_NAME] = sig
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
env[:request_headers].merge!(headers)
|
|
31
|
+
end
|
|
32
|
+
@app.call(env)
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'securerandom'
|
|
4
|
+
require 'openssl'
|
|
5
|
+
require 'logger'
|
|
6
|
+
|
|
7
|
+
module BigSession
|
|
8
|
+
# This middleware reads BigSession headers from the request and sets/creates a
|
|
9
|
+
# SessionId usable by the rest of the app
|
|
10
|
+
class RackMiddleware
|
|
11
|
+
class << self
|
|
12
|
+
def activate(header_secret = nil)
|
|
13
|
+
Rails.application.config.middleware.use ::BigSession::RackMiddleware, header_secret
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def initialize(app, header_secret = nil)
|
|
18
|
+
@app = app
|
|
19
|
+
@header_secret = header_secret
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def call(env)
|
|
23
|
+
header_session_id, header_signature = env.values_at(
|
|
24
|
+
'HTTP_' + ::BigSession::BIG_SESSION_HEADER_NAME.upcase.gsub(/-/, '_'),
|
|
25
|
+
'HTTP_' + ::BigSession::BIG_SESSION_SIGNATURE_HEADER_NAME
|
|
26
|
+
.upcase.gsub(/-/, '_')
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
if header_session_id
|
|
30
|
+
env['rack.session'][::BigSession::RAILS_SESSION_BIG_SESSION_ID_KEY] =
|
|
31
|
+
if @header_secret
|
|
32
|
+
validate_header_session_id(header_session_id, header_signature)
|
|
33
|
+
else
|
|
34
|
+
header_session_id
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
SessionId.set(env['rack.session'][::BigSession::RAILS_SESSION_BIG_SESSION_ID_KEY])
|
|
38
|
+
else
|
|
39
|
+
SessionId.set(env['rack.session'][::BigSession::RAILS_SESSION_BIG_SESSION_ID_KEY]) unless SessionId.current
|
|
40
|
+
env['rack.session'][::BigSession::RAILS_SESSION_BIG_SESSION_ID_KEY] = SessionId.current
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
@app.call(env)
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
private
|
|
47
|
+
|
|
48
|
+
def validate_header_session_id(header_session_id, header_signature)
|
|
49
|
+
digest = OpenSSL::HMAC.hexdigest('sha256', @header_secret, header_session_id)
|
|
50
|
+
return header_session_id if digest == header_signature
|
|
51
|
+
|
|
52
|
+
logger = Logger.new(STDOUT)
|
|
53
|
+
logger.warn('Failed to validate big session header signature.')
|
|
54
|
+
nil
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'securerandom'
|
|
4
|
+
|
|
5
|
+
module BigSession
|
|
6
|
+
# SessionId object bridges an access from users to session id
|
|
7
|
+
class SessionId
|
|
8
|
+
class << self
|
|
9
|
+
def current
|
|
10
|
+
Thread.current[::BigSession::THREAD_BIG_SESSION_ID_KEY]
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def set(value = nil)
|
|
14
|
+
Thread.current[::BigSession::THREAD_BIG_SESSION_ID_KEY] =
|
|
15
|
+
value || new_session_id
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def new_session_id
|
|
19
|
+
SecureRandom.hex(16)
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
private_class_method :new_session_id
|
|
24
|
+
end
|
|
25
|
+
end
|