jwt-kms icon indicating copy to clipboard operation
jwt-kms copied to clipboard

Option to pass in AWS constant

Open andrhamm opened this issue 7 years ago • 1 comments

Hey, thanks for the lib!

I'm using the AWS X-Ray client and I believe I need to be able to wrap the initialization of AWS inside a function like so:

var AWS = captureAWS(require('aws-sdk'));

I'm not sure if I can accomplish that since the lib defines AWS on its own.

Thoughts?

andrhamm avatar May 21 '18 14:05 andrhamm

@andrhamm Thanks for the suggestion. How about a config param called AWSXRay that you pass the library to. e.g.

var jwtkms = new JWTKMS({
    aws: {
        region: "us-east-1",
        accessKeyId : process.env.AWS_ACCESS_KEY,	// Optional if set in environment
        secretAccessKey: process.env.AWS_SECRET_KEY	// Optional if set in environment
    },
    AWSXRay: require('aws-xray-sdk')
});

jonathankeebler avatar May 22 '18 14:05 jonathankeebler