rubysl-cgi-session 2.0.1 → 2.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 +4 -4
- data/.travis.yml +2 -2
- data/MRI_LICENSE +56 -0
- data/lib/rubysl/cgi/session/session.rb +15 -13
- data/lib/rubysl/cgi/session/version.rb +1 -1
- metadata +12 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26ddaaae4f815c0c26d3bc998c30839fe7e8ffca
|
4
|
+
data.tar.gz: 66fcf294aae7f3bed56b6def187313004648279c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6cf43c1c58ca67750542b2a077d6a235aa7f36135c95ca65a04611086864369445916c3805e0c61e806ec55bc0d7e7ae93bbb705c2abe03e6e5c6b4b40c4c09
|
7
|
+
data.tar.gz: 2c0ca9519a3080c8d6e7be6e830266b03bd8df1abfc895dfc0553b17bda550daadf27233517f15199b42f447d64b1a794db0d879d672ebbad9615fa70dda2c01
|
data/.travis.yml
CHANGED
data/MRI_LICENSE
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.jp>.
|
2
|
+
You can redistribute it and/or modify it under either the terms of the
|
3
|
+
2-clause BSDL (see the file BSDL), or the conditions below:
|
4
|
+
|
5
|
+
1. You may make and give away verbatim copies of the source form of the
|
6
|
+
software without restriction, provided that you duplicate all of the
|
7
|
+
original copyright notices and associated disclaimers.
|
8
|
+
|
9
|
+
2. You may modify your copy of the software in any way, provided that
|
10
|
+
you do at least ONE of the following:
|
11
|
+
|
12
|
+
a) place your modifications in the Public Domain or otherwise
|
13
|
+
make them Freely Available, such as by posting said
|
14
|
+
modifications to Usenet or an equivalent medium, or by allowing
|
15
|
+
the author to include your modifications in the software.
|
16
|
+
|
17
|
+
b) use the modified software only within your corporation or
|
18
|
+
organization.
|
19
|
+
|
20
|
+
c) give non-standard binaries non-standard names, with
|
21
|
+
instructions on where to get the original software distribution.
|
22
|
+
|
23
|
+
d) make other distribution arrangements with the author.
|
24
|
+
|
25
|
+
3. You may distribute the software in object code or binary form,
|
26
|
+
provided that you do at least ONE of the following:
|
27
|
+
|
28
|
+
a) distribute the binaries and library files of the software,
|
29
|
+
together with instructions (in the manual page or equivalent)
|
30
|
+
on where to get the original distribution.
|
31
|
+
|
32
|
+
b) accompany the distribution with the machine-readable source of
|
33
|
+
the software.
|
34
|
+
|
35
|
+
c) give non-standard binaries non-standard names, with
|
36
|
+
instructions on where to get the original software distribution.
|
37
|
+
|
38
|
+
d) make other distribution arrangements with the author.
|
39
|
+
|
40
|
+
4. You may modify and include the part of the software into any other
|
41
|
+
software (possibly commercial). But some files in the distribution
|
42
|
+
are not written by the author, so that they are not under these terms.
|
43
|
+
|
44
|
+
For the list of those files and their copying conditions, see the
|
45
|
+
file LEGAL.
|
46
|
+
|
47
|
+
5. The scripts and library files supplied as input to or produced as
|
48
|
+
output from the software do not automatically fall under the
|
49
|
+
copyright of the software, but belong to whomever generated them,
|
50
|
+
and may be sold commercially, and may be aggregated with this
|
51
|
+
software.
|
52
|
+
|
53
|
+
6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
|
54
|
+
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
55
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
56
|
+
PURPOSE.
|
@@ -163,24 +163,26 @@ class CGI
|
|
163
163
|
|
164
164
|
# Create a new session id.
|
165
165
|
#
|
166
|
-
# The session id is
|
167
|
-
#
|
168
|
-
#
|
169
|
-
# session ids.
|
166
|
+
# The session id is a secure random number by SecureRandom
|
167
|
+
# if possible, otherwise an SHA512 hash based upon the time,
|
168
|
+
# a random number, and a constant string. This routine is
|
169
|
+
# used internally for automatically generated session ids.
|
170
170
|
def create_new_id
|
171
171
|
require 'securerandom'
|
172
172
|
begin
|
173
|
+
# by OpenSSL, or system provided entropy pool
|
173
174
|
session_id = SecureRandom.hex(16)
|
174
175
|
rescue NotImplementedError
|
175
|
-
|
176
|
-
|
176
|
+
# never happens on modern systems
|
177
|
+
require 'digest'
|
178
|
+
d = Digest('SHA512').new
|
177
179
|
now = Time::now
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
session_id =
|
180
|
+
d.update(now.to_s)
|
181
|
+
d.update(String(now.usec))
|
182
|
+
d.update(String(rand(0)))
|
183
|
+
d.update(String($$))
|
184
|
+
d.update('foobar')
|
185
|
+
session_id = d.hexdigest[0, 32]
|
184
186
|
end
|
185
187
|
session_id
|
186
188
|
end
|
@@ -453,7 +455,7 @@ class CGI
|
|
453
455
|
#
|
454
456
|
# +session+ is the session this instance is associated with.
|
455
457
|
# +option+ is a list of initialisation options. None are
|
456
|
-
# currently
|
458
|
+
# currently recognized.
|
457
459
|
def initialize(session, option=nil)
|
458
460
|
@session_id = session.session_id
|
459
461
|
unless GLOBAL_HASH_TABLE.key?(@session_id)
|
metadata
CHANGED
@@ -1,24 +1,24 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubysl-cgi-session
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Shirai
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-11-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
|
+
type: :development
|
16
|
+
prerelease: false
|
15
17
|
requirement: !ruby/object:Gem::Requirement
|
16
18
|
requirements:
|
17
19
|
- - "~>"
|
18
20
|
- !ruby/object:Gem::Version
|
19
21
|
version: '1.3'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
@@ -26,13 +26,13 @@ dependencies:
|
|
26
26
|
version: '1.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
|
+
type: :development
|
30
|
+
prerelease: false
|
29
31
|
requirement: !ruby/object:Gem::Requirement
|
30
32
|
requirements:
|
31
33
|
- - "~>"
|
32
34
|
- !ruby/object:Gem::Version
|
33
35
|
version: '10.0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
@@ -40,13 +40,13 @@ dependencies:
|
|
40
40
|
version: '10.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: mspec
|
43
|
+
type: :development
|
44
|
+
prerelease: false
|
43
45
|
requirement: !ruby/object:Gem::Requirement
|
44
46
|
requirements:
|
45
47
|
- - "~>"
|
46
48
|
- !ruby/object:Gem::Version
|
47
49
|
version: '1.5'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
@@ -54,13 +54,13 @@ dependencies:
|
|
54
54
|
version: '1.5'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rubysl-prettyprint
|
57
|
+
type: :development
|
58
|
+
prerelease: false
|
57
59
|
requirement: !ruby/object:Gem::Requirement
|
58
60
|
requirements:
|
59
61
|
- - "~>"
|
60
62
|
- !ruby/object:Gem::Version
|
61
63
|
version: '2.0'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
@@ -77,6 +77,7 @@ files:
|
|
77
77
|
- ".travis.yml"
|
78
78
|
- Gemfile
|
79
79
|
- LICENSE
|
80
|
+
- MRI_LICENSE
|
80
81
|
- README.md
|
81
82
|
- Rakefile
|
82
83
|
- lib/cgi/session.rb
|
@@ -105,9 +106,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
105
106
|
version: '0'
|
106
107
|
requirements: []
|
107
108
|
rubyforge_project:
|
108
|
-
rubygems_version: 2.
|
109
|
+
rubygems_version: 2.4.8
|
109
110
|
signing_key:
|
110
111
|
specification_version: 4
|
111
112
|
summary: Ruby standard library cgi-session.
|
112
113
|
test_files: []
|
113
|
-
has_rdoc:
|