New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@znemz/aws-play

Package Overview
Dependencies
Maintainers
2
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@znemz/aws-play - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

README.md

24

aws/kms/args.js
const yargs = require('yargs');
const getArgs = () => {
const { argv } = yargs.option('encoding', {
alias: 'e',
type: 'string',
description: `incoming or outgoing additional encoding / decoding
const { argv } = yargs
.option('encoding', {
alias: 'e',
type: 'string',
description: `incoming or outgoing additional encoding / decoding
IE:

@@ -12,4 +13,15 @@ - encrypt -> will take the decimal outpu and encode in base64

`,
choices: ['base64', 'hex', 'binary'],
});
choices: ['base64', 'hex', 'binary'],
})
.option('key-id', {
alias: 'k',
type: 'string',
description: 'aws kms id or alias defaults to proccess.env.KMS_ID',
})
.option('forceKeyId', {
alias: 'fk',
type: 'bool',
description:
'for decrypt which defaults to false IE uses first key that works, this is to foce a specific key usage',
});

@@ -16,0 +28,0 @@ return argv;

@@ -20,15 +20,20 @@ #!/usr/bin/env node

text = decoder(String(text));
kms.decrypt(
{
CiphertextBlob: text,
},
(err, data) => {
if (err) {
cb(err);
}
cb(null, data.Plaintext);
const opts = { CiphertextBlob: text };
if (args.forceKeyId) {
const kmsId = args['key-id'] || process.env.KMS_ID;
if (kmsId) {
opts.KeyId = kmsId;
}
);
}
kms.decrypt(opts, (err, data) => {
if (err) {
cb(err);
}
cb(null, data.Plaintext);
});
});
process.stdin.pipe(decrypt).pipe(process.stdout);

@@ -18,3 +18,3 @@ #!/usr/bin/env node

{
KeyId: process.env.KMS_ID,
KeyId: args['key-id'] || process.env.KMS_ID,
Plaintext: text,

@@ -21,0 +21,0 @@ },

{
"name": "@znemz/aws-play",
"version": "0.0.1",
"version": "0.0.2",
"description": "",

@@ -5,0 +5,0 @@ "dependencies": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc