Skip to content

Commit 0f04b46

Browse files
authored
Requirements: update django-allauth (#9249)
\### 0.43.0 > In previous versions, the allauth app included a base.html template. This > template could conflict with an equally named template at project level. > Therefore, base.html has now been moved to account/base.html -- you will need > to check your templates and likely override account/base.html within your > project. We include our own base.html template, in order to make the allauth templates use our base template I have added a an account/base.html file that just extends from base.html. \### 0.44.0 > The certificate key part of the SOCIALACCOUNT_PROVIDERS configuration has been > renamed to certificate_key. This is done to prevent the key from being > displayed without being masked in Django debug pages. We don't use that field nor we access it from our application. \### 0.47.0 > Added a new setting SOCIALACCOUNT_LOGIN_ON_GET that controls whether or not the > endpoints for initiating a social login (for example, > "/accounts/google/login/") require a POST request to initiate the handshake. As > requiring a POST is more secure, the default of this new setting is False. This adds one more step for users before signing in with an external provider. > You are about to sign in using a third party account from GitHub. > [ Continue ] I have changed our list to be a form, so it stil is just a click away from our platform, but a link from outside will require the user to click on "continue". We can just set this setting to True if we want too (but there is a security notice that explains why isn't a good idea https://github.com/pennersr/django-allauth/blob/master/ChangeLog.rst#security-notice) \### 0.48.0 > The newly introduced ACCOUNT_PREVENT_ENUMERATION defaults to True impacting the > current behavior of the password reset flow. We want that. > The newly introduced rate limitting is by default turned on. You will need to > provide a 429.html template. We want this, I have added a 429.html template :) > The default of SOCIALACCOUNT_STORE_TOKENS has been changed to False. Rationale > is that storing sensitive information should be opt in, not opt out. If you > were relying on this functionality without having it explicitly turned on, > please add it to your settings.py. We rely on this, I have set it to true. \### 0.49.0 > Changed naming of internal_reset_url_key attribute in > allauth.account.views.PasswordResetFromKeyView to reset_url_key. We don't override this view. Closes #9122
1 parent 7426a47 commit 0f04b46

File tree

9 files changed

+62
-30
lines changed

9 files changed

+62
-30
lines changed

media/css/core.css

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -835,18 +835,25 @@ div.project-import-remote button.remote-sync:before {
835835
content: "\f021";
836836
}
837837

838-
a.socialaccount-provider.github:before {
838+
button.socialaccount-provider {
839+
padding: 6px 10px 6px 10px;
840+
font-size: 16px;
841+
margin: 10px 5px 10px 0px;
842+
line-height: 24px;
843+
}
844+
845+
button.socialaccount-provider.github:before {
839846
font-family: FontAwesome;
840847
content: "\f09b";
841848
}
842849

843-
a.socialaccount-provider.gitlab:before {
850+
button.socialaccount-provider.gitlab:before {
844851
font-family: FontAwesome;
845852
content: "\f296";
846853
}
847854

848-
a.socialaccount-provider.bitbucket:before,
849-
a.socialaccount-provider.bitbucket_oauth2:before {
855+
button.socialaccount-provider.bitbucket:before,
856+
button.socialaccount-provider.bitbucket_oauth2:before {
850857
font-family: FontAwesome;
851858
content: "\f171";
852859
}

readthedocs/projects/static-src/projects/css/import.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ div.project-import-remote {
7171
overflow: auto;
7272
text-align: center;
7373

74-
a.socialaccount-provider {
74+
button.socialaccount-provider {
7575
float: none;
7676
display: inline-block;
7777
margin-bottom: 0.5em;

readthedocs/projects/static/projects/css/import.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ div.project-import-remote ul.socialaccount_providers li {
6060
overflow: auto;
6161
text-align: center;
6262
}
63-
div.project-import-remote ul.socialaccount_providers li a.socialaccount-provider {
63+
div.project-import-remote ul.socialaccount_providers li button.socialaccount-provider {
6464
float: none;
6565
display: inline-block;
6666
margin-bottom: 0.5em;

readthedocs/settings/base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,7 @@ def DOCKER_LIMITS(self):
637637
ACCOUNT_AUTHENTICATION_METHOD = 'username_email'
638638
ACCOUNT_ACTIVATION_DAYS = 7
639639
SOCIALACCOUNT_AUTO_SIGNUP = False
640+
SOCIALACCOUNT_STORE_TOKENS = True
640641
SOCIALACCOUNT_PROVIDERS = {
641642
'github': {
642643
'SCOPE': [

readthedocs/templates/429.html

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{% extends "base.html" %}
2+
{% load core_tags %}
3+
{% load i18n %}
4+
5+
{% block title %}
6+
{% trans "Too many requests" %}
7+
{% endblock %}
8+
9+
{% block header-wrapper %}
10+
{% include "error_header.html" %}
11+
{% endblock %}
12+
13+
{% block notify %}{% endblock %}
14+
15+
{# Hide the language select form so we don't set a CSRF cookie #}
16+
{% block language-select-form %}{% endblock %}
17+
18+
{% block content %}
19+
<pre style="line-height: 1.25; white-space: pre;">
20+
.--~~,__
21+
:-....,-------`~~'._.'
22+
`-,,, ,_ ;'~U'
23+
_,-' ,'`-__; '--.
24+
(_/'~~ ''''(;
25+
26+
Too many requests! Try again in a bit.
27+
</pre>
28+
{% endblock %}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{% extends "base.html" %}

readthedocs/templates/socialaccount/snippets/provider_list.html

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,30 @@
77
{% if provider.id == "openid" %}
88
{% for brand in provider.get_brands %}
99
<li>
10-
<a title="{{ brand.name }}"
11-
class="socialaccount-provider {{ provider.id }} {{ brand.id }} button"
12-
href="{% provider_login_url provider.id openid=brand.openid_url process=process next=next %}"
13-
>
14-
{% blocktrans trimmed with brand_name=brand.name verbiage=verbiage|default:'Connect to' %}
15-
{{ verbiage }} {{ brand_name }}
16-
{% endblocktrans %}
17-
</a>
10+
<form action="{% provider_login_url provider.id openid=brand.openid_url process=process next=next %}" method="post">
11+
{% csrf_token %}
12+
<button
13+
class="socialaccount-provider {{ provider.id }} {{ brand.id }} button"
14+
type="submit"
15+
title="{{ brand.name }}">
16+
{% trans verbiage|default:'Connect to' %} {{ brand.name }}
17+
</button>
18+
</form>
1819
</li>
1920
{% endfor %}
2021
{% endif %}
2122
{% if provider.id != 'bitbucket' %}
2223
{% if allowed_providers and provider.id in allowed_providers or not allowed_providers %}
2324
<li>
24-
<a title="{{ provider.name }}"
25-
class="socialaccount-provider {{ provider.id }} button"
26-
href="{% provider_login_url provider.id process=process scope=scope auth_params=auth_params next=next %}"
27-
>
28-
{% blocktrans trimmed with provider_name=provider.name verbiage=verbiage|default:'Connect to' %}
29-
{{ verbiage }} {{ provider_name }}
30-
{% endblocktrans %}
31-
</a>
25+
<form action="{% provider_login_url provider.id process=process scope=scope auth_params=auth_params next=next %}" method="post">
26+
{% csrf_token %}
27+
<button
28+
class="socialaccount-provider {{ provider.id }} button"
29+
type="submit"
30+
title="{{ provider.name }}">
31+
{% trans verbiage|default:'Connect to' %} {{ provider.name }}
32+
</button>
33+
</form>
3234
</li>
3335
{% endif %}
3436
{% endif %}

requirements/pip.txt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,7 @@ redis==3.5.3 # pyup: ignore
4040

4141
celery==5.2.6
4242

43-
# When upgrading to 0.43.0 we should double check the ``base.html`` change
44-
# described in the changelog. In previous versions, the allauth app included a
45-
# ``base.html`` template. This template could conflict with an equally named
46-
# template at project level. Therefore, ``base.html`` has now been moved to
47-
# ``account/base.html`` -- you will need to check your templates and likely
48-
# override ``account/base.html`` within your project.
49-
django-allauth==0.42.0 # pyup: ignore
43+
django-allauth==0.50.0
5044
requests-oauthlib==1.3.1
5145

5246
GitPython==3.1.27

tox.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ setenv =
1111
LANG=en_US.UTF-8
1212
LC_ALL=en_US.UTF-8
1313
DJANGO_SETTINGS_SKIP_LOCAL=True
14-
VIRTUALENV_SETUPTOOLS=58.3.0
1514
passenv = CI TRAVIS TRAVIS_* HOME
1615
deps =
1716
-r requirements/testing.txt

0 commit comments

Comments
 (0)