motor-admin 0.4.23 → 0.4.25
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/motor/auth_tokens_controller.rb +1 -1
- data/app/controllers/motor/data_controller.rb +2 -0
- data/app/controllers/motor/run_api_requests_controller.rb +1 -1
- data/app/controllers/motor/run_graphql_requests_controller.rb +1 -1
- data/app/models/motor/api_config.rb +2 -2
- data/lib/motor/queries/run_query.rb +6 -15
- data/lib/motor/version.rb +1 -1
- 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: 348ae639231cccca61f74fd3f92c913ac2d63778807e67ad264f43e6be2afa01
|
4
|
+
data.tar.gz: 9f7568df6897b21182d70da600d764a74d806a24affb7764872ef00eb6b345e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42982ac002c2d2ba6d34c42d9ca3b734a8fb8ec2f2b4077408696530c5dcb2d8e0589dc016300b088a4d645452ca9e489c08382f67ebf0f825e7848c2136538a
|
7
|
+
data.tar.gz: 1ed7b6047594f336ddeba7e90348289325d03a3d61c5903174fbca5841c7c4453940ffbbbd2ac01c3f6b2548f6c52c7f3c917a2729f4f8e97d2c19df4cd39d83
|
@@ -28,7 +28,7 @@ module Motor
|
|
28
28
|
|
29
29
|
def respond_with_generic_jwt
|
30
30
|
payload = { uid: current_user.id, exp: GENERIC_TOKEN_TTL.from_now.to_i }
|
31
|
-
token = JWT.encode(payload, Rails.application.
|
31
|
+
token = JWT.encode(payload, Rails.application.credentials.secret_key_base)
|
32
32
|
|
33
33
|
render json: { token: token }
|
34
34
|
end
|
@@ -46,7 +46,7 @@ module Motor
|
|
46
46
|
|
47
47
|
payload = { uid: current_user.id, email: current_user.email, exp: JWT_TTL.from_now.to_i }
|
48
48
|
|
49
|
-
JWT.encode(payload, Rails.application.
|
49
|
+
JWT.encode(payload, Rails.application.credentials.secret_key_base)
|
50
50
|
end
|
51
51
|
|
52
52
|
def request_params
|
@@ -38,7 +38,7 @@ module Motor
|
|
38
38
|
|
39
39
|
payload = { uid: current_user.id, email: current_user.email, exp: JWT_TTL.from_now.to_i }
|
40
40
|
|
41
|
-
JWT.encode(payload, Rails.application.
|
41
|
+
JWT.encode(payload, Rails.application.credentials.secret_key_base)
|
42
42
|
end
|
43
43
|
|
44
44
|
def request_params
|
@@ -7,11 +7,11 @@ module Motor
|
|
7
7
|
attribute :preferences, default: -> { ActiveSupport::HashWithIndifferentAccess.new }
|
8
8
|
attribute :credentials, default: -> { ActiveSupport::HashWithIndifferentAccess.new }
|
9
9
|
|
10
|
-
serialize :credentials, Motor::HashSerializer
|
11
|
-
|
12
10
|
if Rails.version.to_f >= 7.1
|
11
|
+
serialize :credentials, coder: Motor::HashSerializer
|
13
12
|
serialize :preferences, coder: Motor::HashSerializer
|
14
13
|
else
|
14
|
+
serialize :credentials, Motor::HashSerializer
|
15
15
|
serialize :preferences, Motor::HashSerializer
|
16
16
|
end
|
17
17
|
|
@@ -61,27 +61,18 @@ module Motor
|
|
61
61
|
# @param filters [Hash]
|
62
62
|
# @return [ActiveRecord::Result]
|
63
63
|
def execute_query(query, limit, variables_hash, filters)
|
64
|
-
result = nil
|
65
|
-
|
66
64
|
connection_class = fetch_connection_class(query)
|
67
65
|
|
68
66
|
statement = prepare_sql_statement(connection_class, query, limit, variables_hash, filters)
|
69
67
|
|
70
|
-
connection_class.
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
else
|
76
|
-
statement = normalize_statement_for_sql(statement)
|
77
|
-
|
78
|
-
connection_class.connection.exec_query(*statement)
|
79
|
-
end
|
68
|
+
case connection_class.connection.class.name
|
69
|
+
when 'ActiveRecord::ConnectionAdapters::PostgreSQLAdapter'
|
70
|
+
PostgresqlExecQuery.call(connection_class.connection, statement)
|
71
|
+
else
|
72
|
+
statement = normalize_statement_for_sql(statement)
|
80
73
|
|
81
|
-
|
74
|
+
connection_class.connection.exec_query(*statement)
|
82
75
|
end
|
83
|
-
|
84
|
-
result
|
85
76
|
end
|
86
77
|
|
87
78
|
def validate_query!(sql)
|
data/lib/motor/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: motor-admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.25
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pete Matsyburka
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-12-
|
11
|
+
date: 2023-12-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ar_lazy_preload
|