browserbox
Advanced tools
Comparing version 0.3.9 to 0.3.10
{ | ||
"name": "browserbox", | ||
"version": "0.3.9", | ||
"version": "0.3.10", | ||
"homepage": "https://github.com/whiteout-io/browserbox", | ||
@@ -25,3 +25,3 @@ "description": "IMAP client for browsers.", | ||
"axe-logger": "~0.0.2", | ||
"tcp-socket": "~0.3.0" | ||
"tcp-socket": "~0.3.4" | ||
}, | ||
@@ -28,0 +28,0 @@ "devDependencies": { |
@@ -29,3 +29,3 @@ # browserbox | ||
Include following fileson the page. | ||
Include following files on the page. | ||
@@ -59,4 +59,5 @@ ```html | ||
* **id** (optional) is the identification object for [RFC2971](http://tools.ietf.org/html/rfc2971#section-3.3) (ex. `{name: 'myclient', version: '1'}`) | ||
* **useSSL** (optional) enables TLS | ||
* **useSecureTransport** (optional) enables TLS | ||
* **ca** (optional) (only in conjunction with this [TCPSocket shim](https://github.com/whiteout-io/tcp-socket)) if you use TLS, pin a PEM-encoded certificate as a string | ||
* **ignoreTLS** – if set to true, do not call STARTTLS before authentication | ||
@@ -185,2 +186,35 @@ Example | ||
### Notes | ||
Root level `INBOX` is case insensitive, so all subfolders of INBOX, Inbox etc. are mapped together. The first occurence of `INBOX` defines the `name` property for the parent element. `path` values remain as listed. | ||
For example the following IMAP response lists different INBOX names: | ||
``` | ||
* LIST () "INBOX" | ||
* LIST () "Inbox/test" | ||
``` | ||
These different INBOX names are mapped to the following object: | ||
```json | ||
{ | ||
"root": true, | ||
"children": [ | ||
{ | ||
"name": "INBOX", | ||
"delimiter": "/", | ||
"path": "INBOX", | ||
"children": [ | ||
{ | ||
"name": "test", | ||
"delimiter": "/", | ||
"path": "Inbox/test", | ||
} | ||
] | ||
} | ||
] | ||
} | ||
``` | ||
## List namespaces | ||
@@ -699,2 +733,2 @@ | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
SOFTWARE. |
@@ -91,3 +91,3 @@ // Copyright (c) 2014 Andris Reinman | ||
*/ | ||
this._secureMode = !!this.options.useSecureTransport; | ||
this.secureMode = !!this.options.useSecureTransport; | ||
@@ -205,3 +205,3 @@ /** | ||
binaryType: 'arraybuffer', | ||
useSecureTransport: this._secureMode, | ||
useSecureTransport: this.secureMode, | ||
ca: this.options.ca | ||
@@ -229,2 +229,14 @@ }); | ||
/** | ||
* Closes the connection to the server | ||
*/ | ||
ImapClient.prototype.upgrade = function(callback) { | ||
if (this.secureMode) { | ||
return callback(null, false); | ||
} | ||
this.secureMode = true; | ||
this.socket.upgradeToSecure(); | ||
callback(null, true); | ||
}; | ||
/** | ||
* Schedules a command to be sent to the server. This method is chainable. | ||
@@ -231,0 +243,0 @@ * See https://github.com/Kreata/imapHandler for request structure. |
@@ -10,2 +10,4 @@ 'use strict'; | ||
}(function(chai, BrowserBox, hoodiecrow, axe) { | ||
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0"; | ||
var expect = chai.expect; | ||
@@ -24,2 +26,4 @@ chai.Assertion.includeStack = true; | ||
var options = { | ||
//debug: true, | ||
plugins: ["STARTTLS"], | ||
secureConnection: false, | ||
@@ -26,0 +30,0 @@ storage: { |
@@ -35,3 +35,3 @@ 'use strict'; | ||
TCPSocket.prototype.resume = function() {}; | ||
TCPSocket.prototype.send = function() {}; | ||
TCPSocket.prototype.upgradeToSecure = function() {}; | ||
@@ -75,2 +75,22 @@ socketStub = sinon.createStubInstance(TCPSocket); | ||
describe('#upgrade', function() { | ||
it('should upgrade socket', function(done) { | ||
client.secureMode = false; | ||
client.upgrade(function(err, upgraded) { | ||
expect(err).to.not.exist; | ||
expect(upgraded).to.be.true; | ||
done(); | ||
}); | ||
}); | ||
it('should not upgrade socket', function(done) { | ||
client.secureMode = true; | ||
client.upgrade(function(err, upgraded) { | ||
expect(err).to.not.exist; | ||
expect(upgraded).to.be.false; | ||
done(); | ||
}); | ||
}); | ||
}); | ||
describe('#exec', function() { | ||
@@ -77,0 +97,0 @@ it('should add command to queue', function() { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
345535
8031
731
5
Updatedtcp-socket@~0.3.4