thecore_backend_commons 3.0.7 → 3.0.9
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
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f945a5a988302320da13aacff1e60ac457bcfa90e821f7d2f3bd8c504814217f
|
|
4
|
+
data.tar.gz: 17f5d7df875584740df6e1445cec02bda7e8222cfe7e33586c5681c054baead5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 045c8bebc2f8cfca9427e90955a5a6d0651f9a36b808fe848121699bf41e0495af70c14f6baa2e0ca9c07c5880085e60522be7225c3057b23eaff093315fbe03
|
|
7
|
+
data.tar.gz: '025857799451bfa92eb226751bc2605510e600ba1e605bfbcefdba4c772a1e754b06285ed3dd0942845c1667be25b928e816b00fead8719c85a57c2c3f55de04'
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
class ActivityLogChannel < ApplicationCable::Channel
|
|
2
|
+
def subscribed
|
|
3
|
+
stream_from "messages"
|
|
4
|
+
end
|
|
5
|
+
|
|
6
|
+
def unsubscribed
|
|
7
|
+
# Any cleanup needed when channel is unsubscribed
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
# https://cableready.stimulusreflex.com/troubleshooting/#verify-actioncable
|
|
11
|
+
|
|
12
|
+
def receive(data)
|
|
13
|
+
puts data["message"]
|
|
14
|
+
ActionCable.server.broadcast("messages", "ActionCable is connected")
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
require 'active_support/concern'
|
|
2
|
+
|
|
3
|
+
module CableConnectionConcern
|
|
4
|
+
extend ActiveSupport::Concern
|
|
5
|
+
included do
|
|
6
|
+
identified_by :current_user
|
|
7
|
+
|
|
8
|
+
def connect
|
|
9
|
+
self.current_user = find_verified_user
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
protected
|
|
13
|
+
|
|
14
|
+
def find_verified_user # this checks whether a user is authenticated with devise
|
|
15
|
+
if verified_user = env['warden'].user
|
|
16
|
+
verified_user
|
|
17
|
+
else
|
|
18
|
+
reject_unauthorized_connection
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: thecore_backend_commons
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.0.
|
|
4
|
+
version: 3.0.9
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Gabriele Tassoni
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-
|
|
11
|
+
date: 2023-04-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: thecore_auth_commons
|
|
@@ -108,6 +108,34 @@ dependencies:
|
|
|
108
108
|
- - "~>"
|
|
109
109
|
- !ruby/object:Gem::Version
|
|
110
110
|
version: '1.2'
|
|
111
|
+
- !ruby/object:Gem::Dependency
|
|
112
|
+
name: active_storage_validations
|
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
|
114
|
+
requirements:
|
|
115
|
+
- - "~>"
|
|
116
|
+
- !ruby/object:Gem::Version
|
|
117
|
+
version: '1.0'
|
|
118
|
+
type: :runtime
|
|
119
|
+
prerelease: false
|
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
121
|
+
requirements:
|
|
122
|
+
- - "~>"
|
|
123
|
+
- !ruby/object:Gem::Version
|
|
124
|
+
version: '1.0'
|
|
125
|
+
- !ruby/object:Gem::Dependency
|
|
126
|
+
name: ulid
|
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
|
128
|
+
requirements:
|
|
129
|
+
- - "~>"
|
|
130
|
+
- !ruby/object:Gem::Version
|
|
131
|
+
version: '1.3'
|
|
132
|
+
type: :runtime
|
|
133
|
+
prerelease: false
|
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
135
|
+
requirements:
|
|
136
|
+
- - "~>"
|
|
137
|
+
- !ruby/object:Gem::Version
|
|
138
|
+
version: '1.3'
|
|
111
139
|
description: Wrapper to keep all the common libraries and setups needed by Thecore
|
|
112
140
|
UI Backend(s).
|
|
113
141
|
email:
|
|
@@ -118,10 +146,12 @@ extra_rdoc_files: []
|
|
|
118
146
|
files:
|
|
119
147
|
- README.md
|
|
120
148
|
- Rakefile
|
|
149
|
+
- app/channels/activity_log_channel.rb
|
|
121
150
|
- config/initializers/abilities.rb
|
|
122
151
|
- config/initializers/add_to_db_migrations.rb
|
|
123
152
|
- config/initializers/after_initialize.rb
|
|
124
153
|
- config/initializers/application_config.rb
|
|
154
|
+
- config/initializers/concern_cable_connection.rb
|
|
125
155
|
- config/initializers/concern_integer.rb
|
|
126
156
|
- config/initializers/concern_string.rb
|
|
127
157
|
- config/initializers/extension_nil.rb
|