* 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š)
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
* 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š)
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.
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.
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.
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)/]
});
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);
}
- 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`