Skip to content
Snippets Groups Projects
  1. Sep 14, 2012
  2. Sep 10, 2012
  3. Aug 20, 2012
  4. Aug 16, 2012
  5. Aug 15, 2012
    • Brian Warner's avatar
      Bug #2307: don't expire existing sessions when adding a secondary address · 5f5d8e53
      Brian Warner authored
      If a persona.org account is initially created with a "primary"
      address (meaning an address served by a participating IdP, so
      persona.org is given an assertion from that IdP as proof of ownership),
      the new account will not have a password associated with it. If you then
      add a "secondary" address (meaning an address *not* served by a
      participating IdP, requiring an email challenge to prove ownership), you
      will have to set up a password when you add the secondary. The
      establishment of this password should *not* invalidate any sessions that
      were set up earlier.
      
      In Bug #2307, this manifested as the first browser (in which the
      add-secondary-email operation was started, so it had the old session and
      was waiting for the operation to complete, polling
      /wsapi/email_addition_status all the while) receiving a "400
      Unauthorized" error when the email challenge link was opened in a second
      browser (which thus got a new session).
      
      The test for this effect lives in tests/primary-then-secondary-test.js,
      which need the same 2-second delay as password-update-test.js (to make
      sure that the modified lastPasswordReset time was actually different
      than the previous value, so the session really would be expired).
      5f5d8e53
  6. Aug 11, 2012
  7. Aug 10, 2012
    • Lloyd Hilaiel's avatar
      get_rounds becomes getRounds · 588e329a
      Lloyd Hilaiel authored
      588e329a
    • Brian Warner's avatar
      9e9926a1
    • Brian Warner's avatar
      mysql schema: use TIMESTAMP for lastPasswordReset, not BIGINT · e4ec0a0d
      Brian Warner authored
      Since MySQL TIMESTAMP is quantized to whole seconds, also change tests
      to add a 2s stall before changing the password, to make sure
      lastPasswordReset gets a new value.
      e4ec0a0d
    • Brian Warner's avatar
      wsapi.js: if the DB doesn't have a token, don't enforce equality · 69032e53
      Brian Warner authored
      This honors the preceding comment about not gratuitously expiring
      innocent sessions. Somehow this clause got lost as I was
      merging/rebasing this function.
      69032e53
    • Brian Warner's avatar
      wsapi.js: don't check lastPasswordReset for not-yet-authenticated sessions · 79ead620
      Brian Warner authored
      Specifically this should reduce the work needed by the
      'authenticate_user' call by one DB read.
      79ead620
    • Brian Warner's avatar
    • Brian Warner's avatar
    • Brian Warner's avatar
      update stalled-mysql tests to match new behavior · 866d3e11
      Brian Warner authored
      All wsapi operations now require the database (to update+check the
      superSessionToken), so some tests that previously expected operations to
      succeed without a database now expect them to fail (generally 503).
      
      wsapi_client.js was changed to pass HTTP errors during
      /wsapi/session_context back to the caller, so their response code can be
      checked, rather than throwing an error (and preventing any other
      assertions from being made).
      866d3e11
    • Brian Warner's avatar
      add checkExpiredSession check, set session.superSessionToken, add DB methods · 1b0444d8
      Brian Warner authored
      With this change, existing session cookies are invalidated when the user
      changes their password. This will also support a "log me out of
      everywhere" button, which merely needs to update the superSessionToken
      as if the password was changed.
      
      This adds .superSessionToken to all sessions in
      wsapi.authenticateSession, and checks it against the database row in
      during a new checkExpiredSession() call (run for all /wsapi requests,
      both GETs and POSTs).
      
      All database methods which create an account or modify the password were
      changed to also set .superSessionToken (to the current time).
      updatePassword() added an 'invalidateSessions' argument so passwords can
      be rehashed (when the bcrypt work factor changes) *without* invalidating
      sessions. Finally, the database added a new method named
      superSessionToken() to retrieve the current value, for comparison in
      checkExpiredSession().
      
      wsapi/update_password.js is changed to add a call to authenticateSession
      after changing the password, to update the cookie with the new
      .superSessionToken. This ensures that the user's new session works on
      the next call after update_password.
      
      Database rows that don't have a superSessionToken (created before the
      code was upgraded to include this change) will not enforce
      session-checking, so user sessions will not be spontaneously expired
      when the server is upgraded past this revision.
      1b0444d8
    • Brian Warner's avatar
      authenticate_user: factor out updateHash code · 719ac966
      Brian Warner authored
      After the user is authenticated, we might update the hashed password if
      the bcrypt work factor has been changed. To simplify the code in
      preparation for later changes, this patch extracts the updateHash() code
      out to a separate function.
      
      Note that this function must run *after* the `res.json()` call for two
      reasons. The first is to avoid slowing down the client (send answer
      first, do work later). The second is to get the right session cookie
      into the POST that we send to ourselves (to /wsapi/update_password) that
      does the actual hash updated. The session is updated in
      wsapi.authenticateSession, but the cookie isn't regenerated until the
      call to `res.json()`, and the POST is sneakily grabbing the cookie out
      of the response's Set-Cookie header to copy into the request-to-self.
      719ac966
    • Brian Warner's avatar
      wsapi.authenticateSession: async-ify, combine args into a single 'options' · b473c4dd
      Brian Warner authored
      This includes an error-handling argument to the callback.
      b473c4dd
    • Brian Warner's avatar
      f93964f2
    • Brian Warner's avatar
      wsapi cleanup: factor out checkCSRF() · 49b46fd5
      Brian Warner authored
      49b46fd5
  8. Aug 08, 2012
    • Shane Tomlinson's avatar
      Some cleanup from the bcrypt upgrade to v0.7.1. · 07d25614
      Shane Tomlinson authored
      * Change the last bcrypt.get_rounds to bcrypt.getRounds.
      * Remove the bcrypt require from tests where it is not needed.
      * Remove exports.get_rounds from bcrypt.js, it has been deprecated.
      07d25614
    • Sean McArthur's avatar
      update bcrypt to 0.7.1 · 364003eb
      Sean McArthur authored
      this adds Windows support to bcrypt, as long as you're
      using nodejs >= 0.8.5
      
      fixes deprecation warning since newer bcrypt has new API
      364003eb
  9. Aug 03, 2012
  10. Aug 01, 2012
  11. Jul 31, 2012
  12. Jul 27, 2012
  13. Jul 25, 2012
  14. Jul 24, 2012
  15. Jul 23, 2012
  16. Jul 21, 2012
  17. Jul 20, 2012
  18. Jul 19, 2012
Loading