configuration_management_backdoor 2.0.0 → 2.1.0
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 256d604237202d3ca98a9a824a6ef95d104706a3
|
4
|
+
data.tar.gz: d19462405fc812186f24a8190d255060f6aaf753
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f5249845394a2c5034c81f82bc59260b63774d4a00ce5d0060ce9b0fc720c56ce2fa16a770855c1450456b8c0e30d7a6257256a1a0265ba02c0f256e9d7faa0
|
7
|
+
data.tar.gz: 01baea46759ee3aa017b1b6d942d6a4146761cf614e928127cba85a9c1c202fffc573f8b8e0931bfcae93951110566fb83fc35905afb653c2c72b57d656867f3
|
@@ -14,13 +14,21 @@ class ConfigurationManagementBackdoorController < ApplicationController
|
|
14
14
|
|
15
15
|
def invoke_ruby
|
16
16
|
code = request.body.read
|
17
|
-
|
17
|
+
begin
|
18
|
+
render json: {result: eval(code)}
|
19
|
+
rescue Exception => e
|
20
|
+
render json: {error: e.to_s}, status: 422
|
21
|
+
end
|
18
22
|
end
|
19
23
|
|
20
24
|
def invoke_sql
|
21
|
-
|
22
|
-
|
23
|
-
|
25
|
+
begin
|
26
|
+
code = request.body.read
|
27
|
+
res = ActiveRecord::Base.connection.execute code
|
28
|
+
render json: {result: res}
|
29
|
+
rescue Exception => e
|
30
|
+
render json: {error: e.to_s}, status: 422
|
31
|
+
end
|
24
32
|
end
|
25
33
|
|
26
34
|
def invoke
|