uc3-dmp-provenance 0.0.4 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7297f187a4c3383140979caf659f8d6609905b1d71aaf132931c47c1d78fc50b
4
- data.tar.gz: 644eddd6e21ef2bca1cee80ef9f1352233bee5cf29572ce007e8f7cfcdc2bfcb
3
+ metadata.gz: 2a50454ca4755fe1e5a1d28c2453dba6a8b16d3b38e52d29b72977b603f1dd87
4
+ data.tar.gz: 96211ed122d90a542237c4dbd11f1c1bee717abf218034762872cd4c80f5d05b
5
5
  SHA512:
6
- metadata.gz: b470c7add0f67f9bc1ddbcd5087a912a4a92f4b6855b5d4cbdf852975076137355074d7f372f6124e18bdb4e0eb43bce61b49e9731fc855632c61dbfdc2736f3
7
- data.tar.gz: 6c448352d785575a609e14e83b3b9efacb7d8e7b742d5767633e5b62fd4c33f4a24111ce36fc3d87c7224aedbb6e8cc53c6e1eb92eb71555426c47b0c00d1883
6
+ metadata.gz: b6b8f9153f155c64015ea0f6cd5a2687bac9f10968536d9b302768c7500a676f0ae7e51d95862e4097331365086d9b78cbb5abf1829524b9c7aff5f1aa59ecdf
7
+ data.tar.gz: 9abd42ad27019bc4e57c435b0b19c7104569087a00524404e5d2389bcc855fd34b378bad605e8934592ab08dbf100149fbde6c6495b486284235f89415901d22
@@ -5,7 +5,7 @@ require 'uc3-dmp-dynamo'
5
5
 
6
6
  module Uc3DmpProvenance
7
7
  # Standard Error Message from Uc3DmpProvenance
8
- class Uc3DmpProvenanceError < StandardError; end
8
+ class FinderError < StandardError; end
9
9
 
10
10
  # Helper for fetching Provenance JSON records
11
11
  class Finder
@@ -59,7 +59,7 @@ module Uc3DmpProvenance
59
59
  return nil if claim.nil? || !claim.is_a?(Hash) || claim['iss'].nil? || claim['client_id'].nil?
60
60
 
61
61
  user_pool_id = claim['iss'].split('/').last
62
- Uc3DmpCognito.get_client_name(client_id: claim['client_id'])
62
+ Uc3DmpCognito::Client.get_client_name(client_id: claim['client_id'])
63
63
  end
64
64
  end
65
65
  end
@@ -36,7 +36,7 @@ module Uc3DmpProvenance
36
36
  # rubocop:disable Metrics/AbcSize
37
37
  def format_provenance_callback_url(provenance:, value:)
38
38
  # return it as-is if there is no provenance or it's already a URL
39
- return value if provenance.nil?
39
+ return value if provenance.nil? || provenance.fetch('callbackUri', provenance['homepage']).nil?
40
40
 
41
41
  # return it as-is if it's a DOI
42
42
  doi = value.match(DOI_REGEX).to_s
@@ -49,7 +49,7 @@ module Uc3DmpProvenance
49
49
  val = val.gsub(%r{https?://}, '')
50
50
  val = val[1..val.length] if val.start_with?('/')
51
51
  id = provenance['PK']&.gsub(PK_PROVENANCE_PREFIX, '')
52
- "#{id}##{val}"
52
+ id.nil? ? val : "#{id}##{val}"
53
53
  end
54
54
  # rubocop:enable Metrics/AbcSize
55
55
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uc3DmpProvenance
4
- VERSION = '0.0.4'
4
+ VERSION = '0.0.6'
5
5
  end
@@ -3,6 +3,7 @@
3
3
 
4
4
  require 'json'
5
5
 
6
+ require 'uc3-dmp-cognito'
6
7
  require 'uc3-dmp-dynamo'
7
8
 
8
9
  require 'uc3-dmp-provenance/finder'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uc3-dmp-provenance
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Riley
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-09 00:00:00.000000000 Z
11
+ date: 2023-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -25,19 +25,19 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '2.6'
27
27
  - !ruby/object:Gem::Dependency
28
- name: logger
28
+ name: uc3-dmp-cognito
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.4'
33
+ version: '0.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1.4'
40
+ version: '0.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: uc3-dmp-dynamo
43
43
  requirement: !ruby/object:Gem::Requirement