uc3-dmp-cognito 0.0.5 → 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 +4 -4
- data/lib/uc3-dmp-cognito/client.rb +3 -1
- data/lib/uc3-dmp-cognito/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: 2a0f0a88d3609e7f110d0fd61bc4e40f40249f434bcd6744bb8b035e29e2c689
|
4
|
+
data.tar.gz: f020b461f3cfc76732a472819850b43ff2987c7b14bc4308c5c992d30a2f27e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa1427c6c31afcd0416e7fe1fef90d764a66c843e420f620086c480b05c19c1a9f51547537492e2abc28817a15f7462b700094c3308a005e71fa86dd62214abb
|
7
|
+
data.tar.gz: '0867424c8e0197afd500e98c11f0782c93847a29e5f0b96f13ab53a2f77aefb778f03c01d0c545f9d77c204aaa6bf834b6cc197da9943a4a1a2b69b8eeb5231c'
|
@@ -11,12 +11,14 @@ module Uc3DmpCognito
|
|
11
11
|
class << self
|
12
12
|
# Fetch the name of the client from the client id provided.
|
13
13
|
# DMP Provenance names match the Cognito client names
|
14
|
-
def get_client_name(client_id:,
|
14
|
+
def get_client_name(client_id:, logger: nil)
|
15
15
|
user_pool_id = ENV.fetch('COGNITO_USER_POOL_ID', nil)
|
16
16
|
raise ClientError, MSG_MISSING_POOL if user_pool_id.nil?
|
17
17
|
|
18
18
|
client = Aws::CognitoIdentityProvider::Client.new(region: ENV.fetch('AWS_REGION', nil))
|
19
19
|
resp = client.describe_user_pool_client({ user_pool_id: user_pool_id, client_id: client_id })
|
20
|
+
msg = "Searching for Client ID: #{client_id} in Cognito User Pool: #{user_pool_id} - found"
|
21
|
+
logger.debug(message: "#{msg} '#{resp&.user_pool_client&.client_name&.downcase}'") if logger.respond_to?(:debug)
|
20
22
|
resp&.user_pool_client&.client_name&.downcase
|
21
23
|
rescue Aws::Errors::ServiceError => e
|
22
24
|
raise ClientError, format(MSG_COGNITO_ERROR, msg: e.message, trace: e.backtrace)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uc3-dmp-cognito
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
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-06
|
11
|
+
date: 2023-07-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|