vidibus-realm 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 8ea4227435fc17982596a83a5573c1ba10225b87
4
+ data.tar.gz: edb14d4da77a8029deb341db6ab6f3960ee968f8
5
+ SHA512:
6
+ metadata.gz: 4f99d5a76ba2b6c3274a695ee7ccfab4a366d25487f113edd468f2ddc66a6f21c4aa93d874ec47ab21a762e34f30b890bb3188b6c9d4f222f16ddaf513080ba6
7
+ data.tar.gz: 426711c80bc25f188b646daa0e58287afaa7f3cd1945827fbe55fde87bce60982cbd3b5114684b26d25d18c9637c47c23ba5878ff3a03044261ae8cb3f1d6734
@@ -1 +1,2 @@
1
- require "realm/extensions"
1
+ require 'vidibus/realm/extensions'
2
+ require 'vidibus/realm/errors'
@@ -0,0 +1,6 @@
1
+ module Vidibus
2
+ module Realm
3
+ class Error < StandardError; end
4
+ class ServiceError < Error; end
5
+ end
6
+ end
@@ -19,13 +19,15 @@ module Vidibus
19
19
 
20
20
  # Returns current subdomain which is, for now, the realm uuid itself.
21
21
  # The hostname must match the current service's domain because it may
22
- # contain several subdomains as well which are not suitable for
22
+ # contain several subdomains as well which are not suitable for
23
23
  # identifying the current realm.
24
24
  def subdomain
25
25
  env["SERVER_NAME"].match(/(.+)\.#{::Service.this.domain}/)
26
26
  $1
27
- rescue ::Service::ConfigurationError
28
- # Current service has not been configured yet.
27
+ rescue Vidibus::Service::ConfigurationError
28
+ unless env['PATH_INFO'] == '/connector'
29
+ raise(ServiceError, 'This service has not been configured yet')
30
+ end
29
31
  end
30
32
 
31
33
  # Returns realm from constant or subdomain.
@@ -1,5 +1,5 @@
1
1
  module Vidibus
2
2
  module Realm
3
- VERSION = '0.1.0'
3
+ VERSION = '0.1.1'
4
4
  end
5
5
  end
@@ -13,7 +13,7 @@ describe "Vidibus::Realm::Rack" do
13
13
 
14
14
  def downstream_app
15
15
  @downstream_app ||= OpenStruct.new.tap do |a|
16
- mock(a).call.with_any_args {[200,{"Content-Type" => "text/html"},[]]}
16
+ stub(a).call.with_any_args {[200,{"Content-Type" => "text/html"},[]]}
17
17
  end
18
18
  end
19
19
 
@@ -36,6 +36,26 @@ describe "Vidibus::Realm::Rack" do
36
36
  last_request.env[:realm].should be_nil
37
37
  end
38
38
 
39
+ context 'if Service has not been set up' do
40
+ it 'should raise an error' do
41
+ stub(Service).this { raise(Vidibus::Service::ConfigurationError) }
42
+ expect { get 'http://hello.else.local' }.
43
+ to raise_error(Vidibus::Realm::ServiceError)
44
+ end
45
+
46
+ it 'should not raise an error for connector requests' do
47
+ stub(Service).this { raise(Vidibus::Service::ConfigurationError) }
48
+ expect { get 'http://hello.else.local/connector' }.
49
+ not_to raise_error
50
+ end
51
+
52
+ it 'should not raise an error for connector requests with args' do
53
+ stub(Service).this { raise(Vidibus::Service::ConfigurationError) }
54
+ expect { get 'http://hello.else.local/connector?uuid=124' }.
55
+ not_to raise_error
56
+ end
57
+ end
58
+
39
59
  it "should not set realm by subdomain if no subdomain is available" do
40
60
  get "http://something.else.local"
41
61
  last_request.env[:realm].should be_nil
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
16
16
  s.rubyforge_project = "vidibus-realm"
17
17
 
18
18
  s.add_dependency "activesupport", '>= 3'
19
- s.add_dependency "vidibus-service", '>= 0.2.0'
19
+ s.add_dependency "vidibus-service", '>= 0.3.0'
20
20
 
21
21
  s.add_development_dependency "bundler", ">= 1.0.0"
22
22
  s.add_development_dependency "rake", ">= 0"
metadata CHANGED
@@ -1,126 +1,111 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vidibus-realm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
5
- prerelease:
4
+ version: 0.1.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - Andre Pankratz
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-08-30 00:00:00.000000000 Z
11
+ date: 2017-12-21 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: activesupport
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - ">="
20
18
  - !ruby/object:Gem::Version
21
19
  version: '3'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - ">="
28
25
  - !ruby/object:Gem::Version
29
26
  version: '3'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: vidibus-service
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - ">="
36
32
  - !ruby/object:Gem::Version
37
- version: 0.2.0
33
+ version: 0.3.0
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - ">="
44
39
  - !ruby/object:Gem::Version
45
- version: 0.2.0
40
+ version: 0.3.0
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: bundler
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - ">="
52
46
  - !ruby/object:Gem::Version
53
47
  version: 1.0.0
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - ">="
60
53
  - !ruby/object:Gem::Version
61
54
  version: 1.0.0
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: rake
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ! '>='
59
+ - - ">="
68
60
  - !ruby/object:Gem::Version
69
61
  version: '0'
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ! '>='
66
+ - - ">="
76
67
  - !ruby/object:Gem::Version
77
68
  version: '0'
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: rspec
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ! '>='
73
+ - - ">="
84
74
  - !ruby/object:Gem::Version
85
75
  version: '0'
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ! '>='
80
+ - - ">="
92
81
  - !ruby/object:Gem::Version
93
82
  version: '0'
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: rack-test
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
- - - ! '>='
87
+ - - ">="
100
88
  - !ruby/object:Gem::Version
101
89
  version: '0'
102
90
  type: :development
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
- - - ! '>='
94
+ - - ">="
108
95
  - !ruby/object:Gem::Version
109
96
  version: '0'
110
97
  - !ruby/object:Gem::Dependency
111
98
  name: rr
112
99
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
100
  requirements:
115
- - - ! '>='
101
+ - - ">="
116
102
  - !ruby/object:Gem::Version
117
103
  version: '0'
118
104
  type: :development
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
107
  requirements:
123
- - - ! '>='
108
+ - - ">="
124
109
  - !ruby/object:Gem::Version
125
110
  version: '0'
126
111
  description: Provides realm accessor for application controller
@@ -129,14 +114,15 @@ executables: []
129
114
  extensions: []
130
115
  extra_rdoc_files: []
131
116
  files:
132
- - .gitignore
133
- - .rspec
117
+ - ".gitignore"
118
+ - ".rspec"
134
119
  - Gemfile
135
120
  - LICENSE
136
121
  - README.rdoc
137
122
  - Rakefile
138
123
  - lib/vidibus-realm.rb
139
124
  - lib/vidibus/realm.rb
125
+ - lib/vidibus/realm/errors.rb
140
126
  - lib/vidibus/realm/extensions.rb
141
127
  - lib/vidibus/realm/extensions/controller.rb
142
128
  - lib/vidibus/realm/rack.rb
@@ -147,29 +133,25 @@ files:
147
133
  homepage: http://github.com/vidibus/vidibus-realm
148
134
  licenses:
149
135
  - MIT
136
+ metadata: {}
150
137
  post_install_message:
151
138
  rdoc_options: []
152
139
  require_paths:
153
140
  - lib
154
141
  required_ruby_version: !ruby/object:Gem::Requirement
155
- none: false
156
142
  requirements:
157
- - - ! '>='
143
+ - - ">="
158
144
  - !ruby/object:Gem::Version
159
145
  version: '0'
160
- segments:
161
- - 0
162
- hash: 2761137493398817144
163
146
  required_rubygems_version: !ruby/object:Gem::Requirement
164
- none: false
165
147
  requirements:
166
- - - ! '>='
148
+ - - ">="
167
149
  - !ruby/object:Gem::Version
168
150
  version: 1.3.6
169
151
  requirements: []
170
152
  rubyforge_project: vidibus-realm
171
- rubygems_version: 1.8.24
153
+ rubygems_version: 2.6.14
172
154
  signing_key:
173
- specification_version: 3
155
+ specification_version: 4
174
156
  summary: Basic realm handling for Vidibus applications
175
157
  test_files: []