forest_liana 6.0.0 → 6.0.1
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 +1 -1
- data/lib/forest_liana/bootstrapper.rb +7 -0
- data/lib/forest_liana/version.rb +1 -1
- data/lib/generators/forest_liana/install_generator.rb +13 -5
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5eb4a2cdd418f025538c584b5b86f43e9151b25b4d26141fea031257ef5e57c0
|
4
|
+
data.tar.gz: ab34c4d959ca9595817cd2177e7f93592a4646710c2037a240feea7f170a0cc6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 023c6f222358d5549e88ade82349e1fc32606cc2c7bc42c979b6e62da09c1f21b6913df034ec0d269377923dc7f97d1aac03a202093583961c85be4edf748cb7
|
7
|
+
data.tar.gz: 95a443e2a9f13524ffebffea1ece3d7617536439941e1cc1d5b3a41f08e84003d1acec4b6a5fd6cc6ca3811d00442603a768d3763476a3b64e2a34cff3441c4e
|
@@ -86,7 +86,7 @@ module ForestLiana
|
|
86
86
|
render json: response_body, status: 200
|
87
87
|
|
88
88
|
rescue => error
|
89
|
-
render json: { errors: [{ status: error.error_code || 500, detail: error.message }] },
|
89
|
+
render json: { errors: [{ status: error.try(:error_code) || 500, detail: error.message }] },
|
90
90
|
status: error.status || :internal_server_error, serializer: nil
|
91
91
|
end
|
92
92
|
end
|
@@ -15,7 +15,7 @@ module ForestLiana
|
|
15
15
|
registration_endpoint: configuration['registration_endpoint']
|
16
16
|
})
|
17
17
|
else
|
18
|
-
client_credentials
|
18
|
+
client_credentials = { 'client_id' => ForestLiana.forest_client_id }
|
19
19
|
end
|
20
20
|
|
21
21
|
client_data = { :client_id => client_credentials['client_id'], :issuer => configuration['issuer'] }
|
@@ -18,6 +18,13 @@ module ForestLiana
|
|
18
18
|
ForestLiana.auth_secret = ForestLiana.auth_key
|
19
19
|
end
|
20
20
|
|
21
|
+
unless Rails.application.config.action_controller.perform_caching || Rails.env.test? || ForestLiana.forest_client_id
|
22
|
+
FOREST_LOGGER.error "You need to enable caching on your environment to use Forest Admin.\n" \
|
23
|
+
"For a development environment, run: `rails dev:cache`\n" \
|
24
|
+
"Or setup a static forest_client_id by following this part of the documentation:\n" \
|
25
|
+
"https://docs.forestadmin.com/documentation/how-tos/maintain/upgrade-notes-rails/upgrade-to-v6#setup-a-static-clientid"
|
26
|
+
end
|
27
|
+
|
21
28
|
fetch_models
|
22
29
|
check_integrations_setup
|
23
30
|
namespace_duplicated_models
|
data/lib/forest_liana/version.rb
CHANGED
@@ -5,6 +5,7 @@ module ForestLiana
|
|
5
5
|
desc 'Forest Rails Liana installation generator'
|
6
6
|
|
7
7
|
argument :env_secret, type: :string, required: true, desc: 'required', banner: 'env_secret'
|
8
|
+
argument :application_url, type: :string, required: false, desc: 'optional', banner: 'application_url', default: 'http://localhost:3000'
|
8
9
|
|
9
10
|
def install
|
10
11
|
if ForestLiana.env_secret.present?
|
@@ -27,35 +28,42 @@ module ForestLiana
|
|
27
28
|
if File.exist? 'config/secrets.yml'
|
28
29
|
inject_into_file 'config/secrets.yml', after: "development:\n" do
|
29
30
|
" forest_env_secret: #{env_secret}\n" +
|
30
|
-
" forest_auth_secret: #{auth_secret}\n"
|
31
|
+
" forest_auth_secret: #{auth_secret}\n" +
|
32
|
+
" forest_application_url: #{application_url}\n"
|
31
33
|
end
|
32
34
|
|
33
35
|
inject_into_file 'config/secrets.yml', after: "staging:\n", force: true do
|
34
36
|
" forest_env_secret: <%= ENV[\"FOREST_ENV_SECRET\"] %>\n" +
|
35
|
-
" forest_auth_secret: <%= ENV[\"FOREST_AUTH_SECRET\"] %>\n"
|
37
|
+
" forest_auth_secret: <%= ENV[\"FOREST_AUTH_SECRET\"] %>\n" +
|
38
|
+
" forest_application_url: <%= ENV[\"FOREST_APPLICATION_URL\"] %>\n"
|
36
39
|
end
|
37
40
|
|
38
41
|
inject_into_file 'config/secrets.yml', after: "production:\n", force: true do
|
39
42
|
" forest_env_secret: <%= ENV[\"FOREST_ENV_SECRET\"] %>\n" +
|
40
|
-
" forest_auth_secret: <%= ENV[\"FOREST_AUTH_SECRET\"] %>\n"
|
43
|
+
" forest_auth_secret: <%= ENV[\"FOREST_AUTH_SECRET\"] %>\n" +
|
44
|
+
" forest_application_url: <%= ENV[\"FOREST_APPLICATION_URL\"] %>\n"
|
41
45
|
end
|
42
46
|
else
|
43
47
|
create_file 'config/secrets.yml' do
|
44
48
|
"development:\n" +
|
45
49
|
" forest_env_secret: #{env_secret}\n" +
|
46
50
|
" forest_auth_secret: #{auth_secret}\n" +
|
51
|
+
" forest_application_url: #{application_url}\n" +
|
47
52
|
"staging:\n" +
|
48
53
|
" forest_env_secret: <%= ENV[\"FOREST_ENV_SECRET\"] %>\n" +
|
49
54
|
" forest_auth_secret: <%= ENV[\"FOREST_AUTH_SECRET\"] %>\n" +
|
55
|
+
" forest_application_url: <%= ENV[\"FOREST_APPLICATION_URL\"] %>\n" +
|
50
56
|
"production:\n" +
|
51
57
|
" forest_env_secret: <%= ENV[\"FOREST_ENV_SECRET\"] %>\n" +
|
52
|
-
" forest_auth_secret: <%= ENV[\"FOREST_AUTH_SECRET\"] %>\n"
|
58
|
+
" forest_auth_secret: <%= ENV[\"FOREST_AUTH_SECRET\"] %>\n" +
|
59
|
+
" forest_application_url: <%= ENV[\"FOREST_APPLICATION_URL\"] %>\n"
|
53
60
|
end
|
54
61
|
end
|
55
62
|
|
56
63
|
initializer 'forest_liana.rb' do
|
57
64
|
"ForestLiana.env_secret = Rails.application.secrets.forest_env_secret" +
|
58
|
-
"\nForestLiana.auth_secret = Rails.application.secrets.forest_auth_secret"
|
65
|
+
"\nForestLiana.auth_secret = Rails.application.secrets.forest_auth_secret" +
|
66
|
+
"\nForestLiana.application_url = Rails.application.secrets.forest_application_url"
|
59
67
|
end
|
60
68
|
end
|
61
69
|
end
|
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.
|
4
|
+
version: 6.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sandro Munda
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-02-
|
11
|
+
date: 2021-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -469,7 +469,7 @@ homepage: https://github.com/ForestAdmin/forest-rails
|
|
469
469
|
licenses:
|
470
470
|
- GPL-3.0
|
471
471
|
metadata: {}
|
472
|
-
post_install_message:
|
472
|
+
post_install_message:
|
473
473
|
rdoc_options: []
|
474
474
|
require_paths:
|
475
475
|
- lib
|
@@ -485,7 +485,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
485
485
|
version: '0'
|
486
486
|
requirements: []
|
487
487
|
rubygems_version: 3.1.2
|
488
|
-
signing_key:
|
488
|
+
signing_key:
|
489
489
|
specification_version: 4
|
490
490
|
summary: Official Rails Liana for Forest
|
491
491
|
test_files:
|