forest_liana 6.0.0.pre.beta.3 → 6.0.0.pre.beta.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/forest_liana/authentication_controller.rb +1 -1
- data/app/services/forest_liana/oidc_client_manager.rb +9 -5
- data/lib/forest_liana.rb +1 -0
- data/lib/forest_liana/version.rb +1 -1
- data/spec/requests/authentications_spec.rb +4 -3
- data/test/services/forest_liana/resources_getter_test.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d299c9968621d0592da4e25c67969073237e6cf0eac69d0d898e6db6027ad14
|
4
|
+
data.tar.gz: bbb59dfd951086e62df9829124fcf57ef0b71d40550597abeaff3de07450c946
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b3dc3c43d682e085dd95066648471f779bd03da28b935eb645532e04da42ab75651d679291d03118355cba35379655878fa9a3a36a2fb945fbdb1ac35099748
|
7
|
+
data.tar.gz: 2bd81a3eb3aa40c9129b1afd5fc86004eb10bbe6115f422537f82ffbeec0d94be77c542f68ed5494688464f1857bee5b691187a95d86a45357ca6d3e07b7c400
|
@@ -46,7 +46,7 @@ module ForestLiana
|
|
46
46
|
{ 'renderingId' => rendering_id },
|
47
47
|
)
|
48
48
|
|
49
|
-
|
49
|
+
render json: { authorizationUrl: result['authorization_url']}, status: 200
|
50
50
|
rescue => error
|
51
51
|
render json: { errors: [{ status: 500, detail: error.message }] },
|
52
52
|
status: :internal_server_error, serializer: nil
|
@@ -8,11 +8,15 @@ module ForestLiana
|
|
8
8
|
if client_data.nil?
|
9
9
|
configuration = ForestLiana::OidcConfigurationRetriever.retrieve()
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
11
|
+
if ForestLiana.forest_client_id.nil?
|
12
|
+
client_credentials = ForestLiana::OidcDynamicClientRegistrator.register({
|
13
|
+
token_endpoint_auth_method: 'none',
|
14
|
+
redirect_uris: [callback_url],
|
15
|
+
registration_endpoint: configuration['registration_endpoint']
|
16
|
+
})
|
17
|
+
else
|
18
|
+
client_credentials['client_id'] = ForestLiana.forest_client_id
|
19
|
+
end
|
16
20
|
|
17
21
|
client_data = { :client_id => client_credentials['client_id'], :issuer => configuration['issuer'] }
|
18
22
|
Rails.cache.write(callback_url, client_data)
|
data/lib/forest_liana.rb
CHANGED
data/lib/forest_liana/version.rb
CHANGED
@@ -33,12 +33,13 @@ describe "Authentications", type: :request do
|
|
33
33
|
}
|
34
34
|
end
|
35
35
|
|
36
|
-
it "should respond with a
|
37
|
-
expect(response).to have_http_status(
|
36
|
+
it "should respond with a 200 code" do
|
37
|
+
expect(response).to have_http_status(200)
|
38
38
|
end
|
39
39
|
|
40
40
|
it "should return a valid authentication url" do
|
41
|
-
|
41
|
+
body = JSON.parse(response.body, :symbolize_names => true)
|
42
|
+
expect(body[:authorizationUrl]).to eq('https://api.forestadmin.com/oidc/auth?client_id=random_id&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Fforest%2Fauthentication%2Fcallback&response_type=code&scope=openid%20email%20profile&state=%7B%22renderingId%22%3D%3E42%7D')
|
42
43
|
end
|
43
44
|
end
|
44
45
|
|
@@ -119,8 +119,8 @@ module ForestLiana
|
|
119
119
|
records = getter.records
|
120
120
|
count = getter.count
|
121
121
|
|
122
|
-
assert records.count ==
|
123
|
-
assert count =
|
122
|
+
assert records.count == 2
|
123
|
+
assert count = 2
|
124
124
|
assert records.first.id == 4
|
125
125
|
assert records.first.name == 'Oak'
|
126
126
|
assert records.first.owner.name == 'Arnaud Besnier'
|
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: 6.0.0.pre.beta.
|
4
|
+
version: 6.0.0.pre.beta.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:
|
11
|
+
date: 2021-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|