forest_liana 9.5.3 → 9.5.4
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '01219141321710917e3b67dcd37db280425c4cf1620c491172c4bc7ab5616047'
|
4
|
+
data.tar.gz: 12f0c3ae8d97f28a82e70f38c93545f0bed346607c7301a63436077a3e95e858
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 775dbe23c00ecd54bd64cde35a6efc3c40d72d1e873fa9e11d7077c830a1778001d6a90f4c4e9373dcd782e39d371b6673dab6b8f8e7a539a44b0bda49d14f78
|
7
|
+
data.tar.gz: 42441b9c0e1df5f8d760b0216982865ce1c6193452c9fd2677708b1c3171cd162dee9ae61365013a8bb4790998ff2f3cac2e3fe96dc80bd64ecfc6bd003b7ae5
|
@@ -49,20 +49,15 @@ module ForestLiana
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def self.fetch_scopes(rendering_id)
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
data
|
63
|
-
end
|
64
|
-
else
|
65
|
-
raise 'Unable to fetch scopes'
|
52
|
+
Rails.cache.fetch("forest.scopes.#{rendering_id}", expires_in: @@scope_cache_expiration_delta) do
|
53
|
+
response = ForestLiana::ForestApiRequester.get("/liana/v4/permissions/renderings/#{rendering_id}")
|
54
|
+
raise 'Unable to fetch scopes' unless response.is_a?(Net::HTTPOK)
|
55
|
+
parsed_response = JSON.parse(response.body)
|
56
|
+
|
57
|
+
{
|
58
|
+
'scopes' => decode_scope(parsed_response['collections']),
|
59
|
+
'team' => parsed_response['team']
|
60
|
+
}
|
66
61
|
end
|
67
62
|
end
|
68
63
|
|
data/lib/forest_liana/version.rb
CHANGED
@@ -73,6 +73,14 @@ module ForestLiana
|
|
73
73
|
'team' => {'id' => '1', 'name' => 'Operations'},
|
74
74
|
})
|
75
75
|
end
|
76
|
+
|
77
|
+
it 'calls the API only once, even with multiple fetch_scopes calls' do
|
78
|
+
described_class.fetch_scopes(rendering_id)
|
79
|
+
described_class.fetch_scopes(rendering_id)
|
80
|
+
|
81
|
+
expect(ForestLiana::ForestApiRequester).to have_received(:get).once
|
82
|
+
end
|
83
|
+
|
76
84
|
end
|
77
85
|
|
78
86
|
describe 'when scope contains dynamic values' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: forest_liana
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 9.5.
|
4
|
+
version: 9.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sandro Munda
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|