frikandel 3.0.1 → 4.0.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 +4 -4
- data/.devcontainer/Dockerfile +31 -0
- data/.devcontainer/base.Dockerfile +43 -0
- data/.devcontainer/devcontainer.json +40 -0
- data/.github/workflows/ci.yml +18 -29
- data/Appraisals +15 -0
- data/README.md +8 -7
- data/frikandel.gemspec +4 -9
- data/gemfiles/rails_7.2.gemfile +7 -0
- data/gemfiles/rails_8.0.gemfile +7 -0
- data/gemfiles/rails_8.1.gemfile +7 -0
- data/gemfiles/rails_head.gemfile +7 -0
- data/lib/frikandel/bind_session_to_ip_address.rb +1 -5
- data/lib/frikandel/limit_session_lifetime.rb +1 -5
- data/lib/frikandel/version.rb +1 -1
- data/spec/controllers/bind_session_to_ip_address_controller_spec.rb +2 -10
- data/spec/controllers/combined_controller_spec.rb +2 -10
- data/spec/controllers/limit_session_lifetime_controller_spec.rb +2 -10
- data/spec/dummy/app/views/layouts/application.html.erb +1 -5
- data/spec/dummy/config/application.rb +5 -18
- data/spec/dummy/config/boot.rb +1 -1
- data/spec/dummy/config/environments/development.rb +2 -22
- data/spec/dummy/config/environments/production.rb +3 -71
- data/spec/dummy/config/environments/test.rb +4 -28
- data/spec/rails_helper.rb +4 -50
- data/spec/support/application_controller.rb +1 -6
- metadata +19 -104
- data/gemfiles/rails-5.2.x.gemfile +0 -6
- data/gemfiles/rails-6.0.x.gemfile +0 -6
- data/gemfiles/rails-6.1.x.gemfile +0 -6
- data/gemfiles/rails-7.0.x.gemfile +0 -7
- data/gemfiles/rails-head.gemfile +0 -6
- data/spec/dummy/README.rdoc +0 -28
- data/spec/dummy/app/assets/config/manifest.js +0 -3
- data/spec/dummy/app/assets/images/.keep +0 -0
- data/spec/dummy/app/assets/javascripts/application.js +0 -13
- data/spec/dummy/app/assets/stylesheets/application.css +0 -13
- data/spec/dummy/app/mailers/.keep +0 -0
- data/spec/dummy/app/models/.keep +0 -0
- data/spec/dummy/app/models/concerns/.keep +0 -0
- data/spec/dummy/config/database.yml +0 -25
- data/spec/dummy/config/initializers/secret_token.rb +0 -12
- data/spec/dummy/config/initializers/wrap_parameters.rb +0 -14
- data/spec/dummy/lib/assets/.keep +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cff69b9b86ae896c8ba21d0fc1631bd1068f995da1e047d8601f3eb0e8eeca89
|
|
4
|
+
data.tar.gz: 894d018d70cbe303e5b41faf17527557ecc9f434c15b2d361921fc1952a6d82d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2b8933fe59102ddcc724f081fa5406a0ab1d036b8da7001cbf891c29cb05021815c57ea56d2c0a92860ab7ec5b4b99f52c0857f2cd29b77e6ab32b9930ea493b
|
|
7
|
+
data.tar.gz: 29cd07195aafcb9830a48ed64053cf6cf633b9e700541ee88f276607c50def9b5ba3552f77df146857c9a88b097c8c8df37ee8ad96d6ea26946a5e6175ce425a
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# [Choice] Ruby version (use -bullseye variants on local arm64/Apple Silicon): 3, 3.1, 3.0, 2, 2.7, 2.6, 3-bullseye, 3.1-bullseye, 3.0-bullseye, 2-bullseye, 2.7-bullseye, 2.6-bullseye, 3-buster, 3.1-buster, 3.0-buster, 2-buster, 2.7-buster, 2.6-buster
|
|
2
|
+
ARG VARIANT=3-bullseye
|
|
3
|
+
FROM mcr.microsoft.com/vscode/devcontainers/ruby:0-${VARIANT}
|
|
4
|
+
|
|
5
|
+
# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
|
|
6
|
+
ARG NODE_VERSION="none"
|
|
7
|
+
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
|
|
8
|
+
|
|
9
|
+
# [Optional] Uncomment this section to install additional OS packages.
|
|
10
|
+
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
|
11
|
+
# && apt-get -y install --no-install-recommends <your-package-list-here>
|
|
12
|
+
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
|
13
|
+
&& apt-get -y install --no-install-recommends vim
|
|
14
|
+
|
|
15
|
+
# [Optional] Uncomment this line to install additional gems.
|
|
16
|
+
# RUN gem install <your-gem-names-here>
|
|
17
|
+
|
|
18
|
+
# [Optional] Uncomment this line to install global node packages.
|
|
19
|
+
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1
|
|
20
|
+
|
|
21
|
+
# # Install exact ruby version and gems. NOTE: `rvm use` is necessary here, so
|
|
22
|
+
# # that the gems are detected as installed when using the VSCode Terminal later.
|
|
23
|
+
# # (Running `gem install` or `bundle install` without `rvm use` first, will
|
|
24
|
+
# # install the gems in a different directory than expected by rvm.)
|
|
25
|
+
# ARG EXACT_RUBY_VERSION=…
|
|
26
|
+
# RUN su vscode -c "source /usr/local/rvm/scripts/rvm && rvm install ruby ${EXACT_RUBY_VERSION}" 2>&1
|
|
27
|
+
# ARG BUNDLER_VERSION=…
|
|
28
|
+
# RUN su vscode -c "source /usr/local/rvm/scripts/rvm && rvm use ${EXACT_RUBY_VERSION} && gem install bundler:${BUNDLER_VERSION}" 2>&1
|
|
29
|
+
|
|
30
|
+
# NOTE: Set all the ARGs in `.devcontainer/devcontainer.json`, because some are
|
|
31
|
+
# already set that way.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# [Choice] Ruby version (use -bullseye variants on local arm64/Apple Silicon): 3, 3.1, 3.0, 2, 2.7, 2.6, 3-bullseye, 3.1-bullseye, 3.0-bullseye, 2-bullseye, 2.7-bullseye, 2.6-bullseye, 3-buster, 3.1-buster, 3.0-buster, 2-buster, 2.7-buster, 2.6-buster
|
|
2
|
+
ARG VARIANT=2-bullseye
|
|
3
|
+
FROM ruby:${VARIANT}
|
|
4
|
+
|
|
5
|
+
# Copy library scripts to execute
|
|
6
|
+
COPY library-scripts/*.sh library-scripts/*.env /tmp/library-scripts/
|
|
7
|
+
|
|
8
|
+
# [Option] Install zsh
|
|
9
|
+
ARG INSTALL_ZSH="true"
|
|
10
|
+
# [Option] Upgrade OS packages to their latest versions
|
|
11
|
+
ARG UPGRADE_PACKAGES="true"
|
|
12
|
+
# Install needed packages and setup non-root user. Use a separate RUN statement to add your own dependencies.
|
|
13
|
+
ARG USERNAME=vscode
|
|
14
|
+
ARG USER_UID=1000
|
|
15
|
+
ARG USER_GID=$USER_UID
|
|
16
|
+
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
|
17
|
+
# Remove imagemagick due to https://security-tracker.debian.org/tracker/CVE-2019-10131
|
|
18
|
+
&& apt-get purge -y imagemagick imagemagick-6-common \
|
|
19
|
+
# Install common packages, non-root user, rvm, core build tools
|
|
20
|
+
&& bash /tmp/library-scripts/common-debian.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" "true" "true" \
|
|
21
|
+
&& bash /tmp/library-scripts/ruby-debian.sh "none" "${USERNAME}" "true" "true" \
|
|
22
|
+
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/*
|
|
23
|
+
|
|
24
|
+
# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
|
|
25
|
+
ARG NODE_VERSION="none"
|
|
26
|
+
ENV NVM_DIR=/usr/local/share/nvm
|
|
27
|
+
ENV NVM_SYMLINK_CURRENT=true \
|
|
28
|
+
PATH=${NVM_DIR}/current/bin:${PATH}
|
|
29
|
+
RUN bash /tmp/library-scripts/node-debian.sh "${NVM_DIR}" "${NODE_VERSION}" "${USERNAME}" \
|
|
30
|
+
&& apt-get clean -y && rm -rf /var/lib/apt/lists/*
|
|
31
|
+
|
|
32
|
+
# Remove library scripts for final image
|
|
33
|
+
RUN rm -rf /tmp/library-scripts
|
|
34
|
+
|
|
35
|
+
# [Optional] Uncomment this section to install additional OS packages.
|
|
36
|
+
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
|
37
|
+
# && apt-get -y install --no-install-recommends <your-package-list-here>
|
|
38
|
+
|
|
39
|
+
# [Optional] Uncomment this line to install additional gems.
|
|
40
|
+
# RUN gem install <your-gem-names-here>
|
|
41
|
+
|
|
42
|
+
# [Optional] Uncomment this line to install global node packages.
|
|
43
|
+
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
|
|
2
|
+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.234.0/containers/ruby
|
|
3
|
+
{
|
|
4
|
+
"name": "Ruby",
|
|
5
|
+
"build": {
|
|
6
|
+
"dockerfile": "Dockerfile",
|
|
7
|
+
"args": {
|
|
8
|
+
// Update 'VARIANT' to pick a Ruby version: 3, 3.1, 3.0, 2, 2.7, 2.6
|
|
9
|
+
// Append -bullseye or -buster to pin to an OS version.
|
|
10
|
+
// Use -bullseye variants on local on arm64/Apple Silicon.
|
|
11
|
+
"VARIANT": "3-bullseye",
|
|
12
|
+
// Options
|
|
13
|
+
"NODE_VERSION": "lts/*"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
|
|
17
|
+
"workspaceMount": "source=${localWorkspaceFolder},target=/workspaces/taktsoft/${localWorkspaceFolderBasename},type=bind,consistency=cached",
|
|
18
|
+
"workspaceFolder": "/workspaces/taktsoft/${localWorkspaceFolderBasename}",
|
|
19
|
+
|
|
20
|
+
// Set *default* container specific settings.json values on container create.
|
|
21
|
+
"settings": {},
|
|
22
|
+
|
|
23
|
+
// Add the IDs of extensions you want installed when the container is created.
|
|
24
|
+
"extensions": [
|
|
25
|
+
"rebornix.Ruby"
|
|
26
|
+
],
|
|
27
|
+
|
|
28
|
+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
|
29
|
+
// "forwardPorts": [],
|
|
30
|
+
|
|
31
|
+
// Use 'postCreateCommand' to run commands after the container is created.
|
|
32
|
+
// "postCreateCommand": "ruby --version",
|
|
33
|
+
"postCreateCommand": "bundle install",
|
|
34
|
+
|
|
35
|
+
// NOTE: the safe.directory git config is needed with newer git versions and mounts in (dev)containers, cf. https://www.kenmuse.com/blog/avoiding-dubious-ownership-in-dev-containers/
|
|
36
|
+
"postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}",
|
|
37
|
+
|
|
38
|
+
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
|
|
39
|
+
"remoteUser": "vscode"
|
|
40
|
+
}
|
data/.github/workflows/ci.yml
CHANGED
|
@@ -17,39 +17,28 @@ on:
|
|
|
17
17
|
|
|
18
18
|
jobs:
|
|
19
19
|
test:
|
|
20
|
-
|
|
21
20
|
runs-on: ubuntu-latest
|
|
22
21
|
strategy:
|
|
23
22
|
fail-fast: false
|
|
24
23
|
matrix:
|
|
25
|
-
ruby-version: ['2
|
|
26
|
-
gemfile: [
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
- ruby-version: '
|
|
30
|
-
gemfile:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
- ruby-version: '2.6'
|
|
35
|
-
gemfile: rails-7.0.x
|
|
36
|
-
- ruby-version: 'jruby'
|
|
37
|
-
gemfile: rails-7.0.x
|
|
38
|
-
env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
|
|
24
|
+
ruby-version: ['3.2', '3.3', '3.4', '4.0']
|
|
25
|
+
gemfile: ['rails_7.2', 'rails_8.0', 'rails_8.1']
|
|
26
|
+
experimental: [false]
|
|
27
|
+
include:
|
|
28
|
+
- ruby-version: '4.0'
|
|
29
|
+
gemfile: 'rails_head'
|
|
30
|
+
experimental: true
|
|
31
|
+
continue-on-error: ${{ matrix.experimental }}
|
|
32
|
+
env:
|
|
39
33
|
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
|
|
40
|
-
|
|
41
34
|
name: test (ruby ${{ matrix.ruby-version }}, ${{ matrix.gemfile }})
|
|
42
|
-
|
|
43
35
|
steps:
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
|
54
|
-
- name: Run tests
|
|
55
|
-
run: bundle exec rake
|
|
36
|
+
- name: Checkout
|
|
37
|
+
uses: actions/checkout@v4
|
|
38
|
+
- name: Set up Ruby
|
|
39
|
+
uses: ruby/setup-ruby@v1
|
|
40
|
+
with:
|
|
41
|
+
ruby-version: ${{ matrix.ruby-version }}
|
|
42
|
+
bundler-cache: true
|
|
43
|
+
- name: Run tests
|
|
44
|
+
run: bundle exec rake
|
data/Appraisals
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
appraise "rails-7.2" do
|
|
2
|
+
gem "rails", "~> 7.2.0"
|
|
3
|
+
end
|
|
4
|
+
|
|
5
|
+
appraise "rails-8.0" do
|
|
6
|
+
gem "rails", "~> 8.0.0"
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
appraise "rails-8.1" do
|
|
10
|
+
gem "rails", "~> 8.1.0"
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
appraise "rails-head" do
|
|
14
|
+
gem "rails", github: "rails/rails", branch: "main"
|
|
15
|
+
end
|
data/README.md
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
# Frikandel
|
|
2
2
|
[](http://badge.fury.io/rb/frikandel)
|
|
3
3
|
[](https://github.com/taktsoft/frikandel/actions/workflows/ci.yml)
|
|
4
|
-
[](https://codeclimate.com/github/taktsoft/frikandel)
|
|
5
|
-
[](https://gemnasium.com/taktsoft/frikandel)
|
|
6
4
|
|
|
7
5
|
This gem aims to improve the security of your rails application. It allows you to add a TTL (Time To Live) to the session cookie and allows you to bind the session to an IP address.
|
|
8
6
|
|
|
@@ -18,7 +16,7 @@ By adding a TTL the attack window gets smaller. An stolen has to be used within
|
|
|
18
16
|
|
|
19
17
|
## Requirements
|
|
20
18
|
|
|
21
|
-
Rails
|
|
19
|
+
Rails 7.2 and newer are supported, on Ruby 3.2 and newer.
|
|
22
20
|
|
|
23
21
|
|
|
24
22
|
## Installation
|
|
@@ -93,6 +91,8 @@ end
|
|
|
93
91
|
|
|
94
92
|
## Changes
|
|
95
93
|
|
|
94
|
+
* v4.0.0 -- Drop support for Rails < 7.2 and Ruby < 3.2, add support for Rails 7.2, 8.0 and 8.1, rebuild the test suite (RSpec + Appraisal, no ActiveRecord)
|
|
95
|
+
* v3.0.2 -- Add support for Ruby 3.1 and add DevContainer setup for development
|
|
96
96
|
* v3.0.1 -- Add support for Rails v7.x
|
|
97
97
|
* v3.0.0 -- Drop support for Rails < v5.2, add support for Rails v6.1 and switch from TravisCI to GithubActions
|
|
98
98
|
* v2.3.0 -- Add support for Rails v5.1 and Rails v6.0 and fix TravisCI builds
|
|
@@ -104,10 +104,11 @@ end
|
|
|
104
104
|
|
|
105
105
|
To run the test suite with different rails version by selecting the corresponding gemfile. You can use these one liners:
|
|
106
106
|
|
|
107
|
-
$
|
|
108
|
-
$
|
|
109
|
-
$
|
|
110
|
-
$
|
|
107
|
+
$ bundle exec appraisal install
|
|
108
|
+
$ bundle exec appraisal rails-7.2 rake
|
|
109
|
+
$ bundle exec appraisal rails-8.0 rake
|
|
110
|
+
$ bundle exec appraisal rails-8.1 rake
|
|
111
|
+
$ bundle exec appraisal rails-head rake
|
|
111
112
|
|
|
112
113
|
## Contributing
|
|
113
114
|
1. Fork it
|
data/frikandel.gemspec
CHANGED
|
@@ -12,24 +12,19 @@ Gem::Specification.new do |spec|
|
|
|
12
12
|
spec.description = spec.summary
|
|
13
13
|
spec.homepage = "https://github.com/taktsoft/frikandel"
|
|
14
14
|
spec.license = "MIT"
|
|
15
|
+
spec.metadata = { "rubygems_mfa_required" => "true" }
|
|
15
16
|
|
|
16
17
|
spec.files = `git ls-files -z`.split("\x0")
|
|
17
18
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
|
18
|
-
spec.test_files = Dir["spec/**/*"]
|
|
19
19
|
spec.require_paths = ["lib"]
|
|
20
20
|
|
|
21
|
-
spec.required_ruby_version
|
|
22
|
-
spec.required_rubygems_version = ">= 1.3.6"
|
|
21
|
+
spec.required_ruby_version = '>= 3.2'
|
|
23
22
|
|
|
24
23
|
spec.add_development_dependency "bundler"
|
|
25
24
|
spec.add_development_dependency "rake"
|
|
26
|
-
spec.add_development_dependency "sqlite3" unless RUBY_PLATFORM == 'java'
|
|
27
|
-
spec.add_development_dependency "jdbc-sqlite3" if RUBY_PLATFORM == 'java'
|
|
28
|
-
spec.add_development_dependency "activerecord-jdbcsqlite3-adapter" if RUBY_PLATFORM == 'java'
|
|
29
25
|
spec.add_development_dependency "rspec-rails", "> 3.0"
|
|
30
|
-
spec.add_development_dependency "
|
|
26
|
+
spec.add_development_dependency "appraisal"
|
|
31
27
|
spec.add_development_dependency "pry"
|
|
32
|
-
spec.add_development_dependency "test-unit"
|
|
33
28
|
|
|
34
|
-
spec.add_dependency "rails", ">=
|
|
29
|
+
spec.add_dependency "rails", ">= 7.2"
|
|
35
30
|
end
|
|
@@ -4,11 +4,7 @@ module Frikandel
|
|
|
4
4
|
include SessionInvalidation
|
|
5
5
|
|
|
6
6
|
included do
|
|
7
|
-
|
|
8
|
-
append_before_action :validate_session_ip_address
|
|
9
|
-
else
|
|
10
|
-
append_before_filter :validate_session_ip_address
|
|
11
|
-
end
|
|
7
|
+
append_before_action :validate_session_ip_address
|
|
12
8
|
end
|
|
13
9
|
|
|
14
10
|
private
|
|
@@ -4,11 +4,7 @@ module Frikandel
|
|
|
4
4
|
include SessionInvalidation
|
|
5
5
|
|
|
6
6
|
included do
|
|
7
|
-
|
|
8
|
-
append_before_action :validate_session_timestamp
|
|
9
|
-
else
|
|
10
|
-
append_before_filter :validate_session_timestamp
|
|
11
|
-
end
|
|
7
|
+
append_before_action :validate_session_timestamp
|
|
12
8
|
end
|
|
13
9
|
|
|
14
10
|
private
|
data/lib/frikandel/version.rb
CHANGED
|
@@ -5,18 +5,10 @@ require "support/application_controller"
|
|
|
5
5
|
class BindSessionToIpAddressController < ApplicationController
|
|
6
6
|
include Frikandel::BindSessionToIpAddress
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
before_action :flash_alert_and_redirect_home, only: [:redirect_home]
|
|
10
|
-
else
|
|
11
|
-
before_filter :flash_alert_and_redirect_home, only: [:redirect_home]
|
|
12
|
-
end
|
|
8
|
+
before_action :flash_alert_and_redirect_home, only: [:redirect_home]
|
|
13
9
|
|
|
14
10
|
def home
|
|
15
|
-
|
|
16
|
-
render plain: "bind test"
|
|
17
|
-
else
|
|
18
|
-
render text: "bind test"
|
|
19
|
-
end
|
|
11
|
+
render plain: "bind test"
|
|
20
12
|
end
|
|
21
13
|
|
|
22
14
|
def redirect_home
|
|
@@ -6,18 +6,10 @@ class CombinedController < ApplicationController
|
|
|
6
6
|
include Frikandel::LimitSessionLifetime
|
|
7
7
|
include Frikandel::BindSessionToIpAddress
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
before_action :flash_alert_and_redirect_home, only: [:redirect_home]
|
|
11
|
-
else
|
|
12
|
-
before_filter :flash_alert_and_redirect_home, only: [:redirect_home]
|
|
13
|
-
end
|
|
9
|
+
before_action :flash_alert_and_redirect_home, only: [:redirect_home]
|
|
14
10
|
|
|
15
11
|
def home
|
|
16
|
-
|
|
17
|
-
render plain: "combined test"
|
|
18
|
-
else
|
|
19
|
-
render text: "combined test"
|
|
20
|
-
end
|
|
12
|
+
render plain: "combined test"
|
|
21
13
|
end
|
|
22
14
|
|
|
23
15
|
def redirect_home
|
|
@@ -5,18 +5,10 @@ require "support/application_controller"
|
|
|
5
5
|
class LimitSessionLifetimeController < ApplicationController
|
|
6
6
|
include Frikandel::LimitSessionLifetime
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
before_action :flash_alert_and_redirect_home, only: [:redirect_home]
|
|
10
|
-
else
|
|
11
|
-
before_filter :flash_alert_and_redirect_home, only: [:redirect_home]
|
|
12
|
-
end
|
|
8
|
+
before_action :flash_alert_and_redirect_home, only: [:redirect_home]
|
|
13
9
|
|
|
14
10
|
def home
|
|
15
|
-
|
|
16
|
-
render plain: "ttl test"
|
|
17
|
-
else
|
|
18
|
-
render text: "ttl test"
|
|
19
|
-
end
|
|
11
|
+
render plain: "ttl test"
|
|
20
12
|
end
|
|
21
13
|
|
|
22
14
|
def redirect_home
|
|
@@ -2,13 +2,9 @@
|
|
|
2
2
|
<html>
|
|
3
3
|
<head>
|
|
4
4
|
<title>Dummy</title>
|
|
5
|
-
<%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
|
|
6
|
-
<%= javascript_include_tag "application", "data-turbolinks-track" => true %>
|
|
7
5
|
<%= csrf_meta_tags %>
|
|
8
6
|
</head>
|
|
9
7
|
<body>
|
|
10
|
-
|
|
11
|
-
<%= yield %>
|
|
12
|
-
|
|
8
|
+
<%= yield %>
|
|
13
9
|
</body>
|
|
14
10
|
</html>
|
|
@@ -1,30 +1,17 @@
|
|
|
1
1
|
require File.expand_path('../boot', __FILE__)
|
|
2
2
|
|
|
3
|
-
#
|
|
4
|
-
require "active_record/railtie"
|
|
3
|
+
# Only the frameworks the gem actually needs.
|
|
5
4
|
require "action_controller/railtie"
|
|
6
|
-
require "action_mailer/railtie"
|
|
7
|
-
require "sprockets/railtie"
|
|
8
|
-
# require "rails/test_unit/railtie"
|
|
9
5
|
|
|
10
6
|
Bundler.require(*Rails.groups)
|
|
11
7
|
require "frikandel"
|
|
12
8
|
|
|
13
9
|
module Dummy
|
|
14
|
-
RAILS_GEM_VERSION = Gem::Version.new(Rails::VERSION::STRING).freeze
|
|
15
|
-
|
|
16
10
|
class Application < Rails::Application
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
# -- all .rb files in that directory are automatically loaded.
|
|
20
|
-
|
|
21
|
-
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
|
22
|
-
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
|
23
|
-
# config.time_zone = 'Central Time (US & Canada)'
|
|
11
|
+
config.load_defaults "#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}"
|
|
12
|
+
config.eager_load = false
|
|
24
13
|
|
|
25
|
-
#
|
|
26
|
-
|
|
27
|
-
# config.i18n.default_locale = :de
|
|
14
|
+
# Static secret for the test suite only — not a real credential.
|
|
15
|
+
config.secret_key_base = "dummy_secret_key_base_for_the_frikandel_test_suite_only"
|
|
28
16
|
end
|
|
29
17
|
end
|
|
30
|
-
|
data/spec/dummy/config/boot.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Set up gems listed in the Gemfile.
|
|
2
2
|
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
|
|
3
3
|
|
|
4
|
-
require 'bundler/setup' if File.
|
|
4
|
+
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
|
|
5
5
|
$LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)
|
|
@@ -1,29 +1,9 @@
|
|
|
1
1
|
Dummy::Application.configure do
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
# In the development environment your application's code is reloaded on
|
|
5
|
-
# every request. This slows down response time but is perfect for development
|
|
6
|
-
# since you don't have to restart the web server when you make code changes.
|
|
7
|
-
config.cache_classes = false
|
|
8
|
-
|
|
9
|
-
# Do not eager load code on boot.
|
|
2
|
+
config.enable_reloading = true
|
|
10
3
|
config.eager_load = false
|
|
11
4
|
|
|
12
|
-
|
|
13
|
-
config.consider_all_requests_local = true
|
|
5
|
+
config.consider_all_requests_local = true
|
|
14
6
|
config.action_controller.perform_caching = false
|
|
15
7
|
|
|
16
|
-
# Don't care if the mailer can't send.
|
|
17
|
-
config.action_mailer.raise_delivery_errors = false
|
|
18
|
-
|
|
19
|
-
# Print deprecation notices to the Rails logger.
|
|
20
8
|
config.active_support.deprecation = :log
|
|
21
|
-
|
|
22
|
-
# Raise an error on page load if there are pending migrations
|
|
23
|
-
config.active_record.migration_error = :page_load
|
|
24
|
-
|
|
25
|
-
# Debug mode disables concatenation and preprocessing of assets.
|
|
26
|
-
# This option may cause significant delays in view rendering with a large
|
|
27
|
-
# number of complex assets.
|
|
28
|
-
config.assets.debug = true
|
|
29
9
|
end
|
|
@@ -1,80 +1,12 @@
|
|
|
1
1
|
Dummy::Application.configure do
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
# Code is not reloaded between requests.
|
|
5
|
-
config.cache_classes = true
|
|
6
|
-
|
|
7
|
-
# Eager load code on boot. This eager loads most of Rails and
|
|
8
|
-
# your application in memory, allowing both thread web servers
|
|
9
|
-
# and those relying on copy on write to perform better.
|
|
10
|
-
# Rake tasks automatically ignore this option for performance.
|
|
2
|
+
config.enable_reloading = false
|
|
11
3
|
config.eager_load = true
|
|
12
4
|
|
|
13
|
-
|
|
14
|
-
config.consider_all_requests_local = false
|
|
5
|
+
config.consider_all_requests_local = false
|
|
15
6
|
config.action_controller.perform_caching = true
|
|
16
7
|
|
|
17
|
-
|
|
18
|
-
# Add `rack-cache` to your Gemfile before enabling this.
|
|
19
|
-
# For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
|
|
20
|
-
# config.action_dispatch.rack_cache = true
|
|
21
|
-
|
|
22
|
-
# Disable Rails's static asset server (Apache or nginx will already do this).
|
|
23
|
-
config.serve_static_assets = false
|
|
24
|
-
|
|
25
|
-
# Compress JavaScripts and CSS.
|
|
26
|
-
config.assets.js_compressor = :uglifier
|
|
27
|
-
# config.assets.css_compressor = :sass
|
|
28
|
-
|
|
29
|
-
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
|
30
|
-
config.assets.compile = false
|
|
31
|
-
|
|
32
|
-
# Generate digests for assets URLs.
|
|
33
|
-
config.assets.digest = true
|
|
34
|
-
|
|
35
|
-
# Version of your assets, change this if you want to expire all your assets.
|
|
36
|
-
config.assets.version = '1.0'
|
|
37
|
-
|
|
38
|
-
# Specifies the header that your server uses for sending files.
|
|
39
|
-
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
|
|
40
|
-
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
|
|
41
|
-
|
|
42
|
-
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
|
43
|
-
# config.force_ssl = true
|
|
44
|
-
|
|
45
|
-
# Set to :debug to see everything in the log.
|
|
8
|
+
config.public_file_server.enabled = false
|
|
46
9
|
config.log_level = :info
|
|
47
|
-
|
|
48
|
-
# Prepend all log lines with the following tags.
|
|
49
|
-
# config.log_tags = [ :subdomain, :uuid ]
|
|
50
|
-
|
|
51
|
-
# Use a different logger for distributed setups.
|
|
52
|
-
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
|
53
|
-
|
|
54
|
-
# Use a different cache store in production.
|
|
55
|
-
# config.cache_store = :mem_cache_store
|
|
56
|
-
|
|
57
|
-
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
|
58
|
-
# config.action_controller.asset_host = "http://assets.example.com"
|
|
59
|
-
|
|
60
|
-
# Precompile additional assets.
|
|
61
|
-
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
|
|
62
|
-
# config.assets.precompile += %w( search.js )
|
|
63
|
-
|
|
64
|
-
# Ignore bad email addresses and do not raise email delivery errors.
|
|
65
|
-
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
|
66
|
-
# config.action_mailer.raise_delivery_errors = false
|
|
67
|
-
|
|
68
|
-
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
|
69
|
-
# the I18n.default_locale when a translation can not be found).
|
|
70
10
|
config.i18n.fallbacks = true
|
|
71
|
-
|
|
72
|
-
# Send deprecation notices to registered listeners.
|
|
73
11
|
config.active_support.deprecation = :notify
|
|
74
|
-
|
|
75
|
-
# Disable automatic flushing of the log to improve performance.
|
|
76
|
-
# config.autoflush_log = false
|
|
77
|
-
|
|
78
|
-
# Use default logging formatter so that PID and timestamp are not suppressed.
|
|
79
|
-
config.log_formatter = ::Logger::Formatter.new
|
|
80
12
|
end
|
|
@@ -1,41 +1,17 @@
|
|
|
1
1
|
Dummy::Application.configure do
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
# The test environment is used exclusively to run your application's
|
|
5
|
-
# test suite. You never need to work with it otherwise. Remember that
|
|
6
|
-
# your test database is "scratch space" for the test suite and is wiped
|
|
7
|
-
# and recreated between test runs. Don't rely on the data there!
|
|
8
|
-
config.cache_classes = true
|
|
9
|
-
|
|
10
|
-
# Do not eager load code on boot. This avoids loading your whole application
|
|
11
|
-
# just for the purpose of running a single test. If you are using a tool that
|
|
12
|
-
# preloads Rails for running tests, you may have to set it to true.
|
|
2
|
+
config.enable_reloading = false
|
|
13
3
|
config.eager_load = false
|
|
14
4
|
|
|
15
|
-
|
|
16
|
-
if Dummy::RAILS_GEM_VERSION < Gem::Version.new('5.0.0')
|
|
17
|
-
config.serve_static_assets = true
|
|
18
|
-
config.static_cache_control = "public, max-age=3600"
|
|
19
|
-
else
|
|
20
|
-
config.public_file_server.enabled = true
|
|
21
|
-
config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }
|
|
22
|
-
end
|
|
5
|
+
config.public_file_server.enabled = true
|
|
23
6
|
|
|
24
|
-
|
|
25
|
-
config.consider_all_requests_local = true
|
|
7
|
+
config.consider_all_requests_local = true
|
|
26
8
|
config.action_controller.perform_caching = false
|
|
27
9
|
|
|
28
10
|
# Raise exceptions instead of rendering exception templates.
|
|
29
|
-
config.action_dispatch.show_exceptions =
|
|
11
|
+
config.action_dispatch.show_exceptions = :none
|
|
30
12
|
|
|
31
13
|
# Disable request forgery protection in test environment.
|
|
32
14
|
config.action_controller.allow_forgery_protection = false
|
|
33
15
|
|
|
34
|
-
# Tell Action Mailer not to deliver emails to the real world.
|
|
35
|
-
# The :test delivery method accumulates sent emails in the
|
|
36
|
-
# ActionMailer::Base.deliveries array.
|
|
37
|
-
config.action_mailer.delivery_method = :test
|
|
38
|
-
|
|
39
|
-
# Print deprecation notices to the stderr.
|
|
40
16
|
config.active_support.deprecation = :stderr
|
|
41
17
|
end
|
data/spec/rails_helper.rb
CHANGED
|
@@ -1,74 +1,28 @@
|
|
|
1
|
-
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
|
2
1
|
ENV['RAILS_ENV'] ||= 'test'
|
|
3
2
|
require File.expand_path("../dummy/config/environment", __FILE__)
|
|
4
|
-
# Prevent
|
|
3
|
+
# Prevent accidental runs against production.
|
|
5
4
|
abort("The Rails environment is running in production mode!") if Rails.env.production?
|
|
6
5
|
require 'spec_helper'
|
|
7
6
|
require 'rspec/rails'
|
|
8
|
-
# Add additional requires below this line. Rails is not loaded until this point!
|
|
9
|
-
|
|
10
|
-
# Requires supporting ruby files with custom matchers and macros, etc, in
|
|
11
|
-
# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
|
|
12
|
-
# run as spec files by default. This means that files in spec/support that end
|
|
13
|
-
# in _spec.rb will both be required and run as specs, causing the specs to be
|
|
14
|
-
# run twice. It is recommended that you do not name files matching this glob to
|
|
15
|
-
# end with _spec.rb. You can configure this pattern with the --pattern
|
|
16
|
-
# option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
|
|
17
|
-
#
|
|
18
|
-
# The following line is provided for convenience purposes. It has the downside
|
|
19
|
-
# of increasing the boot-up time by auto-requiring all files in the support
|
|
20
|
-
# directory. Alternatively, in the individual `*_spec.rb` files, manually
|
|
21
|
-
# require only the support files necessary.
|
|
22
|
-
#
|
|
23
|
-
# Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }
|
|
24
|
-
|
|
25
|
-
if Dummy::RAILS_GEM_VERSION > Gem::Version.new('4.1.0')
|
|
26
|
-
# Checks for pending migration and applies them before tests are run.
|
|
27
|
-
# If you are not using ActiveRecord, you can remove this line.
|
|
28
|
-
ActiveRecord::Migration.maintain_test_schema!
|
|
29
|
-
end
|
|
30
7
|
|
|
31
8
|
RSpec.configure do |config|
|
|
32
|
-
#
|
|
33
|
-
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
|
34
|
-
|
|
35
|
-
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
|
36
|
-
# examples within a transaction, remove the following line or assign false
|
|
37
|
-
# instead of true.
|
|
38
|
-
config.use_transactional_fixtures = true
|
|
39
|
-
|
|
40
|
-
# RSpec Rails can automatically mix in different behaviours to your tests
|
|
41
|
-
# based on their file location, for example enabling you to call `get` and
|
|
42
|
-
# `post` in specs under `spec/controllers`.
|
|
43
|
-
#
|
|
44
|
-
# You can disable this behaviour by removing the line below, and instead
|
|
45
|
-
# explicitly tag your specs with their type, e.g.:
|
|
46
|
-
#
|
|
47
|
-
# RSpec.describe UsersController, :type => :controller do
|
|
48
|
-
# # ...
|
|
49
|
-
# end
|
|
50
|
-
#
|
|
51
|
-
# The different available types are documented in the features, such as in
|
|
52
|
-
# https://relishapp.com/rspec/rspec-rails/docs
|
|
9
|
+
# Enables `get`/`post` etc. in specs under spec/controllers.
|
|
53
10
|
config.infer_spec_type_from_file_location!
|
|
54
11
|
|
|
55
12
|
# Filter lines from Rails gems in backtraces.
|
|
56
13
|
config.filter_rails_from_backtrace!
|
|
57
|
-
# arbitrary gems may also be filtered via:
|
|
58
|
-
# config.filter_gems_from_backtrace("gem name")
|
|
59
14
|
end
|
|
60
15
|
|
|
61
|
-
|
|
62
16
|
# some helper methods
|
|
63
17
|
|
|
64
18
|
def simulate_redirect!(from_action, to_action)
|
|
65
19
|
get from_action.intern
|
|
66
|
-
from_flash = request.flash
|
|
20
|
+
from_flash = request.flash
|
|
67
21
|
|
|
68
22
|
controller.instance_variable_set(:@_frikandel_did_reset_session, nil) # reset state for redirect request
|
|
69
23
|
|
|
70
24
|
get to_action.intern
|
|
71
|
-
request.flash.update(from_flash.to_hash)
|
|
25
|
+
request.flash.update(from_flash.to_hash)
|
|
72
26
|
end
|
|
73
27
|
|
|
74
28
|
def flash
|
|
@@ -14,11 +14,6 @@ class ApplicationController < ActionController::Base
|
|
|
14
14
|
protect_from_forgery with: :exception
|
|
15
15
|
|
|
16
16
|
def home
|
|
17
|
-
|
|
18
|
-
if Rails::VERSION::MAJOR >= 5
|
|
19
|
-
render plain: "testing"
|
|
20
|
-
else
|
|
21
|
-
render text: "testing"
|
|
22
|
-
end
|
|
17
|
+
render plain: "testing"
|
|
23
18
|
end
|
|
24
19
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: frikandel
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 4.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Taktsoft
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: bundler
|
|
@@ -38,20 +37,6 @@ dependencies:
|
|
|
38
37
|
- - ">="
|
|
39
38
|
- !ruby/object:Gem::Version
|
|
40
39
|
version: '0'
|
|
41
|
-
- !ruby/object:Gem::Dependency
|
|
42
|
-
name: sqlite3
|
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
|
44
|
-
requirements:
|
|
45
|
-
- - ">="
|
|
46
|
-
- !ruby/object:Gem::Version
|
|
47
|
-
version: '0'
|
|
48
|
-
type: :development
|
|
49
|
-
prerelease: false
|
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
-
requirements:
|
|
52
|
-
- - ">="
|
|
53
|
-
- !ruby/object:Gem::Version
|
|
54
|
-
version: '0'
|
|
55
40
|
- !ruby/object:Gem::Dependency
|
|
56
41
|
name: rspec-rails
|
|
57
42
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -67,7 +52,7 @@ dependencies:
|
|
|
67
52
|
- !ruby/object:Gem::Version
|
|
68
53
|
version: '3.0'
|
|
69
54
|
- !ruby/object:Gem::Dependency
|
|
70
|
-
name:
|
|
55
|
+
name: appraisal
|
|
71
56
|
requirement: !ruby/object:Gem::Requirement
|
|
72
57
|
requirements:
|
|
73
58
|
- - ">="
|
|
@@ -94,40 +79,20 @@ dependencies:
|
|
|
94
79
|
- - ">="
|
|
95
80
|
- !ruby/object:Gem::Version
|
|
96
81
|
version: '0'
|
|
97
|
-
- !ruby/object:Gem::Dependency
|
|
98
|
-
name: test-unit
|
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
|
100
|
-
requirements:
|
|
101
|
-
- - ">="
|
|
102
|
-
- !ruby/object:Gem::Version
|
|
103
|
-
version: '0'
|
|
104
|
-
type: :development
|
|
105
|
-
prerelease: false
|
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
107
|
-
requirements:
|
|
108
|
-
- - ">="
|
|
109
|
-
- !ruby/object:Gem::Version
|
|
110
|
-
version: '0'
|
|
111
82
|
- !ruby/object:Gem::Dependency
|
|
112
83
|
name: rails
|
|
113
84
|
requirement: !ruby/object:Gem::Requirement
|
|
114
85
|
requirements:
|
|
115
86
|
- - ">="
|
|
116
87
|
- !ruby/object:Gem::Version
|
|
117
|
-
version:
|
|
118
|
-
- - "<"
|
|
119
|
-
- !ruby/object:Gem::Version
|
|
120
|
-
version: 8.0.0
|
|
88
|
+
version: '7.2'
|
|
121
89
|
type: :runtime
|
|
122
90
|
prerelease: false
|
|
123
91
|
version_requirements: !ruby/object:Gem::Requirement
|
|
124
92
|
requirements:
|
|
125
93
|
- - ">="
|
|
126
94
|
- !ruby/object:Gem::Version
|
|
127
|
-
version:
|
|
128
|
-
- - "<"
|
|
129
|
-
- !ruby/object:Gem::Version
|
|
130
|
-
version: 8.0.0
|
|
95
|
+
version: '7.2'
|
|
131
96
|
description: This gem adds a ttl to the session cookie of your application.
|
|
132
97
|
email:
|
|
133
98
|
- developers@taktsoft.com
|
|
@@ -135,20 +100,23 @@ executables: []
|
|
|
135
100
|
extensions: []
|
|
136
101
|
extra_rdoc_files: []
|
|
137
102
|
files:
|
|
103
|
+
- ".devcontainer/Dockerfile"
|
|
104
|
+
- ".devcontainer/base.Dockerfile"
|
|
105
|
+
- ".devcontainer/devcontainer.json"
|
|
138
106
|
- ".github/workflows/ci.yml"
|
|
139
107
|
- ".gitignore"
|
|
140
108
|
- ".rspec"
|
|
109
|
+
- Appraisals
|
|
141
110
|
- Gemfile
|
|
142
111
|
- Guardfile
|
|
143
112
|
- LICENSE.txt
|
|
144
113
|
- README.md
|
|
145
114
|
- Rakefile
|
|
146
115
|
- frikandel.gemspec
|
|
147
|
-
- gemfiles/
|
|
148
|
-
- gemfiles/
|
|
149
|
-
- gemfiles/
|
|
150
|
-
- gemfiles/
|
|
151
|
-
- gemfiles/rails-head.gemfile
|
|
116
|
+
- gemfiles/rails_7.2.gemfile
|
|
117
|
+
- gemfiles/rails_8.0.gemfile
|
|
118
|
+
- gemfiles/rails_8.1.gemfile
|
|
119
|
+
- gemfiles/rails_head.gemfile
|
|
152
120
|
- lib/frikandel.rb
|
|
153
121
|
- lib/frikandel/bind_session_to_ip_address.rb
|
|
154
122
|
- lib/frikandel/configuration.rb
|
|
@@ -159,18 +127,10 @@ files:
|
|
|
159
127
|
- spec/controllers/combined_controller_spec.rb
|
|
160
128
|
- spec/controllers/customized_on_invalid_session_controller_spec.rb
|
|
161
129
|
- spec/controllers/limit_session_lifetime_controller_spec.rb
|
|
162
|
-
- spec/dummy/README.rdoc
|
|
163
130
|
- spec/dummy/Rakefile
|
|
164
|
-
- spec/dummy/app/assets/config/manifest.js
|
|
165
|
-
- spec/dummy/app/assets/images/.keep
|
|
166
|
-
- spec/dummy/app/assets/javascripts/application.js
|
|
167
|
-
- spec/dummy/app/assets/stylesheets/application.css
|
|
168
131
|
- spec/dummy/app/controllers/application_controller.rb
|
|
169
132
|
- spec/dummy/app/controllers/concerns/.keep
|
|
170
133
|
- spec/dummy/app/helpers/application_helper.rb
|
|
171
|
-
- spec/dummy/app/mailers/.keep
|
|
172
|
-
- spec/dummy/app/models/.keep
|
|
173
|
-
- spec/dummy/app/models/concerns/.keep
|
|
174
134
|
- spec/dummy/app/views/layouts/application.html.erb
|
|
175
135
|
- spec/dummy/bin/bundle
|
|
176
136
|
- spec/dummy/bin/rails
|
|
@@ -178,7 +138,6 @@ files:
|
|
|
178
138
|
- spec/dummy/config.ru
|
|
179
139
|
- spec/dummy/config/application.rb
|
|
180
140
|
- spec/dummy/config/boot.rb
|
|
181
|
-
- spec/dummy/config/database.yml
|
|
182
141
|
- spec/dummy/config/environment.rb
|
|
183
142
|
- spec/dummy/config/environments/development.rb
|
|
184
143
|
- spec/dummy/config/environments/production.rb
|
|
@@ -187,12 +146,9 @@ files:
|
|
|
187
146
|
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
|
188
147
|
- spec/dummy/config/initializers/inflections.rb
|
|
189
148
|
- spec/dummy/config/initializers/mime_types.rb
|
|
190
|
-
- spec/dummy/config/initializers/secret_token.rb
|
|
191
149
|
- spec/dummy/config/initializers/session_store.rb
|
|
192
|
-
- spec/dummy/config/initializers/wrap_parameters.rb
|
|
193
150
|
- spec/dummy/config/locales/en.yml
|
|
194
151
|
- spec/dummy/config/routes.rb
|
|
195
|
-
- spec/dummy/lib/assets/.keep
|
|
196
152
|
- spec/dummy/public/404.html
|
|
197
153
|
- spec/dummy/public/422.html
|
|
198
154
|
- spec/dummy/public/500.html
|
|
@@ -204,8 +160,8 @@ files:
|
|
|
204
160
|
homepage: https://github.com/taktsoft/frikandel
|
|
205
161
|
licenses:
|
|
206
162
|
- MIT
|
|
207
|
-
metadata:
|
|
208
|
-
|
|
163
|
+
metadata:
|
|
164
|
+
rubygems_mfa_required: 'true'
|
|
209
165
|
rdoc_options: []
|
|
210
166
|
require_paths:
|
|
211
167
|
- lib
|
|
@@ -213,55 +169,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
213
169
|
requirements:
|
|
214
170
|
- - ">="
|
|
215
171
|
- !ruby/object:Gem::Version
|
|
216
|
-
version:
|
|
172
|
+
version: '3.2'
|
|
217
173
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
218
174
|
requirements:
|
|
219
175
|
- - ">="
|
|
220
176
|
- !ruby/object:Gem::Version
|
|
221
|
-
version:
|
|
177
|
+
version: '0'
|
|
222
178
|
requirements: []
|
|
223
|
-
rubygems_version:
|
|
224
|
-
signing_key:
|
|
179
|
+
rubygems_version: 4.0.13
|
|
225
180
|
specification_version: 4
|
|
226
181
|
summary: This gem adds a ttl to the session cookie of your application.
|
|
227
|
-
test_files:
|
|
228
|
-
- spec/controllers/bind_session_to_ip_address_controller_spec.rb
|
|
229
|
-
- spec/controllers/combined_controller_spec.rb
|
|
230
|
-
- spec/controllers/customized_on_invalid_session_controller_spec.rb
|
|
231
|
-
- spec/controllers/limit_session_lifetime_controller_spec.rb
|
|
232
|
-
- spec/dummy/README.rdoc
|
|
233
|
-
- spec/dummy/Rakefile
|
|
234
|
-
- spec/dummy/app/assets/config/manifest.js
|
|
235
|
-
- spec/dummy/app/assets/javascripts/application.js
|
|
236
|
-
- spec/dummy/app/assets/stylesheets/application.css
|
|
237
|
-
- spec/dummy/app/controllers/application_controller.rb
|
|
238
|
-
- spec/dummy/app/helpers/application_helper.rb
|
|
239
|
-
- spec/dummy/app/views/layouts/application.html.erb
|
|
240
|
-
- spec/dummy/bin/bundle
|
|
241
|
-
- spec/dummy/bin/rails
|
|
242
|
-
- spec/dummy/bin/rake
|
|
243
|
-
- spec/dummy/config/application.rb
|
|
244
|
-
- spec/dummy/config/boot.rb
|
|
245
|
-
- spec/dummy/config/database.yml
|
|
246
|
-
- spec/dummy/config/environment.rb
|
|
247
|
-
- spec/dummy/config/environments/development.rb
|
|
248
|
-
- spec/dummy/config/environments/production.rb
|
|
249
|
-
- spec/dummy/config/environments/test.rb
|
|
250
|
-
- spec/dummy/config/initializers/backtrace_silencers.rb
|
|
251
|
-
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
|
252
|
-
- spec/dummy/config/initializers/inflections.rb
|
|
253
|
-
- spec/dummy/config/initializers/mime_types.rb
|
|
254
|
-
- spec/dummy/config/initializers/secret_token.rb
|
|
255
|
-
- spec/dummy/config/initializers/session_store.rb
|
|
256
|
-
- spec/dummy/config/initializers/wrap_parameters.rb
|
|
257
|
-
- spec/dummy/config/locales/en.yml
|
|
258
|
-
- spec/dummy/config/routes.rb
|
|
259
|
-
- spec/dummy/config.ru
|
|
260
|
-
- spec/dummy/public/404.html
|
|
261
|
-
- spec/dummy/public/422.html
|
|
262
|
-
- spec/dummy/public/500.html
|
|
263
|
-
- spec/dummy/public/favicon.ico
|
|
264
|
-
- spec/lib/frikandel/configuration_spec.rb
|
|
265
|
-
- spec/rails_helper.rb
|
|
266
|
-
- spec/spec_helper.rb
|
|
267
|
-
- spec/support/application_controller.rb
|
|
182
|
+
test_files: []
|
data/gemfiles/rails-head.gemfile
DELETED
data/spec/dummy/README.rdoc
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
== README
|
|
2
|
-
|
|
3
|
-
This README would normally document whatever steps are necessary to get the
|
|
4
|
-
application up and running.
|
|
5
|
-
|
|
6
|
-
Things you may want to cover:
|
|
7
|
-
|
|
8
|
-
* Ruby version
|
|
9
|
-
|
|
10
|
-
* System dependencies
|
|
11
|
-
|
|
12
|
-
* Configuration
|
|
13
|
-
|
|
14
|
-
* Database creation
|
|
15
|
-
|
|
16
|
-
* Database initialization
|
|
17
|
-
|
|
18
|
-
* How to run the test suite
|
|
19
|
-
|
|
20
|
-
* Services (job queues, cache servers, search engines, etc.)
|
|
21
|
-
|
|
22
|
-
* Deployment instructions
|
|
23
|
-
|
|
24
|
-
* ...
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
Please feel free to use a different markup language if you do not plan to run
|
|
28
|
-
<tt>rake doc:app</tt>.
|
|
File without changes
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
|
2
|
-
// listed below.
|
|
3
|
-
//
|
|
4
|
-
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
|
5
|
-
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
|
|
6
|
-
//
|
|
7
|
-
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
|
8
|
-
// compiled file.
|
|
9
|
-
//
|
|
10
|
-
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
|
|
11
|
-
// about supported directives.
|
|
12
|
-
//
|
|
13
|
-
//= require_tree .
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
|
3
|
-
* listed below.
|
|
4
|
-
*
|
|
5
|
-
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
|
6
|
-
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
|
|
7
|
-
*
|
|
8
|
-
* You're free to add application-wide styles to this file and they'll appear at the top of the
|
|
9
|
-
* compiled file, but it's generally better to create a new file per style scope.
|
|
10
|
-
*
|
|
11
|
-
*= require_self
|
|
12
|
-
*= require_tree .
|
|
13
|
-
*/
|
|
File without changes
|
data/spec/dummy/app/models/.keep
DELETED
|
File without changes
|
|
File without changes
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
# SQLite version 3.x
|
|
2
|
-
# gem install sqlite3
|
|
3
|
-
#
|
|
4
|
-
# Ensure the SQLite 3 gem is defined in your Gemfile
|
|
5
|
-
# gem 'sqlite3'
|
|
6
|
-
development:
|
|
7
|
-
adapter: sqlite3
|
|
8
|
-
database: ":memory:"
|
|
9
|
-
pool: 5
|
|
10
|
-
timeout: 500
|
|
11
|
-
|
|
12
|
-
# Warning: The database defined as "test" will be erased and
|
|
13
|
-
# re-generated from your development database when you run "rake".
|
|
14
|
-
# Do not set this db to the same as development or production.
|
|
15
|
-
test:
|
|
16
|
-
adapter: sqlite3
|
|
17
|
-
database: ":memory:"
|
|
18
|
-
pool: 5
|
|
19
|
-
timeout: 500
|
|
20
|
-
|
|
21
|
-
production:
|
|
22
|
-
adapter: sqlite3
|
|
23
|
-
database: ":memory:"
|
|
24
|
-
pool: 5
|
|
25
|
-
timeout: 500
|
|
@@ -1,12 +0,0 @@
|
|
|
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 `rake secret` to generate a secure secret key.
|
|
9
|
-
|
|
10
|
-
# Make sure your secret_key_base is kept private
|
|
11
|
-
# if you're sharing your code publicly.
|
|
12
|
-
Dummy::Application.config.secret_key_base = '9dadb5f0335f36f1c260d254f5ed7e269356cf63259401ae6be57cc34e22216ecb3ebb0fa819d05268fa5c4c91943a8a8186d2802603b72cda5461f33cc1b990'
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
|
2
|
-
|
|
3
|
-
# This file contains settings for ActionController::ParamsWrapper which
|
|
4
|
-
# is enabled by default.
|
|
5
|
-
|
|
6
|
-
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
|
7
|
-
ActiveSupport.on_load(:action_controller) do
|
|
8
|
-
wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
# To enable root element in JSON for ActiveRecord objects.
|
|
12
|
-
# ActiveSupport.on_load(:active_record) do
|
|
13
|
-
# self.include_root_in_json = true
|
|
14
|
-
# end
|
data/spec/dummy/lib/assets/.keep
DELETED
|
File without changes
|