How to use the mock-aws-s3.SharedIniFileCredentials function in mock-aws-s3

To help you get started, we’ve selected a few mock-aws-s3 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github MathieuLoutre / grunt-aws-s3 / tasks / aws_s3.js View on Github external
}

		var filePairOptions = {
			differential: options.differential,
			stream: options.stream,
			flipExclude: false,
			exclude: false
		};

		// Replace the AWS SDK by the mock package if we're testing
		if (options.mock) {
			AWS = require('mock-aws-s3');
		}

		if (options.awsProfile) {
			var credentials = new AWS.SharedIniFileCredentials({profile: options.awsProfile});
			AWS.config.credentials = credentials;
		}

		if (['dots','progressBar','none'].indexOf(options.progress) < 0) {
			grunt.log.writeln('Invalid progress option; defaulting to dots\n'.yellow);
			options.progress = 'dots';
		}

		// List of acceptable params for an upload
		var put_params = ['CacheControl', 'ContentDisposition', 'ContentEncoding',
			'ContentLanguage', 'ContentLength', 'ContentMD5', 'Expires', 'GrantFullControl',
			'GrantRead', 'GrantReadACP', 'GrantWriteACP', 'Metadata', 'ServerSideEncryption',
			'StorageClass', 'WebsiteRedirectLocation', 'ContentType'];

		// Checks that all params are in put_params
		var isValidParams = function (params) {

mock-aws-s3

Mock AWS S3 SDK for Node.js

MIT
Latest version published 3 years ago

Package Health Score

53 / 100
Full package analysis