uc3-dmp-cognito 0.0.1 → 0.0.2
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-cognito/client.rb +4 -4
- data/lib/uc3-dmp-cognito/version.rb +1 -1
- data/lib/uc3-dmp-cognito.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: 4612dae4df1bacc2d83bfd532501819107ffc9865fa9226b0422fbdfdacd7b0a
|
4
|
+
data.tar.gz: 20aca5572b7d4f5cca6569af7e53b65f9519a2627ae26d92f400d3fe323c205d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6feb9e95e39699dbb0e8b5940b06ee596d6aa28575fe3f9628f33d964089a44ab2814a80dd0be91288a9d773174b6e5898213ddc04d79bc58d1351d8617b54d0
|
7
|
+
data.tar.gz: ad72c9946fc1f6fc0ecb3648a6d8ffdfddf654218e7298b8439c68c49ace16b04f730a6ea7cd2833b780820571b969131d42ca17d571d202547cf45db3ea4546
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Uc3DmpCognito
|
4
|
-
class
|
4
|
+
class ClientError < StandardError; end
|
5
5
|
|
6
6
|
# Helper functions for working with Dynamo JSON
|
7
7
|
class Client
|
@@ -12,14 +12,14 @@ module Uc3DmpCognito
|
|
12
12
|
# Fetch the name of the client from the client id provided.
|
13
13
|
# DMP Provenance names match the Cognito client names
|
14
14
|
def get_client_name(client_id:)
|
15
|
-
user_pool_id = ENV
|
16
|
-
raise
|
15
|
+
user_pool_id = ENV.fetch('COGNITO_USER_POOL', nil)
|
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
20
|
resp&.user_pool_client&.client_name&.downcase
|
21
21
|
rescue Aws::Errors::ServiceError => e
|
22
|
-
raise
|
22
|
+
raise ClientError, format(MSG_COGNITO_ERROR, msg: e.message, trace: e.backtrace)
|
23
23
|
end
|
24
24
|
end
|
25
25
|
end
|
data/lib/uc3-dmp-cognito.rb
CHANGED
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.2
|
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-
|
11
|
+
date: 2023-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|