Commit Graph

1452 Commits

Author SHA1 Message Date
Miroslav Bajtoš 579529ed1d v2.8.6 2014-12-15 19:29:16 +01:00
Miroslav Bajtoš 8892119591 Merge pull request #925 from strongloop/fix/stable-sort-for-middleware
server-app: make _sortLayersByPhase stable
2014-12-15 19:16:13 +01:00
Miroslav Bajtoš 4744aa6920 server-app: make _sortLayersByPhase stable
Fix the phase-sorting algorithm to use a stable sorting algorithm,
since the built-in `Array.prototype.sort` is not stable.
2014-12-15 08:14:26 +01:00
Miroslav Bajtoš 5150a58364 Merge pull request #908 from strongloop/fix/express-helpers-in-phased-middleware
Rework phased middleware, fix several bugs
2014-12-12 13:44:52 +01:00
Miroslav Bajtoš 84af4194fb Rework phased middleware, fix several bugs
Bugs fixed:

 - express helpers like `req.get` are now available in middleware
   handlers registered via `app.middleware`

 - `req.url` does not include the mountpath prefix now, this is
   consistent with the behaviour of `app.use`

The implementation of phased middleware was completely rewritten.
 - We no longer use Phase and PhaseList objects from loopback-phase.
 - Handler functions are registered via the `Layer` mechanism used by
   express router.
 - The app keeps the layers sorted according to phases.
2014-12-12 13:25:35 +01:00
Miroslav Bajtoš d799bb35d3 Merge tag 'v2.8.5'
2.8.5

 * fix jshint errors (Clark Wang)

 * test if cb exists (Clark Wang)

 * fix nested remoting function throwing error will crash app (Clark Wang)

 * Fix bcrypt issues for browserify (Raymond Feng)
2014-12-12 08:57:08 +01:00
Miroslav Bajtoš 581c4230ba Merge branch 'release/2.8.5' into production 2014-12-12 08:57:05 +01:00
Miroslav Bajtoš cbaf06e63b v2.8.5 2014-12-12 08:57:02 +01:00
Raymond Feng 2ad1acd048 Merge pull request #907 from clarkorz/fix/nestRemoting-crash
fix nested remoting function throwing error will crash app
2014-12-10 08:23:51 -08:00
Clark Wang 9c147f1b25 fix jshint errors
Signed-off-by: Clark Wang <clark.wangs@gmail.com>
2014-12-10 19:43:55 +08:00
Clark Wang 7a3e254403 test if cb exists
Signed-off-by: Clark Wang <clark.wangs@gmail.com>
2014-12-10 19:03:48 +08:00
Clark Wang b204367aa6 fix nested remoting function throwing error will crash app
Signed-off-by: Clark Wang <clark.wangs@gmail.com>
2014-12-10 12:04:56 +08:00
Raymond Feng cb2f40bb86 Fix bcrypt issues for browserify 2014-12-08 14:59:21 -08:00
Raymond Feng bb2632a5fc Merge tag 'v2.8.4'
2.8.4

 * Allow native bcrypt for performance (Raymond Feng)
2014-12-08 11:21:23 -08:00
Raymond Feng a7dbb43940 Merge branch 'release/2.8.4' into production 2014-12-08 11:21:21 -08:00
Raymond Feng ca9cd5641f v2.8.4 2014-12-08 11:21:20 -08:00
Raymond Feng 46abc872f4 Merge pull request #894 from strongloop/feature/fix-issue-892
Allow native bcrypt for performance
2014-12-08 11:20:18 -08:00
Miroslav Bajtoš 86bc992bed Merge tag 'v2.8.3'
2.8.3

 * Remove unused underscore dependency (Ryan Graham)
2014-12-08 08:07:55 +01:00
Miroslav Bajtoš 4182c70ff1 Merge branch 'release/2.8.3' into production 2014-12-08 08:07:53 +01:00
Miroslav Bajtoš 577e496b29 v2.8.3 2014-12-08 08:07:51 +01:00
Raymond Feng 1e932e72ed Allow native bcrypt for performance
See https://github.com/strongloop/loopback/issues/892
2014-12-03 09:03:36 -08:00
Miroslav Bajtoš 837f61c2b1 Merge pull request #891 from strongloop/feature/remove-underscore
Remove unused underscore dependency
2014-12-03 08:55:12 +01:00
Ryan Graham 7c0b2e83eb Remove unused underscore dependency 2014-12-02 21:53:30 -08:00
Miroslav Bajtoš b19e67c7a3 Merge tag 'v2.8.2'
2.8.2

 * Prepend slash for nested remoting paths (Clark Wang)

 * fix jscs errors (Rob Halff)

 * enable jshint for tests (Rob Halff)

 * permit some globals (Rob Halff)

 * 'done' is not defined (Rob Halff)

 * 'memory' is already defined (Rob Halff)

 * singlequote, semicolon & /*jshint -W030 */ (Rob Halff)
2014-11-27 10:01:15 +01:00
Miroslav Bajtoš 465deefd8e Merge branch 'release/2.8.2' into production 2014-11-27 10:01:13 +01:00
Miroslav Bajtoš 4ee05df20f v2.8.2 2014-11-27 10:01:11 +01:00
Miroslav Bajtoš 543e90993c Merge pull request #812 from clarkorz:fix/nest-remote-path
prepend slash for nested remoting path

Close #812
2014-11-27 09:57:42 +01:00
Clark Wang a12c2ece28 Prepend slash for nested remoting paths
Fix remoting paths of relation methods to correctly show
in API Explorer.
2014-11-27 09:56:44 +01:00
Miroslav Bajtoš b83ded7113 Merge pull request #853 from rhalff/cleanup-tests
Cleanup tests
2014-11-25 13:49:39 +01:00
Miroslav Bajtoš dbc1c8465d Merge tag 'v2.8.1'
2.8.1

 * Update docs.json (Rand McKinney)

 * Update favicon.js (Rand McKinney)
2014-11-25 11:21:50 +01:00
Miroslav Bajtoš 61bec45a99 Merge branch 'release/2.8.1' into production 2014-11-25 11:21:48 +01:00
Miroslav Bajtoš d864972bc6 v2.8.1 2014-11-25 11:21:46 +01:00
Rand McKinney 5695499f72 Update docs.json
Add favicon middleware.
2014-11-24 17:13:25 -08:00
Rand McKinney 2522b3f15e Update favicon.js
Add basic JSdoc
2014-11-24 15:08:21 -08:00
Rand McKinney 761a819673 Update docs.json
Fix path to middleware functions.
2014-11-24 14:17:39 -08:00
Rob Halff 36e1f6840c fix jscs errors 2014-11-21 03:35:36 +01:00
Rob Halff 38757c1c88 enable jshint for tests 2014-11-21 02:57:22 +01:00
Rob Halff e8215bf954 permit some globals 2014-11-21 02:56:48 +01:00
Rob Halff a722f8c4cf 'done' is not defined 2014-11-21 02:52:11 +01:00
Rob Halff 4ee7b5f440 'memory' is already defined 2014-11-21 02:47:47 +01:00
Rob Halff 918497c365 singlequote, semicolon & /*jshint -W030 */ 2014-11-21 02:46:21 +01:00
Raymond Feng 800ce7f363 Merge tag 'v2.8.0'
2.8.0

 * Expose more loopback middleware for require (Raymond Feng)

 * Scope app middleware to a list of paths (Miroslav Bajtoš)

 * Update CONTRIBUTING.md (Alex Voitau)

 * Fix the model name for hasMany/through relation (Raymond Feng)

 * Fixing the model attach (wfgomes)

 * Minor: update jsdoc for PersistedModel.updateAll (Alex Voitau)

 * AccessToken: optional `options` in findForRequest (Miroslav Bajtoš)

 * server-app: improve jsdoc comments (Miroslav Bajtoš)

 * server-app: middleware API improvements (Miroslav Bajtoš)

 * typo of port server (wfgomes)

 * Move middleware sources to `server/middleware` (Miroslav Bajtoš)

 * app.middleware: verify serial exec of handlers (Miroslav Bajtoš)

 * Simplify `app.defineMiddlewarePhases` (Miroslav Bajtoš)

 * Make sure loopback has all properties from express (Raymond Feng)

 * Implement `app.defineMiddlewarePhases` (Miroslav Bajtoš)

 * Implement app.middlewareFromConfig (Miroslav Bajtoš)

 * middleware/token: store the token in current ctx (Miroslav Bajtoš)

 * Fix `loopback.getCurrentContext` (Miroslav Bajtoš)

 * Update chai to ^1.10.0 (Miroslav Bajtoš)

 * package: fix deps (Miroslav Bajtoš)

 * Middleware phases - initial implementation (Miroslav Bajtoš)

 * Allows ACLs/settings in model config (Raymond Feng)

 * Remove context middleware per Ritchie (Rand McKinney)

 * Add API doc for context middleware - see #337 (crandmck)

 * Update persisted-model.js (Rand McKinney)

 * rest middleware: clean up context config (Miroslav Bajtoš)

 * Move `context` example to a standalone app (Miroslav Bajtoš)

 * Enable the context middleware from loopback.rest (Raymond Feng)

 * Add context propagation middleware (Raymond Feng)

 * Changes to JSdoc comments (Rand McKinney)

 * Reorder classes alphabetically in each section (Rand McKinney)

 * common: coding style cleanup (Miroslav Bajtoš)

 * Coding style cleanup (Gruntfile, lib) (Miroslav Bajtoš)

 * Enable jscs for `lib`, fix style violations (Rob Halff)

 * Add access-context.js to API doc (Rand McKinney)

 * Remove doc for debug function (Rand McKinney)

 * Update registry.js (Rand McKinney)

 * Fix the jsdoc for User.login (Raymond Feng)

 * Deleted instantiation of new Change model. This PR removes the instantiation of a new change model as models return from Change.find are already instances of Change. This solves the duplicate Id issue #649 (Berkeley Martinez)

 * Expose path to the built-in favicon file (Miroslav Bajtoš)

 * Add API docs for `loopback.static`. (Miroslav Bajtoš)

 * Add test for `remoting.rest.supportedTypes` (Miroslav Bajtoš)

 * Revert "rest handler options" (Miroslav Bajtoš)

 * REST handler options. (Guilherme Cirne)

 * The elapsed time in milliseconds can be 0 (less than 1 ms) (Raymond Feng)
2014-11-19 11:38:59 -08:00
Raymond Feng 5526402e1c Merge branch 'release/2.8.0' into production 2014-11-19 11:38:58 -08:00
Raymond Feng 503d0144cf v2.8.0 2014-11-19 11:38:56 -08:00
Raymond Feng 62637e87d5 Merge pull request #834 from strongloop/feature/expose-loopback-middleware
Expose more loopback middleware for require
2014-11-19 11:32:57 -08:00
Raymond Feng a9b4df1f2d Expose more loopback middleware for require 2014-11-19 11:32:22 -08:00
Miroslav Bajtoš 1c1e64c09e Merge pull request #837 from strongloop/feature/scope-middleware-to-path
#794 - Scope app middleware to a list of paths
2014-11-19 19:21:34 +01:00
Miroslav Bajtoš c411fb3e40 Merge pull request #813 from strongloop/fix/AccessToken.findForRequest
AccessToken: optional `options` in findForRequest
2014-11-19 19:18:42 +01:00
Miroslav Bajtoš 2baa4b03a3 Scope app middleware to a list of paths
Add a new argument to `app.middleware` allowing developers
to restrict the middleware to a list of paths or regular expresions.

Modify `app.middlewareFromConfig` to pass `config.paths` as the second
arg of `app.middleware`.

Examples:

    // A string path (interpreted via path-to-regexp)
    app.middleware('auth', '/admin', ldapAuth);

    // A regular expression
    app.middleware('initial', /^\/~(admin|root)/, rejectWith404);

    // A list of scopes
    app.middleware('routes', ['/api', /^\/assets/.*\.json$/], foo);

    // From config
    app.middlewareFromConfig(
      handlerFactory,
      {
        phase: 'initial',
        paths: ['/scope', /^\/(a|b)/]
      });
2014-11-19 15:42:54 +01:00
Raymond Feng 768dc4a7b0 Merge pull request #822 from wfgomes/patch-2
Fixing the model attach
2014-11-18 11:08:02 -08:00