Commit Graph

4238 Commits

Author SHA1 Message Date
Avital Oliver
7c813691f2 Try to fix #2093 2014-04-30 11:55:45 -07:00
Emily Stark
b37fd2af7e Merge branch 'master' into devel 2014-04-30 11:03:19 -07:00
Emily Stark
cb6113170f Generate a fresh secret at end of OAuth, and require that secret on login.
Ensures that only the user who completed the OAuth flow can log in over DDP.
2014-04-30 10:08:16 -07:00
Emily Stark
30b937365f Use Random.id() for meetup state parameter.
For some reason meetup converts underscores to spaces in the state
parameter.
2014-04-29 19:56:11 -07:00
Dan Dascalescu
64e02f2f56 Pass failure message for test.length() 2014-04-29 16:49:48 -07:00
David Glasser
e7f955f809 Fix accidental QUERYING->STEADY transition
Fixes "Exception in defer callback: Error: Phase unexpectedly STEADY"
error
2014-04-29 15:00:55 -07:00
David Glasser
2b8f2cc566 Handle token observe better with overlapping login
Before this, we could see the "non-null user observe" error if:

- One login method ran (eg login) and it called _setLoginToken.
  It stored null in userObservesForConnections and gets to the
  defer/observe part
- Another login method ran (eg getNewToken) and it called
  _setLoginToken. The call to removeTokenFromConnection at the top
  clears the null from userObservesForConnections, and it then
  stores its own null in userObservesForConnections, and defers
- One of them finishes the observe and puts its observe in
  userObservesForConnections, overwriting the null which it thinks
  is its alone
- The other one gets there and throws

Also, consistently use _.has when checking if userObservesForConnections
has an element.
2014-04-29 14:30:34 -07:00
Avital Oliver
9ab335baff Fix consistent id tests on IE8
IE8 doesn't support `func.name`
2014-04-29 13:59:51 -07:00
Emily Stark
31a9b47bc6 Don't set img tags to javascript: URLs in tests in IE.
IE throws an exception if you set an img src to a javascript: URL.
2014-04-28 20:51:49 -07:00
Emily Stark
8b634a96f9 Wait for sub ready on another mongo-livedata test 2014-04-28 16:23:42 -07:00
Avital Oliver
2fdae0f132 Wait for subscription ready on another mongo livedata test 2014-04-28 16:11:53 -07:00
Emily Stark
6ce2c131d3 Fix some mongo-livedata tests 2014-04-28 16:04:50 -07:00
Avital Oliver
5a646fe796 Work towards better mongo-livedata tests.
We should always wait for subscription to be ready
before calling methods if we expect to be able to read
the database within a method callback
2014-04-28 16:03:55 -07:00
Avital Oliver
d45414154d Simplify mongo-livedata id generation tests 2014-04-28 13:54:08 -07:00
Avital Oliver
e48a3e557f Fix IE8 "table assembly" test failure.
We no longer automatically wrap table elements in
a <tbody>.
2014-04-28 12:17:00 -07:00
Avital Oliver
dd7d8fea60 Fix consistent id tests.
We now wait for subscriptions to be ready before calling
methods that affect those collections. Otherwise, when the
callback fires the documents in those collections aren't
guaranteed to be available on the client.
2014-04-25 18:54:52 -07:00
Avital Oliver
e4c17ef07b Isolate consistent id generation tests 2014-04-25 18:50:16 -07:00
David Greenspan
788b5254fb Address Blaze XXXs in History.md 2014-04-24 22:00:20 -07:00
Emily Stark
9b41237f69 One last little tweak to javascript: error message 2014-04-24 18:58:41 -07:00
Emily Stark
ff7fc769d9 Tweak javascript: attribute value error message. 2014-04-24 18:55:54 -07:00
Emily Stark
ef2412dcec Suppress logs on javascript: attribute tests 2014-04-24 17:45:01 -07:00
Emily Stark
6b67cd0449 Catch errors in _storePendingCredential to avoid crashing runner 2014-04-24 16:33:11 -07:00
David Glasser
4777e64336 Don't pass server-generated _id to allow/deny
This lets you still use C.insert from the client but reject arbitrary
client-set _id's (as opposed to _id's generated using the Random.id()
algorithm with a client-determined _id).

If you don't want clients to be able to have any control over the _id at
all for inserts, then you'll have to forbid all direct inserts and use
your own methods which explicitly do `C.insert({_id: Random.id(), ...})`

Note that allow/deny rules with transforms still see an _id, because
transforms need to have (and preserve) _id.  This means that if you
really want to see the server-generated _id, you can just specify an
identity transform for your allow/deny rule.
2014-04-24 14:01:39 -07:00
David Glasser
41b5b95b38 testAsyncMulti: Include block index in failures 2014-04-24 14:01:34 -07:00
Emily Stark
9fb63da3c7 Handle unexpected keys for pending OAuth credentials.
Duplicate keys aren't expected, but in case something weird happens,
just override the previous information associated with that key. We
simply insert nothing for non-string keys (e.g. an OAuth flow with no
`state` parameter, which should never happen normally).
2014-04-24 10:06:39 -07:00
Nick Martin
a496fcab4c one more comment. 2014-04-23 19:37:03 -07:00
Andrew Wilcox
ab08191ac3 Allow validate login hook to override error from beginPasswordExchange
Fixes #2058
2014-04-23 19:37:03 -07:00
Justin SB
47b022841b Generalize reproducible inserted ID generation
For example, calling `insert` inside a method body will now return
consistent IDs on the client and the server, and latency compensation
will work properly instead of producing flicker.

Code that wants a random stream that is consistent between method stub
and real method execution can get one with `DDP.randomStream`.
2014-04-23 16:05:32 -07:00
Avital Oliver
471f09cbce Oops. The test shouldn't throw errors on the server. 2014-04-22 21:39:46 -07:00
Avital Oliver
3ad2a70a03 Truncate HTTP errors at 500 characters, not 180.
I hit this personally with a misconfigured OAuth service and
I couldn't diagnose the problem due to the message being too
short.
2014-04-22 21:29:32 -07:00
David Glasser
a8869d07ec Provide a better error if ROOT_URL is not an URL
Fixes #1404.
2014-04-22 15:52:52 -07:00
Emily Stark
326180ce0a Oauth -> OAuth 2014-04-22 11:44:13 -07:00
Emily Stark
20f2ec4226 Add OAuth token encryption to pending token collections 2014-04-22 11:41:55 -07:00
Emily Stark
55363a9b86 Merge remote-tracking branch 'origin/devel' into awwx-oauth-encryption
Conflicts:
	History.md
	packages/facebook/facebook_client.js
	packages/github/github_client.js
	packages/google/google_client.js
	packages/meetup/meetup_client.js
	packages/meteor-developer/meteor_developer_client.js
	packages/twitter/twitter_client.js
	packages/weibo/weibo_client.js
2014-04-22 11:31:31 -07:00
Emily Stark
739cb078f7 Add a couple more oauth encryption tests 2014-04-22 11:24:06 -07:00
Emily Stark
24e42e715b Remove Meteor._printDecryptionFailures.
We can add it back in if users want it; for now it makes me nervous.
2014-04-22 11:23:34 -07:00
Emily Stark
54f6d3654a Move userId out of AAD and into plaintext.
We want to maintain compatibility with the node crypto module, which
doesn't currently have an interface for specifying AAD.
2014-04-22 10:28:27 -07:00
Emily Stark
93cf643c0f Merge branch 'href-attr-handler' into devel 2014-04-22 09:45:15 -07:00
Emily Stark
c445b57134 Avoid relying on HTMLAnchorElement.protocol; browser support not clear.
Also avoid url.format, since we don't actually need server-side URL
normalization yet and it's not clear what, if any, normalization
url.format does.
2014-04-21 22:11:02 -07:00
Emily Stark
775ff19345 Only update URL attribute values after checking protocol. 2014-04-21 21:56:16 -07:00
Emily Stark
af7aab41b6 Remove unnecessary DOM update in test. 2014-04-21 21:55:59 -07:00
David Glasser
3229f24ad0 Update Twitter configuration instructions again
Also, advise turning on "Sign in with Twitter", which means that users
won't get an authorization question every time they log in.

Fixes #1164.
2014-04-21 19:28:21 -07:00
Emily Stark
b6501d4ebe Merge branch 'master' into devel
Conflicts:
	History.md
	packages/oauth1/oauth1_server.js
2014-04-21 15:29:31 -07:00
Emily Stark
f016894e7b Merge branch 'release-0.8.0.1'
Conflicts:
	docs/.meteor/release
	docs/lib/release-override.js
	examples/clock/.meteor/release
	examples/leaderboard/.meteor/release
	examples/parties/.meteor/release
	examples/todos/.meteor/release
	examples/wordplay/.meteor/release
2014-04-21 15:26:47 -07:00
Emily Stark
3ad1672282 Fix open redirector in oauth1 login flow.
Clients are no longer allowed to specify callback URLs.
2014-04-21 14:26:40 -07:00
David Glasser
8c38550315 Improve error message for pre-config login
Addresses #2048.

An earlier attempt (to wait for the config to load) ran into popup
blockers.

It would be nice to load the config statically with something like
Arunoda's fast-render. That said, even that's not good enough to allow
OAuth logins that bypass the popup blocker that aren't a result of a
user action, and for user actions it's easy enough to gate your login
button on `Accounts.loginServicesConfigured()`.

Longer term solutions include non-popup methods of OAuth login (see
Issue #438).
2014-04-21 13:39:36 -07:00
David Glasser
a251255001 Revert "Meteor.loginWith<External> now waits for config"
This reverts commit 76ded8feb2.
2014-04-21 13:39:36 -07:00
Emily Stark
4c85670676 Check auth_ok before parsing decrypted ciphertext 2014-04-21 11:40:38 -07:00
Emily Stark
a7a21e5365 Add some curly braces 2014-04-21 11:19:03 -07:00
Emily Stark
f8036fc1f4 Check authTag in isSealed 2014-04-21 11:17:37 -07:00