Commit Graph

216 Commits

Author SHA1 Message Date
Miroslav Bajtoš 73ee01f27c 2.16.1
* Add back loopback properties like modelBuilder (Miroslav Bajtoš)
2015-04-17 18:35:30 +02:00
Raymond Feng 5158df8790 2.16.0
* Expose the `filter` argument for findById (Raymond Feng)

 * fixed the missing '.' in various description fields. (Edmond Lau)

 * Conflict resolution and Access control (Miroslav Bajtoš)

 * Fix the typo (Raymond Feng)

 * Fix PersistedModel._defineChangeModel (Miroslav Bajtoš)

 * AccessControl for change replication (Miroslav Bajtoš)

 * test: remove global autoAttach (Miroslav Bajtoš)

 * Add support for app level Model isolation (Ritchie Martori)

 * Implement ModelCtor.afterRemoteError (Miroslav Bajtoš)

 * Code cleanup, add Model._runWhenAttachedToApp (Miroslav Bajtoš)

 * Refactor Model and PersistedModel registration (Miroslav Bajtoš)

 * Fix the style issue (Raymond Feng)

 * Add missing error handlers to checkpoints() (Miroslav Bajtoš)

 * Fix where param format (Rand McKinney)

 * Test embedsOne CRUD methods (Fabien Franzen)
2015-04-16 15:13:49 -07:00
Miroslav Bajtoš dd83be99f0 Implement ModelCtor.afterRemoteError 2015-04-03 10:31:03 +02:00
Miroslav Bajtoš 3ef7dedfa4 2.15.0
* Improve error handling in replication (Miroslav Bajtoš)

 * Add `loopback.runInContext` (Miroslav Bajtoš)

 * Fix style issues (Raymond Feng)

 * Document the new third callback arg of replicate() (Miroslav Bajtoš)

 * Fix API doc for updateAll/deleteAll (Miroslav Bajtoš)

 * Import subset of underscore.string scripts only (Miroslav Bajtoš)

 * Use `ctx.instance` provided by "after delete" hook (Miroslav Bajtoš)

 * Add conflict resolution API (Miroslav Bajtoš)

 * Detect 3rd-party changes made during replication (Miroslav Bajtoš)

 * Ability to pass in custom verification token generator This commit adds the ability for the developer to use a custom token generator function for the user.verify(...) method. By default, the system will still use the crypto.randomBytes() method if no option is provided. (jakerella)

 * Remove unnecessary delay in tests. (Miroslav Bajtoš)

 * Update README.md (Simon Ho)

 * Remove duplicate cb func from getRoles and other doc cleanup (crandmck)

 * Enhance the token middleware to support current user literal (Raymond Feng)

 * Handling owner being a relation/function (Benjamin Boudreau)

 * Run replication tests in the browser too (Miroslav Bajtoš)

 * Add replication tests for conflict resolution (Miroslav Bajtoš)

 * Fix an assertion broke by recent chai upgrade. (Miroslav Bajtoš)

 * Static ACL support array of properties now (ulion)

 * Add more integration tests for replication (Miroslav Bajtoš)

 * Prevent more kinds of false replication conflicts (Miroslav Bajtoš)

 * Upgrade deps (Raymond Feng)

 * Fix "Issues" link in readme (Simon Ho)

 * Add more debug logs to replication (Miroslav Bajtoš)

 * Fixes #1158. (Jason Sturges)

 * Checkpoint: start with seq=1 instead of seq=0 (Miroslav Bajtoš)

 * Return new checkpoints in callback of replicate() (Miroslav Bajtoš)

 * Create a remote checkpoint during replication too (Miroslav Bajtoš)

 * Replication: fix checkpoint-related race condition (Miroslav Bajtoš)

 * Support different "since" for source and target (Miroslav Bajtoš)
2015-04-01 18:50:18 +02:00
Miroslav Bajtoš 2aa09ba574 Add `loopback.runInContext`
Refactor the core implementation of current context from
server/middleware/context.js into server/current-context.js.

Expose new public API:
 - loopback.runInContext
 - loopback.createContext
2015-03-27 19:12:17 +01:00
Raymond Feng 2ce1d14a0e Upgrade deps 2015-03-04 16:30:03 -08:00
Raymond Feng b7541c1a7e 2.14.0
* Replace deprecated hooks with Operation hooks (Miroslav Bajtoš)

 * test: don't warn about running deprecated paths (Miroslav Bajtoš)

 * karma conf: prevent timeouts on Travis CI (Miroslav Bajtoš)

 * Pass options from User.login to createAccessToken (Raymond Feng)

 * Config option to disable legacy explorer routes Setting legacyExplorer to false in the loopback config will disable the routes /routes and /models made available in loopback.rest. The deprecate module has been added to the project with a reference added for the legacyExplorer option as it is no longer required by loopback-explorer. Tests added to validate functionality of disabled and enabled legacy explorer routes. (Ron Edgecomb)

 * test: setup GUID for all models tracking changes (Miroslav Bajtoš)

 * Change tracking requires a string id set to GUID (Miroslav Bajtoš)
2015-03-03 11:14:55 -08:00
Miroslav Bajtoš 610767b6c8 Change tracking requires a string id set to GUID
Print a deprecation warning when a persisted model is tracking changes
but does not have a client-generated unique string id property (GUID).
2015-03-02 18:16:18 +01:00
Raymond Feng 19a3fe64e4 2.13.0
* Add a workaround to avoid conflicts with NewRelic (Raymond Feng)

 * Fix "User.confirm" to always call afterRemote hook (Pradnya Baviskar)

 * Skip hashing password if it's already hashed (Raymond Feng)

 * travis.yml: drop 0.11, add 0.12 and iojs (Miroslav Bajtoš)

 * Add docs for settings per #1069 (crandmck)

 * Fix change detection & tracking (Miroslav Bajtoš)

 * Minor doc fix (Ritchie Martori)

 * Upgrade jscs to ~1.11 via grunt-jscs ^1.5 (Miroslav Bajtoš)

 * Remove redundant dev-dep serve-favicon (Miroslav Bajtoš)

 * Fix test broken by recent juggler changes (Miroslav Bajtoš)

 * Fix coding style issue (Raymond Feng)

 * Remove trailing spaces (Raymond Feng)

 * Fix for issue 1099. (zane)

 * Fix API docs per #1041 (crandmck)

 * Fix API docs to add proper callback doc per #1041 (crandmck)

 * Fix #1080 - domain memory leak. (Samuel Reed)

 * Document user settings (Ritchie Martori)

 * Add wiki references to readme (Simon Ho)
2015-02-25 10:24:31 -08:00
Pradnya Baviskar 8766d4a68d Fix "User.confirm" to always call afterRemote hook
Make the "redirect" parameter optional. When the parameter is not
specified, the server responds with an empty response (204). This allows
API clients to call the method without the need to handle redirects
and HTML responses.

Even when the "redirect" parameter is included, the builtin afterRemote
hook still calls next(), so that user-provided afterRemote hooks
are executed too.
2015-02-25 14:20:47 +01:00
Miroslav Bajtoš c2236c393b Upgrade jscs to ~1.11 via grunt-jscs ^1.5 2015-02-20 15:31:15 +01:00
Miroslav Bajtoš 921759838d Remove redundant dev-dep serve-favicon
`serve-favicon` is already a regular dependency.
2015-02-20 13:28:35 +01:00
Miroslav Bajtoš c925e669f7 Fix test broken by recent juggler changes
The patch strongloop/loopback-datasource-juggler#436 changed the way
how `Model.extend` works, which broke one loopback test relying on the
old behaviour.

This commit fixes the failing test. The test is checking now that
the model base was not changed, instead of checking that the base
is undefined.
2015-02-20 13:08:39 +01:00
Raymond Feng 8e8b620930 v2.12.1 2015-02-03 11:14:39 -08:00
Raymond Feng 04670a85f8 v2.12.0 2015-02-03 10:38:29 -08:00
Miroslav Bajtoš 24ef5cd59e v2.11.0 2015-01-27 09:47:41 +01:00
Raymond Feng 41d9bbb7df v2.10.2 2015-01-16 10:33:39 -08:00
Raymond Feng e4dc893383 v2.10.1 2015-01-15 13:57:13 -08:00
Raymond Feng 0fed971e30 v2.10.0 2015-01-07 21:54:11 -08:00
Raymond Feng 47c9147f03 Revert the peer dep change to avoid npm complaints 2015-01-07 21:53:34 -08:00
Raymond Feng 7f381a07d7 Update strong-remoting dep 2015-01-07 14:41:37 -08:00
Raymond Feng 6bde5c8d30 v2.9.0 2015-01-07 14:04:31 -08:00
Raymond Feng 543e640b5a Update juggler dep 2015-01-07 14:04:05 -08:00
Miroslav Bajtoš fc60222569 v2.8.8 2015-01-07 12:08:07 +01:00
Miroslav Bajtoš 3e3a10153d v2.8.7 2015-01-06 08:39:55 +01:00
Ryan Graham da5774c0d6 package: add versioned sl-blip dependency
Resolves strongloop-internal/scrum-nodeops#239
2015-01-05 09:27:35 -08:00
Miroslav Bajtoš 579529ed1d v2.8.6 2014-12-15 19:29:16 +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š 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š cbaf06e63b v2.8.5 2014-12-12 08:57:02 +01:00
Raymond Feng cb2f40bb86 Fix bcrypt issues for browserify 2014-12-08 14:59:21 -08:00
Raymond Feng ca9cd5641f v2.8.4 2014-12-08 11:21:20 -08:00
Miroslav Bajtoš 577e496b29 v2.8.3 2014-12-08 08:07:51 +01:00
Ryan Graham 7c0b2e83eb Remove unused underscore dependency 2014-12-02 21:53:30 -08:00
Miroslav Bajtoš 4ee05df20f v2.8.2 2014-11-27 10:01:11 +01:00
Miroslav Bajtoš d864972bc6 v2.8.1 2014-11-25 11:21:46 +01:00
Raymond Feng 503d0144cf v2.8.0 2014-11-19 11:38:56 -08:00
Raymond Feng a9b4df1f2d Expose more loopback middleware for require 2014-11-19 11:32:22 -08: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
Miroslav Bajtoš c29ace3404 Update chai to ^1.10.0 2014-11-11 11:04:40 +01:00
Miroslav Bajtoš a22474d454 package: fix deps
Move loopback-phase from "devDependencies" to "dependencies".
2014-11-11 08:41:51 +01:00
Miroslav Bajtoš 4e1433b519 Middleware phases - initial implementation
Modify the app and router implementation, so that the middleware is
executed in order defined by phases.

Predefined phases:

    'initial', 'session', 'auth', 'parse', 'routes', 'files', 'final'

Methods defined via `app.use`, `app.route` and friends are executed
as the first thing in 'routes' phase.

API usage:

    app.middleware('initial', compression());
    app.middleware('initial:before', serveFavicon());
    app.middleware('files:after', loopback.urlNotFound());
    app.middleware('final:after', errorHandler());

Middleware flavours:

    // regular handler
    function handler(req, res, next) {
      // do stuff
      next();
    }

    // error handler
    function errorHandler(err, req, res, next) {
      // handle error and/or call next
      next(err);
    }
2014-11-10 19:50:58 +01:00
Raymond Feng 246f38c05d Add context propagation middleware
- Implement the middleware `loopback.context`
 - Inject context into juggler and strong-remoting
 - Make http context optional and default to false
 - Optionally mount context middleware from `loopback.rest`
2014-11-05 09:13:44 +01:00
Rob Halff 33096dafa7 Enable jscs for `lib`, fix style violations 2014-11-04 08:25:33 +01:00
Raymond Feng 04729fdffa Bump version 2014-10-27 09:46:34 -07:00
Miroslav Bajtoš d08e296f48 2.6.0 2014-10-23 13:43:29 +02:00
Ritchie Martori 360063a5d2 2.5.0 2014-10-15 11:57:46 -07:00
Miroslav Bajtoš 59457eef6f 2.4.1 2014-10-10 19:51:52 +02:00
Ritchie Martori b00bce330f 2.4.0 2014-10-01 15:01:13 -07:00
Krishna Raman b5516757ae Move looback remote connector to npm module 2014-10-01 14:48:34 -07:00