forest_admin_agent 1.0.0.pre.beta.104 → 1.0.0.pre.beta.105
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/lib/forest_admin_agent/auth/auth_manager.rb +9 -3
- data/lib/forest_admin_agent/auth/oauth2/forest_provider.rb +1 -1
- data/lib/forest_admin_agent/auth/oidc_client_manager.rb +1 -1
- data/lib/forest_admin_agent/routes/security/authentication.rb +5 -2
- data/lib/forest_admin_agent/services/ip_whitelist.rb +1 -1
- data/lib/forest_admin_agent/utils/schema/schema_emitter.rb +1 -1
- data/lib/forest_admin_agent/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bab1660ec5da0ad70169cba69909b512f381629a9e0f3cf83a6a37c769a3d32c
|
4
|
+
data.tar.gz: 8f621b97527e976187d8f381f51458a3e2b2a186d7f3c29dfe7344d32e02b742
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2e05b9d8bfe793d07b1a07a3d321406fe4ca0af15f33c711a2f48d499295b56b2ecf795112631f0fe9b86c4a37e01daba5d1afc2a81fad5df2d401d0833394e
|
7
|
+
data.tar.gz: be0fb1d26c9775938827bfa366bd494851f3fff86e58dba928e213743002a1301f56034f0ff1769acd5c071cae22faa8d9b142c7b885acbf73e3cca30687a42a
|
@@ -14,7 +14,10 @@ module ForestAdminAgent
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def verify_code_and_generate_token(params)
|
17
|
-
|
17
|
+
unless params['state']
|
18
|
+
raise ForestAdminAgent::Error,
|
19
|
+
ForestAdminAgent::Utils::ErrorMessages::INVALID_STATE_MISSING
|
20
|
+
end
|
18
21
|
|
19
22
|
if Facades::Container.cache(:debug)
|
20
23
|
OpenIDConnect.http_config do |options|
|
@@ -36,12 +39,15 @@ module ForestAdminAgent
|
|
36
39
|
|
37
40
|
def get_rendering_id_from_state(state)
|
38
41
|
state = JSON.parse(state.tr("'", '"').gsub('=>', ':'))
|
39
|
-
|
42
|
+
unless state.key? 'renderingId'
|
43
|
+
raise ForestAdminAgent::Error,
|
44
|
+
ForestAdminAgent::Utils::ErrorMessages::INVALID_STATE_RENDERING_ID
|
45
|
+
end
|
40
46
|
|
41
47
|
begin
|
42
48
|
Integer(state['renderingId'])
|
43
49
|
rescue ArgumentError
|
44
|
-
raise Error, ForestAdminAgent::Utils::ErrorMessages::INVALID_RENDERING_ID
|
50
|
+
raise ForestAdminAgent::Error, ForestAdminAgent::Utils::ErrorMessages::INVALID_RENDERING_ID
|
45
51
|
end
|
46
52
|
|
47
53
|
state['renderingId'].to_i
|
@@ -39,7 +39,7 @@ module ForestAdminAgent
|
|
39
39
|
server_error = response.body.key?('errors') ? response.body['errors'][0] : nil
|
40
40
|
if server_error &&
|
41
41
|
server_error['name'] == Utils::ErrorMessages::TWO_FACTOR_AUTHENTICATION_REQUIRED
|
42
|
-
raise Error, Utils::ErrorMessages::TWO_FACTOR_AUTHENTICATION_REQUIRED
|
42
|
+
raise ForestAdminAgent::Error, Utils::ErrorMessages::TWO_FACTOR_AUTHENTICATION_REQUIRED
|
43
43
|
end
|
44
44
|
|
45
45
|
response.body.with_indifferent_access
|
@@ -71,7 +71,7 @@ module ForestAdminAgent
|
|
71
71
|
def retrieve_config(uri)
|
72
72
|
OAuth2::OidcConfig.discover! uri
|
73
73
|
rescue OpenIDConnect::Discovery::DiscoveryFailed
|
74
|
-
raise Error, ForestAdminAgent::Utils::ErrorMessages::SERVER_DOWN
|
74
|
+
raise ForestAdminAgent::Error, ForestAdminAgent::Utils::ErrorMessages::SERVER_DOWN
|
75
75
|
end
|
76
76
|
end
|
77
77
|
end
|
@@ -80,12 +80,15 @@ module ForestAdminAgent
|
|
80
80
|
protected
|
81
81
|
|
82
82
|
def get_and_check_rendering_id(params)
|
83
|
-
|
83
|
+
unless params['renderingId']
|
84
|
+
raise ForestAdminAgent::Error,
|
85
|
+
ForestAdminAgent::Utils::ErrorMessages::MISSING_RENDERING_ID
|
86
|
+
end
|
84
87
|
|
85
88
|
begin
|
86
89
|
Integer(params['renderingId'])
|
87
90
|
rescue ArgumentError
|
88
|
-
raise Error, ForestAdminAgent::Utils::ErrorMessages::INVALID_RENDERING_ID
|
91
|
+
raise ForestAdminAgent::Error, ForestAdminAgent::Utils::ErrorMessages::INVALID_RENDERING_ID
|
89
92
|
end
|
90
93
|
|
91
94
|
params['renderingId'].to_i
|
@@ -93,7 +93,7 @@ module ForestAdminAgent
|
|
93
93
|
@use_ip_whitelist = ip_whitelist_data['use_ip_whitelist']
|
94
94
|
@rules = ip_whitelist_data['rules']
|
95
95
|
rescue StandardError
|
96
|
-
raise Error, ForestAdminAgent::Utils::ErrorMessages::UNEXPECTED
|
96
|
+
raise ForestAdminAgent::Error, ForestAdminAgent::Utils::ErrorMessages::UNEXPECTED
|
97
97
|
end
|
98
98
|
end
|
99
99
|
end
|