punk 0.3.6 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +1 -1
- data/.rubocop.yml +1091 -93
- data/.standard.yml +2 -0
- data/Gemfile +60 -60
- data/Gemfile.lock +22 -17
- data/README.md +7 -3
- data/Rakefile +9 -7
- data/VERSION +1 -1
- data/app/migrations/001_lets_punk.rb +1 -1
- data/app/routes/hello.rb +1 -1
- data/bin/punk +5 -5
- data/lib/punk.rb +7 -7
- data/lib/punk/actions/sessions/create.rb +3 -3
- data/lib/punk/actions/sessions/verify.rb +2 -2
- data/lib/punk/commands/auth.rb +4 -4
- data/lib/punk/commands/generate.rb +5 -5
- data/lib/punk/commands/http.rb +4 -4
- data/lib/punk/commands/list.rb +10 -10
- data/lib/punk/core/app.rb +41 -41
- data/lib/punk/core/boot.rb +5 -5
- data/lib/punk/core/cli.rb +3 -3
- data/lib/punk/core/commander.rb +28 -28
- data/lib/punk/core/commands.rb +8 -8
- data/lib/punk/core/env.rb +27 -27
- data/lib/punk/core/exec.rb +8 -8
- data/lib/punk/core/interface.rb +19 -19
- data/lib/punk/core/load.rb +2 -2
- data/lib/punk/core/logger.rb +3 -3
- data/lib/punk/core/monkey.rb +1 -1
- data/lib/punk/core/pry.rb +2 -2
- data/lib/punk/core/settings.rb +4 -4
- data/lib/punk/core/version.rb +1 -1
- data/lib/punk/core/worker.rb +6 -6
- data/lib/punk/framework/all.rb +8 -8
- data/lib/punk/framework/model.rb +6 -5
- data/lib/punk/framework/plugins/all.rb +1 -1
- data/lib/punk/framework/plugins/validation.rb +8 -8
- data/lib/punk/framework/service.rb +5 -3
- data/lib/punk/framework/worker.rb +3 -3
- data/lib/punk/helpers/all.rb +5 -5
- data/lib/punk/helpers/loggable.rb +3 -3
- data/lib/punk/helpers/publishable.rb +1 -1
- data/lib/punk/helpers/renderable.rb +10 -10
- data/lib/punk/helpers/validatable.rb +7 -6
- data/lib/punk/migrations/001_punk.rb +12 -12
- data/lib/punk/models/group.rb +1 -1
- data/lib/punk/models/identity.rb +1 -1
- data/lib/punk/models/session.rb +7 -7
- data/lib/punk/models/tenant.rb +1 -1
- data/lib/punk/models/user.rb +2 -2
- data/lib/punk/plugins/all.rb +2 -2
- data/lib/punk/plugins/cors.rb +2 -2
- data/lib/punk/plugins/ssl.rb +1 -1
- data/lib/punk/routes/groups.rb +1 -1
- data/lib/punk/routes/plivo.rb +1 -1
- data/lib/punk/routes/sessions.rb +2 -2
- data/lib/punk/routes/swagger.rb +2 -2
- data/lib/punk/routes/tenants.rb +1 -1
- data/lib/punk/routes/users.rb +1 -1
- data/lib/punk/services/challenge_claim.rb +5 -5
- data/lib/punk/services/generate_swagger.rb +6 -6
- data/lib/punk/services/prove_claim.rb +1 -1
- data/lib/punk/startup/cache.rb +3 -3
- data/lib/punk/startup/database.rb +4 -4
- data/lib/punk/startup/environment.rb +6 -6
- data/lib/punk/startup/logger.rb +2 -2
- data/lib/punk/startup/task.rb +5 -5
- data/lib/punk/views/fail.rb +2 -2
- data/lib/punk/views/groups/list.rb +2 -2
- data/lib/punk/views/info.rb +2 -2
- data/lib/punk/views/plivo_store.rb +2 -2
- data/lib/punk/views/sessions/list.rb +2 -2
- data/lib/punk/views/sessions/pending.rb +2 -2
- data/lib/punk/views/tenants/list.rb +2 -2
- data/lib/punk/views/users/list.rb +2 -2
- data/lib/punk/views/users/show.rb +2 -2
- data/lib/punk/workers/geocode_session_worker.rb +3 -3
- data/lib/punk/workers/identify_session_worker.rb +1 -1
- data/lib/punk/workers/send_email_worker.rb +3 -3
- data/lib/punk/workers/send_sms_worker.rb +3 -3
- data/punk.gemspec +8 -4
- data/spec/actions/groups/punk/list_groups_action_spec.rb +9 -9
- data/spec/actions/sessions/punk/clear_session_action_spec.rb +11 -11
- data/spec/actions/sessions/punk/create_session_action_spec.rb +9 -9
- data/spec/actions/sessions/punk/list_sessions_action_spec.rb +8 -8
- data/spec/actions/sessions/punk/verify_session_action_spec.rb +24 -24
- data/spec/actions/tenants/punk/list_tenants_action_spec.rb +6 -6
- data/spec/actions/users/punk/list_group_users_action_spec.rb +6 -6
- data/spec/actions/users/punk/list_tenant_users_action_spec.rb +6 -6
- data/spec/factories/group.rb +1 -1
- data/spec/factories/group_user_metadata.rb +1 -1
- data/spec/factories/identity.rb +4 -4
- data/spec/factories/session.rb +1 -1
- data/spec/factories/tenant.rb +1 -1
- data/spec/factories/tenant_user_metadata.rb +1 -1
- data/spec/factories/user.rb +1 -1
- data/spec/lib/commands/generate_spec.rb +2 -2
- data/spec/lib/commands/list_spec.rb +2 -2
- data/spec/lib/commands/swagger_spec.rb +2 -2
- data/spec/lib/engine/punk_env_spec.rb +4 -4
- data/spec/lib/engine/punk_exec_spec.rb +2 -2
- data/spec/lib/engine/punk_init_spec.rb +2 -2
- data/spec/lib/engine/punk_store_spec.rb +2 -2
- data/spec/models/punk/group_spec.rb +4 -4
- data/spec/models/punk/group_user_metadata_spec.rb +2 -2
- data/spec/models/punk/identity_spec.rb +17 -17
- data/spec/models/punk/session_spec.rb +4 -4
- data/spec/models/punk/tenant_spec.rb +3 -3
- data/spec/models/punk/tenant_user_metadata_spec.rb +2 -2
- data/spec/models/punk/user_spec.rb +9 -9
- data/spec/routes/groups/get_groups_spec.rb +4 -4
- data/spec/routes/plivo/get_plivo_spec.rb +1 -1
- data/spec/routes/sessions/delete_session_spec.rb +1 -1
- data/spec/routes/sessions/get_sessions_spec.rb +5 -5
- data/spec/routes/sessions/patch_session_spec.rb +1 -1
- data/spec/routes/sessions/post_session_spec.rb +1 -1
- data/spec/routes/swagger/get_swagger_spec.rb +1 -1
- data/spec/routes/tenants/get_tenants_spec.rb +5 -5
- data/spec/routes/users/get_users_spec.rb +6 -6
- data/spec/services/punk/challenge_claim_service_spec.rb +2 -2
- data/spec/services/punk/create_identities_service_spec.rb +1 -1
- data/spec/services/punk/generate_swagger_service_spec.rb +2 -2
- data/spec/services/punk/prove_claim_service_spec.rb +2 -2
- data/spec/services/punk/secret_service_spec.rb +2 -2
- data/spec/spec_helper.rb +27 -27
- data/spec/views/punk/plivo_store_spec.rb +2 -2
- data/spec/views/sessions/punk/list_sessions_view_spec.rb +2 -2
- data/spec/views/sessions/punk/pending_session_view_spec.rb +2 -2
- data/spec/views/tenants/punk/list_tenants_view_spec.rb +2 -2
- data/spec/views/users/punk/list_groups_view_spec.rb +2 -2
- data/spec/views/users/punk/list_users_view_spec.rb +2 -2
- data/spec/workers/punk/geocode_session_worker_spec.rb +2 -2
- data/spec/workers/punk/identify_session_worker_spec.rb +3 -3
- data/spec/workers/punk/send_email_worker_spec.rb +1 -1
- metadata +18 -3
@@ -1,28 +1,28 @@
|
|
1
1
|
# frozen-string-literal: true
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require "uri"
|
4
|
+
require "phony"
|
5
5
|
|
6
6
|
module PUNK
|
7
7
|
module Plugins
|
8
8
|
module Validation
|
9
9
|
module InstanceMethods
|
10
|
-
def validates_url(atts, opts={})
|
11
|
-
default = {
|
10
|
+
def validates_url(atts, opts = {})
|
11
|
+
default = {message: "is not a URL"}
|
12
12
|
validatable_attributes(atts, default.merge(opts)) do |_name, value, message|
|
13
13
|
message unless URI::DEFAULT_PARSER.make_regexp.match(value).to_a.compact.length > 2
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
|
-
def validates_email(atts, opts={})
|
18
|
-
default = {
|
17
|
+
def validates_email(atts, opts = {})
|
18
|
+
default = {message: "is not an email address"}
|
19
19
|
validatable_attributes(atts, default.merge(opts)) do |_name, value, message|
|
20
20
|
message unless URI::MailTo::EMAIL_REGEXP.match(value)
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
-
def validates_phone(atts, opts={})
|
25
|
-
default = {
|
24
|
+
def validates_phone(atts, opts = {})
|
25
|
+
default = {message: "is not a phone number"}
|
26
26
|
validatable_attributes(atts, default.merge(opts)) do |_name, value, message|
|
27
27
|
message unless Phony.plausible?(value)
|
28
28
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "active_support/string_inquirer"
|
4
4
|
|
5
5
|
module PUNK
|
6
6
|
class Service < Runnable
|
@@ -34,9 +34,11 @@ module PUNK
|
|
34
34
|
ActiveSupport::StringInquirer.new(@_state.to_s)
|
35
35
|
end
|
36
36
|
|
37
|
-
def on_success
|
37
|
+
def on_success
|
38
|
+
end
|
38
39
|
|
39
|
-
def on_failure
|
40
|
+
def on_failure
|
41
|
+
end
|
40
42
|
|
41
43
|
private
|
42
44
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "sidekiq"
|
4
4
|
|
5
5
|
module PUNK
|
6
6
|
class Worker < Runnable
|
@@ -8,11 +8,11 @@ module PUNK
|
|
8
8
|
|
9
9
|
def self.perform_now(**kwargs)
|
10
10
|
worker = new
|
11
|
-
worker.define_singleton_method :logger, -> { SemanticLogger[
|
11
|
+
worker.define_singleton_method :logger, -> { SemanticLogger["PUNK::SKQ"] }
|
12
12
|
worker.send(:perform, **kwargs)
|
13
13
|
end
|
14
14
|
|
15
|
-
def perform(kwargs={})
|
15
|
+
def perform(kwargs = {})
|
16
16
|
@_started = Time.now.utc
|
17
17
|
logger.info "Started #{self.class.name}", kwargs.sanitize.inspect
|
18
18
|
logger.push_tags(self.class.name)
|
data/lib/punk/helpers/all.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "active_support/concern"
|
4
4
|
|
5
|
-
require_relative
|
6
|
-
require_relative
|
7
|
-
require_relative
|
8
|
-
require_relative
|
5
|
+
require_relative "loggable"
|
6
|
+
require_relative "publishable"
|
7
|
+
require_relative "renderable"
|
8
|
+
require_relative "validatable"
|
@@ -20,8 +20,8 @@ module PUNK
|
|
20
20
|
self.class.profile_trace(name, **kwargs, &block)
|
21
21
|
end
|
22
22
|
|
23
|
-
def exception(e, extra={})
|
24
|
-
if ENV.key?(
|
23
|
+
def exception(e, extra = {})
|
24
|
+
if ENV.key?("SENTRY_DSN")
|
25
25
|
::Sentry.capture_exception(
|
26
26
|
e,
|
27
27
|
message: e.message,
|
@@ -45,7 +45,7 @@ module PUNK
|
|
45
45
|
if trim || ignore.any? { |path| line =~ /#{path}/ }
|
46
46
|
unless skip
|
47
47
|
skip = true
|
48
|
-
|
48
|
+
"..."
|
49
49
|
end
|
50
50
|
else
|
51
51
|
skip = false
|
@@ -1,15 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "tilt"
|
4
4
|
|
5
5
|
module PUNK
|
6
6
|
module Renderable
|
7
7
|
FORMATS =
|
8
8
|
{
|
9
|
-
html: {
|
10
|
-
json: {
|
11
|
-
csv: {
|
12
|
-
xml: {
|
9
|
+
html: {renderer: :to_html, extension: "slim"},
|
10
|
+
json: {renderer: :to_json, extension: "jbuilder"},
|
11
|
+
csv: {renderer: :to_csv, extension: "rcsv"},
|
12
|
+
xml: {renderer: :to_xml, extension: "xml.slim"}
|
13
13
|
}.freeze
|
14
14
|
|
15
15
|
def template(name)
|
@@ -21,19 +21,19 @@ module PUNK
|
|
21
21
|
send(FORMATS[format][:renderer])
|
22
22
|
end
|
23
23
|
|
24
|
-
def to_html(options={})
|
24
|
+
def to_html(options = {})
|
25
25
|
_render(:html, options)
|
26
26
|
end
|
27
27
|
|
28
|
-
def to_json(options={})
|
28
|
+
def to_json(options = {})
|
29
29
|
_render(:json, options)
|
30
30
|
end
|
31
31
|
|
32
|
-
def to_csv(options={})
|
32
|
+
def to_csv(options = {})
|
33
33
|
_render(:csv, options)
|
34
34
|
end
|
35
35
|
|
36
|
-
def to_xml(options={})
|
36
|
+
def to_xml(options = {})
|
37
37
|
_render(:xml, options)
|
38
38
|
end
|
39
39
|
|
@@ -52,7 +52,7 @@ module PUNK
|
|
52
52
|
protected
|
53
53
|
|
54
54
|
def _dir
|
55
|
-
File.join(PUNK.get.app.path,
|
55
|
+
File.join(PUNK.get.app.path, "templates")
|
56
56
|
end
|
57
57
|
|
58
58
|
private
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
4
|
-
require_relative
|
3
|
+
require "sequel/plugins/validation_helpers"
|
4
|
+
require_relative "../framework/plugins/validation"
|
5
5
|
|
6
6
|
module PUNK
|
7
7
|
module Validatable
|
@@ -21,9 +21,10 @@ module PUNK
|
|
21
21
|
errors.empty?
|
22
22
|
end
|
23
23
|
|
24
|
-
def validate
|
24
|
+
def validate
|
25
|
+
end
|
25
26
|
|
26
|
-
def validates_not_empty(atts, opts=Sequel::OPTS)
|
27
|
+
def validates_not_empty(atts, opts = Sequel::OPTS)
|
27
28
|
validatable_attributes_for_type(:not_empty, atts, opts) { |_a, v, m| validation_error_message(m) if v.blank? }
|
28
29
|
end
|
29
30
|
|
@@ -42,13 +43,13 @@ module PUNK
|
|
42
43
|
value =
|
43
44
|
begin
|
44
45
|
instance_variable_get(name)
|
45
|
-
rescue
|
46
|
+
rescue
|
46
47
|
nil
|
47
48
|
end
|
48
49
|
value ||=
|
49
50
|
begin
|
50
51
|
send(name)
|
51
|
-
rescue
|
52
|
+
rescue
|
52
53
|
nil
|
53
54
|
end
|
54
55
|
value
|
@@ -3,10 +3,10 @@
|
|
3
3
|
def _tenants
|
4
4
|
create_table :tenants do
|
5
5
|
uuid :id, primary_key: true, default: Sequel.function(:gen_random_uuid)
|
6
|
-
punk_state :state, null: false, default:
|
6
|
+
punk_state :state, null: false, default: "created"
|
7
7
|
String :name, null: false, text: true
|
8
8
|
String :icon, text: true
|
9
|
-
jsonb :data, default:
|
9
|
+
jsonb :data, default: "{}"
|
10
10
|
DateTime :created_at
|
11
11
|
DateTime :updated_at
|
12
12
|
end
|
@@ -15,12 +15,12 @@ end
|
|
15
15
|
def _users
|
16
16
|
create_table :users do
|
17
17
|
uuid :id, primary_key: true, default: Sequel.function(:gen_random_uuid)
|
18
|
-
punk_state :state, null: false, default:
|
18
|
+
punk_state :state, null: false, default: "created"
|
19
19
|
String :name, null: false, text: true
|
20
20
|
String :icon, text: true
|
21
21
|
String :email, text: true, unique: true
|
22
22
|
String :phone, text: true, unique: true
|
23
|
-
jsonb :data, default:
|
23
|
+
jsonb :data, default: "{}"
|
24
24
|
DateTime :created_at
|
25
25
|
DateTime :updated_at
|
26
26
|
end
|
@@ -38,10 +38,10 @@ end
|
|
38
38
|
def _groups
|
39
39
|
create_table :groups do
|
40
40
|
uuid :id, primary_key: true, default: Sequel.function(:gen_random_uuid)
|
41
|
-
punk_state :state, null: false, default:
|
41
|
+
punk_state :state, null: false, default: "created"
|
42
42
|
String :name, null: false, text: true
|
43
43
|
String :icon, text: true
|
44
|
-
jsonb :data, default:
|
44
|
+
jsonb :data, default: "{}"
|
45
45
|
DateTime :created_at
|
46
46
|
DateTime :updated_at
|
47
47
|
foreign_key :tenant_id, :tenants, null: false, type: :uuid
|
@@ -61,10 +61,10 @@ def _identities
|
|
61
61
|
create_enum(:claim_type, %w[email phone])
|
62
62
|
create_table :identities do
|
63
63
|
uuid :id, primary_key: true, default: Sequel.function(:gen_random_uuid)
|
64
|
-
punk_state :state, null: false, default:
|
64
|
+
punk_state :state, null: false, default: "created"
|
65
65
|
claim_type :claim_type, null: false
|
66
66
|
String :claim, text: true, null: false, unique: true
|
67
|
-
jsonb :data, default:
|
67
|
+
jsonb :data, default: "{}"
|
68
68
|
DateTime :created_at
|
69
69
|
DateTime :updated_at
|
70
70
|
foreign_key :user_id, :users, null: true, type: :uuid
|
@@ -76,13 +76,13 @@ def _sessions
|
|
76
76
|
create_table :sessions do
|
77
77
|
uuid :id, primary_key: true, default: Sequel.function(:gen_random_uuid)
|
78
78
|
uuid :slug, default: Sequel.function(:gen_random_uuid)
|
79
|
-
session_state :state, null: false, default:
|
79
|
+
session_state :state, null: false, default: "created"
|
80
80
|
File :salt, text: true
|
81
81
|
File :hash, text: true
|
82
82
|
Integer :attempt_count, null: false, default: 0
|
83
|
-
cidr :remote_addr, null: false, default:
|
84
|
-
String :user_agent, text: true, null: false, default:
|
85
|
-
jsonb :data, default:
|
83
|
+
cidr :remote_addr, null: false, default: "127.0.0.1"
|
84
|
+
String :user_agent, text: true, null: false, default: "Mozilla/5.0 (compatible; Punk!; +https://punk.kranzky.com)"
|
85
|
+
jsonb :data, default: "{}"
|
86
86
|
DateTime :created_at
|
87
87
|
DateTime :updated_at
|
88
88
|
foreign_key :identity_id, :identities, null: false, type: :uuid
|
data/lib/punk/models/group.rb
CHANGED
data/lib/punk/models/identity.rb
CHANGED
data/lib/punk/models/session.rb
CHANGED
@@ -5,7 +5,7 @@ module PUNK
|
|
5
5
|
# @property slug(required) [string] a unique identifier for the session while it is being challenged
|
6
6
|
# @property message(required) [string] a message to be displayed to the user to let them know what to do
|
7
7
|
class Session < PUNK::Model
|
8
|
-
|
8
|
+
alias_method :to_s, :state
|
9
9
|
|
10
10
|
many_to_one :identity
|
11
11
|
one_through_one :user, join_table: :identities, left_key: :id, left_primary_key: :identity_id
|
@@ -38,27 +38,27 @@ module PUNK
|
|
38
38
|
|
39
39
|
dataset_module do
|
40
40
|
def created
|
41
|
-
where(state:
|
41
|
+
where(state: "created")
|
42
42
|
end
|
43
43
|
|
44
44
|
def pending
|
45
|
-
where(state:
|
45
|
+
where(state: "pending")
|
46
46
|
end
|
47
47
|
|
48
48
|
def active
|
49
|
-
where(state:
|
49
|
+
where(state: "active")
|
50
50
|
end
|
51
51
|
|
52
52
|
def expired
|
53
|
-
where(state:
|
53
|
+
where(state: "expired")
|
54
54
|
end
|
55
55
|
|
56
56
|
def deleted
|
57
|
-
where(state:
|
57
|
+
where(state: "deleted")
|
58
58
|
end
|
59
59
|
|
60
60
|
def expiring
|
61
|
-
where { Sequel.&({
|
61
|
+
where { Sequel.&({state: ["created", "pending"]}, (created_at < 5.minutes.ago)) }.or { Sequel.&({state: "active"}, ((updated_at < 1.month.ago) | (created_at < 1.year.ago))) }
|
62
62
|
end
|
63
63
|
end
|
64
64
|
|
data/lib/punk/models/tenant.rb
CHANGED
data/lib/punk/models/user.rb
CHANGED
@@ -6,7 +6,7 @@ module PUNK
|
|
6
6
|
# @property name(required) [string] the name of the user
|
7
7
|
# @property icon(required) [string] an image URL
|
8
8
|
class User < Model
|
9
|
-
|
9
|
+
alias_method :to_s, :name
|
10
10
|
|
11
11
|
many_to_many :tenants
|
12
12
|
many_to_many :groups
|
@@ -25,7 +25,7 @@ module PUNK
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def active_sessions
|
28
|
-
sessions_dataset.where(Sequel.lit('"sessions"."state"') =>
|
28
|
+
sessions_dataset.where(Sequel.lit('"sessions"."state"') => "active")
|
29
29
|
end
|
30
30
|
end
|
31
31
|
end
|
data/lib/punk/plugins/all.rb
CHANGED
data/lib/punk/plugins/cors.rb
CHANGED
@@ -5,11 +5,11 @@ class Roda
|
|
5
5
|
module Cors
|
6
6
|
def self.configure(app, origin)
|
7
7
|
return if origin.nil?
|
8
|
-
require
|
8
|
+
require "rack/cors"
|
9
9
|
app.use ::Rack::Cors do
|
10
10
|
allow do
|
11
11
|
origins origin
|
12
|
-
resource
|
12
|
+
resource "*", headers: :any, methods: :any
|
13
13
|
end
|
14
14
|
end
|
15
15
|
end
|
data/lib/punk/plugins/ssl.rb
CHANGED
data/lib/punk/routes/groups.rb
CHANGED
data/lib/punk/routes/plivo.rb
CHANGED
data/lib/punk/routes/sessions.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
# @resource Sessions
|
4
4
|
#
|
5
5
|
# Handle the authentication flow.
|
6
|
-
PUNK.route(
|
6
|
+
PUNK.route("sessions") do
|
7
7
|
# Challenge the claim of someone having a particular email address or phone number.
|
8
8
|
# @path [POST] /sessions
|
9
9
|
# @parameter claim(required) [string] An email address or mobile phone number.
|
@@ -24,7 +24,7 @@ PUNK.route('sessions') do
|
|
24
24
|
# route: POST /sessions
|
25
25
|
post do
|
26
26
|
require_anonymous!
|
27
|
-
perform PUNK::CreateSessionAction, args.merge(remote_addr: request.ip || PUNK::Session.default_values[:remote_addr].to_s, user_agent: request.env[
|
27
|
+
perform PUNK::CreateSessionAction, args.merge(remote_addr: request.ip || PUNK::Session.default_values[:remote_addr].to_s, user_agent: request.env["HTTP_USER_AGENT"] || PUNK::Session.default_values[:user_agent])
|
28
28
|
end
|
29
29
|
|
30
30
|
# route: GET /sessions/current
|