pisoni 1.29.0 → 1.29.1
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -1
- data/Gemfile +2 -4
- data/lib/3scale/core/application.rb +1 -1
- data/lib/3scale/core/application_key.rb +2 -4
- data/lib/3scale/core/service.rb +1 -6
- data/lib/3scale/core/version.rb +1 -1
- data/spec/alert_limit_spec.rb +13 -13
- data/spec/application_key_spec.rb +24 -8
- data/spec/application_referrer_filter_spec.rb +3 -3
- data/spec/service_spec.rb +0 -5
- metadata +6 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4bc480ca255fad3679c652ee5913824d543c7f4e5d51b0866f3919d4d1a496c3
|
|
4
|
+
data.tar.gz: d5b36dd8d28242573d3e476ae4420c93dfd30275848ea16c4526ad61db1a386e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ffb11b5ae16138162d9fbb2c5b0784618b94d478cbbfd6e8edc377ae05b3554471ffd360db902ba5e569b0c90b96ceca3005860d53f57cfdab744cb48f019716
|
|
7
|
+
data.tar.gz: 5ff19f326743a8e56b8cb2df1ab37bbef54bafbd075a4e8d6a90ee729b51e8950e7248d331724982fbf7f42c5e6ceb265f13767bd4c9b7d4c09633ab982b3eca
|
data/CHANGELOG.md
CHANGED
|
@@ -2,12 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
Notable changes to Pisoni will be tracked in this document.
|
|
4
4
|
|
|
5
|
+
## 1.29.1 - 2023-11-30
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- Fixed the issue with updating/deleting keys for applications with special characters in the
|
|
10
|
+
application IDs by escaping them. [#31](https://github.com/3scale/pisoni/pull/31)
|
|
11
|
+
|
|
5
12
|
## 1.29.0 - 2020-03-17
|
|
6
13
|
|
|
7
14
|
### Removed
|
|
8
15
|
|
|
9
16
|
- "Latest transactions" functionality
|
|
10
|
-
[#
|
|
17
|
+
[#27](https://github.com/3scale/pisoni/pull/27)
|
|
11
18
|
|
|
12
19
|
## 1.28.0 - 2019-12-20
|
|
13
20
|
|
data/Gemfile
CHANGED
|
@@ -3,14 +3,12 @@ source "https://rubygems.org"
|
|
|
3
3
|
gemspec
|
|
4
4
|
|
|
5
5
|
group :test do
|
|
6
|
-
gem 'turn', '~> 0.9.7'
|
|
7
6
|
gem 'minitest'
|
|
8
7
|
gem "codeclimate-test-reporter", require: nil
|
|
9
8
|
end
|
|
10
9
|
|
|
11
10
|
group :development, :test do
|
|
12
|
-
gem 'pry',
|
|
13
|
-
gem 'pry-
|
|
14
|
-
gem 'pry-byebug', '~> 2.0.0'
|
|
11
|
+
gem 'pry-doc', '>= 0.8'
|
|
12
|
+
gem 'pry-byebug', '>= 3.7.0'
|
|
15
13
|
gem 'license_finder', '~> 5', require: false
|
|
16
14
|
end
|
|
@@ -23,14 +23,12 @@ module ThreeScale
|
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
def self.base_uri(service_id, application_id)
|
|
26
|
-
"#{default_uri}#{service_id}/applications/#{application_id}/keys/"
|
|
26
|
+
"#{default_uri}#{service_id}/applications/#{CGI::escape(application_id.to_s)}/keys/"
|
|
27
27
|
end
|
|
28
28
|
private_class_method :base_uri
|
|
29
29
|
|
|
30
30
|
def self.application_key_uri(service_id, application_id, value = '')
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"#{base_uri(service_id, application_id)}#{escaped_value}"
|
|
31
|
+
"#{base_uri(service_id, application_id)}#{CGI::escape(value.to_s)}"
|
|
34
32
|
end
|
|
35
33
|
private_class_method :application_key_uri
|
|
36
34
|
end
|
data/lib/3scale/core/service.rb
CHANGED
|
@@ -2,8 +2,7 @@ module ThreeScale
|
|
|
2
2
|
module Core
|
|
3
3
|
class Service < APIClient::Resource
|
|
4
4
|
attributes :provider_key, :id, :backend_version, :referrer_filters_required,
|
|
5
|
-
:
|
|
6
|
-
:default_user_plan_name, :default_service, :state
|
|
5
|
+
:default_service, :state
|
|
7
6
|
|
|
8
7
|
class << self
|
|
9
8
|
def load_by_id(service_id)
|
|
@@ -85,10 +84,6 @@ module ThreeScale
|
|
|
85
84
|
@referrer_filters_required
|
|
86
85
|
end
|
|
87
86
|
|
|
88
|
-
def user_registration_required?
|
|
89
|
-
@user_registration_required
|
|
90
|
-
end
|
|
91
|
-
|
|
92
87
|
def active?
|
|
93
88
|
state == :active
|
|
94
89
|
end
|
data/lib/3scale/core/version.rb
CHANGED
data/spec/alert_limit_spec.rb
CHANGED
|
@@ -5,17 +5,17 @@ module ThreeScale
|
|
|
5
5
|
describe '.load_all' do
|
|
6
6
|
describe 'when there are alert limits' do
|
|
7
7
|
let(:service_id) { 100 }
|
|
8
|
-
let(:
|
|
8
|
+
let(:limits) { [50, 100] }
|
|
9
9
|
before do
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
limits.map { |value| AlertLimit.delete(service_id, value) }
|
|
11
|
+
limits.map { |value| AlertLimit.save(service_id, value) }
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
it 'returns a list of alert limits' do
|
|
15
15
|
alert_limits = AlertLimit.load_all(service_id)
|
|
16
16
|
|
|
17
17
|
alert_limits.size.must_equal 2
|
|
18
|
-
alert_limits.map(&:value).must_equal
|
|
18
|
+
alert_limits.map(&:value).must_equal limits
|
|
19
19
|
end
|
|
20
20
|
end
|
|
21
21
|
|
|
@@ -30,40 +30,40 @@ module ThreeScale
|
|
|
30
30
|
|
|
31
31
|
describe '.save' do
|
|
32
32
|
let(:service_id) { 500 }
|
|
33
|
-
let(:
|
|
33
|
+
let(:limit) { 100 }
|
|
34
34
|
|
|
35
35
|
before do
|
|
36
|
-
AlertLimit.delete(service_id,
|
|
36
|
+
AlertLimit.delete(service_id, limit)
|
|
37
37
|
end
|
|
38
38
|
|
|
39
39
|
it 'returns a AlertLimit object' do
|
|
40
|
-
alert_limit = AlertLimit.save(service_id,
|
|
40
|
+
alert_limit = AlertLimit.save(service_id, limit)
|
|
41
41
|
|
|
42
42
|
alert_limit.must_be_kind_of AlertLimit
|
|
43
|
-
alert_limit.value.must_equal
|
|
43
|
+
alert_limit.value.must_equal limit
|
|
44
44
|
end
|
|
45
45
|
end
|
|
46
46
|
|
|
47
47
|
describe '.delete' do
|
|
48
48
|
describe 'with an existing alert limit' do
|
|
49
49
|
let(:service_id) { 300 }
|
|
50
|
-
let(:
|
|
50
|
+
let(:limit) { 50 }
|
|
51
51
|
|
|
52
52
|
before do
|
|
53
|
-
AlertLimit.save(service_id,
|
|
53
|
+
AlertLimit.save(service_id, limit)
|
|
54
54
|
end
|
|
55
55
|
|
|
56
56
|
it 'returns true' do
|
|
57
|
-
AlertLimit.delete(service_id,
|
|
57
|
+
AlertLimit.delete(service_id, limit).must_equal true
|
|
58
58
|
end
|
|
59
59
|
end
|
|
60
60
|
|
|
61
61
|
describe 'with a non-existing alert limit' do
|
|
62
62
|
let(:service_id) { 300 }
|
|
63
|
-
let(:
|
|
63
|
+
let(:limit) { 75 }
|
|
64
64
|
|
|
65
65
|
it 'returns true' do
|
|
66
|
-
AlertLimit.delete(service_id,
|
|
66
|
+
AlertLimit.delete(service_id, limit).must_equal false
|
|
67
67
|
end
|
|
68
68
|
end
|
|
69
69
|
end
|
|
@@ -6,21 +6,21 @@ module ThreeScale
|
|
|
6
6
|
describe 'when there are application keys' do
|
|
7
7
|
let(:service_id) { 100 }
|
|
8
8
|
let(:app_id) { 2001 }
|
|
9
|
-
let(:
|
|
9
|
+
let(:keys) { %w[foo bar] }
|
|
10
10
|
before do
|
|
11
|
-
|
|
11
|
+
keys.map { |key| ApplicationKey.delete(service_id, app_id, key) }
|
|
12
12
|
|
|
13
13
|
Application.save service_id: service_id, id: app_id, state: 'suspended',
|
|
14
14
|
plan_id: '3066', plan_name: 'crappy', redirect_url: 'blah'
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
keys.map { |key| ApplicationKey.save(service_id, app_id, key) }
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
it 'returns a list of application keys' do
|
|
20
20
|
application_keys = ApplicationKey.load_all(service_id, app_id)
|
|
21
21
|
|
|
22
22
|
application_keys.size.must_equal 2
|
|
23
|
-
application_keys.map(&:value).sort.must_equal
|
|
23
|
+
application_keys.map(&:value).sort.must_equal keys.sort
|
|
24
24
|
end
|
|
25
25
|
end
|
|
26
26
|
|
|
@@ -42,20 +42,20 @@ module ThreeScale
|
|
|
42
42
|
describe '.save' do
|
|
43
43
|
let(:service_id) { 500 }
|
|
44
44
|
let(:app_id) { 500 }
|
|
45
|
-
let(:
|
|
45
|
+
let(:key) { "foobar" }
|
|
46
46
|
|
|
47
47
|
before do
|
|
48
|
-
ApplicationKey.delete(service_id, app_id,
|
|
48
|
+
ApplicationKey.delete(service_id, app_id, key)
|
|
49
49
|
|
|
50
50
|
Application.save service_id: service_id, id: app_id, state: 'suspended',
|
|
51
51
|
plan_id: '3066', plan_name: 'crappy', redirect_url: 'blah'
|
|
52
52
|
end
|
|
53
53
|
|
|
54
54
|
it 'returns an ApplicationKey object' do
|
|
55
|
-
application_key = ApplicationKey.save(service_id, app_id,
|
|
55
|
+
application_key = ApplicationKey.save(service_id, app_id, key)
|
|
56
56
|
|
|
57
57
|
application_key.must_be_kind_of ApplicationKey
|
|
58
|
-
application_key.value.must_equal
|
|
58
|
+
application_key.value.must_equal key
|
|
59
59
|
end
|
|
60
60
|
|
|
61
61
|
describe 'with a key that contains special chars (*, _, etc.)' do
|
|
@@ -72,6 +72,22 @@ module ThreeScale
|
|
|
72
72
|
application_key.value.must_equal key
|
|
73
73
|
end
|
|
74
74
|
end
|
|
75
|
+
|
|
76
|
+
describe 'with app ID that contains special characters ({, $, ? etc.)' do
|
|
77
|
+
let(:app_id) { 'abc{1}$3?' }
|
|
78
|
+
let(:key) { 'z#$*' }
|
|
79
|
+
|
|
80
|
+
before do
|
|
81
|
+
ApplicationKey.delete(service_id, app_id, key)
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
it 'saves it correctly' do
|
|
85
|
+
application_key = ApplicationKey.save(service_id, app_id, key)
|
|
86
|
+
|
|
87
|
+
application_key.must_be_kind_of ApplicationKey
|
|
88
|
+
application_key.value.must_equal key
|
|
89
|
+
end
|
|
90
|
+
end
|
|
75
91
|
end
|
|
76
92
|
|
|
77
93
|
describe '.delete' do
|
|
@@ -25,15 +25,15 @@ module ThreeScale
|
|
|
25
25
|
|
|
26
26
|
describe '.load_all' do
|
|
27
27
|
describe 'Getting all referrer filters' do
|
|
28
|
-
let(:
|
|
28
|
+
let(:ref_filters) { %w(foo bar) }
|
|
29
29
|
|
|
30
30
|
before do
|
|
31
|
-
|
|
31
|
+
ref_filters.map { |value| ApplicationReferrerFilter.save(service_id, app_id, value) }
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
it 'returns a sorted list of filters' do
|
|
35
35
|
filters = ApplicationReferrerFilter.load_all(service_id, app_id)
|
|
36
|
-
filters.must_equal
|
|
36
|
+
filters.must_equal ref_filters.sort
|
|
37
37
|
end
|
|
38
38
|
end
|
|
39
39
|
|
data/spec/service_spec.rb
CHANGED
|
@@ -26,8 +26,6 @@ module ThreeScale
|
|
|
26
26
|
id: default_service_id,
|
|
27
27
|
referrer_filters_required: true,
|
|
28
28
|
backend_version: 'oauth',
|
|
29
|
-
default_user_plan_id: 15,
|
|
30
|
-
default_user_plan_name: 'test name',
|
|
31
29
|
default_service: true
|
|
32
30
|
raise unless service.default_service
|
|
33
31
|
|
|
@@ -47,10 +45,7 @@ module ThreeScale
|
|
|
47
45
|
service.provider_key.must_equal default_provider_key
|
|
48
46
|
service.id.must_equal default_service_id.to_s
|
|
49
47
|
service.referrer_filters_required?.must_equal true
|
|
50
|
-
service.user_registration_required?.must_equal true
|
|
51
48
|
service.backend_version.must_equal 'oauth'
|
|
52
|
-
service.default_user_plan_id.must_equal '15'
|
|
53
|
-
service.default_user_plan_name.must_equal 'test name'
|
|
54
49
|
end
|
|
55
50
|
end
|
|
56
51
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: pisoni
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.29.
|
|
4
|
+
version: 1.29.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alejandro Martinez Ruiz
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2023-12-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|
|
@@ -137,7 +137,7 @@ homepage: https://github.com/3scale/pisoni
|
|
|
137
137
|
licenses:
|
|
138
138
|
- Apache-2.0
|
|
139
139
|
metadata: {}
|
|
140
|
-
post_install_message:
|
|
140
|
+
post_install_message:
|
|
141
141
|
rdoc_options:
|
|
142
142
|
- "--charset=UTF-8"
|
|
143
143
|
require_paths:
|
|
@@ -153,8 +153,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
153
153
|
- !ruby/object:Gem::Version
|
|
154
154
|
version: '0'
|
|
155
155
|
requirements: []
|
|
156
|
-
rubygems_version: 3.
|
|
157
|
-
signing_key:
|
|
156
|
+
rubygems_version: 3.1.6
|
|
157
|
+
signing_key:
|
|
158
158
|
specification_version: 4
|
|
159
159
|
summary: Client for the Apisonator internal API for model data
|
|
160
160
|
test_files:
|