glib-web 3.23.0 → 3.23.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/concerns/glib/json/libs.rb +28 -9
- data/app/controllers/concerns/glib/json/new_dynamic_text.rb +0 -0
- data/app/helpers/glib/app_feature_support_helper.rb +0 -0
- data/app/helpers/glib/dynamic_texts_helper.rb +0 -0
- data/app/helpers/glib/json_ui/action_builder/sheets.rb +0 -0
- data/app/helpers/glib/json_ui/analytics_helper.rb +0 -0
- data/app/helpers/glib/json_ui/generic_builders.rb +0 -0
- data/app/helpers/glib/urls_helper.rb +2 -2
- data/app/models/glib/active_storage/attachment.rb +0 -0
- data/app/models/glib/active_storage/blob.rb +0 -0
- data/app/models/glib/dynamic_text_record.rb +0 -0
- data/app/models/glib/text.rb +0 -0
- data/app/validators/email_typo_validator.rb +0 -0
- data/app/validators/email_validator.rb +0 -0
- data/app/validators/url_validator.rb +0 -0
- data/app/views/json_ui/garage/actions/_sheets.json.jbuilder +0 -0
- data/app/views/json_ui/garage/actions/dialogs_oauth_post.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/dynamic_select_data.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/generic_post.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/submission_flow.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/submission_flow_post.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/submission_indicator.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/submission_indicator_post.json.jbuilder +0 -0
- data/app/views/json_ui/garage/home/blank.json.jbuilder +0 -0
- data/app/views/json_ui/garage/home/slow.json.jbuilder +0 -0
- data/app/views/json_ui/garage/lists/autoload_all.json.jbuilder +0 -0
- data/app/views/json_ui/garage/lists/autoload_as_needed.json.jbuilder +0 -0
- data/app/views/json_ui/garage/lists/chat_ui.json.jbuilder +0 -0
- data/app/views/json_ui/garage/lists/fab.json.jbuilder +0 -0
- data/app/views/json_ui/garage/notifications/web_socket.json.jbuilder +0 -0
- data/app/views/json_ui/garage/pages/custom_style_class.json.jbuilder +0 -0
- data/app/views/json_ui/garage/pages/full_width.json.jbuilder +0 -0
- data/app/views/json_ui/garage/pages/full_width_height.json.jbuilder +0 -0
- data/app/views/json_ui/garage/pages/layout.json.jbuilder +0 -0
- data/app/views/json_ui/garage/pages/lifecycle_hooks.json.jbuilder +0 -0
- data/app/views/json_ui/garage/pages/loading_indicator.json.jbuilder +0 -0
- data/app/views/json_ui/garage/pages/nested_scroll.json.jbuilder +0 -0
- data/app/views/json_ui/garage/pages/redirect_onload.json.jbuilder +0 -0
- data/app/views/json_ui/garage/panels/_styled.json.jbuilder +0 -0
- data/app/views/json_ui/garage/panels/card.json.jbuilder +0 -0
- data/app/views/json_ui/garage/panels/custom.json.jbuilder +0 -0
- data/app/views/json_ui/garage/panels/outlined.json.jbuilder +0 -0
- data/app/views/json_ui/garage/services/dynamic_text.json.jbuilder +0 -0
- data/app/views/json_ui/garage/services/image.json.jbuilder +0 -0
- data/app/views/json_ui/garage/services/index.json.jbuilder +0 -0
- data/app/views/json_ui/garage/tables/_autoload_section.json.jbuilder +0 -0
- data/app/views/json_ui/garage/tables/autoload_all.json.jbuilder +0 -0
- data/app/views/json_ui/garage/tables/autoload_as_needed.json.jbuilder +0 -0
- data/app/views/json_ui/garage/tables/export_import.json.jbuilder +0 -0
- data/app/views/json_ui/garage/tables/index.json.jbuilder +0 -0
- data/app/views/json_ui/garage/views/calendar_data.json.jbuilder +0 -0
- data/app/views/json_ui/garage/views/links.json.jbuilder +0 -0
- data/app/views/json_ui/garage/views/map_data.json.jbuilder +0 -0
- data/app/views/json_ui/garage/views/multimedia.json.jbuilder +0 -0
- data/app/views/layouts/json_ui/no_custom.html.erb +0 -0
- data/lib/generators/glib/install_generator.rb +0 -0
- data/lib/generators/templates/20191017062519_create_texts.rb +0 -0
- data/lib/generators/templates/20191024063257_add_scope_to_texts.rb +0 -0
- data/lib/generators/templates/20191112095018_add_lang_to_texts.rb +0 -0
- data/lib/generators/templates/20191126071051_create_active_storage_tables.active_storage.rb +0 -0
- data/lib/generators/templates/database.yml +0 -0
- data/lib/generators/templates/dynamic_text.rb +0 -0
- data/lib/glib/crypt/utils.rb +2 -1
- data/lib/glib/crypt.rb +27 -0
- data/lib/glib/dynamic_text/config.rb +0 -0
- data/lib/glib/dynamic_text.rb +0 -0
- data/lib/glib/json_crawler/action_crawler.rb +0 -0
- data/lib/glib/json_crawler/action_crawlers/action_http.rb +0 -0
- data/lib/glib/json_crawler/action_crawlers/dialogs_alert.rb +0 -0
- data/lib/glib/json_crawler/action_crawlers/menu.rb +0 -0
- data/lib/glib/json_crawler/action_crawlers/run_multiple.rb +0 -0
- data/lib/glib/json_crawler/action_crawlers/windows_open.rb +0 -0
- data/lib/glib/json_crawler/coverage.rb +0 -0
- data/lib/glib/value.rb +0 -0
- data/lib/glib/version.rb +0 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a463edeeb95d3a9e47207f9e5fd921303312b569631d93dd5ea8c23efba11ed
|
4
|
+
data.tar.gz: b38669675d682f3d496494911644e77c1a6c1a3f7cf2842ae3ad711881d0a491
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f18b467c3684b845aa4a9df7ea9a59a2f295dca6e8a2a33e3b10f843f6e56470de7acd8033c41ef6e0648a289e40e91e9dcdfa525f4eddf3f1babcf58d2a39f5
|
7
|
+
data.tar.gz: 1261d90e5b621f6a27b93505af7fef472d6fb7375a042827a84003694a212b271bedbaa08c1a08eae6c2c1334486b01f479bb0a8729fe03f6891494b1378b4db
|
@@ -62,14 +62,27 @@ module Glib::Json::Libs
|
|
62
62
|
JSON.parse(render_to_string(template, locals: args))
|
63
63
|
end
|
64
64
|
|
65
|
-
def
|
65
|
+
def glib_html_url(url)
|
66
|
+
url = url.include?('?') ? url.sub(/.json\?/, '?') : url.sub(/.json$/, '')
|
67
|
+
|
68
|
+
# As much as possible, try retaining the front fragment by matching the back, because
|
69
|
+
# the front could be either a `?` or `&`
|
70
|
+
url = url.sub(/format=json\&/, '');
|
71
|
+
|
72
|
+
# If no match, then we replace the front fragment
|
73
|
+
url.sub(/[\&\?]format=json/, '');
|
74
|
+
end
|
75
|
+
|
76
|
+
def glib_redirect_to(url, return_to_previous: false)
|
77
|
+
url = __delete_redirect_back_url(url) if return_to_previous
|
78
|
+
|
66
79
|
respond_to do |format|
|
67
80
|
format.html do
|
68
81
|
redirect_to url
|
69
82
|
end
|
70
83
|
format.json do
|
71
84
|
if __json_ui_rendering?
|
72
|
-
redirect_to url
|
85
|
+
redirect_to glib_html_url(url)
|
73
86
|
return
|
74
87
|
end
|
75
88
|
|
@@ -147,10 +160,10 @@ module Glib::Json::Libs
|
|
147
160
|
session.delete(REDIRECT_BACK_KEY) || url
|
148
161
|
end
|
149
162
|
|
150
|
-
def html_ui_redirect_back_or_to(default_url)
|
151
|
-
|
152
|
-
|
153
|
-
end
|
163
|
+
# def html_ui_redirect_back_or_to(default_url)
|
164
|
+
# redirect_url = __delete_redirect_back_url(default_url)
|
165
|
+
# redirect_to redirect_url
|
166
|
+
# end
|
154
167
|
|
155
168
|
def json_ui_redirect_back_or_to(default_url, json_action)
|
156
169
|
redirect_url = __delete_redirect_back_url(default_url)
|
@@ -210,9 +223,15 @@ module Glib::Json::Libs
|
|
210
223
|
end
|
211
224
|
|
212
225
|
def json_ui_redirect_to(url)
|
213
|
-
|
214
|
-
|
215
|
-
|
226
|
+
# `onLoad` also executes in `onResponse` situation, e.g. form submit.
|
227
|
+
on_load = { action: 'windows/open', url: url }
|
228
|
+
|
229
|
+
if glib_json_dialog_mode?
|
230
|
+
# Only do this in dialog mode because this seems to add to the rendering time
|
231
|
+
# (i.e. longer flicker time), presumably due to the use of things like `nextTick()`.
|
232
|
+
on_load = { action: 'dialogs/close', onClose: on_load }
|
233
|
+
end
|
234
|
+
render json: { onLoad: on_load }
|
216
235
|
end
|
217
236
|
|
218
237
|
module ClassMethods
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Glib
|
2
2
|
module UrlsHelper
|
3
|
-
def glib_url_current(
|
4
|
-
url_for(
|
3
|
+
def glib_url_current(replacement_params: params.to_unsafe_h, extra_params: {})
|
4
|
+
url_for(replacement_params.merge(extra_params.merge(only_path: false)))
|
5
5
|
end
|
6
6
|
|
7
7
|
def glib_url_equals_current?(url)
|
File without changes
|
File without changes
|
File without changes
|
data/app/models/glib/text.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/glib/crypt/utils.rb
CHANGED
data/lib/glib/crypt.rb
CHANGED
@@ -1 +1,28 @@
|
|
1
1
|
require_relative './crypt/utils'
|
2
|
+
|
3
|
+
# A replacement of Glib::Crypt::Utils
|
4
|
+
module Glib
|
5
|
+
class Crypt
|
6
|
+
# Recommended digest: 'SHA256'
|
7
|
+
def self.encrypt(original_message, encryption_secret, encryption_salt, digest)
|
8
|
+
encryptor = message_encryptor(encryption_secret, encryption_salt, digest)
|
9
|
+
CGI.escape(encryptor.encrypt_and_sign(original_message))
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.decrypt(encrypted_message, encryption_secret, encryption_salt, digest)
|
13
|
+
encryptor = message_encryptor(encryption_secret, encryption_salt, digest)
|
14
|
+
begin
|
15
|
+
encryptor.decrypt_and_verify(CGI.unescape(encrypted_message))
|
16
|
+
rescue ActiveSupport::MessageEncryptor::InvalidMessage
|
17
|
+
nil
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
def self.message_encryptor(encryption_secret, encryption_salt, digest)
|
23
|
+
key_generator = ActiveSupport::KeyGenerator.new(encryption_secret, iterations: 1000)
|
24
|
+
key_secret = key_generator.generate_key(encryption_salt, 32)
|
25
|
+
ActiveSupport::MessageEncryptor.new(key_secret, digest: digest, serializer: JSON)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
File without changes
|
data/lib/glib/dynamic_text.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/glib/value.rb
CHANGED
File without changes
|
data/lib/glib/version.rb
CHANGED
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glib-web
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.23.
|
4
|
+
version: 3.23.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ''
|
@@ -336,7 +336,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
336
336
|
- !ruby/object:Gem::Version
|
337
337
|
version: '0'
|
338
338
|
requirements: []
|
339
|
-
|
339
|
+
rubyforge_project:
|
340
|
+
rubygems_version: 2.7.6
|
340
341
|
signing_key:
|
341
342
|
specification_version: 4
|
342
343
|
summary: ''
|