global_session 3.2.10 → 3.3.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/global_session.gemspec +21 -86
- data/lib/global_session.rb +12 -7
- data/lib/global_session/directory.rb +8 -6
- data/lib/global_session/keystore.rb +28 -6
- data/lib/global_session/rack.rb +1 -1
- data/lib/global_session/session.rb +11 -6
- data/lib/global_session/session/abstract.rb +123 -4
- data/lib/global_session/session/v1.rb +6 -14
- data/lib/global_session/session/v2.rb +9 -17
- data/lib/global_session/session/v3.rb +11 -137
- data/lib/global_session/session/v4.rb +140 -0
- data/lib/global_session/version.rb +3 -0
- metadata +18 -91
- data/.ruby-version +0 -1
- data/.travis.yml +0 -11
- data/CHANGELOG.md +0 -94
- data/LICENSE +0 -20
- data/README.rdoc +0 -298
- data/Rakefile +0 -48
- data/VERSION +0 -1
- data/init.rb +0 -4
- data/rails/init.rb +0 -23
- data/rails_generators/global_session/USAGE +0 -1
- data/rails_generators/global_session/global_session_generator.rb +0 -51
- data/rails_generators/global_session/templates/global_session.yml.erb +0 -41
- data/rails_generators/global_session_authority/USAGE +0 -1
- data/rails_generators/global_session_authority/global_session_authority_generator.rb +0 -53
data/Rakefile
DELETED
@@ -1,48 +0,0 @@
|
|
1
|
-
# -*-ruby-*-
|
2
|
-
require 'rubygems'
|
3
|
-
require 'rake'
|
4
|
-
require 'right_develop'
|
5
|
-
require 'right_support'
|
6
|
-
require 'spec/rake/spectask'
|
7
|
-
require 'rubygems/package_task'
|
8
|
-
require 'rake/clean'
|
9
|
-
require 'cucumber/rake/task'
|
10
|
-
|
11
|
-
task :default => [:spec, :cucumber]
|
12
|
-
|
13
|
-
desc "Run unit tests"
|
14
|
-
Spec::Rake::SpecTask.new do |t|
|
15
|
-
t.spec_files = Dir['**/*_spec.rb']
|
16
|
-
t.spec_opts = lambda do
|
17
|
-
IO.readlines(File.join(File.dirname(__FILE__), 'spec', 'spec.opts')).map {|l| l.chomp.split " "}.flatten
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
desc "Run functional tests"
|
22
|
-
Cucumber::Rake::Task.new do |t|
|
23
|
-
t.cucumber_opts = %w{--tags ~@slow --color --format pretty}
|
24
|
-
end
|
25
|
-
|
26
|
-
if require_succeeds? 'jeweler'
|
27
|
-
Jeweler::Tasks.new do |gem|
|
28
|
-
# gem is a Gem::Specification; see http://docs.rubygems.org/read/chapter/20 for more options
|
29
|
-
gem.name = "global_session"
|
30
|
-
gem.homepage = "https://github.com/rightscale/global_session"
|
31
|
-
gem.license = "MIT"
|
32
|
-
gem.summary = %Q{Secure single-domain session sharing plugin for Rack and Rails.}
|
33
|
-
gem.description = %Q{This Rack middleware allows several web apps in an authentication domain to share session state, facilitating single sign-on in a distributed web app. It only provides session sharing and does not concern itself with authentication or replication of the user database.}
|
34
|
-
gem.email = "support@rightscale.com"
|
35
|
-
gem.authors = ['Tony Spataro']
|
36
|
-
gem.required_ruby_version = '~> 2.0'
|
37
|
-
gem.files.exclude 'Gemfile*'
|
38
|
-
gem.files.exclude 'features/**/*'
|
39
|
-
gem.files.exclude 'fixtures/**/*'
|
40
|
-
gem.files.exclude 'features/**/*'
|
41
|
-
gem.files.exclude 'spec/**/*'
|
42
|
-
end
|
43
|
-
Jeweler::RubygemsDotOrgTasks.new
|
44
|
-
end
|
45
|
-
|
46
|
-
CLEAN.include('pkg')
|
47
|
-
|
48
|
-
RightDevelop::CI::RakeTask.new
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
3.2.10
|
data/init.rb
DELETED
data/rails/init.rb
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
# Copyright (c) 2012 RightScale Inc
|
2
|
-
#
|
3
|
-
# Permission is hereby granted, free of charge, to any person obtaining
|
4
|
-
# a copy of this software and associated documentation files (the
|
5
|
-
# "Software"), to deal in the Software without restriction, including
|
6
|
-
# without limitation the rights to use, copy, modify, merge, publish,
|
7
|
-
# distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
-
# permit persons to whom the Software is furnished to do so, subject to
|
9
|
-
# the following conditions:
|
10
|
-
#
|
11
|
-
# The above copyright notice and this permission notice shall be
|
12
|
-
# included in all copies or substantial portions of the Software.
|
13
|
-
#
|
14
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
-
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
-
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
-
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
-
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
-
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
-
|
22
|
-
require 'global_session'
|
23
|
-
require 'global_session/rails'
|
@@ -1 +0,0 @@
|
|
1
|
-
./script/generate global_session config <DNS domain for production cookie>
|
@@ -1,51 +0,0 @@
|
|
1
|
-
# Copyright (c) 2012 RightScale Inc
|
2
|
-
#
|
3
|
-
# Permission is hereby granted, free of charge, to any person obtaining
|
4
|
-
# a copy of this software and associated documentation files (the
|
5
|
-
# "Software"), to deal in the Software without restriction, including
|
6
|
-
# without limitation the rights to use, copy, modify, merge, publish,
|
7
|
-
# distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
-
# permit persons to whom the Software is furnished to do so, subject to
|
9
|
-
# the following conditions:
|
10
|
-
#
|
11
|
-
# The above copyright notice and this permission notice shall be
|
12
|
-
# included in all copies or substantial portions of the Software.
|
13
|
-
#
|
14
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
-
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
-
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
-
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
-
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
-
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
-
|
22
|
-
class GlobalSessionGenerator < Rails::Generator::Base
|
23
|
-
def initialize(runtime_args, runtime_options = {})
|
24
|
-
super
|
25
|
-
|
26
|
-
@app_name = File.basename(::Rails.root)
|
27
|
-
@app_domain = args.shift
|
28
|
-
raise ArgumentError, "Must specify DNS domain for global session cookie, e.g. 'example.com'" unless @app_domain
|
29
|
-
end
|
30
|
-
|
31
|
-
def manifest
|
32
|
-
record do |m|
|
33
|
-
|
34
|
-
m.template 'global_session.yml.erb',
|
35
|
-
'config/global_session.yml',
|
36
|
-
:assigns=>{:app_name=>@app_name,
|
37
|
-
:app_domain=>@app_domain}
|
38
|
-
|
39
|
-
puts "*** IMPORTANT - WORK IS REQUIRED ***"
|
40
|
-
puts "In order to make use of the global session, you will need to ensure that it"
|
41
|
-
puts "is installed to the Rack middleware stack. You can do so by adding an extra"
|
42
|
-
puts "line in your environment.rb inside the Rails initializer block, like so:"
|
43
|
-
puts
|
44
|
-
puts " Rails::Initializer.run do |config|"
|
45
|
-
puts "ADD>> require 'global_session'"
|
46
|
-
puts "ADD>> GlobalSession::Rails.activate(config)"
|
47
|
-
puts " end"
|
48
|
-
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
@@ -1,41 +0,0 @@
|
|
1
|
-
# Common attributes.
|
2
|
-
# May be overidden by per-environment settings; see below
|
3
|
-
common:
|
4
|
-
attributes:
|
5
|
-
signed: # integrity-protected attributes
|
6
|
-
- user
|
7
|
-
insecure: # Insecure (unsigned) attributes
|
8
|
-
- account
|
9
|
-
ephemeral: true # Ephemeral cookies go away when the browser closes
|
10
|
-
|
11
|
-
# Test/spec runs
|
12
|
-
test:
|
13
|
-
timeout: 15 #minutes
|
14
|
-
renew: 5 #minutes before expiration
|
15
|
-
cookie:
|
16
|
-
name: global_session
|
17
|
-
authority: test # the name of the local authority (optional)
|
18
|
-
trust: #which authorities this app will trust
|
19
|
-
- test
|
20
|
-
|
21
|
-
# Development mode
|
22
|
-
development:
|
23
|
-
timeout: 60
|
24
|
-
renew: 15
|
25
|
-
cookie:
|
26
|
-
name: global_session
|
27
|
-
authority: development
|
28
|
-
trust:
|
29
|
-
- development
|
30
|
-
- production
|
31
|
-
|
32
|
-
# Production mode
|
33
|
-
production:
|
34
|
-
timeout: 60
|
35
|
-
renew: 15
|
36
|
-
cookie:
|
37
|
-
name: global_session
|
38
|
-
domain: <%= app_domain %>
|
39
|
-
authority: production
|
40
|
-
trust:
|
41
|
-
- production
|
@@ -1 +0,0 @@
|
|
1
|
-
./script/generate global_session authority <name of authority>
|
@@ -1,53 +0,0 @@
|
|
1
|
-
# Copyright (c) 2012 RightScale Inc
|
2
|
-
#
|
3
|
-
# Permission is hereby granted, free of charge, to any person obtaining
|
4
|
-
# a copy of this software and associated documentation files (the
|
5
|
-
# "Software"), to deal in the Software without restriction, including
|
6
|
-
# without limitation the rights to use, copy, modify, merge, publish,
|
7
|
-
# distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
-
# permit persons to whom the Software is furnished to do so, subject to
|
9
|
-
# the following conditions:
|
10
|
-
#
|
11
|
-
# The above copyright notice and this permission notice shall be
|
12
|
-
# included in all copies or substantial portions of the Software.
|
13
|
-
#
|
14
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
-
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
-
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
-
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
-
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
-
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
-
|
22
|
-
class GlobalSessionAuthorityGenerator < Rails::Generator::Base
|
23
|
-
def initialize(runtime_args, runtime_options = {})
|
24
|
-
super
|
25
|
-
|
26
|
-
@app_name = File.basename(::Rails.root)
|
27
|
-
@auth_name = args.shift
|
28
|
-
raise ArgumentError, "Must specify name for global session authority, e.g. 'prod'" unless @auth_name
|
29
|
-
end
|
30
|
-
|
31
|
-
def manifest
|
32
|
-
record do |m|
|
33
|
-
new_key = GlobalSession::Keystore.create_keypair(:RSA, 1024)
|
34
|
-
new_public = new_key.public_key.to_pem
|
35
|
-
new_private = new_key.to_pem
|
36
|
-
|
37
|
-
dest_dir = File.join(::Rails.root, 'config', 'authorities')
|
38
|
-
FileUtils.mkdir_p(dest_dir)
|
39
|
-
|
40
|
-
File.open(File.join(dest_dir, @auth_name + ".pub"), 'w') do |f|
|
41
|
-
f.puts new_public
|
42
|
-
end
|
43
|
-
|
44
|
-
File.open(File.join(dest_dir, @auth_name + ".key"), 'w') do |f|
|
45
|
-
f.puts new_private
|
46
|
-
end
|
47
|
-
|
48
|
-
puts "***"
|
49
|
-
puts "*** Don't forget to delete config/authorities/#{@auth_name}.key"
|
50
|
-
puts "***"
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|