lws 8.1.0 → 8.1.1

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
  SHA256:
3
- metadata.gz: 71387b35e80a4e507b40fa30176d0a559240fbf1e20663b3a1912ae99ec578d0
4
- data.tar.gz: 9951a09859f23241cdc36e762ce8c3cb3c487247c2f2016a664b713ab8a5f7db
3
+ metadata.gz: 16e2ff022ec5a0d90dbec7b90fb67c7c41b874b9e180043c4ab7dce11c8d5f14
4
+ data.tar.gz: a520b5bb06cb824d0d6e1ae96411bd4897adcb403885b1507f0837fdeadbc002
5
5
  SHA512:
6
- metadata.gz: 425ddb46ef824e6b54703743ad5e15eaf666cee672548abb4b5c98f01fc2c302c1a0ca60bffd4da2aef74da3bef27bdcca7a623ae34194ed5d86e9bdd093e4e2
7
- data.tar.gz: 187749b5eabf148b000466a99dc6d87538ae35f6e1cfb67eddf39f8096d651c0eab92b7cf8053247449616ab00cf9152b9229a5d43c1d0b8061a5821d2e50867
6
+ metadata.gz: f88df0aa55c55daa6e9fdf86886ab189e14e5e88a01e1fa75e3082306f458e44c1da75467af338fd34261c2e8a6e7ef9cb0a4ccd43975659a16e09d61df2babe
7
+ data.tar.gz: 14bf37d42921f08f90e1eb1f5c71b36af54017f4620b7f132c0f1f7a866a44afa1c107679d049a34745857c0410b3e57e218153a593c3b2ba6889cfccd51e3bd
data/lib/lws/version.rb CHANGED
@@ -14,6 +14,6 @@ module LWS
14
14
 
15
15
  # The LWS library version.
16
16
  # @note The major and minor version parts match the LWS API version!
17
- VERSION = "8.1.0".freeze
17
+ VERSION = "8.1.1".freeze
18
18
 
19
19
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lws
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.1.0
4
+ version: 8.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - LeftClick B.V.
@@ -48,16 +48,22 @@ dependencies:
48
48
  name: hashie
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - "~>"
51
+ - - ">="
52
52
  - !ruby/object:Gem::Version
53
53
  version: '3.5'
54
+ - - "<"
55
+ - !ruby/object:Gem::Version
56
+ version: '6'
54
57
  type: :runtime
55
58
  prerelease: false
56
59
  version_requirements: !ruby/object:Gem::Requirement
57
60
  requirements:
58
- - - "~>"
61
+ - - ">="
59
62
  - !ruby/object:Gem::Version
60
63
  version: '3.5'
64
+ - - "<"
65
+ - !ruby/object:Gem::Version
66
+ version: '6'
61
67
  - !ruby/object:Gem::Dependency
62
68
  name: multi_json
63
69
  requirement: !ruby/object:Gem::Requirement
@@ -274,31 +280,6 @@ files:
274
280
  - lib/lws/middleware/request_headers.rb
275
281
  - lib/lws/stubbing.rb
276
282
  - lib/lws/version.rb
277
- - test/api_token_middleware_test.rb
278
- - test/auth_test.rb
279
- - test/caching_test.rb
280
- - test/config/empty.yml
281
- - test/config/endpoints.yml
282
- - test/config/full.yml
283
- - test/config/invalid.yml
284
- - test/config/switch_env.yml
285
- - test/config/tokens.yml
286
- - test/corporate_website_test.rb
287
- - test/digital_signage_test.rb
288
- - test/fixtures/auth.yml
289
- - test/fixtures/permissions.yml
290
- - test/generic_test.rb
291
- - test/http_caching_test.rb
292
- - test/json_parser_test.rb
293
- - test/logger_test.rb
294
- - test/maps_test.rb
295
- - test/presence_test.rb
296
- - test/resource_test.rb
297
- - test/setup_test.rb
298
- - test/stubbing_test.rb
299
- - test/support/with_env.rb
300
- - test/test_helper.rb
301
- - test/ticket_test.rb
302
283
  homepage: https://leftclick.eu/
303
284
  licenses: []
304
285
  metadata: {}
@@ -321,29 +302,4 @@ rubygems_version: 3.3.5
321
302
  signing_key:
322
303
  specification_version: 4
323
304
  summary: LeftClick web services library for Ruby
324
- test_files:
325
- - test/api_token_middleware_test.rb
326
- - test/auth_test.rb
327
- - test/caching_test.rb
328
- - test/config/empty.yml
329
- - test/config/endpoints.yml
330
- - test/config/full.yml
331
- - test/config/invalid.yml
332
- - test/config/switch_env.yml
333
- - test/config/tokens.yml
334
- - test/corporate_website_test.rb
335
- - test/digital_signage_test.rb
336
- - test/fixtures/auth.yml
337
- - test/fixtures/permissions.yml
338
- - test/generic_test.rb
339
- - test/http_caching_test.rb
340
- - test/json_parser_test.rb
341
- - test/logger_test.rb
342
- - test/maps_test.rb
343
- - test/presence_test.rb
344
- - test/resource_test.rb
345
- - test/setup_test.rb
346
- - test/stubbing_test.rb
347
- - test/support/with_env.rb
348
- - test/test_helper.rb
349
- - test/ticket_test.rb
305
+ test_files: []
@@ -1,59 +0,0 @@
1
- #
2
- # Copyright © 2016–2021 LeftClick Web Services B.V.
3
- #
4
- # This software is property of LeftClick Web Services B.V. and cannot be
5
- # redistributed and/or modified without permission. The software or any
6
- # of its parts cannot be used for any other purposes than the LeftClick
7
- # services and only during a valid license subscription. For more
8
- # information, please contact LeftClick Web Services B.V. at:
9
- # Schootense Dreef 20A, 5708 HZ Helmond, The Netherlands,
10
- # info@leftclick.eu, +3185-4444-004.
11
-
12
-
13
- require "test_helper"
14
-
15
- class WorkingTokenAuthenticator < Faraday::Middleware
16
-
17
- def call(env)
18
- env[:request_headers]["X-Token"] = ENV["LC_LWS_TEST_TOKEN"]
19
- @app.call(env)
20
- end
21
-
22
- end
23
-
24
- class BrokenTokenAuthenticator < Faraday::Middleware
25
-
26
- def call(env)
27
- env[:request_headers]["X-Token"] = ""
28
- @app.call(env)
29
- end
30
-
31
- end
32
-
33
- class TestAPITokenMiddleware < MiniTest::Test
34
-
35
- def test_working_token_authenticator
36
- # Configure the working token authenticator instead of the test API token
37
- reconfigure(api_token: nil,
38
- api_token_middleware: WorkingTokenAuthenticator)
39
-
40
- token = LWS::Auth::Token.all.first
41
- refute_nil(token)
42
-
43
- # Restore the token
44
- reconfigure
45
- end
46
-
47
- def test_broken_token_authenticator
48
- # Configure the working token authenticator instead of the test API token
49
- reconfigure(api_token: nil,
50
- api_token_middleware: BrokenTokenAuthenticator)
51
-
52
- token = LWS::Auth::Token.all.first
53
- assert_nil(token)
54
-
55
- # Restore the token
56
- reconfigure
57
- end
58
-
59
- end
data/test/auth_test.rb DELETED
@@ -1,190 +0,0 @@
1
- #
2
- # Copyright © 2016–2021 LeftClick Web Services B.V.
3
- #
4
- # This software is property of LeftClick Web Services B.V. and cannot be
5
- # redistributed and/or modified without permission. The software or any
6
- # of its parts cannot be used for any other purposes than the LeftClick
7
- # services and only during a valid license subscription. For more
8
- # information, please contact LeftClick Web Services B.V. at:
9
- # Schootense Dreef 20A, 5708 HZ Helmond, The Netherlands,
10
- # info@leftclick.eu, +3185-4444-004.
11
-
12
-
13
- require "test_helper"
14
-
15
- class TestAuthAccount < MiniTest::Test
16
-
17
- include LWS::Auth
18
-
19
- def setup
20
- @account = Account.find(1)
21
- end
22
-
23
- def test_valid
24
- refute_nil(@account)
25
- assert_instance_of(Account, @account)
26
- refute_nil(@account.id)
27
- end
28
-
29
- def test_valid_associations
30
- assert_instance_of(App, @account.apps.first)
31
- assert_instance_of(Company, @account.company)
32
- if @account.users.present?
33
- assert_instance_of(User, @account.users.first)
34
- end
35
- if @account.devices.present?
36
- assert_instance_of(Device, @account.devices.first)
37
- end
38
- end
39
-
40
- end
41
-
42
- class TestAuthApp < MiniTest::Test
43
-
44
- include LWS::Auth
45
-
46
- def setup
47
- @app = App.all.first
48
- end
49
-
50
- def test_valid
51
- refute_nil(@app)
52
- assert_instance_of(App, @app)
53
- refute_nil(@app.id)
54
- end
55
-
56
- def test_valid_associations
57
- # FIXME: Doesn't work
58
- #assert_instance_of(Account, @app.accounts.first)
59
- #assert_instance_of(Company, @app.companies.first)
60
- #assert_instance_of(License, @app.licenses.first)
61
- end
62
-
63
- end
64
-
65
- class TestAuthCompany < MiniTest::Test
66
-
67
- include LWS::Auth
68
-
69
- def setup
70
- @company = Company.find(1)
71
- @child_company = Company.find(2)
72
- end
73
-
74
- def test_valid
75
- refute_nil(@company)
76
- assert_instance_of(Company, @company)
77
- refute_nil(@company.id)
78
- end
79
-
80
- def test_valid_associations
81
- assert_instance_of(Account, @company.accounts.first)
82
- assert_instance_of(App, @company.apps.first)
83
- assert_instance_of(Account, @company.contact_person)
84
- assert_instance_of(Contract, @company.contracts.first)
85
- assert_instance_of(License, @company.licenses.first)
86
- assert_instance_of(Company, @child_company.parent)
87
- assert_instance_of(UsageReport, @company.usage_reports.first)
88
- end
89
-
90
- end
91
-
92
- class TestAuthContract < MiniTest::Test
93
-
94
- include LWS::Auth
95
-
96
- def setup
97
- @company = Company.find(1)
98
- # Contracts only exist as child objects of companies
99
- @contract = @company.contracts.first
100
- end
101
-
102
- def test_valid
103
- refute_nil(@contract)
104
- assert_instance_of(Contract, @contract)
105
- refute_nil(@contract.id)
106
- end
107
-
108
- def test_valid_associations
109
- assert_instance_of(Company, @contract.company)
110
- assert_equal(@company, @contract.company)
111
- end
112
-
113
- end
114
-
115
- class TestAuthLicense < MiniTest::Test
116
-
117
- include LWS::Auth
118
-
119
- def setup
120
- @company = Company.find(1)
121
- # Licenses only exist as child objects of companies
122
- @license = @company.licenses.first
123
- end
124
-
125
- def test_valid
126
- refute_nil(@license)
127
- assert_instance_of(License, @license)
128
- refute_nil(@license.id)
129
- end
130
-
131
- def test_valid_associations
132
- assert_instance_of(App, @license.app)
133
- assert_instance_of(Company, @license.company)
134
- assert_equal(@company, @license.company)
135
- end
136
-
137
- end
138
-
139
- class TestAuthToken < MiniTest::Test
140
-
141
- include LWS::Auth
142
-
143
- def setup
144
- @token = Token.find(ENV["LC_LWS_TEST_TOKEN"])
145
- end
146
-
147
- def test_valid
148
- refute_nil(@token)
149
- assert_instance_of(Token, @token)
150
- refute_nil(@token.id)
151
- assert_equal(LWS.config.api_token, @token.token)
152
- end
153
-
154
- def test_valid_associations
155
- assert_instance_of(Account, @token.account)
156
- if @token.user.present?
157
- assert_instance_of(User, @token.user)
158
- assert_equal(@token.user.account.id, @token.account.id)
159
- elsif @token.device.present?
160
- assert_instance_of(Device, @token.device)
161
- assert_equal(@token.device.account.id, @token.account.id)
162
- else
163
- fail "token should be associated with either a user or a device"
164
- end
165
- end
166
-
167
- end
168
-
169
- class TestAuthUsageReport < MiniTest::Test
170
-
171
- include LWS::Auth
172
-
173
- def setup
174
- @company = Company.find(1)
175
- # Contracts only exist as child objects of companies
176
- @usage_report = @company.usage_reports.first
177
- end
178
-
179
- def test_valid
180
- refute_nil(@usage_report)
181
- assert_instance_of(UsageReport, @usage_report)
182
- refute_nil(@usage_report.id)
183
- end
184
-
185
- def test_valid_associations
186
- assert_instance_of(Company, @usage_report.company)
187
- assert_equal(@company, @usage_report.company)
188
- end
189
-
190
- end
data/test/caching_test.rb DELETED
@@ -1,65 +0,0 @@
1
- #
2
- # Copyright © 2016–2021 LeftClick Web Services B.V.
3
- #
4
- # This software is property of LeftClick Web Services B.V. and cannot be
5
- # redistributed and/or modified without permission. The software or any
6
- # of its parts cannot be used for any other purposes than the LeftClick
7
- # services and only during a valid license subscription. For more
8
- # information, please contact LeftClick Web Services B.V. at:
9
- # Schootense Dreef 20A, 5708 HZ Helmond, The Netherlands,
10
- # info@leftclick.eu, +3185-4444-004.
11
-
12
-
13
- require "test_helper"
14
-
15
- class TestCaching < MiniTest::Test
16
-
17
- # Class used to check if data is read/written to the cache
18
- class CacheTest
19
-
20
- attr_reader :last_read_key
21
- attr_reader :last_written_key, :last_written_value
22
-
23
- def read(key)
24
- @last_read_key = key
25
- nil
26
- end
27
-
28
- def write(key, value)
29
- @last_written_key, @last_written_value = key, value
30
- nil
31
- end
32
-
33
- end
34
-
35
- def setup
36
- @cache_mock = CacheTest.new
37
-
38
- # Redo the LWS setup with cache
39
- LWS.setup do |config|
40
- config.api_token = ENV["LC_LWS_TEST_TOKEN"]
41
- config.caching_object = @cache_mock
42
- if ENV["LC_LWS_TEST_DEBUG"].present?
43
- config.http_debug = true
44
- config.json_debug = true
45
- end
46
- config.environment = :development
47
- end
48
- end
49
-
50
- def teardown
51
- # Restore the configuration
52
- reconfigure
53
- end
54
-
55
- def test_working_cache
56
- assert_nil(@cache_mock.last_read_key)
57
- assert_nil(@cache_mock.last_written_key)
58
- assert_nil(@cache_mock.last_written_value)
59
- _configs = LWS::Auth::Configuration.all.to_a
60
- refute_nil(@cache_mock.last_read_key)
61
- assert_equal(@cache_mock.last_read_key, @cache_mock.last_written_key)
62
- refute_nil(@cache_mock.last_written_value)
63
- end
64
-
65
- end
@@ -1,2 +0,0 @@
1
- ---
2
- default: {}
@@ -1,4 +0,0 @@
1
- ---
2
- development:
3
- endpoints:
4
- maps: http://maps.leftclick.cloud
data/test/config/full.yml DELETED
@@ -1,16 +0,0 @@
1
- ---
2
- default:
3
- environment: development
4
- proxy: http://user:password@proxyserver:8080
5
-
6
- development:
7
- api_token: "dev-token"
8
- endpoints:
9
- maps: "http://maps.leftclick.cloud"
10
- http_debug: true
11
- http_debug_headers: true
12
- json_debug: true
13
-
14
- production:
15
- http_debug: false
16
- json_debug: false
@@ -1,3 +0,0 @@
1
- ---
2
- development:
3
- foo: bar
@@ -1,3 +0,0 @@
1
- ---
2
- default:
3
- environment: production
@@ -1,3 +0,0 @@
1
- ---
2
- development:
3
- api_token: "dev-token"
@@ -1,113 +0,0 @@
1
- #
2
- # Copyright © 2016–2021 LeftClick Web Services B.V.
3
- #
4
- # This software is property of LeftClick Web Services B.V. and cannot be
5
- # redistributed and/or modified without permission. The software or any
6
- # of its parts cannot be used for any other purposes than the LeftClick
7
- # services and only during a valid license subscription. For more
8
- # information, please contact LeftClick Web Services B.V. at:
9
- # Schootense Dreef 20A, 5708 HZ Helmond, The Netherlands,
10
- # info@leftclick.eu, +3185-4444-004.
11
-
12
-
13
- require "test_helper"
14
-
15
- class TestCorporateWebsiteArticle < MiniTest::Test
16
-
17
- include LWS::CorporateWebsite
18
-
19
- def setup
20
- @page = Page.find(1)
21
- @article = @page.articles.first
22
- end
23
-
24
- def test_valid
25
- refute_nil(@article)
26
- assert_instance_of(Article, @article)
27
- refute_nil(@article.id)
28
- end
29
-
30
- def test_valid_associations
31
- assert_instance_of(Page, @article.page)
32
- assert_equal(@page, @article.page)
33
- end
34
-
35
- end
36
-
37
- class TestCorporateWebsiteOfficeTime < MiniTest::Test
38
-
39
- include LWS::CorporateWebsite
40
-
41
- def setup
42
- @office_time = OfficeTime.find(1)
43
- end
44
-
45
- def test_valid
46
- refute_nil(@office_time)
47
- assert_instance_of(OfficeTime, @office_time)
48
- refute_nil(@office_time.id)
49
- end
50
-
51
- end
52
-
53
- class TestCorporateWebsitePage < MiniTest::Test
54
-
55
- include LWS::CorporateWebsite
56
-
57
- def setup
58
- @page = Page.find(1)
59
- end
60
-
61
- def test_valid
62
- refute_nil(@page)
63
- assert_instance_of(Page, @page)
64
- refute_nil(@page.id)
65
- end
66
-
67
- def test_valid_associations
68
- assert_instance_of(Article, @page.articles.first)
69
- end
70
-
71
- end
72
-
73
- # FIXME: There is no social page to test
74
- #class TestCorporateWebsiteSocialPage < MiniTest::Test
75
- #
76
- # include LWS::CorporateWebsite
77
- #
78
- # def setup
79
- # @social_page = SocialPage.find(1)
80
- # end
81
- #
82
- # def test_valid
83
- # refute_nil(@social_page)
84
- # assert_instance_of(SocialPage, @social_page)
85
- # refute_nil(@social_page.id)
86
- # end
87
- #
88
- # def test_valid_associations
89
- # assert_instance_of(LWS::Auth::Account, @social_page.account)
90
- # assert_instance_of(LWS::Auth::Company, @social_page.company)
91
- # end
92
- #
93
- #end
94
-
95
- class TestCorporateWebsiteSocialPost < MiniTest::Test
96
-
97
- include LWS::CorporateWebsite
98
-
99
- def setup
100
- @social_post = SocialPost.find(1)
101
- end
102
-
103
- def test_valid
104
- refute_nil(@social_post)
105
- assert_instance_of(SocialPost, @social_post)
106
- refute_nil(@social_post.id)
107
- end
108
-
109
- def test_valid_associations
110
- assert_instance_of(Article, @social_post.article)
111
- end
112
-
113
- end