punk 0.3.6 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (136) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test.yml +1 -1
  3. data/.rubocop.yml +1091 -93
  4. data/.standard.yml +2 -0
  5. data/Gemfile +60 -60
  6. data/Gemfile.lock +22 -17
  7. data/README.md +7 -3
  8. data/Rakefile +9 -7
  9. data/VERSION +1 -1
  10. data/app/migrations/001_lets_punk.rb +1 -1
  11. data/app/routes/hello.rb +1 -1
  12. data/bin/punk +5 -5
  13. data/lib/punk.rb +7 -7
  14. data/lib/punk/actions/sessions/create.rb +3 -3
  15. data/lib/punk/actions/sessions/verify.rb +2 -2
  16. data/lib/punk/commands/auth.rb +4 -4
  17. data/lib/punk/commands/generate.rb +5 -5
  18. data/lib/punk/commands/http.rb +4 -4
  19. data/lib/punk/commands/list.rb +10 -10
  20. data/lib/punk/core/app.rb +41 -41
  21. data/lib/punk/core/boot.rb +5 -5
  22. data/lib/punk/core/cli.rb +3 -3
  23. data/lib/punk/core/commander.rb +28 -28
  24. data/lib/punk/core/commands.rb +8 -8
  25. data/lib/punk/core/env.rb +27 -27
  26. data/lib/punk/core/exec.rb +8 -8
  27. data/lib/punk/core/interface.rb +19 -19
  28. data/lib/punk/core/load.rb +2 -2
  29. data/lib/punk/core/logger.rb +3 -3
  30. data/lib/punk/core/monkey.rb +1 -1
  31. data/lib/punk/core/pry.rb +2 -2
  32. data/lib/punk/core/settings.rb +4 -4
  33. data/lib/punk/core/version.rb +1 -1
  34. data/lib/punk/core/worker.rb +6 -6
  35. data/lib/punk/framework/all.rb +8 -8
  36. data/lib/punk/framework/model.rb +6 -5
  37. data/lib/punk/framework/plugins/all.rb +1 -1
  38. data/lib/punk/framework/plugins/validation.rb +8 -8
  39. data/lib/punk/framework/service.rb +5 -3
  40. data/lib/punk/framework/worker.rb +3 -3
  41. data/lib/punk/helpers/all.rb +5 -5
  42. data/lib/punk/helpers/loggable.rb +3 -3
  43. data/lib/punk/helpers/publishable.rb +1 -1
  44. data/lib/punk/helpers/renderable.rb +10 -10
  45. data/lib/punk/helpers/validatable.rb +7 -6
  46. data/lib/punk/migrations/001_punk.rb +12 -12
  47. data/lib/punk/models/group.rb +1 -1
  48. data/lib/punk/models/identity.rb +1 -1
  49. data/lib/punk/models/session.rb +7 -7
  50. data/lib/punk/models/tenant.rb +1 -1
  51. data/lib/punk/models/user.rb +2 -2
  52. data/lib/punk/plugins/all.rb +2 -2
  53. data/lib/punk/plugins/cors.rb +2 -2
  54. data/lib/punk/plugins/ssl.rb +1 -1
  55. data/lib/punk/routes/groups.rb +1 -1
  56. data/lib/punk/routes/plivo.rb +1 -1
  57. data/lib/punk/routes/sessions.rb +2 -2
  58. data/lib/punk/routes/swagger.rb +2 -2
  59. data/lib/punk/routes/tenants.rb +1 -1
  60. data/lib/punk/routes/users.rb +1 -1
  61. data/lib/punk/services/challenge_claim.rb +5 -5
  62. data/lib/punk/services/generate_swagger.rb +6 -6
  63. data/lib/punk/services/prove_claim.rb +1 -1
  64. data/lib/punk/startup/cache.rb +3 -3
  65. data/lib/punk/startup/database.rb +4 -4
  66. data/lib/punk/startup/environment.rb +6 -6
  67. data/lib/punk/startup/logger.rb +2 -2
  68. data/lib/punk/startup/task.rb +5 -5
  69. data/lib/punk/views/fail.rb +2 -2
  70. data/lib/punk/views/groups/list.rb +2 -2
  71. data/lib/punk/views/info.rb +2 -2
  72. data/lib/punk/views/plivo_store.rb +2 -2
  73. data/lib/punk/views/sessions/list.rb +2 -2
  74. data/lib/punk/views/sessions/pending.rb +2 -2
  75. data/lib/punk/views/tenants/list.rb +2 -2
  76. data/lib/punk/views/users/list.rb +2 -2
  77. data/lib/punk/views/users/show.rb +2 -2
  78. data/lib/punk/workers/geocode_session_worker.rb +3 -3
  79. data/lib/punk/workers/identify_session_worker.rb +1 -1
  80. data/lib/punk/workers/send_email_worker.rb +3 -3
  81. data/lib/punk/workers/send_sms_worker.rb +3 -3
  82. data/punk.gemspec +8 -4
  83. data/spec/actions/groups/punk/list_groups_action_spec.rb +9 -9
  84. data/spec/actions/sessions/punk/clear_session_action_spec.rb +11 -11
  85. data/spec/actions/sessions/punk/create_session_action_spec.rb +9 -9
  86. data/spec/actions/sessions/punk/list_sessions_action_spec.rb +8 -8
  87. data/spec/actions/sessions/punk/verify_session_action_spec.rb +24 -24
  88. data/spec/actions/tenants/punk/list_tenants_action_spec.rb +6 -6
  89. data/spec/actions/users/punk/list_group_users_action_spec.rb +6 -6
  90. data/spec/actions/users/punk/list_tenant_users_action_spec.rb +6 -6
  91. data/spec/factories/group.rb +1 -1
  92. data/spec/factories/group_user_metadata.rb +1 -1
  93. data/spec/factories/identity.rb +4 -4
  94. data/spec/factories/session.rb +1 -1
  95. data/spec/factories/tenant.rb +1 -1
  96. data/spec/factories/tenant_user_metadata.rb +1 -1
  97. data/spec/factories/user.rb +1 -1
  98. data/spec/lib/commands/generate_spec.rb +2 -2
  99. data/spec/lib/commands/list_spec.rb +2 -2
  100. data/spec/lib/commands/swagger_spec.rb +2 -2
  101. data/spec/lib/engine/punk_env_spec.rb +4 -4
  102. data/spec/lib/engine/punk_exec_spec.rb +2 -2
  103. data/spec/lib/engine/punk_init_spec.rb +2 -2
  104. data/spec/lib/engine/punk_store_spec.rb +2 -2
  105. data/spec/models/punk/group_spec.rb +4 -4
  106. data/spec/models/punk/group_user_metadata_spec.rb +2 -2
  107. data/spec/models/punk/identity_spec.rb +17 -17
  108. data/spec/models/punk/session_spec.rb +4 -4
  109. data/spec/models/punk/tenant_spec.rb +3 -3
  110. data/spec/models/punk/tenant_user_metadata_spec.rb +2 -2
  111. data/spec/models/punk/user_spec.rb +9 -9
  112. data/spec/routes/groups/get_groups_spec.rb +4 -4
  113. data/spec/routes/plivo/get_plivo_spec.rb +1 -1
  114. data/spec/routes/sessions/delete_session_spec.rb +1 -1
  115. data/spec/routes/sessions/get_sessions_spec.rb +5 -5
  116. data/spec/routes/sessions/patch_session_spec.rb +1 -1
  117. data/spec/routes/sessions/post_session_spec.rb +1 -1
  118. data/spec/routes/swagger/get_swagger_spec.rb +1 -1
  119. data/spec/routes/tenants/get_tenants_spec.rb +5 -5
  120. data/spec/routes/users/get_users_spec.rb +6 -6
  121. data/spec/services/punk/challenge_claim_service_spec.rb +2 -2
  122. data/spec/services/punk/create_identities_service_spec.rb +1 -1
  123. data/spec/services/punk/generate_swagger_service_spec.rb +2 -2
  124. data/spec/services/punk/prove_claim_service_spec.rb +2 -2
  125. data/spec/services/punk/secret_service_spec.rb +2 -2
  126. data/spec/spec_helper.rb +27 -27
  127. data/spec/views/punk/plivo_store_spec.rb +2 -2
  128. data/spec/views/sessions/punk/list_sessions_view_spec.rb +2 -2
  129. data/spec/views/sessions/punk/pending_session_view_spec.rb +2 -2
  130. data/spec/views/tenants/punk/list_tenants_view_spec.rb +2 -2
  131. data/spec/views/users/punk/list_groups_view_spec.rb +2 -2
  132. data/spec/views/users/punk/list_users_view_spec.rb +2 -2
  133. data/spec/workers/punk/geocode_session_worker_spec.rb +2 -2
  134. data/spec/workers/punk/identify_session_worker_spec.rb +3 -3
  135. data/spec/workers/punk/send_email_worker_spec.rb +1 -1
  136. metadata +18 -3
@@ -1,3 +1,3 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'validation'
3
+ require_relative "validation"
@@ -1,28 +1,28 @@
1
1
  # frozen-string-literal: true
2
2
 
3
- require 'uri'
4
- require 'phony'
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 = { message: "is not a URL" }
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 = { message: "is not an email address" }
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 = { message: "is not a phone number" }
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 'active_support/string_inquirer'
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; end
37
+ def on_success
38
+ end
38
39
 
39
- def on_failure; end
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 'sidekiq'
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['PUNK::SKQ'] }
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)
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'active_support/concern'
3
+ require "active_support/concern"
4
4
 
5
- require_relative 'loggable'
6
- require_relative 'publishable'
7
- require_relative 'renderable'
8
- require_relative 'validatable'
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?('SENTRY_DSN')
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,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'wisper'
3
+ require "wisper"
4
4
 
5
5
  module PUNK
6
6
  module Publishable
@@ -1,15 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'tilt'
3
+ require "tilt"
4
4
 
5
5
  module PUNK
6
6
  module Renderable
7
7
  FORMATS =
8
8
  {
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' }
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, 'templates')
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 'sequel/plugins/validation_helpers'
4
- require_relative '../framework/plugins/validation'
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; end
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 StandardError
46
+ rescue
46
47
  nil
47
48
  end
48
49
  value ||=
49
50
  begin
50
51
  send(name)
51
- rescue StandardError
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: 'created'
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: 'created'
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: 'created'
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: 'created'
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: 'created'
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: '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: '{}'
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
@@ -6,7 +6,7 @@ module PUNK
6
6
  # @property name(required) [string] the name of the group
7
7
  # @property icon(required) [string] an image URL
8
8
  class Group < PUNK::Model
9
- alias to_s name
9
+ alias_method :to_s, :name
10
10
 
11
11
  many_to_one :tenant
12
12
  many_to_many :users
@@ -2,7 +2,7 @@
2
2
 
3
3
  module PUNK
4
4
  class Identity < PUNK::Model
5
- alias to_s claim
5
+ alias_method :to_s, :claim
6
6
 
7
7
  many_to_one :user
8
8
  one_to_many :sessions
@@ -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
- alias to_s state
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: 'created')
41
+ where(state: "created")
42
42
  end
43
43
 
44
44
  def pending
45
- where(state: 'pending')
45
+ where(state: "pending")
46
46
  end
47
47
 
48
48
  def active
49
- where(state: 'active')
49
+ where(state: "active")
50
50
  end
51
51
 
52
52
  def expired
53
- where(state: 'expired')
53
+ where(state: "expired")
54
54
  end
55
55
 
56
56
  def deleted
57
- where(state: 'deleted')
57
+ where(state: "deleted")
58
58
  end
59
59
 
60
60
  def expiring
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))) }
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
 
@@ -6,7 +6,7 @@ module PUNK
6
6
  # @property name(required) [string] the name of the tenant
7
7
  # @property icon(required) [string] an image URL
8
8
  class Tenant < PUNK::Model
9
- alias to_s name
9
+ alias_method :to_s, :name
10
10
 
11
11
  many_to_many :users
12
12
  one_to_many :groups
@@ -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
- alias to_s name
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"') => 'active')
28
+ sessions_dataset.where(Sequel.lit('"sessions"."state"') => "active")
29
29
  end
30
30
  end
31
31
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'cors'
4
- require_relative 'ssl'
3
+ require_relative "cors"
4
+ require_relative "ssl"
@@ -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 'rack/cors'
8
+ require "rack/cors"
9
9
  app.use ::Rack::Cors do
10
10
  allow do
11
11
  origins origin
12
- resource '*', headers: :any, methods: :any
12
+ resource "*", headers: :any, methods: :any
13
13
  end
14
14
  end
15
15
  end
@@ -4,7 +4,7 @@ class Roda
4
4
  module RodaPlugins
5
5
  module Ssl
6
6
  def self.configure(app)
7
- require 'rack/ssl-enforcer'
7
+ require "rack/ssl-enforcer"
8
8
  app.use ::Rack::SslEnforcer
9
9
  end
10
10
  end
@@ -3,7 +3,7 @@
3
3
  # @resource Groups
4
4
  #
5
5
  # Each tenant can have many groups.
6
- PUNK.route('groups') do
6
+ PUNK.route("groups") do
7
7
  require_session!
8
8
  require_tenant!
9
9
 
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # route: GET /plivo
4
- PUNK.route('plivo') { present PUNK::PlivoStore }
4
+ PUNK.route("plivo") { present PUNK::PlivoStore }
@@ -3,7 +3,7 @@
3
3
  # @resource Sessions
4
4
  #
5
5
  # Handle the authentication flow.
6
- PUNK.route('sessions') do
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['HTTP_USER_AGENT'] || PUNK::Session.default_values[:user_agent])
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