uc3-dmp-provenance 0.0.9 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/uc3-dmp-provenance/finder.rb +3 -3
- data/lib/uc3-dmp-provenance/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6a82bbb7e1b2b0e5e6e7a917a1d5356cdf0d73b63f5c9a61b3423093aa09c2d
|
4
|
+
data.tar.gz: 682482122e0cd16c5ec9dd1d15656c9107dc50af912d33aeef6232af6e9d5bf3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a51d2021d22d798d024a23b7c88a7f6142afaf163d68b296e0237d7d6fe486400cca32876c2250beef798439fff547ef38c85caa1737c82a35de16c6e2031a2
|
7
|
+
data.tar.gz: ae852a0a5d87de997f9b76e293fa225c00fa4eba0e358f2aca62d69344cd6acb6038fdef250dba5d55746432571bd3b64227712080faa40bbbbcd0289c2c6e43
|
@@ -31,7 +31,7 @@ module Uc3DmpProvenance
|
|
31
31
|
return nil unless identity.is_a?(Hash) && !identity['iss'].nil? && !identity['client_id'].nil?
|
32
32
|
|
33
33
|
client = Uc3DmpDynamo::Client.new
|
34
|
-
client_name = _cognito_client_id_to_name(claim: identity)
|
34
|
+
client_name = _cognito_client_id_to_name(claim: identity, logger: logger)
|
35
35
|
|
36
36
|
resp = client.get_item(
|
37
37
|
key: { PK: Helper.append_pk_prefix(provenance: client_name), SK: Helper::SK_PROVENANCE_PREFIX },
|
@@ -43,7 +43,7 @@ module Uc3DmpProvenance
|
|
43
43
|
# Fetch the Provenance by it's PK.
|
44
44
|
#
|
45
45
|
# Expecting either the name (e.g. `dmptool` or the qualified PK (e.g. `PROVENANCE#dmptool`)
|
46
|
-
def from_pk(pk:)
|
46
|
+
def from_pk(pk:, logger: nil)
|
47
47
|
return nil if pk.nil?
|
48
48
|
|
49
49
|
pk = Helper.append_pk_prefix(provenance: pk)
|
@@ -57,7 +57,7 @@ module Uc3DmpProvenance
|
|
57
57
|
private
|
58
58
|
|
59
59
|
# Method to fetch the client's name from the Cognito UserPool based on the client_id
|
60
|
-
def _cognito_client_id_to_name(claim:)
|
60
|
+
def _cognito_client_id_to_name(claim:, logger: nil)
|
61
61
|
return nil if claim.nil? || !claim.is_a?(Hash) || claim['iss'].nil? || claim['client_id'].nil?
|
62
62
|
|
63
63
|
user_pool_id = claim['iss'].split('/').last
|