loopback/test
Miroslav Bajtoš c5145bdf34
Add support for scoped access tokens
Define a new property `AccessToken.scopes` to contain the list of
scopes granted to this access token.

Define a new remote method metadata `accessScopes` to contain a list
of scope name required by this method.

Define a special built-in scope name "DEFAULT" that's used when
a method/token does not provide any scopes. This allows access
tokens to grant access to both the default scope and any additional
custom scopes at the same time.

Modify the authorization algorithm to ensure that at least one
of the scopes required by a remote method is allowed by the scopes
granted to the requesting access token.

The "DEFAULT" scope preserve backwards compatibility because existing
remote methods with no `accessScopes` can be accessed by (existing)
access tokens with no `scopes` defined.

Impact on existing applications:

 - Database schema must be updated after upgrading the loopback version

 - If the application was already using a custom `AccessToken.scopes`
   property with a type different from an array, then the relevant code
   must be updated to work with the new type "array of strings".
2017-04-07 13:04:40 +02:00
..
e2e Update eslint to loopback config v5 2016-11-22 14:08:02 +01:00
fixtures fix custom token model in token middleware 2017-03-06 16:10:25 +01:00
helpers Upgrade supertest to 3.x 2017-02-09 16:17:10 +01:00
util Update eslint to loopback config v5 2016-11-22 14:08:02 +01:00
access-control.integration.js Turn on "no-unused-expressions" rule for eslint 2016-11-22 15:30:04 +01:00
access-token.test.js Fix user-literal rewrite for anonymous requests 2017-04-04 16:30:08 +02:00
acl.test.js Add support for scoped access tokens 2017-04-07 13:04:40 +02:00
app.test.js Add new event "remoteMethodAdded" 2017-03-31 15:32:19 +02:00
authorization-scopes.test.js Add support for scoped access tokens 2017-04-07 13:04:40 +02:00
change-stream.test.js Turn on "no-unused-expressions" rule for eslint 2016-11-22 15:30:04 +01:00
change.test.js Allow custom properties of Change Model 2017-03-09 08:58:42 +01:00
checkpoint.test.js Turn on "no-unused-expressions" rule for eslint 2016-11-22 15:30:04 +01:00
context-options.test.js Upgrade supertest to 3.x 2017-02-09 16:17:10 +01:00
data-source.test.js Update eslint to loopback config v5 2016-11-22 14:08:02 +01:00
email.test.js Update eslint to loopback config v5 2016-11-22 14:08:02 +01:00
error-handler.test.js Turn on "no-unused-expressions" rule for eslint 2016-11-22 15:30:04 +01:00
geo-point.test.js Update eslint to loopback config v5 2016-11-22 14:08:02 +01:00
hidden-properties.test.js Update eslint to loopback config v5 2016-11-22 14:08:02 +01:00
integration.test.js Turn on "no-unused-expressions" rule for eslint 2016-11-22 15:30:04 +01:00
karma.conf.js Babelify juggler for Karma tests 2017-02-01 14:00:43 +01:00
key-value-model.test.js Turn on "no-unused-expressions" rule for eslint 2016-11-22 15:30:04 +01:00
loopback.test.js Turn on "no-unused-expressions" rule for eslint 2016-11-22 15:30:04 +01:00
memory.test.js Update eslint to loopback config v5 2016-11-22 14:08:02 +01:00
mocha.opts Use English when running Mocha tests 2017-01-26 10:11:08 +01:00
model.application.test.js Upgrade eslint config and grunt-eslint to latest 2016-12-06 16:05:13 +01:00
model.test.js Add new event "remoteMethodAdded" 2017-03-31 15:32:19 +02:00
multiple-user-principal-types.test.js Fix Role.isOwner() for multiple user models 2017-02-17 11:19:07 +01:00
registries.test.js Turn on "no-unused-expressions" rule for eslint 2016-11-22 15:30:04 +01:00
relations.integration.js Upgrade supertest to 3.x 2017-02-09 16:17:10 +01:00
remote-connector.test.js Contextify DAO and relation methods 2016-12-22 10:26:09 +01:00
remoting-coercion.test.js Update eslint to loopback config v5 2016-11-22 14:08:02 +01:00
remoting.integration.js Contextify DAO and relation methods 2016-12-22 10:26:09 +01:00
replication.rest.test.js Use local registry in test/replication.rest.test 2017-02-24 15:13:06 +01:00
replication.test.js Allow custom properties of Change Model 2017-03-09 08:58:42 +01:00
rest.middleware.test.js Upgrade eslint config and grunt-eslint to latest 2016-12-06 16:05:13 +01:00
role-mapping.test.js Add promise support to built-in model RoleMapping 2017-02-01 09:51:43 +01:00
role.test.js Fix context passing in OWNER role resolver 2017-02-24 12:28:30 +01:00
user.integration.js Add User.changePassword(id, old, new, cb) 2017-03-24 11:01:04 +01:00
user.test.js Add support for scoped access tokens 2017-04-07 13:04:40 +02:00
utils.test.js Optimise replication 2017-02-22 15:12:54 +01:00