uc3-dmp-rds 0.0.25 → 0.0.26

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cd42f3d5944c5a82f29f7280dcb79808fcc6201c857957e6997c5187eda3d34a
4
- data.tar.gz: dd9efa204770d794fa9e3e62933ae99d67fb922a1d4ba981fb18747557545178
3
+ metadata.gz: bd9a51c00223257f3aa00133b904f00e0c8cede3f166d9521accf5759f928b1a
4
+ data.tar.gz: 4ca625aa165517ca2f8dd3dd9e4ee14a7188ed44bf65f13dc5f6be65afcd31bd
5
5
  SHA512:
6
- metadata.gz: e6d618ef509262e41e4c3ac3b70d35bad8e56c32ca44fc69a804706822cb129d875e4f4bb3f4c4f554be5c167172edc1ace7ded63ade31f39c3ac87f26dbdafb
7
- data.tar.gz: 1b037b248507347285533d8a3a9831ad25f3fcd6b20742b6d7596844d40dfeb3834273bb9a630e843f2a025815ec9b3aa603a9ef95681b66fe95cac83bcda613
6
+ metadata.gz: 9b647640ad6a581e0721cbdd43cd0c6b033c45578ee3e6bb2d44f2c3537d896a5994146f4d995bdb67769a5ff13bfbd38eec29a38124363fd0046d9108829c52
7
+ data.tar.gz: 319c3c1b995efe7089852318080e6321658aab5bc9099c3c6939e5ca5cb609275f3944e1335ed36794cc16e172049e20d0c4071a71868f06dbc47ac38cefe449
@@ -36,8 +36,8 @@ module Uc3DmpRds
36
36
  host: ENV.fetch('DATABASE_HOST', nil),
37
37
  port: ENV.fetch('DATABASE_PORT', nil),
38
38
  database: ENV.fetch('DATABASE_NAME', nil),
39
- username: username,
40
- password: password,
39
+ username:,
40
+ password:,
41
41
  encoding: 'utf8mb4'
42
42
  )
43
43
  !connection.nil?
@@ -50,7 +50,7 @@ module Uc3DmpRds
50
50
  def execute_query(sql:, **params)
51
51
  return [] unless sql.is_a?(String) && !sql.strip.empty? && (params.nil? || params.is_a?(Hash))
52
52
  # Verify that all of the kewords are accounted for and that values were supplied
53
- raise AdapterError, MSG_KEYWORDS_INVALID unless _verify_params(sql: sql, params: params)
53
+ raise AdapterError, MSG_KEYWORDS_INVALID unless _verify_params(sql:, params:)
54
54
 
55
55
  ActiveRecord::Base.simple_execute(sql, params)
56
56
  rescue StandardError => e
@@ -20,13 +20,13 @@ module Uc3DmpRds
20
20
  def authenticate(token:)
21
21
  raise AuthenticatorError, MSG_INVALID_TOKEN if token.nil? || token.to_s.strip.empty?
22
22
 
23
- users = _query_user(token: token)
23
+ users = _query_user(token:)
24
24
  raise AuthenticatorError, MSG_INVALID_TOKEN unless users.is_a?(Array) && users.any?
25
25
 
26
26
  user = users.first
27
27
  raise AuthenticatorError, MSG_INACTIVE_USER unless user['active']
28
28
 
29
- _serialize_user(user: user)
29
+ _serialize_user(user:)
30
30
  end
31
31
 
32
32
  private
@@ -50,10 +50,11 @@ module Uc3DmpRds
50
50
  AND i.identifier_scheme_id IN (SELECT sch.id FROM identifier_schemes sch WHERE sch.name = 'orcid')
51
51
  WHERE users.api_token = :token
52
52
  SQL
53
- users = ActiveRecord::Base.simple_execute(sql, token: token.to_s.strip)
53
+ ActiveRecord::Base.simple_execute(sql, token: token.to_s.strip)
54
54
  end
55
55
 
56
56
  # Convert the ActiveRecord query results into a JSON object
57
+ # rubocop:disable Metrics/AbcSize
57
58
  def _serialize_user(user:)
58
59
  return {} if user.nil? || user['email'].nil?
59
60
 
@@ -72,6 +73,7 @@ module Uc3DmpRds
72
73
  hash[:affiliation][:affiliation_id] = { type: 'ror', identifier: user['ror_id'] } unless user['ror_id'].nil?
73
74
  JSON.parse(hash.to_json)
74
75
  end
76
+ # rubocop:enable Metrics/AbcSize
75
77
  end
76
78
  end
77
79
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uc3DmpRds
4
- VERSION = '0.0.25'
4
+ VERSION = '0.0.26'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uc3-dmp-rds
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.25
4
+ version: 0.0.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Riley
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-05 00:00:00.000000000 Z
11
+ date: 2023-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_record_simple_execute
@@ -139,7 +139,7 @@ licenses:
139
139
  - MIT
140
140
  metadata:
141
141
  rubygems_mfa_required: 'false'
142
- post_install_message:
142
+ post_install_message:
143
143
  rdoc_options: []
144
144
  require_paths:
145
145
  - lib
@@ -147,15 +147,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
147
147
  requirements:
148
148
  - - ">="
149
149
  - !ruby/object:Gem::Version
150
- version: '2.7'
150
+ version: '3.2'
151
151
  required_rubygems_version: !ruby/object:Gem::Requirement
152
152
  requirements:
153
153
  - - ">="
154
154
  - !ruby/object:Gem::Version
155
155
  version: '0'
156
156
  requirements: []
157
- rubygems_version: 3.1.6
158
- signing_key:
157
+ rubygems_version: 3.4.10
158
+ signing_key:
159
159
  specification_version: 4
160
160
  summary: DMPTool gem that provides general support for accessing MySQL DB hosted on
161
161
  AWS RDS