Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

envoy

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

envoy - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

lib/adapters/s3.js

6

lib/envoy.js

@@ -103,3 +103,3 @@ (function () {

opts = _.extend({}, opts);
opts = this.readyOpts(opts);

@@ -130,2 +130,4 @@ this.filterAndReadFiles(sources, filter, function(err, files) {

opts = this.readyOpts(opts);
//If we already have data just use it

@@ -256,3 +258,3 @@ if(opts.persistenceData) {

opts = _.extend({}, opts);
opts.persistenceData = opts.persistenceData || {};
opts.persistenceData = opts.persistenceData || false;
opts.baseDir = opts.baseDir || './';

@@ -259,0 +261,0 @@ opts.initialRun = opts.persistenceData ? false : true;

@@ -9,3 +9,3 @@ {

],
"version": "0.0.3",
"version": "0.0.4",
"repository": {

@@ -18,2 +18,4 @@ "type": "git",

"jsftp": "0.6.x"
, "knox": "0.8.x"
, "mime": "1.2.x"
, "async": "0.2.x"

@@ -20,0 +22,0 @@ , "crypto": "0.0.x"

@@ -95,2 +95,5 @@ #Envoy

* Server should not auto-rename uploaded files on conflict
* We are tested against pure-ftpd and vsftpd
* We are tested against pure-ftpd and vsftpd
* S3
* Enable static website hosting yourself
* We'll set `x-amz-acl = public-read` on uploaded objects

@@ -36,181 +36,4 @@ var assert = require('assert')

});
}
, testNormalizePath = function(fixture, expected) {
var client;
assert.doesNotThrow(function () {
client = new require( path.join('../../lib/adapters/ftp') );
});
assert.strictEqual(client.normalize(fixture), expected);
}
, testHandlePath = function(fixture, expected, cb) {
var buffer = []
, reverseBuffer = []
, handler = function (curdir, next) {
buffer.push(curdir);
next();
}
, reverseHandler = function (curdir, next) {
//look: unshifts instead
reverseBuffer.unshift(curdir);
next();
}
, client;
assert.doesNotThrow(function () {
client = new require( path.join('../../lib/adapters/ftp') );
});
client.handlePath(fixture, handler, function (err) {
assert.equal(err, null, err);
assert.deepEqual(buffer, expected);
client.handlePathBackwards(fixture, reverseHandler, function (err) {
assert.equal(err, null, err);
assert.deepEqual(reverseBuffer, expected);
cb();
});
});
};
tests["normalizePath blank"] = function () {
testNormalizePath('', './');
};
tests["normalizePath ."] = function () {
testNormalizePath('.', './');
};
tests["normalizePath ./"] = function () {
testNormalizePath('./', './');
};
tests["normalizePath /"] = function () {
testNormalizePath('/', '/');
};
tests["normalizePath .dotfile"] = function () {
testNormalizePath('.dotfile', './.dotfile');
};
tests["normalizePath /.dotfile"] = function () {
testNormalizePath('/.dotfile', '/.dotfile');
};
tests["normalizePath ./.dotfile"] = function () {
testNormalizePath('./.dotfile', './.dotfile');
};
tests["normalizePath ./.dotfile/"] = function () {
testNormalizePath('./.dotfile/', './.dotfile');
};
tests["normalizePath /my.file.txt"] = function () {
testNormalizePath('/my.file.txt', '/my.file.txt');
};
tests["normalizePath ./my.file.txt"] = function () {
testNormalizePath('./my.file.txt', './my.file.txt');
};
tests["normalizePath my.file.txt"] = function () {
testNormalizePath('my.file.txt', './my.file.txt');
};
tests["normalizePath ./relative/path"] = function () {
testNormalizePath('./relative/path', './relative/path/');
};
tests["normalizePath /absolute/path"] = function () {
testNormalizePath('/absolute/path', '/absolute/path/');
};
tests["normalizePath ambiguous/path"] = function () {
testNormalizePath('ambiguous/path', './ambiguous/path/');
};
tests["normalizePath ambiguous/path"] = function () {
testNormalizePath('ambiguous/path/', './ambiguous/path/');
};
tests["handlePath to relative file"] = function (after) {
var fixture = 'somewhere/over/the/rainbow/file.txt'
, expected = [
'./'
, 'somewhere/'
, 'somewhere/over/'
, 'somewhere/over/the/'
, 'somewhere/over/the/rainbow/'
];
testHandlePath(fixture, expected, after);
};
tests["handlePath to relative dotfile"] = function (after) {
var fixture = 'somewhere/over/the/rainbow/.dotfile'
, expected = [
'./'
, 'somewhere/'
, 'somewhere/over/'
, 'somewhere/over/the/'
, 'somewhere/over/the/rainbow/'
];
testHandlePath(fixture, expected, after);
};
tests["handlePath to absolute file"] = function (after) {
var fixture = '/somewhere/over/the/rainbow/file.txt'
, expected = [
'/'
, '/somewhere/'
, '/somewhere/over/'
, '/somewhere/over/the/'
, '/somewhere/over/the/rainbow/'
];
testHandlePath(fixture, expected, after);
};
tests["handlePath to relative directory"] = function (after) {
var fixture = 'somewhere/over/the/rainbow/'
, expected = [
'./'
, 'somewhere/'
, 'somewhere/over/'
, 'somewhere/over/the/'
, 'somewhere/over/the/rainbow/'
];
testHandlePath(fixture, expected, after);
};
tests["handlePath to absolute directory"] = function (after) {
var fixture = '/somewhere/over/the/rainbow/'
, expected = [
'/'
, '/somewhere/'
, '/somewhere/over/'
, '/somewhere/over/the/'
, '/somewhere/over/the/rainbow/'
];
testHandlePath(fixture, expected, after);
};
tests["handlePath to absolute directory"] = function (after) {
var fixture = '/somewhere/over/the/rainbow/'
, expected = [
'/'
, '/somewhere/'
, '/somewhere/over/'
, '/somewhere/over/the/'
, '/somewhere/over/the/rainbow/'
];
testHandlePath(fixture, expected, after);
};
tests["ensurePath somewhere/over/the/rainbow/file.txt"] = function (after) {

@@ -250,3 +73,3 @@ var fixture = 'somewhere/over/the/rainbow/file.txt';

tests["handlePath create directory recursively"] = function (after) {
tests["use handlePath create directory recursively"] = function (after) {
var fixture = 'somewhere/over/the/rainbow/file.txt';

@@ -253,0 +76,0 @@

@@ -8,6 +8,2 @@ var assert = require('assert')

, fixtures = require('../fixtures')
, adapters = {
memory: {}
, ftp: secrets.ftp
}
/*

@@ -88,28 +84,39 @@ * Sets up for a test

};
}
, adapters = []
//Add to this array new adapters to test
, opts = {
memory: {}
, s3: secrets.s3
, ftp: secrets.ftp
};
_.each(opts, function (opts, adapter) {
adapters.push(adapter.toLowerCase());
});
//Shared tests for each adapter
_.each(adapters, function(opts, adapterName) {
_.each(adapters, function(adapterName) {
tests[adapterName + " CRUD alphanumeric path"] = function (next) {
setup(adapterName, opts, testCRUD(fixtures.fileOne, next));
setup(adapterName, opts[adapterName], testCRUD(fixtures.fileOne, next));
};
tests[adapterName + " CRUD dashes in path"] = function (next) {
setup(adapterName, opts, testCRUD(fixtures.fileTwo, next));
setup(adapterName, opts[adapterName], testCRUD(fixtures.fileTwo, next));
};
tests[adapterName + " CRUD slashes in path"] = function (next) {
setup(adapterName, opts, testCRUD(fixtures.fileThree, next));
setup(adapterName, opts[adapterName], testCRUD(fixtures.fileThree, next));
};
tests[adapterName + " CRUD dotfile"] = function (next) {
setup(adapterName, opts, testCRUD(fixtures.fileFour, next));
setup(adapterName, opts[adapterName], testCRUD(fixtures.fileFour, next));
};
tests[adapterName + " CRUD dot in directory"] = function (next) {
setup(adapterName, opts, testCRUD(fixtures.fileFive, next));
setup(adapterName, opts[adapterName], testCRUD(fixtures.fileFive, next));
};
tests[adapterName + " CRUD dotfile in directory"] = function (next) {
setup(adapterName, opts, testCRUD(fixtures.fileSix, next));
setup(adapterName, opts[adapterName], testCRUD(fixtures.fileSix, next));
};

@@ -116,0 +123,0 @@ });

@@ -7,17 +7,28 @@ var assert = require('assert')

, fixtures = require('./fixtures')
, adapters = ["memory", "ftp"]
, undeployOpts
, adapters = []
//Add to this array new adapters to test
, opts = {
memory: {
baseDir:'./tests'
}
memory: {}
, s3: secrets.s3
, ftp: secrets.ftp
}
, undeploy = function () {
};
_.extend(opts.ftp, {baseDir:'./tests'});
_.each(opts, function (opts, adapter) {
adapters.push(adapter.toLowerCase());
});
//Load s3 configuration from travis if possible
if(process.env.TRAVIS_SECURE_ENV_VARS) {
_.extend(opts.s3,{
key: process.env.AWS_S3_KEY
, secret: process.env.AWS_S3_SECRET
, bucket: process.env.AWS_S3_BUCKET
, region: process.env.AWS_S3_REGION
});
}
_.each(adapters, function (adapterName) {
_.extend(opts[adapterName], {baseDir:'./tests'});

@@ -24,0 +35,0 @@ tests[adapterName + ' deploy/undeploy empty collection'] = function (next) {

Sorry, the diff of this file is not supported yet

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