ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anovi...@apache.org
Subject [39/52] [partial] incubator-ignite git commit: # ignite-843 WIP.
Date Fri, 08 May 2015 11:37:04 GMT
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0ef79031/modules/webconfig/nodejs/node_modules/express-session/node_modules/utils-merge/LICENSE
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/node_modules/express-session/node_modules/utils-merge/LICENSE
b/modules/webconfig/nodejs/node_modules/express-session/node_modules/utils-merge/LICENSE
new file mode 100644
index 0000000..e33bd10
--- /dev/null
+++ b/modules/webconfig/nodejs/node_modules/express-session/node_modules/utils-merge/LICENSE
@@ -0,0 +1,20 @@
+(The MIT License)
+
+Copyright (c) 2013 Jared Hanson
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0ef79031/modules/webconfig/nodejs/node_modules/express-session/node_modules/utils-merge/README.md
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/node_modules/express-session/node_modules/utils-merge/README.md
b/modules/webconfig/nodejs/node_modules/express-session/node_modules/utils-merge/README.md
new file mode 100644
index 0000000..2f94e9b
--- /dev/null
+++ b/modules/webconfig/nodejs/node_modules/express-session/node_modules/utils-merge/README.md
@@ -0,0 +1,34 @@
+# utils-merge
+
+Merges the properties from a source object into a destination object.
+
+## Install
+
+    $ npm install utils-merge
+
+## Usage
+
+```javascript
+var a = { foo: 'bar' }
+  , b = { bar: 'baz' };
+
+merge(a, b);
+// => { foo: 'bar', bar: 'baz' }
+```
+
+## Tests
+
+    $ npm install
+    $ npm test
+
+[![Build Status](https://secure.travis-ci.org/jaredhanson/utils-merge.png)](http://travis-ci.org/jaredhanson/utils-merge)
+
+## Credits
+
+  - [Jared Hanson](http://github.com/jaredhanson)
+
+## License
+
+[The MIT License](http://opensource.org/licenses/MIT)
+
+Copyright (c) 2013 Jared Hanson <[http://jaredhanson.net/](http://jaredhanson.net/)>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0ef79031/modules/webconfig/nodejs/node_modules/express-session/node_modules/utils-merge/index.js
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/node_modules/express-session/node_modules/utils-merge/index.js
b/modules/webconfig/nodejs/node_modules/express-session/node_modules/utils-merge/index.js
new file mode 100644
index 0000000..4265c69
--- /dev/null
+++ b/modules/webconfig/nodejs/node_modules/express-session/node_modules/utils-merge/index.js
@@ -0,0 +1,23 @@
+/**
+ * Merge object b with object a.
+ *
+ *     var a = { foo: 'bar' }
+ *       , b = { bar: 'baz' };
+ *
+ *     merge(a, b);
+ *     // => { foo: 'bar', bar: 'baz' }
+ *
+ * @param {Object} a
+ * @param {Object} b
+ * @return {Object}
+ * @api public
+ */
+
+exports = module.exports = function(a, b){
+  if (a && b) {
+    for (var key in b) {
+      a[key] = b[key];
+    }
+  }
+  return a;
+};

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0ef79031/modules/webconfig/nodejs/node_modules/express-session/node_modules/utils-merge/package.json
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/node_modules/express-session/node_modules/utils-merge/package.json
b/modules/webconfig/nodejs/node_modules/express-session/node_modules/utils-merge/package.json
new file mode 100644
index 0000000..2f9660e
--- /dev/null
+++ b/modules/webconfig/nodejs/node_modules/express-session/node_modules/utils-merge/package.json
@@ -0,0 +1,60 @@
+{
+  "name": "utils-merge",
+  "version": "1.0.0",
+  "description": "merge() utility function",
+  "keywords": [
+    "util"
+  ],
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/jaredhanson/utils-merge.git"
+  },
+  "bugs": {
+    "url": "http://github.com/jaredhanson/utils-merge/issues"
+  },
+  "author": {
+    "name": "Jared Hanson",
+    "email": "jaredhanson@gmail.com",
+    "url": "http://www.jaredhanson.net/"
+  },
+  "licenses": [
+    {
+      "type": "MIT",
+      "url": "http://www.opensource.org/licenses/MIT"
+    }
+  ],
+  "main": "./index",
+  "dependencies": {},
+  "devDependencies": {
+    "mocha": "1.x.x",
+    "chai": "1.x.x"
+  },
+  "scripts": {
+    "test": "mocha --reporter spec --require test/bootstrap/node test/*.test.js"
+  },
+  "engines": {
+    "node": ">= 0.4.0"
+  },
+  "_id": "utils-merge@1.0.0",
+  "dist": {
+    "shasum": "0294fb922bb9375153541c4f7096231f287c8af8",
+    "tarball": "http://registry.npmjs.org/utils-merge/-/utils-merge-1.0.0.tgz"
+  },
+  "_from": "utils-merge@1.0.0",
+  "_npmVersion": "1.2.25",
+  "_npmUser": {
+    "name": "jaredhanson",
+    "email": "jaredhanson@gmail.com"
+  },
+  "maintainers": [
+    {
+      "name": "jaredhanson",
+      "email": "jaredhanson@gmail.com"
+    }
+  ],
+  "directories": {},
+  "_shasum": "0294fb922bb9375153541c4f7096231f287c8af8",
+  "_resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.0.tgz",
+  "readme": "ERROR: No README data found!",
+  "homepage": "https://github.com/jaredhanson/utils-merge#readme"
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0ef79031/modules/webconfig/nodejs/node_modules/express-session/package.json
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/node_modules/express-session/package.json b/modules/webconfig/nodejs/node_modules/express-session/package.json
new file mode 100644
index 0000000..114e90d
--- /dev/null
+++ b/modules/webconfig/nodejs/node_modules/express-session/package.json
@@ -0,0 +1,91 @@
+{
+  "name": "express-session",
+  "version": "1.11.1",
+  "description": "Simple session middleware for Express",
+  "author": {
+    "name": "TJ Holowaychuk",
+    "email": "tj@vision-media.ca",
+    "url": "http://tjholowaychuk.com"
+  },
+  "contributors": [
+    {
+      "name": "Douglas Christopher Wilson",
+      "email": "doug@somethingdoug.com"
+    },
+    {
+      "name": "Joe Wagner",
+      "email": "njwjs722@gmail.com"
+    }
+  ],
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/expressjs/session"
+  },
+  "license": "MIT",
+  "dependencies": {
+    "cookie": "0.1.2",
+    "cookie-signature": "1.0.6",
+    "crc": "3.2.1",
+    "debug": "~2.1.3",
+    "depd": "~1.0.1",
+    "on-headers": "~1.0.0",
+    "parseurl": "~1.3.0",
+    "uid-safe": "1.1.0",
+    "utils-merge": "1.0.0"
+  },
+  "devDependencies": {
+    "after": "0.8.1",
+    "cookie-parser": "~1.3.4",
+    "express": "~4.11.2",
+    "istanbul": "0.3.8",
+    "mocha": "~2.2.4",
+    "supertest": "~0.15.0"
+  },
+  "files": [
+    "session/",
+    "HISTORY.md",
+    "LICENSE",
+    "index.js"
+  ],
+  "engines": {
+    "node": ">= 0.8.0"
+  },
+  "scripts": {
+    "test": "mocha --bail --reporter spec test/",
+    "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot test/",
+    "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter
spec test/"
+  },
+  "gitHead": "fa89a8dd6adb81f63583e0ab7ff65d0550162cbe",
+  "bugs": {
+    "url": "https://github.com/expressjs/session/issues"
+  },
+  "homepage": "https://github.com/expressjs/session",
+  "_id": "express-session@1.11.1",
+  "_shasum": "607eb9458e9e98c1ab576e3408f5c8d9019fe633",
+  "_from": "express-session@*",
+  "_npmVersion": "1.4.28",
+  "_npmUser": {
+    "name": "dougwilson",
+    "email": "doug@somethingdoug.com"
+  },
+  "maintainers": [
+    {
+      "name": "shtylman",
+      "email": "shtylman@gmail.com"
+    },
+    {
+      "name": "dougwilson",
+      "email": "doug@somethingdoug.com"
+    },
+    {
+      "name": "mscdex",
+      "email": "mscdex@mscdex.net"
+    }
+  ],
+  "dist": {
+    "shasum": "607eb9458e9e98c1ab576e3408f5c8d9019fe633",
+    "tarball": "http://registry.npmjs.org/express-session/-/express-session-1.11.1.tgz"
+  },
+  "directories": {},
+  "_resolved": "https://registry.npmjs.org/express-session/-/express-session-1.11.1.tgz"
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0ef79031/modules/webconfig/nodejs/node_modules/express-session/session/cookie.js
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/node_modules/express-session/session/cookie.js b/modules/webconfig/nodejs/node_modules/express-session/session/cookie.js
new file mode 100644
index 0000000..86591de
--- /dev/null
+++ b/modules/webconfig/nodejs/node_modules/express-session/session/cookie.js
@@ -0,0 +1,128 @@
+
+/*!
+ * Connect - session - Cookie
+ * Copyright(c) 2010 Sencha Inc.
+ * Copyright(c) 2011 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+/**
+ * Module dependencies.
+ */
+
+var merge = require('utils-merge')
+  , cookie = require('cookie');
+
+/**
+ * Initialize a new `Cookie` with the given `options`.
+ *
+ * @param {IncomingMessage} req
+ * @param {Object} options
+ * @api private
+ */
+
+var Cookie = module.exports = function Cookie(options) {
+  this.path = '/';
+  this.maxAge = null;
+  this.httpOnly = true;
+  if (options) merge(this, options);
+  this.originalMaxAge = undefined == this.originalMaxAge
+    ? this.maxAge
+    : this.originalMaxAge;
+};
+
+/*!
+ * Prototype.
+ */
+
+Cookie.prototype = {
+
+  /**
+   * Set expires `date`.
+   *
+   * @param {Date} date
+   * @api public
+   */
+
+  set expires(date) {
+    this._expires = date;
+    this.originalMaxAge = this.maxAge;
+  },
+
+  /**
+   * Get expires `date`.
+   *
+   * @return {Date}
+   * @api public
+   */
+
+  get expires() {
+    return this._expires;
+  },
+
+  /**
+   * Set expires via max-age in `ms`.
+   *
+   * @param {Number} ms
+   * @api public
+   */
+
+  set maxAge(ms) {
+    this.expires = 'number' == typeof ms
+      ? new Date(Date.now() + ms)
+      : ms;
+  },
+
+  /**
+   * Get expires max-age in `ms`.
+   *
+   * @return {Number}
+   * @api public
+   */
+
+  get maxAge() {
+    return this.expires instanceof Date
+      ? this.expires.valueOf() - Date.now()
+      : this.expires;
+  },
+
+  /**
+   * Return cookie data object.
+   *
+   * @return {Object}
+   * @api private
+   */
+
+  get data() {
+    return {
+        originalMaxAge: this.originalMaxAge
+      , expires: this._expires
+      , secure: this.secure
+      , httpOnly: this.httpOnly
+      , domain: this.domain
+      , path: this.path
+    }
+  },
+
+  /**
+   * Return a serialized cookie string.
+   *
+   * @return {String}
+   * @api public
+   */
+
+  serialize: function(name, val){
+    return cookie.serialize(name, val, this.data);
+  },
+
+  /**
+   * Return JSON representation of this cookie.
+   *
+   * @return {Object}
+   * @api private
+   */
+
+  toJSON: function(){
+    return this.data;
+  }
+};

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0ef79031/modules/webconfig/nodejs/node_modules/express-session/session/memory.js
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/node_modules/express-session/session/memory.js b/modules/webconfig/nodejs/node_modules/express-session/session/memory.js
new file mode 100644
index 0000000..9887680
--- /dev/null
+++ b/modules/webconfig/nodejs/node_modules/express-session/session/memory.js
@@ -0,0 +1,183 @@
+/*!
+ * express-session
+ * Copyright(c) 2010 Sencha Inc.
+ * Copyright(c) 2011 TJ Holowaychuk
+ * Copyright(c) 2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+/**
+ * Module dependencies.
+ * @private
+ */
+
+var Store = require('./store')
+var util = require('util')
+
+/**
+ * Shim setImmediate for node.js < 0.10
+ * @private
+ */
+
+/* istanbul ignore next */
+var defer = typeof setImmediate === 'function'
+  ? setImmediate
+  : function(fn){ process.nextTick(fn.bind.apply(fn, arguments)) }
+
+/**
+ * Module exports.
+ */
+
+module.exports = MemoryStore
+
+/**
+ * A session store in memory.
+ * @public
+ */
+
+function MemoryStore() {
+  Store.call(this)
+  this.sessions = Object.create(null)
+}
+
+/**
+ * Inherit from Store.
+ */
+
+util.inherits(MemoryStore, Store)
+
+/**
+ * Get all active sessions.
+ *
+ * @param {function} callback
+ * @public
+ */
+
+MemoryStore.prototype.all = function all(callback) {
+  var sessionIds = Object.keys(this.sessions)
+  var sessions = Object.create(null)
+
+  for (var i = 0; i < sessionIds.length; i++) {
+    var sessionId = sessionIds[i]
+    var session = getSession.call(this, sessionId)
+
+    if (session) {
+      sessions[sessionId] = session;
+    }
+  }
+
+  callback && defer(callback, null, sessions)
+}
+
+/**
+ * Clear all sessions.
+ *
+ * @param {function} callback
+ * @public
+ */
+
+MemoryStore.prototype.clear = function clear(callback) {
+  this.sessions = Object.create(null)
+  callback && defer(callback)
+}
+
+/**
+ * Destroy the session associated with the given session ID.
+ *
+ * @param {string} sessionId
+ * @public
+ */
+
+MemoryStore.prototype.destroy = function destroy(sessionId, callback) {
+  delete this.sessions[sessionId]
+  callback && defer(callback)
+}
+
+/**
+ * Fetch session by the given session ID.
+ *
+ * @param {string} sessionId
+ * @param {function} callback
+ * @public
+ */
+
+MemoryStore.prototype.get = function get(sessionId, callback) {
+  defer(callback, null, getSession.call(this, sessionId))
+}
+
+/**
+ * Commit the given session associated with the given sessionId to the store.
+ *
+ * @param {string} sessionId
+ * @param {object} session
+ * @param {function} callback
+ * @public
+ */
+
+/**
+ * Get number of active sessions.
+ *
+ * @param {function} callback
+ * @public
+ */
+
+MemoryStore.prototype.length = function length(callback) {
+  this.all(function (err, sessions) {
+    if (err) return callback(err)
+    callback(null, Object.keys(sessions).length)
+  })
+}
+
+MemoryStore.prototype.set = function set(sessionId, session, callback) {
+  this.sessions[sessionId] = JSON.stringify(session)
+  callback && defer(callback)
+}
+
+/**
+ * Touch the given session object associated with the given session ID.
+ *
+ * @param {string} sessionId
+ * @param {object} session
+ * @param {function} callback
+ * @public
+ */
+
+MemoryStore.prototype.touch = function touch(sessionId, session, callback) {
+  var currentSession = getSession.call(this, sessionId)
+
+  if (currentSession) {
+    // update expiration
+    currentSession.cookie = session.cookie
+    this.sessions[sessionId] = JSON.stringify(currentSession)
+  }
+
+  callback && defer(callback)
+}
+
+/**
+ * Get session from the store.
+ * @private
+ */
+
+function getSession(sessionId) {
+  var sess = this.sessions[sessionId]
+
+  if (!sess) {
+    return
+  }
+
+  // parse
+  sess = JSON.parse(sess)
+
+  var expires = typeof sess.cookie.expires === 'string'
+    ? new Date(sess.cookie.expires)
+    : sess.cookie.expires
+
+  // destroy expired session
+  if (expires && expires <= Date.now()) {
+    delete this.sessions[sessionId]
+    return
+  }
+
+  return sess
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0ef79031/modules/webconfig/nodejs/node_modules/express-session/session/session.js
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/node_modules/express-session/session/session.js b/modules/webconfig/nodejs/node_modules/express-session/session/session.js
new file mode 100644
index 0000000..4647f9d
--- /dev/null
+++ b/modules/webconfig/nodejs/node_modules/express-session/session/session.js
@@ -0,0 +1,124 @@
+
+/*!
+ * Connect - session - Session
+ * Copyright(c) 2010 Sencha Inc.
+ * Copyright(c) 2011 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+/**
+ * Expose Session.
+ */
+
+module.exports = Session;
+
+/**
+ * Create a new `Session` with the given request and `data`.
+ *
+ * @param {IncomingRequest} req
+ * @param {Object} data
+ * @api private
+ */
+
+function Session(req, data) {
+  Object.defineProperty(this, 'req', { value: req });
+  Object.defineProperty(this, 'id', { value: req.sessionID });
+
+  if (typeof data === 'object' && data !== null) {
+    // merge data into this, ignoring prototype properties
+    for (var prop in data) {
+      if (!(prop in this)) {
+        this[prop] = data[prop]
+      }
+    }
+  }
+}
+
+/**
+ * Update reset `.cookie.maxAge` to prevent
+ * the cookie from expiring when the
+ * session is still active.
+ *
+ * @return {Session} for chaining
+ * @api public
+ */
+
+Session.prototype.touch = function(){
+  return this.resetMaxAge();
+};
+
+/**
+ * Reset `.maxAge` to `.originalMaxAge`.
+ *
+ * @return {Session} for chaining
+ * @api public
+ */
+
+Session.prototype.resetMaxAge = function(){
+  this.cookie.maxAge = this.cookie.originalMaxAge;
+  return this;
+};
+
+/**
+ * Save the session data with optional callback `fn(err)`.
+ *
+ * @param {Function} fn
+ * @return {Session} for chaining
+ * @api public
+ */
+
+Session.prototype.save = function(fn){
+  this.req.sessionStore.set(this.id, this, fn || function(){});
+  return this;
+};
+
+/**
+ * Re-loads the session data _without_ altering
+ * the maxAge properties. Invokes the callback `fn(err)`,
+ * after which time if no exception has occurred the
+ * `req.session` property will be a new `Session` object,
+ * although representing the same session.
+ *
+ * @param {Function} fn
+ * @return {Session} for chaining
+ * @api public
+ */
+
+Session.prototype.reload = function(fn){
+  var req = this.req
+    , store = this.req.sessionStore;
+  store.get(this.id, function(err, sess){
+    if (err) return fn(err);
+    if (!sess) return fn(new Error('failed to load session'));
+    store.createSession(req, sess);
+    fn();
+  });
+  return this;
+};
+
+/**
+ * Destroy `this` session.
+ *
+ * @param {Function} fn
+ * @return {Session} for chaining
+ * @api public
+ */
+
+Session.prototype.destroy = function(fn){
+  delete this.req.session;
+  this.req.sessionStore.destroy(this.id, fn);
+  return this;
+};
+
+/**
+ * Regenerate this request's session.
+ *
+ * @param {Function} fn
+ * @return {Session} for chaining
+ * @api public
+ */
+
+Session.prototype.regenerate = function(fn){
+  this.req.sessionStore.regenerate(this.req, fn);
+  return this;
+};

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0ef79031/modules/webconfig/nodejs/node_modules/express-session/session/store.js
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/node_modules/express-session/session/store.js b/modules/webconfig/nodejs/node_modules/express-session/session/store.js
new file mode 100644
index 0000000..54294cb
--- /dev/null
+++ b/modules/webconfig/nodejs/node_modules/express-session/session/store.js
@@ -0,0 +1,84 @@
+
+/*!
+ * Connect - session - Store
+ * Copyright(c) 2010 Sencha Inc.
+ * Copyright(c) 2011 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+/**
+ * Module dependencies.
+ */
+
+var EventEmitter = require('events').EventEmitter
+  , Session = require('./session')
+  , Cookie = require('./cookie');
+
+/**
+ * Initialize abstract `Store`.
+ *
+ * @api private
+ */
+
+var Store = module.exports = function Store(options){};
+
+/**
+ * Inherit from `EventEmitter.prototype`.
+ */
+
+Store.prototype.__proto__ = EventEmitter.prototype;
+
+/**
+ * Re-generate the given requests's session.
+ *
+ * @param {IncomingRequest} req
+ * @return {Function} fn
+ * @api public
+ */
+
+Store.prototype.regenerate = function(req, fn){
+  var self = this;
+  this.destroy(req.sessionID, function(err){
+    self.generate(req);
+    fn(err);
+  });
+};
+
+/**
+ * Load a `Session` instance via the given `sid`
+ * and invoke the callback `fn(err, sess)`.
+ *
+ * @param {String} sid
+ * @param {Function} fn
+ * @api public
+ */
+
+Store.prototype.load = function(sid, fn){
+  var self = this;
+  this.get(sid, function(err, sess){
+    if (err) return fn(err);
+    if (!sess) return fn();
+    var req = { sessionID: sid, sessionStore: self };
+    sess = self.createSession(req, sess);
+    fn(null, sess);
+  });
+};
+
+/**
+ * Create session from JSON `sess` data.
+ *
+ * @param {IncomingRequest} req
+ * @param {Object} sess
+ * @return {Session}
+ * @api private
+ */
+
+Store.prototype.createSession = function(req, sess){
+  var expires = sess.cookie.expires
+    , orig = sess.cookie.originalMaxAge;
+  sess.cookie = new Cookie(sess.cookie);
+  if ('string' == typeof expires) sess.cookie.expires = new Date(expires);
+  sess.cookie.originalMaxAge = orig;
+  req.session = new Session(req, sess);
+  return req.session;
+};


Mime
View raw message