Refactors facebook login into oauth generic login Adds additional oauth2 providers adds ability to pass an oAuth validator in the config Adds Twitter validation support + OAuth 1 client Support auth_token instead of access_token for twitter Improves code coverage of OAuth Adds validation of oauth provider structures Better coverage of the OAuth spec 100% coverage of OAuth1.js Adds passing auth_token_secret for Twitter auth. Refactors auth validation methods to include authData parameter - Adds ability to extens oauth validator through configuration - Adds ability to extend oauth validator through external module (file or package) - Adds more tests - Adds tests to login with custom auth provider Adds more tests for REST API fixes twitter auth_token f
34 lines
1.0 KiB
JavaScript
34 lines
1.0 KiB
JavaScript
// A Config object provides information about how a specific app is
|
|
// configured.
|
|
// mount is the URL for the root of the API; includes http, domain, etc.
|
|
function Config(applicationId, mount) {
|
|
var cache = require('./cache');
|
|
var DatabaseAdapter = require('./DatabaseAdapter');
|
|
|
|
var cacheInfo = cache.apps[applicationId];
|
|
this.valid = !!cacheInfo;
|
|
if (!this.valid) {
|
|
return;
|
|
}
|
|
|
|
this.applicationId = applicationId;
|
|
this.collectionPrefix = cacheInfo.collectionPrefix || '';
|
|
this.masterKey = cacheInfo.masterKey;
|
|
this.clientKey = cacheInfo.clientKey;
|
|
this.javascriptKey = cacheInfo.javascriptKey;
|
|
this.dotNetKey = cacheInfo.dotNetKey;
|
|
this.restAPIKey = cacheInfo.restAPIKey;
|
|
this.fileKey = cacheInfo.fileKey;
|
|
this.facebookAppIds = cacheInfo.facebookAppIds;
|
|
this.enableAnonymousUsers = cacheInfo.enableAnonymousUsers;
|
|
|
|
this.database = DatabaseAdapter.getDatabaseConnection(applicationId);
|
|
this.filesController = cacheInfo.filesController;
|
|
|
|
this.oauth = cacheInfo.oauth;
|
|
this.mount = mount;
|
|
}
|
|
|
|
|
|
module.exports = Config;
|