Modify `app.enableAuth` to automaticaly setup all required models
that are not attached to the app nor a datasource.
Users wishing to use this option must provide the name of the
data-source to use for these models.
Example usage:
var app = loopback();
app.dataSource('db', { connector: 'memory' });
app.enableAuth({ dataSource: 'db' });
app.use(loopback.rest());
app.listen(3000);
When creating an application with a local registry, the default
behaviour is to define only two core models Model & PersistedModel.
The new flag `loadBuiltinModels` modifies this behaviour and instructs
loopback to define all builtin models in the local registry too.
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
* Use the new remoting.authorization hook for check access (Ritchie Martori)
* Define remote methods via model settings/config (Miroslav Bajtoš)
* Pass the full options object to the email send method in user verification process. (Alexandru Savin)
* un-document _findLayerByHandler (Rand McKinney)
* Gruntfile: disable debug & watch for CI builds (Miroslav Bajtoš)
* Update devDependencies to the latest versions (Miroslav Bajtoš)
* Remove trailing whitespace added by 242bcec (Miroslav Bajtoš)
* Update model.js (Rand McKinney)
Process `settings.methods` and `config.methods` as a key-value map
where the key is the method name and the value is an object describing
the method in the format expected by strong-remoting.
Example: a static method `Model.create`
"methods": {
"create": {
"isStatic": true,
"accepts": {
"arg": "data", "type": "Car",
"http": { "source": "body" }
},
"returns": { "arg": "data", "type": "Car", "root": true }
}
}
This patch is based on the code proposed by @mrfelton in #1163.
This fixes the following error on io.js:
Fatal error: Maximum call stack size exceeded
RangeError: Maximum call stack size exceeded
at String.match (native)
at Object.exports.fromSource (node_modules/karma-browserify/node_modules/convert-source-map/index.js:109:19)
at updateSourceMap (node_modules/karma-browserify/lib/bro.js:326:23)
at Browserify.<anonymous> (node_modules/karma-browserify/lib/bro.js:351:9)
at Browserify.g (events.js:257:16)
at emitTwo (events.js:92:20)
at Browserify.emit (events.js:169:7)
at node_modules/karma-browserify/lib/bro.js:263:11
at node_modules/browserify/index.js:758:13
at ConcatStream.<anonymous> (node_modules/browserify/node_modules/concat-stream/index.js:36:43)
This patch fixes the method Model.getApp() that started to report
the following error after b61fae5 was landed:
assert.js:88
throw new assert.AssertionError({
^
AssertionError: undefined == true
at loopback/loopback/lib/model.js:392:7
at EventEmitter.<anonymous> (loopback/loopback/lib/model.js:222:9)
at EventEmitter.g (events.js:257:16)
at emitOne (events.js:77:13)
at EventEmitter.emit (events.js:166:7)
at EventEmitter.app.model (loopback/loopback/lib/application.js:157:9)
Change the type of the "include" argument to "string array".
The type used to be "string" before and thus requests sending multiple
include items were technically incorrect.