{"_id":"@bluehalo/fhir-secrets","_rev":"8-c427e67b15e92b21d388d0518344dc17","name":"@bluehalo/fhir-secrets","dist-tags":{"latest":"0.10.0"},"versions":{"0.9.7":{"name":"@bluehalo/fhir-secrets","version":"0.9.7","author":{"name":"Robert-W","email":"rwinterbottom@asymmetrik.com"},"license":"MIT","_id":"@bluehalo/fhir-secrets@0.9.7","maintainers":[{"name":"ashin-bluehalo","email":"andrew.shin@bluehalo.com"},{"name":"ekoon121","email":"ekoon@asymmetrik.com"},{"name":"reblace","email":"reblace@gmail.com"}],"homepage":"https://github.com/BlueHalo/node-fhir-server-core","dist":{"shasum":"6ace48eddf51cdb45b183933772ab70d8b9299bc","tarball":"https://registry.npmjs.org/@bluehalo/fhir-secrets/-/fhir-secrets-0.9.7.tgz","fileCount":18,"integrity":"sha512-FmE+fgbLMUB8rN8bLWwnapdwmnWNFjMAZ29/05HHQz5v4tR/B5bIwBS1xW+ylvcFlj05i13emDoGYb3H0iCsdg==","signatures":[{"sig":"MEQCIDcfwgkWswkAtn/2NQklXsGJp0WiiSrqt3+RvKuMzhKsAiBHjBRnx+RRdrxHWSkAPDZ7I8Tyjg6fcp4PNmYnuvSodA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":57177},"main":"index.js","gitHead":"717c4ad053a5034563d778318b9ccb673d025930","scripts":{"test":"jest"},"_npmUser":{"name":"ashin-bluehalo","email":"andrew.shin@bluehalo.com"},"repository":{"type":"git","directory":"packages/fhir-secrets"},"_npmVersion":"8.5.0","description":"AWS KMS Secrets retrieval promisified","directories":{},"_nodeVersion":"16.14.2","dependencies":{"aws-sdk":"^2.1018.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/fhir-secrets_0.9.7_1708113987963_0.02624875711134167","host":"s3://npm-registry-packages"}},"0.10.0":{"name":"@bluehalo/fhir-secrets","version":"0.10.0","author":{"name":"Robert-W","email":"rwinterbottom@asymmetrik.com"},"license":"MIT","_id":"@bluehalo/fhir-secrets@0.10.0","maintainers":[{"name":"ekdeveloper","email":"eugene.koon@bluehalo.com"},{"name":"shane-bh","email":"shane.oneill@bluehalo.com"},{"name":"ashin-bluehalo","email":"andrew.shin@bluehalo.com"},{"name":"reblace","email":"reblace@gmail.com"}],"homepage":"https://github.com/Bluehalo/node-fhir-server-core","dist":{"shasum":"d8c9c38f29eadbf715f53cd03a85679e4afcc080","tarball":"https://registry.npmjs.org/@bluehalo/fhir-secrets/-/fhir-secrets-0.10.0.tgz","fileCount":8,"integrity":"sha512-gDrgjY9KtTXmdwIMdfLGTrBU5by8najWMwPIEZlbeffcbutwTXbXr1T6vrsWYufuj1tYHgc6vqNwfirsgcVbNA==","signatures":[{"sig":"MEQCIDtJJ7AYQUXrMkaNCpVAYIdNsEAIoszhceXlycjne8D5AiBz8aHYrsf7s1BpLljIxgON0W4axlWdUo+5y60b+MmkHg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6652},"main":"index.js","gitHead":"717c4ad053a5034563d778318b9ccb673d025930","scripts":{"test":"jest"},"_npmUser":{"name":"ekdeveloper","email":"eugene.koon@bluehalo.com"},"repository":{"type":"git","directory":"packages/fhir-secrets"},"description":"AWS KMS Secrets retrieval promisified","directories":{},"dependencies":{"aws-sdk":"^2.1684.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0"},"_npmOperationalInternal":{"tmp":"tmp/fhir-secrets_0.10.0_1726061255503_0.73376332423881","host":"s3://npm-registry-packages"}}},"time":{"created":"2024-02-16T20:06:27.831Z","modified":"2026-03-25T20:10:59.629Z","0.9.7":"2024-02-16T20:06:28.253Z","0.10.0":"2024-09-11T13:27:35.689Z"},"author":{"name":"Robert-W","email":"rwinterbottom@asymmetrik.com"},"license":"MIT","homepage":"https://github.com/Bluehalo/node-fhir-server-core","repository":{"type":"git","directory":"packages/fhir-secrets"},"description":"AWS KMS Secrets retrieval promisified","maintainers":[{"email":"reblace@gmail.com","name":"reblace"},{"email":"eugene.koon@bluehalo.com","name":"ekdeveloper"},{"email":"andrew.shin@bluehalo.com","name":"ashin-bluehalo"},{"email":"shane.oneill@bluehalo.com","name":"shane-bh"},{"email":"rnmercado@gmail.com","name":"rodmercad"}],"readme":"# `FHIR-Secrets`\n\n> AWS KMS Secrets retrieval promisified.\n\n# Install\n\n```shell\nyarn add @bluehalo/fhir-secrets\n```\n\n## Prerequisites\n\n- You will need an AWS Account.\n- You should have the CiphertextBlob you need to decrypt.\n- You can [authenticate with AWS](https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/setting-credentials-node.html).\n\n## Usage\n\nDepending on where you are running this code, the setup portion may change. If you have a default AWS profile with region and everything else set, you can use the decrypt function as follows:\n\n```javascript\nconst secrets = require('@bluehalo/fhir-secrets');\n\n// This is output when you encrypt a secret with kms\n// https://docs.aws.amazon.com/cli/latest/reference/kms/encrypt.html\nlet CiphertextBlob = 'somefakeblobcontent=';\n\n// Lets assume this blob contains metadata for a plaintext secret with value foobar\nsecrets\n  .decrypt({ CiphertextBlob })\n  .then((secret) => {\n    console.log(secret);\n    // logs foobar\n  })\n  .catch(console.error);\n```\n\nIf you need to configure the setup process with region or other properties in the client class constructor, you can do so and chain the process.\n\n```javascript\nconst secrets = require('@bluehalo/fhir-secrets');\n\nsecrets\n  .configure({ region: 'us-east-2' })\n  .decrypt({ CiphertextBlob: 'somefakeblobcontent=' })\n  .then((secret) => doThingsWithSecret())\n  .catch(console.error);\n```\n\nSee [fhir-secrets tests](https://github.com/Bluehalo/node-fhir-server-core/tree/master/packages/fhir-secrets/index.test.js) for more usage examples.\n\n## Methods\n\n### configure\n\n> Configures the service class with any AWS or service class specific configurations.\n\nThis takes a single options object. See https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/KMS.html#constructor-property. It returns `this` so you can immediately call `decrypt` after configuring it.\n\n### decrypt\n\n> Wrapper on kms.decrypt but returns a promise which resolves the plain text of the secret.\n\nThis takes a single options object. See https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/KMS.html#decrypt-property. The only necessary property from this is `CiphertextBlob`.\n","readmeFilename":"README.md"}