Skip to content

Commit

Permalink
More fixes, from the merge of devel into linker.
Browse files Browse the repository at this point in the history
Mostly related to making the big OAuth refactoring linker-friendly.
  • Loading branch information
glasser committed May 28, 2013
1 parent 8a7b1dd commit d757b36
Show file tree
Hide file tree
Showing 21 changed files with 33 additions and 15 deletions.
1 change: 1 addition & 0 deletions packages/accounts-oauth/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.build*
1 change: 1 addition & 0 deletions packages/facebook/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.build*
1 change: 1 addition & 0 deletions packages/github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.build*
1 change: 1 addition & 0 deletions packages/google/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.build*
1 change: 1 addition & 0 deletions packages/meetup/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.build*
1 change: 1 addition & 0 deletions packages/oauth/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.build*
3 changes: 2 additions & 1 deletion packages/oauth/oauth_common.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
Oauth = {};
// @export Oauth
Oauth = {};
11 changes: 6 additions & 5 deletions packages/oauth/oauth_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ Meteor._routePolicy.declare('/_oauth/', 'network');

Oauth._services = {};

// Maps from service version to handler function.
Oauth._requestHandlers = {};


// Register a handler for an OAuth service. The handler will be called
// when we get an incoming http request on /_oauth/{serviceName}. This
Expand Down Expand Up @@ -88,12 +91,10 @@ Oauth._middleware = function (req, res, next) {
// Make sure we're configured
ensureConfigured(serviceName);

if (service.version === 1)
Oauth1._handleRequest(service, req.query, res);
else if (service.version === 2)
Oauth2._handleRequest(service, req.query, res);
else
var handler = Oauth._requestHandlers[service.version];
if (!handler)
throw new Error("Unexpected OAuth version " + service.version);
handler(service, req.query, res);
} catch (err) {
// if we got thrown an error, save it off, it will get passed to
// the approporiate login call (if any) and reported there.
Expand Down
3 changes: 2 additions & 1 deletion packages/oauth/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ Package.describe({

Package.on_use(function (api) {
api.use('routepolicy', 'server');
api.use('service-configuration', 'server');

api.add_files('oauth_common.js', ['client', 'server']);
api.add_files('oauth_client.js', 'client');
api.add_files('oauth_server.js', 'server');
});
});
1 change: 1 addition & 0 deletions packages/oauth1/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.build*
3 changes: 2 additions & 1 deletion packages/oauth1/oauth1_common.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
Oauth1 = {};
// @export Oauth1
Oauth1 = {};
2 changes: 1 addition & 1 deletion packages/oauth1/oauth1_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Oauth1._requestTokens = {};

// connect middleware
Oauth1._handleRequest = function (service, query, res) {
Oauth._requestHandlers['1'] = function (service, query, res) {

var config = ServiceConfiguration.configurations.findOne({service: service.serviceName});
if (!config) {
Expand Down
3 changes: 2 additions & 1 deletion packages/oauth1/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Package.describe({

Package.on_use(function (api) {
api.use('service-configuration', ['client', 'server']);
api.use('oauth', 'client');
api.use('oauth', ['client', 'server']);

api.add_files('oauth1_binding.js', 'server');
api.add_files('oauth1_common.js', ['client', 'server']);
Expand All @@ -17,5 +17,6 @@ Package.on_test(function (api) {
api.use('random');
api.use('service-configuration', 'server');
api.use('oauth1', 'server');
api.use('oauth', 'server');
api.add_files("oauth1_tests.js", 'server');
});
1 change: 1 addition & 0 deletions packages/oauth2/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.build*
2 changes: 1 addition & 1 deletion packages/oauth2/oauth2_common.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Oauth2 = {};
Oauth2 = {};
2 changes: 1 addition & 1 deletion packages/oauth2/oauth2_server.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// connect middleware
Oauth2._handleRequest = function (service, query, res) {
Oauth._requestHandlers['2'] = function (service, query, res) {
// check if user authorized access
if (!query.error) {
// Prepare the login results before returning. This way the
Expand Down
6 changes: 3 additions & 3 deletions packages/oauth2/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ Package.describe({

Package.on_use(function (api) {
api.use('service-configuration', ['client', 'server']);
api.use('oauth', 'client');
api.use('oauth', ['client', 'server']);

api.add_files('oauth2_common.js', ['client', 'server']);
api.add_files('oauth2_server.js', 'server');
});

Package.on_test(function (api) {
api.use('service-configuration', 'server');
api.use('oauth2', 'server');
api.use(['tinytest', 'random', 'oauth2', 'oauth', 'service-configuration'],
'server');
api.add_files("oauth2_tests.js", 'server');
});
2 changes: 2 additions & 0 deletions packages/random/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ Package.describe({

Package.on_use(function (api, where) {
where = where || ['client', 'server'];
api.use('underscore');
api.add_files('random.js', where);
});

Package.on_test(function(api) {
api.use('random');
api.use('tinytest');
api.add_files('random_tests.js', ['client', 'server']);
});
1 change: 1 addition & 0 deletions packages/service-configuration/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.build*
1 change: 1 addition & 0 deletions packages/twitter/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.build*
1 change: 1 addition & 0 deletions packages/weibo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.build*

0 comments on commit d757b36

Please sign in to comment.