restpack_web 0.0.5 → 0.2.17

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.
metadata CHANGED
@@ -1,142 +1,170 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: restpack_web
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.2.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gavin Joyce
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-19 00:00:00.000000000 Z
11
+ date: 2013-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: restpack_gem
14
+ name: rack-auto-session-domain
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: 0.1.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: 0.1.1
27
27
  - !ruby/object:Gem::Dependency
28
- name: restpack_core_service
28
+ name: restpack_core_client
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: 0.2.2
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: 0.2.2
41
41
  - !ruby/object:Gem::Dependency
42
- name: restpack_user_service
42
+ name: public_suffix
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ~>
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: 1.3.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ~>
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: 1.3.0
55
55
  - !ruby/object:Gem::Dependency
56
- name: restpack_account_service
56
+ name: yajl-ruby
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ~>
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: 1.1.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: 1.1.0
69
+ - !ruby/object:Gem::Dependency
70
+ name: rake
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ! '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ! '>='
67
81
  - !ruby/object:Gem::Version
68
82
  version: '0'
69
83
  - !ruby/object:Gem::Dependency
70
- name: restpack_group_service
84
+ name: rack
71
85
  requirement: !ruby/object:Gem::Requirement
72
86
  requirements:
73
- - - '>='
87
+ - - ! '>='
74
88
  - !ruby/object:Gem::Version
75
89
  version: '0'
76
- type: :runtime
90
+ type: :development
77
91
  prerelease: false
78
92
  version_requirements: !ruby/object:Gem::Requirement
79
93
  requirements:
80
- - - '>='
94
+ - - ! '>='
81
95
  - !ruby/object:Gem::Version
82
96
  version: '0'
83
97
  - !ruby/object:Gem::Dependency
84
- name: bundler
98
+ name: bump
85
99
  requirement: !ruby/object:Gem::Requirement
86
100
  requirements:
87
101
  - - ~>
88
102
  - !ruby/object:Gem::Version
89
- version: '1.3'
103
+ version: '0.4'
90
104
  type: :development
91
105
  prerelease: false
92
106
  version_requirements: !ruby/object:Gem::Requirement
93
107
  requirements:
94
108
  - - ~>
95
109
  - !ruby/object:Gem::Version
96
- version: '1.3'
110
+ version: '0.4'
97
111
  - !ruby/object:Gem::Dependency
98
- name: rake
112
+ name: minitest
99
113
  requirement: !ruby/object:Gem::Requirement
100
114
  requirements:
101
- - - '>='
115
+ - - ~>
102
116
  - !ruby/object:Gem::Version
103
- version: '0'
117
+ version: '4.7'
104
118
  type: :development
105
119
  prerelease: false
106
120
  version_requirements: !ruby/object:Gem::Requirement
107
121
  requirements:
108
- - - '>='
122
+ - - ~>
109
123
  - !ruby/object:Gem::Version
110
- version: '0'
124
+ version: '4.7'
111
125
  - !ruby/object:Gem::Dependency
112
- name: rspec
126
+ name: rack-test
113
127
  requirement: !ruby/object:Gem::Requirement
114
128
  requirements:
115
- - - '>='
129
+ - - ~>
116
130
  - !ruby/object:Gem::Version
117
- version: '0'
131
+ version: '0.6'
118
132
  type: :development
119
133
  prerelease: false
120
134
  version_requirements: !ruby/object:Gem::Requirement
121
135
  requirements:
122
- - - '>='
136
+ - - ~>
123
137
  - !ruby/object:Gem::Version
124
- version: '0'
138
+ version: '0.6'
125
139
  - !ruby/object:Gem::Dependency
126
- name: bump
140
+ name: webmock
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ~>
144
+ - !ruby/object:Gem::Version
145
+ version: '1.11'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ~>
151
+ - !ruby/object:Gem::Version
152
+ version: '1.11'
153
+ - !ruby/object:Gem::Dependency
154
+ name: rest-client
127
155
  requirement: !ruby/object:Gem::Requirement
128
156
  requirements:
129
- - - '>='
157
+ - - ! '>='
130
158
  - !ruby/object:Gem::Version
131
159
  version: '0'
132
160
  type: :development
133
161
  prerelease: false
134
162
  version_requirements: !ruby/object:Gem::Requirement
135
163
  requirements:
136
- - - '>='
164
+ - - ! '>='
137
165
  - !ruby/object:Gem::Version
138
166
  version: '0'
139
- description: Rack middleware for your RestPack web apps
167
+ description: Run a web application on RestPack
140
168
  email:
141
169
  - gavinjoyce@gmail.com
142
170
  executables: []
@@ -145,22 +173,26 @@ extra_rdoc_files: []
145
173
  files:
146
174
  - .gitignore
147
175
  - Gemfile
148
- - LICENSE.txt
176
+ - LICENSE
149
177
  - README.md
150
178
  - Rakefile
151
179
  - lib/restpack_web.rb
152
- - lib/restpack_web/configuration.rb
180
+ - lib/restpack_web/app.rb
153
181
  - lib/restpack_web/context.rb
154
- - lib/restpack_web/rack/domain.rb
155
- - lib/restpack_web/rack/session.rb
156
- - lib/restpack_web/rack/user.rb
157
182
  - lib/restpack_web/rails/controller.rb
158
183
  - lib/restpack_web/sinatra/app.rb
184
+ - lib/restpack_web/test_support.rb
159
185
  - lib/restpack_web/version.rb
160
186
  - restpack_web.gemspec
161
- homepage: http://restpack.org/
162
- licenses:
163
- - MIT
187
+ - spec/fixtures/channels.json
188
+ - spec/fixtures/configurations_root.json
189
+ - spec/fixtures/domains_search.json
190
+ - spec/fixtures/users.json
191
+ - spec/lib/restpack_web_spec.rb
192
+ - spec/lib/test_support_spec.rb
193
+ - spec/spec_helper.rb
194
+ homepage: https://github.com/RestPack
195
+ licenses: []
164
196
  metadata: {}
165
197
  post_install_message:
166
198
  rdoc_options: []
@@ -168,18 +200,25 @@ require_paths:
168
200
  - lib
169
201
  required_ruby_version: !ruby/object:Gem::Requirement
170
202
  requirements:
171
- - - '>='
203
+ - - ! '>='
172
204
  - !ruby/object:Gem::Version
173
205
  version: '0'
174
206
  required_rubygems_version: !ruby/object:Gem::Requirement
175
207
  requirements:
176
- - - '>='
208
+ - - ! '>='
177
209
  - !ruby/object:Gem::Version
178
210
  version: '0'
179
211
  requirements: []
180
212
  rubyforge_project:
181
- rubygems_version: 2.0.7
213
+ rubygems_version: 2.0.3
182
214
  signing_key:
183
215
  specification_version: 4
184
- summary: Rack middleware
185
- test_files: []
216
+ summary: Run a web application on RestPack
217
+ test_files:
218
+ - spec/fixtures/channels.json
219
+ - spec/fixtures/configurations_root.json
220
+ - spec/fixtures/domains_search.json
221
+ - spec/fixtures/users.json
222
+ - spec/lib/restpack_web_spec.rb
223
+ - spec/lib/test_support_spec.rb
224
+ - spec/spec_helper.rb
data/LICENSE.txt DELETED
@@ -1,22 +0,0 @@
1
- Copyright (c) 2013 Gavin Joyce
2
-
3
- MIT License
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,16 +0,0 @@
1
- module RestPack::Web
2
- class Configuration
3
- attr_accessor :authentication_port
4
-
5
- def initialize
6
- @authentication_port = nil
7
- end
8
- end
9
-
10
- mattr_accessor :config
11
- @@config = Configuration.new
12
-
13
- def self.setup
14
- yield @@config
15
- end
16
- end
@@ -1,36 +0,0 @@
1
- module RestPack::Web::Rack
2
- class Domain
3
- def initialize(app)
4
- @app = app
5
- end
6
-
7
- def call(env)
8
- identifier = Rack::Request.new(env).host
9
-
10
- response = Commands::Core::Domain::ByIdentifier.run({
11
- identifier: identifier,
12
- include: 'applications'
13
- })
14
-
15
- if response.status == :ok
16
- domain = response.result[:domains][0]
17
- application = response.result[:applications][0]
18
-
19
- env['restpack'] ||= {}
20
- env['restpack'][:domain] = domain
21
- env['restpack'][:application] = application
22
- env['restpack'][:application_id] = application[:id]
23
-
24
- env['restpack.session.options'] ||= {}
25
- env['restpack.session.options'][:key] = 'restpack.session'
26
- env['restpack.session.options'][:secret] = domain[:session_secret]
27
- env['restpack.session.options'][:domain] = domain[:identifier]
28
- else
29
- #TODO: GJ: better exceptions based on response status
30
- raise "[#{identifier}] is not a RestPack domain"
31
- end
32
-
33
- @app.call(env)
34
- end
35
- end
36
- end
@@ -1,7 +0,0 @@
1
- require 'encrypted_cookie'
2
-
3
- module RestPack::Web::Rack
4
- class Session < Rack::Session::EncryptedCookie
5
-
6
- end
7
- end
@@ -1,35 +0,0 @@
1
- require 'restpack_user_service'
2
- require 'restpack_account_service'
3
-
4
- module RestPack::Web::Rack
5
- class User
6
- def initialize(app)
7
- @app = app
8
- end
9
-
10
- def call(env)
11
- session = env["restpack.session"]
12
- user_id = session[:user_id]
13
- account_id = session[:account_id]
14
-
15
- if user_id && account_id
16
- response = Commands::Users::User::Get.run({
17
- id: user_id,
18
- application_id: env['restpack'][:application_id]
19
- })
20
-
21
- raise "Error getting user" unless response.success?
22
- env['restpack'][:user] = response.result[:users][0]
23
-
24
- response = Commands::Accounts::Account::Get.run({
25
- id: account_id,
26
- application_id: env['restpack'][:application_id]
27
- })
28
- raise "Error getting account" unless response.success?
29
- env['restpack'][:account] = response.result[:accounts][0]
30
- end
31
-
32
- @app.call(env)
33
- end
34
- end
35
- end