lws 7.5.2 → 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: b99d34205cd4ffde5b0f179231bc246389b34e72c568f57111c14c209a8e62a1
4
- data.tar.gz: 7817ee1db2af892eb4364b42108c56649c1ba85466aa411a15159f8a02ba4206
3
+ metadata.gz: 16e2ff022ec5a0d90dbec7b90fb67c7c41b874b9e180043c4ab7dce11c8d5f14
4
+ data.tar.gz: a520b5bb06cb824d0d6e1ae96411bd4897adcb403885b1507f0837fdeadbc002
5
5
  SHA512:
6
- metadata.gz: 846e9c8541020b87204294b639578635db29849b04a01d0255ab6cc94f3b698e0fb36509a72cc0db4d64e56387634d5afce424e4d9ff6a5fa6d37b0ce7f5b415
7
- data.tar.gz: 788437c7e9b84bbe701473eec1d76a9c9326e37dfcfb1959f5a9a7f6f415ba9d532e6b98603354f5b36cd3f73b8ba97d99aecc6de96a976473df605b8dffe919
6
+ metadata.gz: f88df0aa55c55daa6e9fdf86886ab189e14e5e88a01e1fa75e3082306f458e44c1da75467af338fd34261c2e8a6e7ef9cb0a4ccd43975659a16e09d61df2babe
7
+ data.tar.gz: 14bf37d42921f08f90e1eb1f5c71b36af54017f4620b7f132c0f1f7a866a44afa1c107679d049a34745857c0410b3e57e218153a593c3b2ba6889cfccd51e3bd
data/lib/lws/apps/auth.rb CHANGED
@@ -69,16 +69,6 @@ module LWS::Auth
69
69
  # (at least 8 characters long)
70
70
  attribute :name
71
71
 
72
- # @!attribute start_app
73
- # @return [App, nil] the app to start with/open when logging in
74
- belongs_to :start_app, class_name: "LWS::Auth::App",
75
- foreign_key: :start_app_id,
76
- uri: "apps/:id"
77
-
78
- # @!attribute start_app_id
79
- # @return [Integer, nil] the ID of the app to start with/open when logging in
80
- attribute :start_app_id
81
-
82
72
  # @!attribute users
83
73
  # @return [Array<User>] the users that are assigned to the account
84
74
  has_many :users
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 = "7.5.2".freeze
17
+ VERSION = "8.1.1".freeze
18
18
 
19
19
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lws
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.5.2
4
+ version: 8.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - LeftClick B.V.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-13 00:00:00.000000000 Z
11
+ date: 2023-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday-http-cache
@@ -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: {}
@@ -317,33 +298,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
317
298
  - !ruby/object:Gem::Version
318
299
  version: '0'
319
300
  requirements: []
320
- rubygems_version: 3.1.2
301
+ 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/presence_test.rb
326
- - test/http_caching_test.rb
327
- - test/generic_test.rb
328
- - test/corporate_website_test.rb
329
- - test/stubbing_test.rb
330
- - test/support/with_env.rb
331
- - test/caching_test.rb
332
- - test/maps_test.rb
333
- - test/ticket_test.rb
334
- - test/api_token_middleware_test.rb
335
- - test/digital_signage_test.rb
336
- - test/json_parser_test.rb
337
- - test/logger_test.rb
338
- - test/config/switch_env.yml
339
- - test/config/full.yml
340
- - test/config/empty.yml
341
- - test/config/tokens.yml
342
- - test/config/invalid.yml
343
- - test/config/endpoints.yml
344
- - test/auth_test.rb
345
- - test/test_helper.rb
346
- - test/fixtures/auth.yml
347
- - test/fixtures/permissions.yml
348
- - test/resource_test.rb
349
- - test/setup_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,191 +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
- assert_instance_of(App, @account.start_app)
39
- end
40
-
41
- end
42
-
43
- class TestAuthApp < MiniTest::Test
44
-
45
- include LWS::Auth
46
-
47
- def setup
48
- @app = App.all.first
49
- end
50
-
51
- def test_valid
52
- refute_nil(@app)
53
- assert_instance_of(App, @app)
54
- refute_nil(@app.id)
55
- end
56
-
57
- def test_valid_associations
58
- # FIXME: Doesn't work
59
- #assert_instance_of(Account, @app.accounts.first)
60
- #assert_instance_of(Company, @app.companies.first)
61
- #assert_instance_of(License, @app.licenses.first)
62
- end
63
-
64
- end
65
-
66
- class TestAuthCompany < MiniTest::Test
67
-
68
- include LWS::Auth
69
-
70
- def setup
71
- @company = Company.find(1)
72
- @child_company = Company.find(2)
73
- end
74
-
75
- def test_valid
76
- refute_nil(@company)
77
- assert_instance_of(Company, @company)
78
- refute_nil(@company.id)
79
- end
80
-
81
- def test_valid_associations
82
- assert_instance_of(Account, @company.accounts.first)
83
- assert_instance_of(App, @company.apps.first)
84
- assert_instance_of(Account, @company.contact_person)
85
- assert_instance_of(Contract, @company.contracts.first)
86
- assert_instance_of(License, @company.licenses.first)
87
- assert_instance_of(Company, @child_company.parent)
88
- assert_instance_of(UsageReport, @company.usage_reports.first)
89
- end
90
-
91
- end
92
-
93
- class TestAuthContract < MiniTest::Test
94
-
95
- include LWS::Auth
96
-
97
- def setup
98
- @company = Company.find(1)
99
- # Contracts only exist as child objects of companies
100
- @contract = @company.contracts.first
101
- end
102
-
103
- def test_valid
104
- refute_nil(@contract)
105
- assert_instance_of(Contract, @contract)
106
- refute_nil(@contract.id)
107
- end
108
-
109
- def test_valid_associations
110
- assert_instance_of(Company, @contract.company)
111
- assert_equal(@company, @contract.company)
112
- end
113
-
114
- end
115
-
116
- class TestAuthLicense < MiniTest::Test
117
-
118
- include LWS::Auth
119
-
120
- def setup
121
- @company = Company.find(1)
122
- # Licenses only exist as child objects of companies
123
- @license = @company.licenses.first
124
- end
125
-
126
- def test_valid
127
- refute_nil(@license)
128
- assert_instance_of(License, @license)
129
- refute_nil(@license.id)
130
- end
131
-
132
- def test_valid_associations
133
- assert_instance_of(App, @license.app)
134
- assert_instance_of(Company, @license.company)
135
- assert_equal(@company, @license.company)
136
- end
137
-
138
- end
139
-
140
- class TestAuthToken < MiniTest::Test
141
-
142
- include LWS::Auth
143
-
144
- def setup
145
- @token = Token.find(ENV["LC_LWS_TEST_TOKEN"])
146
- end
147
-
148
- def test_valid
149
- refute_nil(@token)
150
- assert_instance_of(Token, @token)
151
- refute_nil(@token.id)
152
- assert_equal(LWS.config.api_token, @token.token)
153
- end
154
-
155
- def test_valid_associations
156
- assert_instance_of(Account, @token.account)
157
- if @token.user.present?
158
- assert_instance_of(User, @token.user)
159
- assert_equal(@token.user.account.id, @token.account.id)
160
- elsif @token.device.present?
161
- assert_instance_of(Device, @token.device)
162
- assert_equal(@token.device.account.id, @token.account.id)
163
- else
164
- fail "token should be associated with either a user or a device"
165
- end
166
- end
167
-
168
- end
169
-
170
- class TestAuthUsageReport < MiniTest::Test
171
-
172
- include LWS::Auth
173
-
174
- def setup
175
- @company = Company.find(1)
176
- # Contracts only exist as child objects of companies
177
- @usage_report = @company.usage_reports.first
178
- end
179
-
180
- def test_valid
181
- refute_nil(@usage_report)
182
- assert_instance_of(UsageReport, @usage_report)
183
- refute_nil(@usage_report.id)
184
- end
185
-
186
- def test_valid_associations
187
- assert_instance_of(Company, @usage_report.company)
188
- assert_equal(@company, @usage_report.company)
189
- end
190
-
191
- 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