Skip to content

Commit

Permalink
Add logging for qa deployment issue
Browse files Browse the repository at this point in the history
  • Loading branch information
nonword committed Nov 8, 2024
1 parent 7310c89 commit f24db4d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion config/qa.env
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ENCRYPTED_NYPL_OAUTH_SECRET=AQECAHh7ea2tyZ6phZgT4B9BDKwguhlFtRC6hgt+7HbmeFsrsgAA

NYPL_CORE_VERSION=v2.21

LOG_LEVEL=info
LOG_LEVEL=debug
FEATURES=on-site-edd

SEARCH_ITEMS_SIZE=3
Expand Down
2 changes: 2 additions & 0 deletions lib/kms-helper.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const { KMSClient, DecryptCommand } = require('@aws-sdk/client-kms')
const logger = require('./logger')

let awsCredentials

Expand All @@ -16,6 +17,7 @@ async function decrypt (encrypted) {
// Use credentials if given (local invocations). Otherwise rely on
// environment (deployed code):
if (awsCredentials) {
logger.debug('KMS decrypt using local AWS credentials')
config.credentials = awsCredentials
}
const client = new KMSClient(config)
Expand Down
2 changes: 1 addition & 1 deletion lib/load-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ module.exports.decryptEncryptedConfig = () => {
const keyWithoutPrefix = key.replace(/^ENCRYPTED_/, '')
const decrypted = await decrypt(process.env[key])
.catch((e) => {
logger.error(`Load-config: Failed to decrypt ${key}`)
logger.error(`Load-config: Failed to decrypt ${key}: ${e}`)
})
logger.debug(`Load-config: Decrypted ${key}`)
process.env[keyWithoutPrefix] = decrypted
Expand Down

0 comments on commit f24db4d

Please sign in to comment.