global_session 3.2.3 → 3.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 963d6cb25a64471b784029c872d54b566e3294c4
4
- data.tar.gz: 72ff692d9f0c2006617916f278c3b9a8f9c51733
3
+ metadata.gz: c7e181a406367d55cef38b2965dcfaa5d7f5a601
4
+ data.tar.gz: aded36bd963545b5930fdec586cf1ebf1824c1ac
5
5
  SHA512:
6
- metadata.gz: 605c83e83fc60a9de1376f82473ef4da7d4e167c8532ef1701a04b9bf512b309e6182da581ae97ab21f092e7251c883fb954a33f1d34934e63c9ff79d9626af5
7
- data.tar.gz: eba30a2fe91159f20bf00a9eb4cbb45aa7a7d70aeac5bd0f426f66cbaae7998efac96de2ecd0daf4b7e92a3a87be95de0cd2fa89c2858295134cd3e26ad45f66
6
+ metadata.gz: 24a37d9464766407ad1150318c1cfc1e6c1fefd09023fb4c9433fda7ab68ba9f59ef10dd71f5fd23815cef17b0927ca4c913083c562039735e2ed9bd03eedf88
7
+ data.tar.gz: d33635ee36886e29d4422a0a3a1e48e5caf4977b08c10e7023b7de55815f87c06d7fb62a9bc92e9543879b2937e143ab2b5e3c700fdd4916cbd9d4990f252e1d
data/.travis.yml CHANGED
@@ -2,7 +2,10 @@ language: ruby
2
2
  cache: bundler
3
3
  rvm:
4
4
  - 1.8.7
5
- - 2.1
5
+ - 2.1.8
6
+ before_install:
7
+ - sudo apt-get -qq update
8
+ - sudo apt-get install -y libgmp3-dev
6
9
  script:
7
10
  - bundle exec rake ci:spec
8
11
  bundler_args: --without development
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.2.3
1
+ 3.2.4
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: global_session 3.2.3 ruby lib
5
+ # stub: global_session 3.2.4 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "global_session"
9
- s.version = "3.2.3"
9
+ s.version = "3.2.4"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Tony Spataro"]
14
- s.date = "2015-12-07"
14
+ s.date = "2016-02-05"
15
15
  s.description = "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."
16
16
  s.email = "support@rightscale.com"
17
17
  s.extra_rdoc_files = [
@@ -107,6 +107,32 @@ module GlobalSession::Session
107
107
  result
108
108
  end
109
109
 
110
+ # Delete a key from the global session attributes. If the key exists,
111
+ # mark the global session dirty
112
+ #
113
+ # @param [String] the key to delete
114
+ # @return [Object] the value of the key deleted, or nil if not found
115
+ def delete(key)
116
+ key = key.to_s #take care of symbol-style keys
117
+ raise GlobalSession::InvalidSession unless valid?
118
+
119
+ if @schema_signed.include?(key)
120
+ authority_check
121
+
122
+ # Only mark dirty if the key actually exists
123
+ @dirty_secure = true if @signed.keys.include? key
124
+ value = @signed.delete(key)
125
+ elsif @schema_insecure.include?(key)
126
+
127
+ # Only mark dirty if the key actually exists
128
+ @dirty_insecure = true if @insecure.keys.include? key
129
+ value = @insecure.delete(key)
130
+ else
131
+ raise ArgumentError, "Attribute '#{key}' is not specified in global session configuration"
132
+ end
133
+
134
+ return value
135
+ end
110
136
 
111
137
  # Serialize the session to a form suitable for use with HTTP cookies. If any
112
138
  # secure attributes have changed since the session was instantiated, compute
@@ -248,6 +274,16 @@ module GlobalSession::Session
248
274
 
249
275
  private
250
276
 
277
+ # This is called by #clone and is used to augment the shallow clone behavior
278
+ #
279
+ # @return [Object] this global session object which doesn't reference the
280
+ # the hashes from the original object
281
+ def initialize_copy(source)
282
+ super
283
+ @signed = ::RightSupport::Data::HashTools.deep_clone2(@signed)
284
+ @insecure = ::RightSupport::Data::HashTools.deep_clone2(@insecure)
285
+ end
286
+
251
287
  def load_from_cookie(cookie) # :nodoc:
252
288
  hash = nil
253
289
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: global_session
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.3
4
+ version: 3.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tony Spataro
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-07 00:00:00.000000000 Z
11
+ date: 2016-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json