uc3-dmp-provenance 0.0.7 → 0.0.9
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 +7 -4
- data/lib/uc3-dmp-provenance/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b248054cb3c84cd6befad733c0239ca005216354f165e512bf09660850f894c
|
4
|
+
data.tar.gz: 24596ac4f42da2dcbc859e9f58d790d2ea8eafec1691eba9711c20ecdfc9bfca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15195f0efcc76a6632ad521a182eb2d9e3ffefa57d53c9649e39d3a94212423dd04823e542a9eff83e78f6cab328ea10ef822bc63cda3d9fdab46cf679428ff7
|
7
|
+
data.tar.gz: d6f94292832fa83ccc5f0a1ddb976a5f2a95cd1db026ea508e8a03465a3ffc66846182a3a4e07009fa75a3e3faa589309824ac8c53279914e07c5a2d77b05b05
|
@@ -27,14 +27,15 @@ module Uc3DmpProvenance
|
|
27
27
|
# "client_id": "abcdefghijklmnopqrstuvwxyz"
|
28
28
|
# }
|
29
29
|
# -------------------------------------------------------------------------------------------
|
30
|
-
def from_lambda_cotext(identity:)
|
30
|
+
def from_lambda_cotext(identity:, logger: nil)
|
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
34
|
client_name = _cognito_client_id_to_name(claim: identity)
|
35
35
|
|
36
36
|
resp = client.get_item(
|
37
|
-
key: { PK: Helper.append_pk_prefix(client_name), SK: Helper::SK_PROVENANCE_PREFIX }
|
37
|
+
key: { PK: Helper.append_pk_prefix(provenance: client_name), SK: Helper::SK_PROVENANCE_PREFIX },
|
38
|
+
logger: logger
|
38
39
|
)
|
39
40
|
resp.nil? || resp.empty? ? nil : resp
|
40
41
|
end
|
@@ -45,9 +46,10 @@ module Uc3DmpProvenance
|
|
45
46
|
def from_pk(pk:)
|
46
47
|
return nil if pk.nil?
|
47
48
|
|
48
|
-
pk = Helper.append_pk_prefix(pk)
|
49
|
+
pk = Helper.append_pk_prefix(provenance: pk)
|
49
50
|
resp = client.get_item(
|
50
|
-
key: { PK: Helper.append_pk_prefix(pk), SK: Helper::SK_PROVENANCE_PREFIX }
|
51
|
+
key: { PK: Helper.append_pk_prefix(provenance: pk), SK: Helper::SK_PROVENANCE_PREFIX },
|
52
|
+
logger: logger
|
51
53
|
)
|
52
54
|
resp.nil? || resp.empty? ? nil : resp
|
53
55
|
end
|
@@ -59,6 +61,7 @@ module Uc3DmpProvenance
|
|
59
61
|
return nil if claim.nil? || !claim.is_a?(Hash) || claim['iss'].nil? || claim['client_id'].nil?
|
60
62
|
|
61
63
|
user_pool_id = claim['iss'].split('/').last
|
64
|
+
logger.debug(message: "Cognito User Pool: #{user_pool_id}, ClientId: #{claim['client_id']}") if logger.respond_to?(:debug)
|
62
65
|
Uc3DmpCognito::Client.get_client_name(client_id: claim['client_id'])
|
63
66
|
end
|
64
67
|
end
|
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
|
+
version: 0.0.9
|
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-
|
11
|
+
date: 2023-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|