uc3-dmp-rds 0.0.18 → 0.0.21

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: ef65457155892c90bf5172d0a6bdbcf81f65a9c207f460f37100995f6895f1a6
4
- data.tar.gz: 31d3dd6a9c5a831f3aff7c9407dadc0cc1957b19058003fa85f3638dd55b59ab
3
+ metadata.gz: 556a5c27b265c712a98fc858b989731699df14085366ed2c6d34ab2cab96764f
4
+ data.tar.gz: 97c6eca72baa2f61d14af830b27e2f712bd345f8987b14e806413c3d57aa8e7d
5
5
  SHA512:
6
- metadata.gz: '0196dd990fa57ea307f7a29888f2d96863b764ab20ec0df43d61a7d6180d855b5f3b07c511f3b255e5f70cd10e9a108edc46aa4f3bb034d520112ceecf3cb969'
7
- data.tar.gz: 630ea47371bb9a4e353423e3eca70df20302e92716e2ff0020d98b7a80d8a8957392754234176bc92e587929216ecb0a9d988bf5c1e8ada16cd175a88317a03f
6
+ metadata.gz: 3abd42f8fa4240b227fada42f88ea80b334cba106038ec0b188f59a0eae1846b3be21290bfb99a2279eb53ae09dbb59f9fb84a34a8a4d9a84ced15e3136b7213
7
+ data.tar.gz: 25ff9c28b1c097aacefa95692b0a4614ee9c7045c001b71e2330990e371ec6649be8cd9389387da90a7b28832870a9ac1646c571d737279e7eda3d0408c49170
@@ -36,7 +36,7 @@ module Uc3DmpRds
36
36
  return nil if token.nil?
37
37
 
38
38
  sql = <<~SQL.squish
39
- SELECT users.firstname, users.surname, users.email, users.active, i.value orcid,
39
+ SELECT users.id, users.firstname, users.surname, users.email, users.active, i.value orcid,
40
40
  orgs.name org_name, ro.name ror_name, ro.ror_id,
41
41
  (SELECT perms.name FROM users_perms up LEFT OUTER JOIN perms ON up.perm_id = perms.id
42
42
  WHERE users.id = up.user_id AND perms.name = 'modify_templates') perm
@@ -58,9 +58,11 @@ module Uc3DmpRds
58
58
  return {} if user.nil? || user['email'].nil?
59
59
 
60
60
  hash = {
61
+ id: user.id,
61
62
  name: [user['surname'], user['firstname']].join(', '),
62
63
  mbox: user['email'],
63
- admin: !user['perm'].nil?
64
+ admin: !user['perm'].nil?,
65
+ active: user.fetch('active', false)
64
66
  }
65
67
  hash[:user_id] = { type: 'orcid', identifier: user['orcid'] } unless user['orcid'].nil?
66
68
  return hash if user['org_name'].nil?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uc3DmpRds
4
- VERSION = '0.0.18'
4
+ VERSION = '0.0.21'
5
5
  end
data/lib/uc3-dmp-rds.rb CHANGED
@@ -7,5 +7,6 @@ require 'uc3-dmp-rds/authenticator'
7
7
  # RDS Database adapter
8
8
  module Uc3DmpRds
9
9
  MSG_MISSING_TOKEN = 'Missing API Token. Expected header: `Authorization: token 12345`'
10
+ MSG_MISSING_USER = 'Unknown or unauthenticated user'
10
11
  end
11
12
  # rubocop:enable Naming/FileName
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uc3-dmp-rds
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.18
4
+ version: 0.0.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Riley