punk 0.1.4 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.editorconfig +9 -0
- data/.github/workflows/test.yml +26 -1
- data/.rdoc_options +23 -0
- data/.rgignore +1 -0
- data/.rspec +2 -0
- data/Gemfile +5 -6
- data/Gemfile.lock +16 -29
- data/README.md +1 -1
- data/VERSION +1 -1
- data/app/migrations/001_lets_punk.rb +3 -0
- data/app/routes/hello.rb +4 -0
- data/env/.gitignore +3 -0
- data/env/spec/test.sh +3 -0
- data/lib/punk/actions/.keep +0 -0
- data/lib/punk/actions/groups/list.rb +24 -0
- data/lib/punk/actions/sessions/clear.rb +21 -0
- data/lib/punk/actions/sessions/create.rb +64 -0
- data/lib/punk/actions/sessions/list.rb +18 -0
- data/lib/punk/actions/sessions/verify.rb +24 -0
- data/lib/punk/actions/tenants/list.rb +18 -0
- data/lib/punk/actions/users/list_group.rb +18 -0
- data/lib/punk/actions/users/list_tenant.rb +18 -0
- data/lib/punk/actions/users/show.rb +18 -0
- data/lib/punk/commands/list.rb +12 -6
- data/lib/punk/config/defaults.json +3 -0
- data/lib/punk/config/schema.json +3 -0
- data/lib/punk/core/app.rb +4 -6
- data/lib/punk/core/commander.rb +7 -4
- data/lib/punk/core/exec.rb +2 -0
- data/lib/punk/core/load.rb +0 -1
- data/lib/punk/framework/command.rb +5 -1
- data/lib/punk/framework/plugins/validation.rb +0 -14
- data/lib/punk/helpers/loggable.rb +1 -1
- data/lib/punk/migrations/001_punk.rb +103 -0
- data/lib/punk/models/.keep +0 -0
- data/lib/punk/models/group.rb +20 -0
- data/lib/punk/models/group_user_metadata.rb +17 -0
- data/lib/punk/models/identity.rb +29 -0
- data/lib/punk/models/session.rb +89 -0
- data/lib/punk/models/tenant.rb +19 -0
- data/lib/punk/models/tenant_user_metadata.rb +17 -0
- data/lib/punk/models/user.rb +31 -0
- data/lib/punk/routes/groups.rb +31 -0
- data/lib/punk/routes/plivo.rb +4 -0
- data/lib/punk/routes/sessions.rb +108 -0
- data/lib/punk/routes/swagger.rb +9 -0
- data/lib/punk/routes/tenants.rb +29 -0
- data/lib/punk/routes/users.rb +36 -0
- data/lib/punk/services/.keep +0 -0
- data/lib/punk/services/challenge_claim.rb +46 -0
- data/lib/punk/services/create_identities.rb +25 -0
- data/lib/punk/services/generate_swagger.rb +25 -0
- data/lib/punk/services/prove_claim.rb +29 -0
- data/lib/punk/services/secret.rb +9 -0
- data/lib/punk/templates/groups/list.jbuilder +7 -0
- data/lib/punk/templates/plivo.slim +16 -0
- data/lib/punk/templates/sessions/list.jbuilder +6 -0
- data/lib/punk/templates/sessions/pending.jbuilder +4 -0
- data/lib/punk/templates/tenants/list.jbuilder +7 -0
- data/lib/punk/templates/tenants/list.slim +8 -0
- data/lib/punk/templates/users/list.jbuilder +7 -0
- data/lib/punk/templates/users/list.rcsv +4 -0
- data/lib/punk/templates/users/show.jbuilder +5 -0
- data/lib/punk/views/groups/list.rb +22 -0
- data/lib/punk/views/plivo_store.rb +15 -0
- data/lib/punk/views/sessions/list.rb +22 -0
- data/lib/punk/views/sessions/pending.rb +28 -0
- data/lib/punk/views/tenants/list.rb +22 -0
- data/lib/punk/views/users/list.rb +22 -0
- data/lib/punk/views/users/show.rb +22 -0
- data/lib/punk/workers/.keep +0 -0
- data/lib/punk/workers/expire_sessions.rb +9 -0
- data/lib/punk/workers/geocode_session_worker.rb +48 -0
- data/lib/punk/workers/identify_session_worker.rb +45 -0
- data/lib/punk/workers/secret.rb +18 -0
- data/lib/punk/workers/send_email_worker.rb +51 -0
- data/lib/punk/workers/send_sms_worker.rb +40 -0
- data/punk.gemspec +140 -14
- data/schema.psql +345 -0
- data/spec/actions/groups/punk/list_groups_action_spec.rb +36 -0
- data/spec/actions/sessions/punk/clear_session_action_spec.rb +29 -0
- data/spec/actions/sessions/punk/create_session_action_spec.rb +33 -0
- data/spec/actions/sessions/punk/list_sessions_action_spec.rb +26 -0
- data/spec/actions/sessions/punk/verify_session_action_spec.rb +59 -0
- data/spec/actions/tenants/punk/list_tenants_action_spec.rb +25 -0
- data/spec/actions/users/punk/list_group_users_action_spec.rb +26 -0
- data/spec/actions/users/punk/list_tenant_users_action_spec.rb +26 -0
- data/spec/factories/group.rb +12 -0
- data/spec/factories/group_user_metadata.rb +10 -0
- data/spec/factories/identity.rb +19 -0
- data/spec/factories/session.rb +12 -0
- data/spec/factories/tenant.rb +10 -0
- data/spec/factories/tenant_user_metadata.rb +10 -0
- data/spec/factories/user.rb +12 -0
- data/spec/lib/commands/auth_spec.rb +11 -0
- data/spec/lib/commands/generate_spec.rb +7 -0
- data/spec/lib/commands/http_spec.rb +23 -0
- data/spec/lib/commands/list_spec.rb +7 -0
- data/spec/lib/commands/swagger_spec.rb +7 -0
- data/spec/lib/engine/punk_env_spec.rb +13 -0
- data/spec/lib/engine/punk_exec_spec.rb +9 -0
- data/spec/lib/engine/punk_init_spec.rb +9 -0
- data/spec/lib/engine/punk_store_spec.rb +10 -0
- data/spec/lib/punk.env +7 -0
- data/spec/models/punk/group_spec.rb +50 -0
- data/spec/models/punk/group_user_metadata_spec.rb +61 -0
- data/spec/models/punk/identity_spec.rb +61 -0
- data/spec/models/punk/session_spec.rb +156 -0
- data/spec/models/punk/tenant_spec.rb +51 -0
- data/spec/models/punk/tenant_user_metadata_spec.rb +61 -0
- data/spec/models/punk/user_spec.rb +115 -0
- data/spec/routes/groups/get_groups_spec.rb +33 -0
- data/spec/routes/plivo/get_plivo_spec.rb +11 -0
- data/spec/routes/sessions/delete_session_spec.rb +11 -0
- data/spec/routes/sessions/get_sessions_spec.rb +30 -0
- data/spec/routes/sessions/patch_session_spec.rb +11 -0
- data/spec/routes/sessions/post_session_spec.rb +11 -0
- data/spec/routes/swagger/get_swagger_spec.rb +12 -0
- data/spec/routes/tenants/get_tenants_spec.rb +31 -0
- data/spec/routes/users/get_users_spec.rb +60 -0
- data/spec/services/punk/challenge_claim_service_spec.rb +7 -0
- data/spec/services/punk/create_identities_service_spec.rb +14 -0
- data/spec/services/punk/generate_swagger_service_spec.rb +7 -0
- data/spec/services/punk/prove_claim_service_spec.rb +7 -0
- data/spec/services/punk/secret_service_spec.rb +7 -0
- data/spec/spec_helper.rb +122 -0
- data/spec/vcr_cassettes/PUNK_GeocodeSessionWorker/updates_the_session_data.yml +57 -0
- data/spec/vcr_cassettes/PUNK_IdentifySessionWorker/updates_the_session_data.yml +112 -0
- data/spec/views/punk/plivo_store_spec.rb +7 -0
- data/spec/views/sessions/punk/list_sessions_view_spec.rb +7 -0
- data/spec/views/sessions/punk/pending_session_view_spec.rb +7 -0
- data/spec/views/tenants/punk/list_tenants_view_spec.rb +7 -0
- data/spec/views/users/punk/list_groups_view_spec.rb +7 -0
- data/spec/views/users/punk/list_users_view_spec.rb +7 -0
- data/spec/workers/punk/expire_sessions_worker_spec.rb +31 -0
- data/spec/workers/punk/geocode_session_worker_spec.rb +14 -0
- data/spec/workers/punk/identify_session_worker_spec.rb +15 -0
- data/spec/workers/punk/secret_worker_spec.rb +20 -0
- data/spec/workers/punk/send_email_worker_spec.rb +46 -0
- data/spec/workers/punk/send_sms_worker_spec.rb +33 -0
- metadata +148 -11
- data/lib/punk/views/all.rb +0 -4
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module PUNK
|
4
|
+
class SendSmsWorker < Worker
|
5
|
+
args :to, :body
|
6
|
+
|
7
|
+
def validate
|
8
|
+
validates_type String, :to
|
9
|
+
validates_phone :to
|
10
|
+
validates_includes PUNK.get.plivo.whitelist, :to if !PUNK.env.test? && !PUNK.get.plivo.mock && PUNK.get.plivo.whitelist.present?
|
11
|
+
validates_type String, :body
|
12
|
+
validates_length_range 1..1600, :body
|
13
|
+
end
|
14
|
+
|
15
|
+
def process
|
16
|
+
if PUNK.env.test? || PUNK.get.plivo.mock
|
17
|
+
plivo = PUNK.cache.get(:plivo) || []
|
18
|
+
message =
|
19
|
+
{
|
20
|
+
sent: Time.now.utc.to_s,
|
21
|
+
from: PUNK.get.plivo.number,
|
22
|
+
to: to,
|
23
|
+
body: body
|
24
|
+
}
|
25
|
+
plivo.prepend(message)
|
26
|
+
PUNK.cache.set(:plivo, plivo)
|
27
|
+
unless PUNK.env.test?
|
28
|
+
require 'launchy'
|
29
|
+
Launchy.open("#{PUNK.get.app.url || 'http://localhost:3000'}/plivo.html")
|
30
|
+
end
|
31
|
+
return
|
32
|
+
end
|
33
|
+
|
34
|
+
require 'plivo'
|
35
|
+
|
36
|
+
client = Plivo::RestClient.new(PUNK.get.plivo.auth_id, PUNK.get.plivo.auth_token)
|
37
|
+
client.messages.create(PUNK.get.plivo.number, [to], body)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
data/punk.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: punk 0.
|
5
|
+
# stub: punk 0.2.0 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "punk".freeze
|
9
|
-
s.version = "0.
|
9
|
+
s.version = "0.2.0"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib".freeze]
|
13
13
|
s.authors = ["Lloyd Kranzky".freeze]
|
14
|
-
s.date = "2021-01-
|
14
|
+
s.date = "2021-01-13"
|
15
15
|
s.description = "".freeze
|
16
16
|
s.email = "lloyd@kranzky.com".freeze
|
17
17
|
s.executables = ["punk".freeze]
|
@@ -21,8 +21,12 @@ Gem::Specification.new do |s|
|
|
21
21
|
]
|
22
22
|
s.files = [
|
23
23
|
".document",
|
24
|
+
".editorconfig",
|
24
25
|
".github/workflows/ship.yml",
|
25
26
|
".github/workflows/test.yml",
|
27
|
+
".rdoc_options",
|
28
|
+
".rgignore",
|
29
|
+
".rspec",
|
26
30
|
".rubocop.yml",
|
27
31
|
"Gemfile",
|
28
32
|
"Gemfile.lock",
|
@@ -30,9 +34,23 @@ Gem::Specification.new do |s|
|
|
30
34
|
"README.md",
|
31
35
|
"Rakefile",
|
32
36
|
"VERSION",
|
37
|
+
"app/migrations/001_lets_punk.rb",
|
38
|
+
"app/routes/hello.rb",
|
33
39
|
"bin/punk",
|
40
|
+
"env/.gitignore",
|
41
|
+
"env/spec/test.sh",
|
34
42
|
"env/test.sh",
|
35
43
|
"lib/punk.rb",
|
44
|
+
"lib/punk/actions/.keep",
|
45
|
+
"lib/punk/actions/groups/list.rb",
|
46
|
+
"lib/punk/actions/sessions/clear.rb",
|
47
|
+
"lib/punk/actions/sessions/create.rb",
|
48
|
+
"lib/punk/actions/sessions/list.rb",
|
49
|
+
"lib/punk/actions/sessions/verify.rb",
|
50
|
+
"lib/punk/actions/tenants/list.rb",
|
51
|
+
"lib/punk/actions/users/list_group.rb",
|
52
|
+
"lib/punk/actions/users/list_tenant.rb",
|
53
|
+
"lib/punk/actions/users/show.rb",
|
36
54
|
"lib/punk/commands/auth.rb",
|
37
55
|
"lib/punk/commands/generate.rb",
|
38
56
|
"lib/punk/commands/http.rb",
|
@@ -76,9 +94,30 @@ Gem::Specification.new do |s|
|
|
76
94
|
"lib/punk/helpers/renderable.rb",
|
77
95
|
"lib/punk/helpers/swagger.rb",
|
78
96
|
"lib/punk/helpers/validatable.rb",
|
97
|
+
"lib/punk/migrations/001_punk.rb",
|
98
|
+
"lib/punk/models/.keep",
|
99
|
+
"lib/punk/models/group.rb",
|
100
|
+
"lib/punk/models/group_user_metadata.rb",
|
101
|
+
"lib/punk/models/identity.rb",
|
102
|
+
"lib/punk/models/session.rb",
|
103
|
+
"lib/punk/models/tenant.rb",
|
104
|
+
"lib/punk/models/tenant_user_metadata.rb",
|
105
|
+
"lib/punk/models/user.rb",
|
79
106
|
"lib/punk/plugins/all.rb",
|
80
107
|
"lib/punk/plugins/cors.rb",
|
81
108
|
"lib/punk/plugins/ssl.rb",
|
109
|
+
"lib/punk/routes/groups.rb",
|
110
|
+
"lib/punk/routes/plivo.rb",
|
111
|
+
"lib/punk/routes/sessions.rb",
|
112
|
+
"lib/punk/routes/swagger.rb",
|
113
|
+
"lib/punk/routes/tenants.rb",
|
114
|
+
"lib/punk/routes/users.rb",
|
115
|
+
"lib/punk/services/.keep",
|
116
|
+
"lib/punk/services/challenge_claim.rb",
|
117
|
+
"lib/punk/services/create_identities.rb",
|
118
|
+
"lib/punk/services/generate_swagger.rb",
|
119
|
+
"lib/punk/services/prove_claim.rb",
|
120
|
+
"lib/punk/services/secret.rb",
|
82
121
|
"lib/punk/startup/cache.rb",
|
83
122
|
"lib/punk/startup/database.rb",
|
84
123
|
"lib/punk/startup/environment.rb",
|
@@ -88,14 +127,98 @@ Gem::Specification.new do |s|
|
|
88
127
|
"lib/punk/templates/fail.rcsv",
|
89
128
|
"lib/punk/templates/fail.slim",
|
90
129
|
"lib/punk/templates/fail.xml.slim",
|
130
|
+
"lib/punk/templates/groups/list.jbuilder",
|
91
131
|
"lib/punk/templates/info.jbuilder",
|
92
132
|
"lib/punk/templates/info.rcsv",
|
93
133
|
"lib/punk/templates/info.slim",
|
94
134
|
"lib/punk/templates/info.xml.slim",
|
95
|
-
"lib/punk/
|
135
|
+
"lib/punk/templates/plivo.slim",
|
136
|
+
"lib/punk/templates/sessions/list.jbuilder",
|
137
|
+
"lib/punk/templates/sessions/pending.jbuilder",
|
138
|
+
"lib/punk/templates/tenants/list.jbuilder",
|
139
|
+
"lib/punk/templates/tenants/list.slim",
|
140
|
+
"lib/punk/templates/users/list.jbuilder",
|
141
|
+
"lib/punk/templates/users/list.rcsv",
|
142
|
+
"lib/punk/templates/users/show.jbuilder",
|
96
143
|
"lib/punk/views/fail.rb",
|
144
|
+
"lib/punk/views/groups/list.rb",
|
97
145
|
"lib/punk/views/info.rb",
|
98
|
-
"punk.
|
146
|
+
"lib/punk/views/plivo_store.rb",
|
147
|
+
"lib/punk/views/sessions/list.rb",
|
148
|
+
"lib/punk/views/sessions/pending.rb",
|
149
|
+
"lib/punk/views/tenants/list.rb",
|
150
|
+
"lib/punk/views/users/list.rb",
|
151
|
+
"lib/punk/views/users/show.rb",
|
152
|
+
"lib/punk/workers/.keep",
|
153
|
+
"lib/punk/workers/expire_sessions.rb",
|
154
|
+
"lib/punk/workers/geocode_session_worker.rb",
|
155
|
+
"lib/punk/workers/identify_session_worker.rb",
|
156
|
+
"lib/punk/workers/secret.rb",
|
157
|
+
"lib/punk/workers/send_email_worker.rb",
|
158
|
+
"lib/punk/workers/send_sms_worker.rb",
|
159
|
+
"punk.gemspec",
|
160
|
+
"schema.psql",
|
161
|
+
"spec/actions/groups/punk/list_groups_action_spec.rb",
|
162
|
+
"spec/actions/sessions/punk/clear_session_action_spec.rb",
|
163
|
+
"spec/actions/sessions/punk/create_session_action_spec.rb",
|
164
|
+
"spec/actions/sessions/punk/list_sessions_action_spec.rb",
|
165
|
+
"spec/actions/sessions/punk/verify_session_action_spec.rb",
|
166
|
+
"spec/actions/tenants/punk/list_tenants_action_spec.rb",
|
167
|
+
"spec/actions/users/punk/list_group_users_action_spec.rb",
|
168
|
+
"spec/actions/users/punk/list_tenant_users_action_spec.rb",
|
169
|
+
"spec/factories/group.rb",
|
170
|
+
"spec/factories/group_user_metadata.rb",
|
171
|
+
"spec/factories/identity.rb",
|
172
|
+
"spec/factories/session.rb",
|
173
|
+
"spec/factories/tenant.rb",
|
174
|
+
"spec/factories/tenant_user_metadata.rb",
|
175
|
+
"spec/factories/user.rb",
|
176
|
+
"spec/lib/commands/auth_spec.rb",
|
177
|
+
"spec/lib/commands/generate_spec.rb",
|
178
|
+
"spec/lib/commands/http_spec.rb",
|
179
|
+
"spec/lib/commands/list_spec.rb",
|
180
|
+
"spec/lib/commands/swagger_spec.rb",
|
181
|
+
"spec/lib/engine/punk_env_spec.rb",
|
182
|
+
"spec/lib/engine/punk_exec_spec.rb",
|
183
|
+
"spec/lib/engine/punk_init_spec.rb",
|
184
|
+
"spec/lib/engine/punk_store_spec.rb",
|
185
|
+
"spec/lib/punk.env",
|
186
|
+
"spec/models/punk/group_spec.rb",
|
187
|
+
"spec/models/punk/group_user_metadata_spec.rb",
|
188
|
+
"spec/models/punk/identity_spec.rb",
|
189
|
+
"spec/models/punk/session_spec.rb",
|
190
|
+
"spec/models/punk/tenant_spec.rb",
|
191
|
+
"spec/models/punk/tenant_user_metadata_spec.rb",
|
192
|
+
"spec/models/punk/user_spec.rb",
|
193
|
+
"spec/routes/groups/get_groups_spec.rb",
|
194
|
+
"spec/routes/plivo/get_plivo_spec.rb",
|
195
|
+
"spec/routes/sessions/delete_session_spec.rb",
|
196
|
+
"spec/routes/sessions/get_sessions_spec.rb",
|
197
|
+
"spec/routes/sessions/patch_session_spec.rb",
|
198
|
+
"spec/routes/sessions/post_session_spec.rb",
|
199
|
+
"spec/routes/swagger/get_swagger_spec.rb",
|
200
|
+
"spec/routes/tenants/get_tenants_spec.rb",
|
201
|
+
"spec/routes/users/get_users_spec.rb",
|
202
|
+
"spec/services/punk/challenge_claim_service_spec.rb",
|
203
|
+
"spec/services/punk/create_identities_service_spec.rb",
|
204
|
+
"spec/services/punk/generate_swagger_service_spec.rb",
|
205
|
+
"spec/services/punk/prove_claim_service_spec.rb",
|
206
|
+
"spec/services/punk/secret_service_spec.rb",
|
207
|
+
"spec/spec_helper.rb",
|
208
|
+
"spec/vcr_cassettes/PUNK_GeocodeSessionWorker/updates_the_session_data.yml",
|
209
|
+
"spec/vcr_cassettes/PUNK_IdentifySessionWorker/updates_the_session_data.yml",
|
210
|
+
"spec/views/punk/plivo_store_spec.rb",
|
211
|
+
"spec/views/sessions/punk/list_sessions_view_spec.rb",
|
212
|
+
"spec/views/sessions/punk/pending_session_view_spec.rb",
|
213
|
+
"spec/views/tenants/punk/list_tenants_view_spec.rb",
|
214
|
+
"spec/views/users/punk/list_groups_view_spec.rb",
|
215
|
+
"spec/views/users/punk/list_users_view_spec.rb",
|
216
|
+
"spec/workers/punk/expire_sessions_worker_spec.rb",
|
217
|
+
"spec/workers/punk/geocode_session_worker_spec.rb",
|
218
|
+
"spec/workers/punk/identify_session_worker_spec.rb",
|
219
|
+
"spec/workers/punk/secret_worker_spec.rb",
|
220
|
+
"spec/workers/punk/send_email_worker_spec.rb",
|
221
|
+
"spec/workers/punk/send_sms_worker_spec.rb"
|
99
222
|
]
|
100
223
|
s.homepage = "https://github.com/kranzky/punk".freeze
|
101
224
|
s.licenses = ["Unlicense".freeze]
|
@@ -127,7 +250,7 @@ Gem::Specification.new do |s|
|
|
127
250
|
s.add_runtime_dependency(%q<sequel>.freeze, ["~> 5.40"])
|
128
251
|
s.add_runtime_dependency(%q<aasm>.freeze, ["~> 5.1"])
|
129
252
|
s.add_runtime_dependency(%q<http-accept>.freeze, ["~> 2.1"])
|
130
|
-
s.add_runtime_dependency(%q<
|
253
|
+
s.add_runtime_dependency(%q<ipstack>.freeze, ["~> 0.1"])
|
131
254
|
s.add_runtime_dependency(%q<rbnacl>.freeze, ["~> 7.1"])
|
132
255
|
s.add_runtime_dependency(%q<userstack>.freeze, ["~> 0.1"])
|
133
256
|
s.add_runtime_dependency(%q<sidekiq>.freeze, ["~> 6.1"])
|
@@ -138,12 +261,13 @@ Gem::Specification.new do |s|
|
|
138
261
|
s.add_runtime_dependency(%q<roda-route_list>.freeze, ["~> 2.1"])
|
139
262
|
s.add_runtime_dependency(%q<slim>.freeze, ["~> 4.1"])
|
140
263
|
s.add_runtime_dependency(%q<jbuilder>.freeze, ["~> 2.10"])
|
141
|
-
s.add_runtime_dependency(%q<oj>.freeze, ["~> 3.
|
264
|
+
s.add_runtime_dependency(%q<oj>.freeze, ["~> 3.11"])
|
142
265
|
s.add_runtime_dependency(%q<tilt-jbuilder>.freeze, ["~> 0.7"])
|
143
266
|
s.add_runtime_dependency(%q<rdoc>.freeze, ["~> 6.3"])
|
144
267
|
s.add_runtime_dependency(%q<swagger_yard>.freeze, ["~> 1.0"])
|
145
268
|
s.add_runtime_dependency(%q<activesupport>.freeze, ["~> 6.1"])
|
146
|
-
s.add_runtime_dependency(%q<sentry-
|
269
|
+
s.add_runtime_dependency(%q<sentry-ruby>.freeze, ["~> 4.1"])
|
270
|
+
s.add_runtime_dependency(%q<sentry-sidekiq>.freeze, ["~> 4.1"])
|
147
271
|
s.add_runtime_dependency(%q<skylight>.freeze, ["~> 4.3"])
|
148
272
|
s.add_runtime_dependency(%q<phony>.freeze, ["~> 2.18"])
|
149
273
|
s.add_development_dependency(%q<bundler>.freeze, ["~> 1.17"])
|
@@ -174,7 +298,7 @@ Gem::Specification.new do |s|
|
|
174
298
|
s.add_dependency(%q<sequel>.freeze, ["~> 5.40"])
|
175
299
|
s.add_dependency(%q<aasm>.freeze, ["~> 5.1"])
|
176
300
|
s.add_dependency(%q<http-accept>.freeze, ["~> 2.1"])
|
177
|
-
s.add_dependency(%q<
|
301
|
+
s.add_dependency(%q<ipstack>.freeze, ["~> 0.1"])
|
178
302
|
s.add_dependency(%q<rbnacl>.freeze, ["~> 7.1"])
|
179
303
|
s.add_dependency(%q<userstack>.freeze, ["~> 0.1"])
|
180
304
|
s.add_dependency(%q<sidekiq>.freeze, ["~> 6.1"])
|
@@ -185,12 +309,13 @@ Gem::Specification.new do |s|
|
|
185
309
|
s.add_dependency(%q<roda-route_list>.freeze, ["~> 2.1"])
|
186
310
|
s.add_dependency(%q<slim>.freeze, ["~> 4.1"])
|
187
311
|
s.add_dependency(%q<jbuilder>.freeze, ["~> 2.10"])
|
188
|
-
s.add_dependency(%q<oj>.freeze, ["~> 3.
|
312
|
+
s.add_dependency(%q<oj>.freeze, ["~> 3.11"])
|
189
313
|
s.add_dependency(%q<tilt-jbuilder>.freeze, ["~> 0.7"])
|
190
314
|
s.add_dependency(%q<rdoc>.freeze, ["~> 6.3"])
|
191
315
|
s.add_dependency(%q<swagger_yard>.freeze, ["~> 1.0"])
|
192
316
|
s.add_dependency(%q<activesupport>.freeze, ["~> 6.1"])
|
193
|
-
s.add_dependency(%q<sentry-
|
317
|
+
s.add_dependency(%q<sentry-ruby>.freeze, ["~> 4.1"])
|
318
|
+
s.add_dependency(%q<sentry-sidekiq>.freeze, ["~> 4.1"])
|
194
319
|
s.add_dependency(%q<skylight>.freeze, ["~> 4.3"])
|
195
320
|
s.add_dependency(%q<phony>.freeze, ["~> 2.18"])
|
196
321
|
s.add_dependency(%q<bundler>.freeze, ["~> 1.17"])
|
@@ -222,7 +347,7 @@ Gem::Specification.new do |s|
|
|
222
347
|
s.add_dependency(%q<sequel>.freeze, ["~> 5.40"])
|
223
348
|
s.add_dependency(%q<aasm>.freeze, ["~> 5.1"])
|
224
349
|
s.add_dependency(%q<http-accept>.freeze, ["~> 2.1"])
|
225
|
-
s.add_dependency(%q<
|
350
|
+
s.add_dependency(%q<ipstack>.freeze, ["~> 0.1"])
|
226
351
|
s.add_dependency(%q<rbnacl>.freeze, ["~> 7.1"])
|
227
352
|
s.add_dependency(%q<userstack>.freeze, ["~> 0.1"])
|
228
353
|
s.add_dependency(%q<sidekiq>.freeze, ["~> 6.1"])
|
@@ -233,12 +358,13 @@ Gem::Specification.new do |s|
|
|
233
358
|
s.add_dependency(%q<roda-route_list>.freeze, ["~> 2.1"])
|
234
359
|
s.add_dependency(%q<slim>.freeze, ["~> 4.1"])
|
235
360
|
s.add_dependency(%q<jbuilder>.freeze, ["~> 2.10"])
|
236
|
-
s.add_dependency(%q<oj>.freeze, ["~> 3.
|
361
|
+
s.add_dependency(%q<oj>.freeze, ["~> 3.11"])
|
237
362
|
s.add_dependency(%q<tilt-jbuilder>.freeze, ["~> 0.7"])
|
238
363
|
s.add_dependency(%q<rdoc>.freeze, ["~> 6.3"])
|
239
364
|
s.add_dependency(%q<swagger_yard>.freeze, ["~> 1.0"])
|
240
365
|
s.add_dependency(%q<activesupport>.freeze, ["~> 6.1"])
|
241
|
-
s.add_dependency(%q<sentry-
|
366
|
+
s.add_dependency(%q<sentry-ruby>.freeze, ["~> 4.1"])
|
367
|
+
s.add_dependency(%q<sentry-sidekiq>.freeze, ["~> 4.1"])
|
242
368
|
s.add_dependency(%q<skylight>.freeze, ["~> 4.3"])
|
243
369
|
s.add_dependency(%q<phony>.freeze, ["~> 2.18"])
|
244
370
|
s.add_dependency(%q<bundler>.freeze, ["~> 1.17"])
|
data/schema.psql
ADDED
@@ -0,0 +1,345 @@
|
|
1
|
+
--
|
2
|
+
-- PostgreSQL database dump
|
3
|
+
--
|
4
|
+
|
5
|
+
-- Dumped from database version 13.1
|
6
|
+
-- Dumped by pg_dump version 13.1
|
7
|
+
|
8
|
+
SET statement_timeout = 0;
|
9
|
+
SET lock_timeout = 0;
|
10
|
+
SET idle_in_transaction_session_timeout = 0;
|
11
|
+
SET client_encoding = 'UTF8';
|
12
|
+
SET standard_conforming_strings = on;
|
13
|
+
SELECT pg_catalog.set_config('search_path', '', false);
|
14
|
+
SET check_function_bodies = false;
|
15
|
+
SET xmloption = content;
|
16
|
+
SET client_min_messages = warning;
|
17
|
+
SET row_security = off;
|
18
|
+
|
19
|
+
--
|
20
|
+
-- Name: claim_type; Type: TYPE; Schema: public; Owner: jason
|
21
|
+
--
|
22
|
+
|
23
|
+
CREATE TYPE public.claim_type AS ENUM (
|
24
|
+
'email',
|
25
|
+
'phone'
|
26
|
+
);
|
27
|
+
|
28
|
+
|
29
|
+
ALTER TYPE public.claim_type OWNER TO jason;
|
30
|
+
|
31
|
+
--
|
32
|
+
-- Name: punk_state; Type: TYPE; Schema: public; Owner: jason
|
33
|
+
--
|
34
|
+
|
35
|
+
CREATE TYPE public.punk_state AS ENUM (
|
36
|
+
'created',
|
37
|
+
'active',
|
38
|
+
'deleted'
|
39
|
+
);
|
40
|
+
|
41
|
+
|
42
|
+
ALTER TYPE public.punk_state OWNER TO jason;
|
43
|
+
|
44
|
+
--
|
45
|
+
-- Name: session_state; Type: TYPE; Schema: public; Owner: jason
|
46
|
+
--
|
47
|
+
|
48
|
+
CREATE TYPE public.session_state AS ENUM (
|
49
|
+
'pending',
|
50
|
+
'created',
|
51
|
+
'active',
|
52
|
+
'deleted',
|
53
|
+
'expired'
|
54
|
+
);
|
55
|
+
|
56
|
+
|
57
|
+
ALTER TYPE public.session_state OWNER TO jason;
|
58
|
+
|
59
|
+
SET default_tablespace = '';
|
60
|
+
|
61
|
+
SET default_table_access_method = heap;
|
62
|
+
|
63
|
+
--
|
64
|
+
-- Name: groups; Type: TABLE; Schema: public; Owner: jason
|
65
|
+
--
|
66
|
+
|
67
|
+
CREATE TABLE public.groups (
|
68
|
+
id uuid DEFAULT gen_random_uuid() NOT NULL,
|
69
|
+
state public.punk_state DEFAULT 'created'::public.punk_state NOT NULL,
|
70
|
+
name text NOT NULL,
|
71
|
+
icon text,
|
72
|
+
data jsonb DEFAULT '{}'::jsonb,
|
73
|
+
created_at timestamp with time zone,
|
74
|
+
updated_at timestamp with time zone,
|
75
|
+
tenant_id uuid NOT NULL
|
76
|
+
);
|
77
|
+
|
78
|
+
|
79
|
+
ALTER TABLE public.groups OWNER TO jason;
|
80
|
+
|
81
|
+
--
|
82
|
+
-- Name: groups_users; Type: TABLE; Schema: public; Owner: jason
|
83
|
+
--
|
84
|
+
|
85
|
+
CREATE TABLE public.groups_users (
|
86
|
+
group_id uuid NOT NULL,
|
87
|
+
user_id uuid NOT NULL
|
88
|
+
);
|
89
|
+
|
90
|
+
|
91
|
+
ALTER TABLE public.groups_users OWNER TO jason;
|
92
|
+
|
93
|
+
--
|
94
|
+
-- Name: identities; Type: TABLE; Schema: public; Owner: jason
|
95
|
+
--
|
96
|
+
|
97
|
+
CREATE TABLE public.identities (
|
98
|
+
id uuid DEFAULT gen_random_uuid() NOT NULL,
|
99
|
+
state public.punk_state DEFAULT 'created'::public.punk_state NOT NULL,
|
100
|
+
claim_type public.claim_type NOT NULL,
|
101
|
+
claim text NOT NULL,
|
102
|
+
data jsonb DEFAULT '{}'::jsonb,
|
103
|
+
created_at timestamp with time zone,
|
104
|
+
updated_at timestamp with time zone,
|
105
|
+
user_id uuid
|
106
|
+
);
|
107
|
+
|
108
|
+
|
109
|
+
ALTER TABLE public.identities OWNER TO jason;
|
110
|
+
|
111
|
+
--
|
112
|
+
-- Name: schema_info; Type: TABLE; Schema: public; Owner: jason
|
113
|
+
--
|
114
|
+
|
115
|
+
CREATE TABLE public.schema_info (
|
116
|
+
version integer DEFAULT 0 NOT NULL
|
117
|
+
);
|
118
|
+
|
119
|
+
|
120
|
+
ALTER TABLE public.schema_info OWNER TO jason;
|
121
|
+
|
122
|
+
--
|
123
|
+
-- Name: sessions; Type: TABLE; Schema: public; Owner: jason
|
124
|
+
--
|
125
|
+
|
126
|
+
CREATE TABLE public.sessions (
|
127
|
+
id uuid DEFAULT gen_random_uuid() NOT NULL,
|
128
|
+
slug uuid DEFAULT gen_random_uuid(),
|
129
|
+
state public.session_state DEFAULT 'created'::public.session_state NOT NULL,
|
130
|
+
salt bytea,
|
131
|
+
hash bytea,
|
132
|
+
attempt_count integer DEFAULT 0 NOT NULL,
|
133
|
+
remote_addr cidr DEFAULT '127.0.0.1/32'::cidr NOT NULL,
|
134
|
+
user_agent text DEFAULT 'Mozilla/5.0 (compatible; Punk!; +https://punk.kranzky.com)'::text NOT NULL,
|
135
|
+
data jsonb DEFAULT '{}'::jsonb,
|
136
|
+
created_at timestamp with time zone,
|
137
|
+
updated_at timestamp with time zone,
|
138
|
+
identity_id uuid NOT NULL
|
139
|
+
);
|
140
|
+
|
141
|
+
|
142
|
+
ALTER TABLE public.sessions OWNER TO jason;
|
143
|
+
|
144
|
+
--
|
145
|
+
-- Name: tenants; Type: TABLE; Schema: public; Owner: jason
|
146
|
+
--
|
147
|
+
|
148
|
+
CREATE TABLE public.tenants (
|
149
|
+
id uuid DEFAULT gen_random_uuid() NOT NULL,
|
150
|
+
state public.punk_state DEFAULT 'created'::public.punk_state NOT NULL,
|
151
|
+
name text NOT NULL,
|
152
|
+
icon text,
|
153
|
+
data jsonb DEFAULT '{}'::jsonb,
|
154
|
+
created_at timestamp with time zone,
|
155
|
+
updated_at timestamp with time zone
|
156
|
+
);
|
157
|
+
|
158
|
+
|
159
|
+
ALTER TABLE public.tenants OWNER TO jason;
|
160
|
+
|
161
|
+
--
|
162
|
+
-- Name: tenants_users; Type: TABLE; Schema: public; Owner: jason
|
163
|
+
--
|
164
|
+
|
165
|
+
CREATE TABLE public.tenants_users (
|
166
|
+
tenant_id uuid NOT NULL,
|
167
|
+
user_id uuid NOT NULL
|
168
|
+
);
|
169
|
+
|
170
|
+
|
171
|
+
ALTER TABLE public.tenants_users OWNER TO jason;
|
172
|
+
|
173
|
+
--
|
174
|
+
-- Name: users; Type: TABLE; Schema: public; Owner: jason
|
175
|
+
--
|
176
|
+
|
177
|
+
CREATE TABLE public.users (
|
178
|
+
id uuid DEFAULT gen_random_uuid() NOT NULL,
|
179
|
+
state public.punk_state DEFAULT 'created'::public.punk_state NOT NULL,
|
180
|
+
name text NOT NULL,
|
181
|
+
icon text,
|
182
|
+
email text,
|
183
|
+
phone text,
|
184
|
+
data jsonb DEFAULT '{}'::jsonb,
|
185
|
+
created_at timestamp with time zone,
|
186
|
+
updated_at timestamp with time zone
|
187
|
+
);
|
188
|
+
|
189
|
+
|
190
|
+
ALTER TABLE public.users OWNER TO jason;
|
191
|
+
|
192
|
+
--
|
193
|
+
-- Name: groups groups_pkey; Type: CONSTRAINT; Schema: public; Owner: jason
|
194
|
+
--
|
195
|
+
|
196
|
+
ALTER TABLE ONLY public.groups
|
197
|
+
ADD CONSTRAINT groups_pkey PRIMARY KEY (id);
|
198
|
+
|
199
|
+
|
200
|
+
--
|
201
|
+
-- Name: groups_users groups_users_pkey; Type: CONSTRAINT; Schema: public; Owner: jason
|
202
|
+
--
|
203
|
+
|
204
|
+
ALTER TABLE ONLY public.groups_users
|
205
|
+
ADD CONSTRAINT groups_users_pkey PRIMARY KEY (group_id, user_id);
|
206
|
+
|
207
|
+
|
208
|
+
--
|
209
|
+
-- Name: identities identities_claim_key; Type: CONSTRAINT; Schema: public; Owner: jason
|
210
|
+
--
|
211
|
+
|
212
|
+
ALTER TABLE ONLY public.identities
|
213
|
+
ADD CONSTRAINT identities_claim_key UNIQUE (claim);
|
214
|
+
|
215
|
+
|
216
|
+
--
|
217
|
+
-- Name: identities identities_pkey; Type: CONSTRAINT; Schema: public; Owner: jason
|
218
|
+
--
|
219
|
+
|
220
|
+
ALTER TABLE ONLY public.identities
|
221
|
+
ADD CONSTRAINT identities_pkey PRIMARY KEY (id);
|
222
|
+
|
223
|
+
|
224
|
+
--
|
225
|
+
-- Name: sessions sessions_pkey; Type: CONSTRAINT; Schema: public; Owner: jason
|
226
|
+
--
|
227
|
+
|
228
|
+
ALTER TABLE ONLY public.sessions
|
229
|
+
ADD CONSTRAINT sessions_pkey PRIMARY KEY (id);
|
230
|
+
|
231
|
+
|
232
|
+
--
|
233
|
+
-- Name: tenants tenants_pkey; Type: CONSTRAINT; Schema: public; Owner: jason
|
234
|
+
--
|
235
|
+
|
236
|
+
ALTER TABLE ONLY public.tenants
|
237
|
+
ADD CONSTRAINT tenants_pkey PRIMARY KEY (id);
|
238
|
+
|
239
|
+
|
240
|
+
--
|
241
|
+
-- Name: tenants_users tenants_users_pkey; Type: CONSTRAINT; Schema: public; Owner: jason
|
242
|
+
--
|
243
|
+
|
244
|
+
ALTER TABLE ONLY public.tenants_users
|
245
|
+
ADD CONSTRAINT tenants_users_pkey PRIMARY KEY (tenant_id, user_id);
|
246
|
+
|
247
|
+
|
248
|
+
--
|
249
|
+
-- Name: users users_email_key; Type: CONSTRAINT; Schema: public; Owner: jason
|
250
|
+
--
|
251
|
+
|
252
|
+
ALTER TABLE ONLY public.users
|
253
|
+
ADD CONSTRAINT users_email_key UNIQUE (email);
|
254
|
+
|
255
|
+
|
256
|
+
--
|
257
|
+
-- Name: users users_phone_key; Type: CONSTRAINT; Schema: public; Owner: jason
|
258
|
+
--
|
259
|
+
|
260
|
+
ALTER TABLE ONLY public.users
|
261
|
+
ADD CONSTRAINT users_phone_key UNIQUE (phone);
|
262
|
+
|
263
|
+
|
264
|
+
--
|
265
|
+
-- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: jason
|
266
|
+
--
|
267
|
+
|
268
|
+
ALTER TABLE ONLY public.users
|
269
|
+
ADD CONSTRAINT users_pkey PRIMARY KEY (id);
|
270
|
+
|
271
|
+
|
272
|
+
--
|
273
|
+
-- Name: groups_users_group_id_user_id_index; Type: INDEX; Schema: public; Owner: jason
|
274
|
+
--
|
275
|
+
|
276
|
+
CREATE INDEX groups_users_group_id_user_id_index ON public.groups_users USING btree (group_id, user_id);
|
277
|
+
|
278
|
+
|
279
|
+
--
|
280
|
+
-- Name: tenants_users_tenant_id_user_id_index; Type: INDEX; Schema: public; Owner: jason
|
281
|
+
--
|
282
|
+
|
283
|
+
CREATE INDEX tenants_users_tenant_id_user_id_index ON public.tenants_users USING btree (tenant_id, user_id);
|
284
|
+
|
285
|
+
|
286
|
+
--
|
287
|
+
-- Name: groups groups_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: jason
|
288
|
+
--
|
289
|
+
|
290
|
+
ALTER TABLE ONLY public.groups
|
291
|
+
ADD CONSTRAINT groups_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.tenants(id);
|
292
|
+
|
293
|
+
|
294
|
+
--
|
295
|
+
-- Name: groups_users groups_users_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: jason
|
296
|
+
--
|
297
|
+
|
298
|
+
ALTER TABLE ONLY public.groups_users
|
299
|
+
ADD CONSTRAINT groups_users_group_id_fkey FOREIGN KEY (group_id) REFERENCES public.groups(id);
|
300
|
+
|
301
|
+
|
302
|
+
--
|
303
|
+
-- Name: groups_users groups_users_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: jason
|
304
|
+
--
|
305
|
+
|
306
|
+
ALTER TABLE ONLY public.groups_users
|
307
|
+
ADD CONSTRAINT groups_users_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id);
|
308
|
+
|
309
|
+
|
310
|
+
--
|
311
|
+
-- Name: identities identities_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: jason
|
312
|
+
--
|
313
|
+
|
314
|
+
ALTER TABLE ONLY public.identities
|
315
|
+
ADD CONSTRAINT identities_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id);
|
316
|
+
|
317
|
+
|
318
|
+
--
|
319
|
+
-- Name: sessions sessions_identity_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: jason
|
320
|
+
--
|
321
|
+
|
322
|
+
ALTER TABLE ONLY public.sessions
|
323
|
+
ADD CONSTRAINT sessions_identity_id_fkey FOREIGN KEY (identity_id) REFERENCES public.identities(id);
|
324
|
+
|
325
|
+
|
326
|
+
--
|
327
|
+
-- Name: tenants_users tenants_users_tenant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: jason
|
328
|
+
--
|
329
|
+
|
330
|
+
ALTER TABLE ONLY public.tenants_users
|
331
|
+
ADD CONSTRAINT tenants_users_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES public.tenants(id);
|
332
|
+
|
333
|
+
|
334
|
+
--
|
335
|
+
-- Name: tenants_users tenants_users_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: jason
|
336
|
+
--
|
337
|
+
|
338
|
+
ALTER TABLE ONLY public.tenants_users
|
339
|
+
ADD CONSTRAINT tenants_users_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id);
|
340
|
+
|
341
|
+
|
342
|
+
--
|
343
|
+
-- PostgreSQL database dump complete
|
344
|
+
--
|
345
|
+
|