trusona 2.3.0 → 2.5.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +5 -5
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/.gitignore +3 -0
  5. data/.rubocop.yml +13 -0
  6. data/.ruby-version +1 -1
  7. data/.travis.yml +19 -15
  8. data/README.md +4 -3
  9. data/integrations/buster.rb +15 -0
  10. data/integrations/spec_helper.rb +3 -0
  11. data/integrations/trusonafication_spec.rb +18 -3
  12. data/lib/trusona.rb +3 -1
  13. data/lib/trusona/api/signed_request.rb +4 -1
  14. data/lib/trusona/api/verified_response.rb +6 -1
  15. data/lib/trusona/identity_document.rb +0 -6
  16. data/lib/trusona/mappers/base_mapper.rb +5 -0
  17. data/lib/trusona/mappers/paired_tru_code_mapper.rb +1 -0
  18. data/lib/trusona/resources/base_resource.rb +1 -1
  19. data/lib/trusona/resources/device_user_binding.rb +1 -0
  20. data/lib/trusona/resources/device_user_binding_activation.rb +2 -1
  21. data/lib/trusona/resources/identity_document.rb +4 -4
  22. data/lib/trusona/resources/paired_tru_code.rb +1 -0
  23. data/lib/trusona/resources/tru_code.rb +2 -1
  24. data/lib/trusona/resources/trusonafication.rb +29 -20
  25. data/lib/trusona/resources/user_account.rb +6 -2
  26. data/lib/trusona/resources/user_identifier.rb +3 -1
  27. data/lib/trusona/resources/validators.rb +1 -0
  28. data/lib/trusona/services/base_service.rb +9 -2
  29. data/lib/trusona/services/device_user_bindings_service.rb +3 -3
  30. data/lib/trusona/services/identity_documents_service.rb +3 -3
  31. data/lib/trusona/services/paired_tru_code_service.rb +1 -0
  32. data/lib/trusona/trusonafication.rb +32 -3
  33. data/lib/trusona/version.rb +1 -1
  34. data/lib/trusona/workers/device_finder.rb +1 -0
  35. data/lib/trusona/workers/identity_document_finder.rb +1 -0
  36. data/lib/trusona/workers/paired_tru_code_finder.rb +1 -0
  37. data/lib/trusona/workers/tru_code_finder.rb +1 -0
  38. data/lib/trusona/workers/trusonafication_canceler.rb +27 -0
  39. data/lib/trusona/workers/trusonafication_creator.rb +2 -1
  40. data/lib/trusona/workers/trusonafication_finder.rb +1 -1
  41. data/lib/trusona/workers/user_account_finder.rb +1 -3
  42. data/lib/trusona/workers/user_deactivator.rb +1 -3
  43. data/lib/trusona/workers/user_identifier_finder.rb +1 -0
  44. data/trusona.cnf +14 -0
  45. data/trusona.gemspec +9 -7
  46. metadata +85 -57
  47. metadata.gz.sig +0 -0
  48. data/certs/trusona.pem +0 -34
  49. data/trusona.key.pem.enc +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 60739d2fd6bfd4db4b0e43b06aa314a857e46660
4
- data.tar.gz: 49b452b94a0dcff871d2c6d8d3e8a18feb48177e
2
+ SHA256:
3
+ metadata.gz: 6a371d2186875676cdb75a7108eb49fada888ebc9d4ff9b795fba9ef2151cd93
4
+ data.tar.gz: 2338ca4cb6b13dc08a9e6ab411dfe93c4b12c040ac30a35a49dcbd903bc3956b
5
5
  SHA512:
6
- metadata.gz: 5fa55cbf9abe02741f48f82516371c1406e494189f6365521ab3aa0b4e99274e5e0907983cdfe0efdd908d7f9ca15261c39bb56a8091b35c9791814a8406b7ed
7
- data.tar.gz: 4d0eb3dc425a90ca2eb367bc3bcabc6651749ca2fe01115efa853afb6f63b9681c12618f1d28922f696cf44072db429d03424dc00f1161b5c7b735dc95d8a64d
6
+ metadata.gz: e913a545b9658c398711c0469270746661f22c1e872a26d162edccfc9026e7b713a6df6b38c67aa901748da0a3b3b3da44a206bce4a39386a0fe8b1519831d94
7
+ data.tar.gz: 5cca66635a4ac1b576d2908a2da218370df3bbb61ce6e9967501910b51df01034284de116f43e69557d807a51a732a7d9ed8ec38b15e8bc8a163d26c6d526228
Binary file
data.tar.gz.sig CHANGED
Binary file
data/.gitignore CHANGED
@@ -10,6 +10,8 @@
10
10
  *.gem
11
11
  *.key.pem
12
12
 
13
+ vendor/
14
+
13
15
  # rspec failure tracking
14
16
  .rspec_status
15
17
 
@@ -19,3 +21,4 @@
19
21
 
20
22
  test.rb
21
23
  .vscode
24
+ *.pem
@@ -0,0 +1,13 @@
1
+ ## https://github.com/rubocop-hq/rubocop/blob/master/config/default.yml
2
+ ##
3
+ Style/Documentation:
4
+ Enabled: false
5
+
6
+ require: rubocop-performance
7
+
8
+ AllCops:
9
+ Include:
10
+ - 'lib/**/*'
11
+ Metrics:
12
+ Exclude:
13
+ - 'spec/**/*'
@@ -1 +1 @@
1
- 2.6.3
1
+ 2.6.5
@@ -1,30 +1,34 @@
1
- sudo: false
2
1
  language: ruby
3
2
  cache:
4
3
  - bundler
4
+ - directories:
5
+ - vendor/
5
6
  rvm:
6
- - 2.4.3
7
- - 2.5.1
7
+ - 2.6
8
+ - 2.7
8
9
  before_script:
9
- - openssl aes-256-cbc -K $encrypted_2ddff5084a28_key -iv $encrypted_2ddff5084a28_iv -in trusona.key.pem.enc -out trusona.key.pem -d
10
+ - openssl req -utf8 -config trusona.cnf -new -verify -newkey rsa:4096 -days 1 -nodes -x509 -keyout trusona.key.pem -out trusona.pub.pem
10
11
  - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
11
12
  - chmod +x ./cc-test-reporter
12
13
  - ./cc-test-reporter before-build
13
14
  script:
14
- - bundle exec rspec spec -f p
15
- - bundle exec rubocop lib/**/*.rb -F
16
- - gem build trusona.gemspec
17
- after_script:
18
- - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
15
+ - bundle exec rspec -f p
16
+ - bundle exec rubocop lib
17
+ - bundle exec gem build trusona.gemspec --silent
18
+ after_success:
19
+ - if [[ $TRAVIS_PULL_REQUEST == false ]] && [[ $TRAVIS_BRANCH == master ]] && [[ $TRAVIS_JOB_NUMBER =~ ^.*.1$ ]]; then ./cc-test-reporter after-build -t simplecov --exit-code 0; fi
20
+ before_deploy:
21
+ - cp trusona-*.gem trusona.gem
22
+ - "echo ---$'\n':rubygems_api_key: $RUBYGEMS_API_KEY > ~/.gem/credentials"
23
+ - chmod 600 ~/.gem/credentials
19
24
  deploy:
20
- provider: rubygems
21
- api_key: $RUBYGEMS_API_KEY
22
- gem: trusona
23
- gemspec: trusona.gemspec
24
- skip_cleanup: true
25
+ provider: script
26
+ edge: true
27
+ script: gem push trusona.gem
28
+ cleanup: false
25
29
  on:
26
30
  tags: true
27
- rvm: '2.4.3'
31
+ rvm: '2.6'
28
32
  notifications:
29
33
  slack:
30
34
  on_success: always
data/README.md CHANGED
@@ -4,7 +4,7 @@ Easily interact with the Trusona REST API.
4
4
 
5
5
  ## Current Status
6
6
 
7
- [![Build Status](https://travis-ci.com/lighthauz/trusona-server-sdk-ruby.svg?token=2f2CMAnop6pxz1LFFPky&branch=master)](https://travis-ci.com/lighthauz/trusona-server-sdk-ruby)
7
+ [![Build Status](https://travis-ci.com/trusona/trusona-server-sdk-ruby.svg?branch=master)](https://travis-ci.com/trusona/trusona-server-sdk-ruby)
8
8
  [![Maintainability](https://api.codeclimate.com/v1/badges/ec9f4f928125c278fa39/maintainability)](https://codeclimate.com/github/trusona/trusona-server-sdk-ruby/maintainability)
9
9
  [![Test Coverage](https://api.codeclimate.com/v1/badges/ec9f4f928125c278fa39/test_coverage)](https://codeclimate.com/github/trusona/trusona-server-sdk-ruby/test_coverage)
10
10
 
@@ -171,8 +171,9 @@ Note that the custom fields are not used in the case that the Trusonafication is
171
171
  | Prompt | `prompt` | N | Should the user be prompted to Accept or Reject this Trusonafication? Defaults to `true`. |
172
172
  | Expiration | `expires_at` | N | The ISO-8601 UTC timestamp of the Trusonafication's expiration. Defaults to 90 seconds from creation. |
173
173
  | Custom Fields | `custom_fields` | N | Arbitrary key-value data fields made available to the Trusonafication. Amount of data in the hash is limited to 1MB |
174
+ | Callback URL | `callback_url` | N | A HTTPS URL to POST to when the trusonafication has been completed (accepted, rejected, or expired).<br><br> **NOTE:** The URL should include a randomized segment so it cannot be guessed and abused by third-parties e.g. https://your.domain.com/completed_authentications/f8abe61d-4e51-493f-97b1-464c157624f2. |
174
175
 
175
- [^1]: You must provide at least one field that would allow Trusona to determine which user to authenticate. The identifier fields are `device_identifier`, `user_identifier`, and `trucode_id`.
176
+ [^1]: You must provide at least one field that would allow Trusona to determine which user to authenticate. The identifier fields are `device_identifier`, `user_identifier`, `email`, and `trucode_id`.
176
177
 
177
178
  #### Retrieving an existing Trusonafication
178
179
 
@@ -255,7 +256,7 @@ end
255
256
 
256
257
  ### TruCodes
257
258
 
258
- After a user has scanned a TruCode, it's possible to acquire that user's information by getting the
259
+ After a user has scanned a TruCode, it's possible to acquire that user's information by getting the
259
260
  scanned TruCode from the server. The code sample below shows how to do that:
260
261
 
261
262
  ```ruby
@@ -0,0 +1,15 @@
1
+ require 'httparty'
2
+
3
+ class Buster
4
+ def initialize
5
+ @url = 'https://buster.staging.trusona.net'
6
+ end
7
+
8
+ def callback_url(id)
9
+ "#{@url}/callbacks/#{id}"
10
+ end
11
+
12
+ def callback_result(id)
13
+ HTTParty.get(callback_url(id))
14
+ end
15
+ end
@@ -7,9 +7,12 @@ SimpleCov.start do
7
7
  end
8
8
 
9
9
  require 'bundler/setup'
10
+ require 'active_support/core_ext/numeric/time'
11
+ require 'rspec/wait'
10
12
  require 'trusona'
11
13
  require 'securerandom'
12
14
  require 'webmock/rspec'
15
+ require_relative 'buster'
13
16
 
14
17
  WebMock.allow_net_connect!
15
18
 
@@ -12,6 +12,8 @@ RSpec.describe 'Trusonafications' do
12
12
  }
13
13
 
14
14
  @timeout = 5
15
+
16
+ @buster = Buster.new
15
17
  end
16
18
  describe 'creating a trusonafication for a known trusona user' do
17
19
  before do
@@ -40,10 +42,8 @@ RSpec.describe 'Trusonafications' do
40
42
  end
41
43
  end
42
44
  end
43
- describe 'creating a trusonafication for an unknown trusona user' do
45
+ describe 'creating a trusonafication without a level' do
44
46
  it 'as expected, does not work' do
45
- @parameters[:email] = "#{Time.now.to_i}@example.com"
46
-
47
47
  expect {
48
48
  Trusona::Trusonafication.create(
49
49
  params: @parameters, timeout: @timeout
@@ -51,5 +51,20 @@ RSpec.describe 'Trusonafications' do
51
51
  }.to raise_error(Trusona::InvalidResourceError)
52
52
  end
53
53
  end
54
+ describe 'creating a trusonafication with a callback url' do
55
+ it 'should POST to the URL when the trusonafication is completed' do
56
+ callback_id = SecureRandom.uuid
57
+
58
+ @parameters[:callback_url] = @buster.callback_url(callback_id)
59
+ @parameters[:expires_at] = 1.second.from_now
60
+
61
+ Trusona::EssentialTrusonafication.create(params: @parameters, timeout: @timeout)
62
+
63
+ wait_for do
64
+ callback_result = @buster.callback_result(callback_id)
65
+ callback_result.code
66
+ end.to eq(200)
67
+ end
68
+ end
54
69
  end
55
70
  # rubocop:enable Metrics/BlockLength
@@ -32,6 +32,7 @@ require 'trusona/workers/device_user_binding_creator'
32
32
  require 'trusona/workers/device_user_binding_activator'
33
33
  require 'trusona/workers/trusonafication_creator'
34
34
  require 'trusona/workers/trusonafication_finder'
35
+ require 'trusona/workers/trusonafication_canceler'
35
36
  require 'trusona/workers/identity_document_finder'
36
37
  require 'trusona/workers/device_finder'
37
38
  require 'trusona/workers/user_deactivator'
@@ -118,6 +119,7 @@ module Trusona
118
119
  end
119
120
 
120
121
  raise Trusona::ConfigurationError unless @config
122
+
121
123
  @config
122
124
  end
123
125
 
@@ -136,7 +138,7 @@ module Trusona
136
138
  attr_accessor :token, :secret
137
139
  attr_reader :api_host
138
140
 
139
- def initialize()
141
+ def initialize
140
142
  @api_host = 'api.trusona.net'
141
143
  end
142
144
 
@@ -22,7 +22,7 @@ module Trusona
22
22
  def headers
23
23
  @headers.merge(
24
24
  'x-date' => @date,
25
- 'Date' => @date,
25
+ 'Date' => @date,
26
26
  'X-Date' => @date,
27
27
  'Authorization' => @signature,
28
28
  'Content-Type' => determine_content_type
@@ -33,17 +33,20 @@ module Trusona
33
33
 
34
34
  def determine_content_type
35
35
  return '' if @method == 'GET' || @method == 'DELETE'
36
+
36
37
  Trusona::Api::HTTPClient::CONTENT_TYPE
37
38
  end
38
39
 
39
40
  def build_path(path)
40
41
  return path if @uri.query.nil? || @uri.query.empty?
42
+
41
43
  [@uri.path, @uri.query].join('?')
42
44
  end
43
45
 
44
46
  def build_uri(path, body)
45
47
  return build_uri_with_query(URI(path)) if URI(path).query
46
48
  return build_uri_with_body_as_query(path, body) if valid_hash_body(body)
49
+
47
50
  URI::HTTPS.build(host: @host, path: path)
48
51
  end
49
52
 
@@ -15,7 +15,9 @@ module Trusona
15
15
  end
16
16
 
17
17
  def to_h
18
- JSON.parse(@unverified.body) rescue {}
18
+ JSON.parse(@unverified.body)
19
+ rescue StandardError
20
+ {}
19
21
  end
20
22
 
21
23
  def verified?
@@ -50,6 +52,7 @@ module Trusona
50
52
 
51
53
  def parse_path(uri)
52
54
  return uri.path unless uri.query
55
+
53
56
  [uri.path, uri.query].join('?')
54
57
  end
55
58
 
@@ -61,6 +64,7 @@ module Trusona
61
64
  server = @unverified.headers['server']
62
65
  response_type = @unverified.headers['Content-Type']
63
66
  return response_type unless server == LEGACY_SERVER_HEADER
67
+
64
68
  determine_request_content_type
65
69
  end
66
70
 
@@ -69,6 +73,7 @@ module Trusona
69
73
  return default_type unless @unverified.request
70
74
  return default_type unless @unverified.request.options
71
75
  return default_type unless @unverified.request.options[:headers]
76
+
72
77
  @unverified.request.options[:headers]['Content-Type']
73
78
  end
74
79
 
@@ -28,11 +28,8 @@ module Trusona
28
28
  #
29
29
 
30
30
  def self.all(user_identifier: nil)
31
- # rubocop:disable Metrics/LineLength
32
31
  raise ArgumentError, 'A user identifier is required.' unless user_identifier
33
32
 
34
- # rubocop:enable Metrics/LineLength
35
-
36
33
  Trusona::Workers::IdentityDocumentFinder.new.find_all(user_identifier)
37
34
  end
38
35
 
@@ -55,11 +52,8 @@ module Trusona
55
52
  # Trusona::IdentityDocument.find('4FDF044D-89FB-4043-947D-A029CF785B5F')
56
53
  #
57
54
  def self.find(id: nil)
58
- # rubocop:disable Metrics/LineLength
59
55
  raise ArgumentError, 'An Identity Document identifier is required.' unless id
60
56
 
61
- # rubocop:enable Metrics/LineLength
62
-
63
57
  Trusona::Workers::IdentityDocumentFinder.new.find(id)
64
58
  end
65
59
  end
@@ -27,6 +27,7 @@ module Trusona
27
27
 
28
28
  def map_item(item, existing)
29
29
  return nil if item.nil? || item.empty?
30
+
30
31
  item = normalize_keys(item)
31
32
  item = merge_existing_state(item, existing.to_h)
32
33
  item = map_custom_fields(item)
@@ -40,6 +41,7 @@ module Trusona
40
41
 
41
42
  def map_custom_fields(response)
42
43
  return response if custom_mappings.nil? || custom_mappings.empty?
44
+
43
45
  custom_mappings.each do |original_key, new_key|
44
46
  value = response.delete(original_key)
45
47
  response[new_key] = value
@@ -51,17 +53,20 @@ module Trusona
51
53
  def response_invalid?(response)
52
54
  return true if response.nil?
53
55
  return true unless response.respond_to?(:to_h)
56
+
54
57
  false
55
58
  end
56
59
 
57
60
  def resource_invalid?(resource)
58
61
  return true if resource.nil?
59
62
  return true unless resource.respond_to?(:new)
63
+
60
64
  false
61
65
  end
62
66
 
63
67
  def existing_invalid?(existing)
64
68
  return true unless existing.respond_to?(:to_h)
69
+
65
70
  false
66
71
  end
67
72
  end
@@ -2,6 +2,7 @@
2
2
 
3
3
  module Trusona
4
4
  module Mappers
5
+ ## A Pair Trucode Mapper
5
6
  class PairedTruCodeMapper < BaseMapper
6
7
  def resource
7
8
  Trusona::Resources::PairedTruCode
@@ -17,7 +17,7 @@ module Trusona
17
17
  @params
18
18
  end
19
19
 
20
- def to_json
20
+ def to_json(*_args)
21
21
  JSON(to_h)
22
22
  end
23
23
 
@@ -23,6 +23,7 @@ module Trusona
23
23
  def validate
24
24
  return false unless @user_identifier
25
25
  return false unless @device_identifier
26
+
26
27
  true
27
28
  end
28
29
  end
@@ -11,7 +11,7 @@ module Trusona
11
11
 
12
12
  def initialize(params = {})
13
13
  normalized_params = normalize_keys(params)
14
- @id = normalized_params[:id]
14
+ @id = normalized_params[:id]
15
15
  @active = normalized_params[:active]
16
16
 
17
17
  @params = normalized_params
@@ -20,6 +20,7 @@ module Trusona
20
20
 
21
21
  def validate
22
22
  return false unless @id
23
+
23
24
  true
24
25
  end
25
26
  end
@@ -15,14 +15,14 @@ module Trusona
15
15
  normalized = normalize_keys(params)
16
16
 
17
17
  @params = normalized
18
- @document_hash = normalized[:document_hash]
19
- @id = normalized[:id]
20
- @type = normalized[:type]
18
+ @document_hash = normalized[:document_hash]
19
+ @id = normalized[:id]
20
+ @type = normalized[:type]
21
21
  @verification_status = normalized[:verification_status]
22
22
  @user_identifier = normalized[:user_identifier]
23
23
  end
24
24
 
25
- def to_json
25
+ def to_json(*_args)
26
26
  JSON(
27
27
  hash: @document_hash,
28
28
  id: @id,
@@ -2,6 +2,7 @@
2
2
 
3
3
  module Trusona
4
4
  module Resources
5
+ ## A Paired Trucode
5
6
  class PairedTruCode < BaseResource
6
7
  attr_reader :identifier
7
8
 
@@ -19,7 +19,7 @@ module Trusona
19
19
  raise ArgumentError unless validate
20
20
  end
21
21
 
22
- def to_json
22
+ def to_json(*_args)
23
23
  JSON(to_h)
24
24
  end
25
25
 
@@ -35,6 +35,7 @@ module Trusona
35
35
 
36
36
  def validate
37
37
  return false unless present?(@relying_party_id)
38
+
38
39
  true
39
40
  end
40
41
  end
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # rubocop:disable Metrics/ClassLength
3
4
  module Trusona
4
5
  module Resources
5
6
  ##
@@ -11,13 +12,14 @@ module Trusona
11
12
  attr_accessor :device_identifier, :user_identifier, :trucode_id,
12
13
  :resource, :action, :level, :id, :email,
13
14
  :accepted_level, :trusona_id, :expires_at,
14
- :user_presence, :prompt, :custom_fields
15
+ :user_presence, :prompt, :custom_fields, :callback_url
15
16
 
16
17
  # rubocop:disable Metrics/AbcSize
17
18
  # rubocop:disable Metrics/MethodLength
18
19
  def initialize(params = {})
19
20
  @params = normalize_keys(params)
20
21
  return if @params.nil?
22
+
21
23
  self.accepted_level = determine_accepted_level(@params)
22
24
  self.action = @params[:action]
23
25
  self.device_identifier = @params[:device_identifier]
@@ -32,6 +34,7 @@ module Trusona
32
34
  self.prompt = defaulting_to(true, @params[:prompt])
33
35
  self.user_presence = defaulting_to(true, @params[:user_presence])
34
36
  self.custom_fields = @params[:custom_fields]
37
+ self.callback_url = @params[:callback_url]
35
38
 
36
39
  @status = @params[:status]
37
40
  end
@@ -43,27 +46,31 @@ module Trusona
43
46
  end
44
47
 
45
48
  # rubocop:disable Metrics/MethodLength
46
- def to_json
47
- JSON(device_identifier: device_identifier,
48
- user_identifier: user_identifier,
49
- trucode_id: trucode_id,
50
- trusona_id: trusona_id,
51
- email: email,
52
- resource: resource,
53
- action: action,
54
- desired_level: level,
55
- id: id,
56
- status: @status,
57
- prompt: prompt,
58
- user_presence: user_presence,
59
- custom_fields: custom_fields,
60
- expires_at: expires_at&.iso8601)
49
+ def to_json(*_args)
50
+ JSON(
51
+ device_identifier: device_identifier,
52
+ user_identifier: user_identifier,
53
+ trucode_id: trucode_id,
54
+ trusona_id: trusona_id,
55
+ email: email,
56
+ resource: resource,
57
+ action: action,
58
+ desired_level: level,
59
+ id: id,
60
+ status: @status,
61
+ prompt: prompt,
62
+ user_presence: user_presence,
63
+ custom_fields: custom_fields,
64
+ expires_at: expires_at&.iso8601,
65
+ callback_url: callback_url
66
+ )
61
67
  end
62
68
  # rubocop:enable Metrics/MethodLength
63
69
 
64
70
  def accepted?
65
71
  return true if status == :accepted
66
72
  return true if status == :accepted_at_higher_level
73
+
67
74
  false
68
75
  end
69
76
 
@@ -75,8 +82,8 @@ module Trusona
75
82
  attributes_present && attributes_filled
76
83
  end
77
84
 
78
- # rubocop:disable MethodLength
79
- # rubocop:disable CyclomaticComplexity
85
+ # rubocop:disable Metrics/MethodLength
86
+ # rubocop:disable Metrics/CyclomaticComplexity
80
87
  def status
81
88
  case @status
82
89
  when 'INVALID_TRUSONA_ID'
@@ -99,14 +106,15 @@ module Trusona
99
106
  :invalid
100
107
  end
101
108
  end
102
- # rubocop:enable CyclomaticComplexity
103
- # rubocop:enable MethodLength
109
+ # rubocop:enable Metrics/CyclomaticComplexity
110
+ # rubocop:enable Metrics/MethodLength
104
111
 
105
112
  private
106
113
 
107
114
  def defaulting_to(value, param)
108
115
  return value if param.nil?
109
116
  return value if param.respond_to?(:empty?) && param.empty?
117
+
110
118
  param
111
119
  end
112
120
 
@@ -137,3 +145,4 @@ module Trusona
137
145
  end
138
146
  end
139
147
  end
148
+ # rubocop:enable Metrics/ClassLength