global_session 1.0.13 → 1.0.14

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,8 +7,8 @@ spec = Gem::Specification.new do |s|
7
7
  s.required_ruby_version = Gem::Requirement.new(">= 1.8.7")
8
8
 
9
9
  s.name = 'global_session'
10
- s.version = '1.0.13'
11
- s.date = '2012-09-26'
10
+ s.version = '1.0.14'
11
+ s.date = '2012-10-02'
12
12
 
13
13
  s.authors = ['Tony Spataro']
14
14
  s.email = 'support@rightscale.com'
@@ -80,6 +80,31 @@ module GlobalSession
80
80
  end
81
81
  end
82
82
 
83
+ # @return a Hash representation of the session with three subkeys: :metadata, :signed and :insecure
84
+ # @raise nothing -- does not raise; returns empty hash if there is a failure
85
+ def to_hash
86
+ hash = {}
87
+
88
+ md = {}
89
+ signed = {}
90
+ insecure = {}
91
+
92
+ hash[:metadata] = md
93
+ hash[:signed] = signed
94
+ hash[:insecure] = insecure
95
+
96
+ md[:id] = @id
97
+ md[:authority] = @authority
98
+ md[:created_at] = @created_at
99
+ md[:expired_at] = @expired_at
100
+ @signed.each_pair { |k, v| signed[k] = v }
101
+ @insecure.each_pair { |k, v| insecure[k] = v }
102
+
103
+ hash
104
+ rescue Exception => e
105
+ {}
106
+ end
107
+
83
108
  # Determine whether the session is valid. This method simply delegates to the
84
109
  # directory associated with this session.
85
110
  #
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: global_session
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 11
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 13
10
- version: 1.0.13
9
+ - 14
10
+ version: 1.0.14
11
11
  platform: ruby
12
12
  authors:
13
13
  - Tony Spataro
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-09-26 00:00:00 -07:00
18
+ date: 2012-10-02 00:00:00 +00:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency