Mercurial > kallithea
annotate .hgignore @ 5457:f629e9a0c376
auth: secure password reset implementation
This is a better implementation of password reset function, which
doesn't involve sending a new password to the user's email address
in clear text, and at the same time is stateless.
The old implementation generated a new password and sent it
in clear text to whatever email assigned to the user currently,
so that any user, possibly unauthenticated, could request a reset
for any username or email. Apart from potential insecurity, this
made it possible for anyone to disrupt users' workflow by repeatedly
resetting their passwords.
The idea behind this implementation is to generate
an authentication token which is dependent on the user state
at the time before the password change takes place, so the token
is one-time and can't be reused, and also to bind the token to
the browser session.
The token is calculated as SHA1 hash of the following:
* user's identifier (number, not a name)
* timestamp
* hashed user's password
* session identifier
* per-application secret
We use numeric user's identifier, as it's fixed and doesn't change,
so renaming users doesn't affect the mechanism. Timestamp is added
to make it possible to limit the token's validness (currently hard
coded to 24h), and we don't want users to be able to fake that field
easily. Hashed user's password is needed to prevent using the token
again once the password has been changed. Session identifier is
an additional security measure to ensure someone else stealing the
token can't use it. Finally, per-application secret is just another
way to make it harder for an attacker to guess all values in an
attempt to generate a valid token.
When the token is generated, an anonymous user is directed to a
confirmation page where the timestamp and the usernames are already
preloaded, so the user needs to specify the token. User can either
click the link in the email if it's really them reading it, or to type
the token manually.
Using the right token in the same session as it was requested directs
the user to a password change form, where the user is supposed to
specify a new password (twice, of course). Upon completing the form
(which is POSTed) the password change happens and a notification
mail is sent.
The test is updated to test the basic functionality with a bad and
a good token, but it doesn't (yet) cover all code paths.
The original work from Andrew has been thorougly reviewed and heavily
modified by Søren Løvborg.
author | Andrew Shadura <andrew@shadura.me> |
---|---|
date | Sun, 17 May 2015 02:07:18 +0200 |
parents | 19267f233d39 |
children | bfa66e8887d7 |
rev | line source |
---|---|
848
a555d8345105
Small hgignore update
Lukasz Balcerzak <lukasz.balcerzak@python-center.org>
parents:
554
diff
changeset
|
1 syntax: glob |
a555d8345105
Small hgignore update
Lukasz Balcerzak <lukasz.balcerzak@python-center.org>
parents:
554
diff
changeset
|
2 *.pyc |
a555d8345105
Small hgignore update
Lukasz Balcerzak <lukasz.balcerzak@python-center.org>
parents:
554
diff
changeset
|
3 *.swp |
1971
3dd89d30cd28
ignore sqlite files
Marcin Kuzminski <marcin@python-works.com>
parents:
1893
diff
changeset
|
4 *.sqlite |
2555
b5c57e2176dc
ignore tox stuff
Marcin Kuzminski <marcin@python-works.com>
parents:
2379
diff
changeset
|
5 *.tox |
1236
a28bd9cb6549
added egg-info,and .egg in hgignore
Marcin Kuzminski <marcin@python-works.com>
parents:
848
diff
changeset
|
6 *.egg-info |
a28bd9cb6549
added egg-info,and .egg in hgignore
Marcin Kuzminski <marcin@python-works.com>
parents:
848
diff
changeset
|
7 *.egg |
4986
7d6c4bd58abd
i18n: don't include .mo files in the repo - build them on demand
Mads Kiilerich <madski@unity3d.com>
parents:
4902
diff
changeset
|
8 *.mo |
4997
9885bbacf99c
.hgignore: Add .eggs/ and tarballcache/
Marc Abramowitz <marc@marc-abramowitz.com>
parents:
4986
diff
changeset
|
9 .eggs/ |
9885bbacf99c
.hgignore: Add .eggs/ and tarballcache/
Marc Abramowitz <marc@marc-abramowitz.com>
parents:
4986
diff
changeset
|
10 tarballcache/ |
0 | 11 |
12 syntax: regexp | |
2106
95f1ed68cac1
ignore rcextensions
Marcin Kuzminski <marcin@python-works.com>
parents:
2007
diff
changeset
|
13 ^rcextensions |
848
a555d8345105
Small hgignore update
Lukasz Balcerzak <lukasz.balcerzak@python-center.org>
parents:
554
diff
changeset
|
14 ^build |
4096
9496c047ea4d
added dist dir to .hgignore
Marcin Kuzminski <marcin@python-works.com>
parents:
3960
diff
changeset
|
15 ^dist/ |
848
a555d8345105
Small hgignore update
Lukasz Balcerzak <lukasz.balcerzak@python-center.org>
parents:
554
diff
changeset
|
16 ^docs/build/ |
a555d8345105
Small hgignore update
Lukasz Balcerzak <lukasz.balcerzak@python-center.org>
parents:
554
diff
changeset
|
17 ^docs/_build/ |
9 | 18 ^data$ |
5416
19267f233d39
tests: move test.ini to kallithea/tests/
Mads Kiilerich <madski@unity3d.com>
parents:
4997
diff
changeset
|
19 ^kallithea/tests/data$ |
3908
b619d9eef67a
ignore sql_dumps for testing schema migrations
Marcin Kuzminski <marcin@python-works.com>
parents:
3831
diff
changeset
|
20 ^sql_dumps/ |
9 | 21 ^\.settings$ |
22 ^\.project$ | |
72 | 23 ^\.pydevproject$ |
1893
27c8836e6356
ignore coverage and my local dev.ini file
Marcin Kuzminski <marcin@python-works.com>
parents:
1833
diff
changeset
|
24 ^\.coverage$ |
4210
277684f23146
Rename some strings in defaults found in config files
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
4181
diff
changeset
|
25 ^kallithea\.db$ |
460 | 26 ^test\.db$ |
4212
24c0d584ba86
General renaming to Kallithea
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
4210
diff
changeset
|
27 ^Kallithea\.egg-info$ |
4902 | 28 ^my\.ini$ |
2007
324ac367a4da
Added VCS into rhodecode core for faster and easier deployments of new versions
Marcin Kuzminski <marcin@python-works.com>
parents:
1971
diff
changeset
|
29 ^fabfile.py |
3831
bd39c1f70e35
Updated hgignore to skip .idea config files
Marcin Kuzminski <marcin@python-works.com>
parents:
3051
diff
changeset
|
30 ^\.idea$ |