Skip to content

Commit 411e177

Browse files
authored
Update allauth (#11327)
* Update allauth * Delete more stuff * More template changes * Disable rate limits in tests * Revert * Use newer version * Install sphinx testing dependencies * Fix tests
1 parent 5ff3d10 commit 411e177

File tree

14 files changed

+30
-60
lines changed

14 files changed

+30
-60
lines changed

readthedocs/oauth/services/gitlab.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class GitLabService(Service):
3535
# Just use the network location to determine if it's a GitLab project
3636
# because private repos have another base url, eg. [email protected]
3737
url_pattern = re.compile(
38-
re.escape(urlparse(adapter.provider_base_url).netloc),
38+
re.escape(urlparse(adapter.provider_default_url).netloc),
3939
)
4040

4141
PERMISSION_NO_ACCESS = 0
@@ -73,7 +73,7 @@ def sync_repositories(self):
7373
remote_repositories = []
7474
try:
7575
repos = self.paginate(
76-
"{url}/api/v4/projects".format(url=self.adapter.provider_base_url),
76+
"{url}/api/v4/projects".format(url=self.adapter.provider_default_url),
7777
per_page=100,
7878
archived=False,
7979
order_by="path",
@@ -100,7 +100,7 @@ def sync_organizations(self):
100100

101101
try:
102102
orgs = self.paginate(
103-
"{url}/api/v4/groups".format(url=self.adapter.provider_base_url),
103+
"{url}/api/v4/groups".format(url=self.adapter.provider_default_url),
104104
per_page=100,
105105
all_available=False,
106106
order_by="path",
@@ -110,7 +110,7 @@ def sync_organizations(self):
110110
remote_organization = self.create_organization(org)
111111
org_repos = self.paginate(
112112
"{url}/api/v4/groups/{id}/projects".format(
113-
url=self.adapter.provider_base_url,
113+
url=self.adapter.provider_default_url,
114114
id=org["id"],
115115
),
116116
per_page=100,
@@ -131,7 +131,7 @@ def sync_organizations(self):
131131
# which contains the admin permission fields.
132132
resp = self.get_session().get(
133133
"{url}/api/v4/projects/{id}".format(
134-
url=self.adapter.provider_base_url, id=repo["id"]
134+
url=self.adapter.provider_default_url, id=repo["id"]
135135
)
136136
)
137137

@@ -270,7 +270,7 @@ def create_organization(self, fields):
270270
organization.name = fields.get("name")
271271
organization.slug = fields.get("path")
272272
organization.url = "{url}/{path}".format(
273-
url=self.adapter.provider_base_url,
273+
url=self.adapter.provider_default_url,
274274
path=fields.get("path"),
275275
)
276276
organization.avatar_url = fields.get("avatar_url")
@@ -336,7 +336,7 @@ def get_provider_data(self, project, integration):
336336
try:
337337
resp = session.get(
338338
"{url}/api/v4/projects/{repo_id}/hooks".format(
339-
url=self.adapter.provider_base_url,
339+
url=self.adapter.provider_default_url,
340340
repo_id=repo_id,
341341
),
342342
)
@@ -383,7 +383,7 @@ def setup_webhook(self, project, integration=None):
383383
)
384384

385385
repo_id = self._get_repo_id(project)
386-
url = f"{self.adapter.provider_base_url}/api/v4/projects/{repo_id}/hooks"
386+
url = f"{self.adapter.provider_default_url}/api/v4/projects/{repo_id}/hooks"
387387

388388
if repo_id is None:
389389
return (False, resp)
@@ -462,7 +462,7 @@ def update_webhook(self, project, integration):
462462
hook_id = provider_data.get("id")
463463
resp = session.put(
464464
"{url}/api/v4/projects/{repo_id}/hooks/{hook_id}".format(
465-
url=self.adapter.provider_base_url,
465+
url=self.adapter.provider_default_url,
466466
repo_id=repo_id,
467467
hook_id=hook_id,
468468
),
@@ -537,7 +537,7 @@ def send_build_status(self, build, commit, status):
537537
"description": description,
538538
"context": context,
539539
}
540-
url = f"{self.adapter.provider_base_url}/api/v4/projects/{repo_id}/statuses/{commit}"
540+
url = f"{self.adapter.provider_default_url}/api/v4/projects/{repo_id}/statuses/{commit}"
541541

542542
log.bind(
543543
project_slug=project.slug,

readthedocs/rtd_tests/tests/test_celery.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def test_send_build_status_no_remote_repo_or_social_account_github(
149149
notification.format_values,
150150
{
151151
"provider_name": "GitHub",
152-
"url_connect_account": "/accounts/social/connections/",
152+
"url_connect_account": "/accounts/3rdparty/",
153153
},
154154
)
155155

@@ -222,6 +222,6 @@ def test_send_build_status_no_remote_repo_or_social_account_gitlab(
222222
notification.format_values,
223223
{
224224
"provider_name": "GitLab",
225-
"url_connect_account": "/accounts/social/connections/",
225+
"url_connect_account": "/accounts/3rdparty/",
226226
},
227227
)

readthedocs/settings/base.py

-7
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,6 @@ def INSTALLED_APPS(self): # noqa
285285
"allauth.socialaccount",
286286
"allauth.socialaccount.providers.github",
287287
"allauth.socialaccount.providers.gitlab",
288-
"allauth.socialaccount.providers.bitbucket",
289288
"allauth.socialaccount.providers.bitbucket_oauth2",
290289
"cacheops",
291290
]
@@ -698,12 +697,6 @@ def DOCKER_LIMITS(self):
698697
],
699698
# Bitbucket scope/permissions are determined by the Oauth consumer setup on bitbucket.org.
700699
},
701-
# Deprecated, we use `bitbucket_oauth2` for all new connections.
702-
"bitbucket": {
703-
"APPS": [
704-
{"client_id": "123", "secret": "456", "key": ""},
705-
],
706-
},
707700
}
708701

709702
@property

readthedocs/templates/account/login.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% extends "account/base.html" %}
1+
{% extends "account/base_entrance.html" %}
22

33
{% load i18n %}
44
{% load account %}

readthedocs/templates/account/signup.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% extends "account/base.html" %}
1+
{% extends "account/base_entrance.html" %}
22

33
{% load i18n %}
44

readthedocs/templates/socialaccount/authentication_error.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% extends "socialaccount/base.html" %}
1+
{% extends "socialaccount/base_entrance.html" %}
22

33
{% load i18n %}
44

readthedocs/templates/socialaccount/snippets/provider_list.html

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@
66
{% for provider in socialaccount_providers %}
77
{% comment %}
88
- OpenID is not implemented.
9-
- Bitbucket is deprecated (in favor of their new oauth implementation).
109
- SAML is handled in another view, we don't want to list all SAML integrations here.
1110
{% endcomment %}
12-
{% if provider.id != 'bitbucket' and provider.id != 'saml' %}
11+
{% if provider.id != 'saml' %}
1312
{% if allowed_providers and provider.id in allowed_providers or not allowed_providers %}
1413
<li>
1514
<form action="{% provider_login_url provider.id process=process scope=scope auth_params=auth_params next=next %}" method="post">

requirements/deploy.txt

+1-9
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,6 @@ cssselect==1.2.0
9090
# pyquery
9191
decorator==5.1.1
9292
# via ipython
93-
defusedxml==0.7.1
94-
# via
95-
# -r requirements/pip.txt
96-
# python3-openid
9793
distlib==0.3.8
9894
# via
9995
# -r requirements/pip.txt
@@ -124,7 +120,7 @@ django==4.2.13
124120
# django-timezone-field
125121
# djangorestframework
126122
# jsonfield
127-
django-allauth[saml]==0.57.2
123+
django-allauth[saml,socialaccount]==0.63.1
128124
# via -r requirements/pip.txt
129125
django-annoying==0.10.6
130126
# via -r requirements/pip.txt
@@ -320,10 +316,6 @@ python-dateutil==2.9.0.post0
320316
# botocore
321317
# elasticsearch-dsl
322318
# python-crontab
323-
python3-openid==3.2.0
324-
# via
325-
# -r requirements/pip.txt
326-
# django-allauth
327319
python3-saml==1.16.0
328320
# via
329321
# -r requirements/pip.txt

requirements/docker.txt

+1-9
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,6 @@ decorator==5.1.1
100100
# via
101101
# ipdb
102102
# ipython
103-
defusedxml==0.7.1
104-
# via
105-
# -r requirements/pip.txt
106-
# python3-openid
107103
distlib==0.3.8
108104
# via
109105
# -r requirements/pip.txt
@@ -134,7 +130,7 @@ django==4.2.13
134130
# django-timezone-field
135131
# djangorestframework
136132
# jsonfield
137-
django-allauth[saml]==0.57.2
133+
django-allauth[saml,socialaccount]==0.63.1
138134
# via -r requirements/pip.txt
139135
django-annoying==0.10.6
140136
# via -r requirements/pip.txt
@@ -352,10 +348,6 @@ python-dateutil==2.9.0.post0
352348
# botocore
353349
# elasticsearch-dsl
354350
# python-crontab
355-
python3-openid==3.2.0
356-
# via
357-
# -r requirements/pip.txt
358-
# django-allauth
359351
python3-saml==1.16.0
360352
# via
361353
# -r requirements/pip.txt

requirements/pip.in

+1-3
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,7 @@ django-celery-beat
8282
# TODO: remove this dependency once we upgrade Celery. It should auto-install it.
8383
tzdata
8484

85-
# 0.58.0 refactored the built-in templates,
86-
# we need to check if we need to update our custom templates.
87-
django-allauth[saml]==0.57.2
85+
django-allauth[socialaccount,saml]==0.63.1
8886

8987
requests-oauthlib
9088

requirements/pip.txt

+1-5
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ cryptography==42.0.7
5555
# via pyjwt
5656
cssselect==1.2.0
5757
# via pyquery
58-
defusedxml==0.7.1
59-
# via python3-openid
6058
distlib==0.3.8
6159
# via virtualenv
6260
dj-pagination==2.5.0
@@ -85,7 +83,7 @@ django==4.2.13
8583
# django-timezone-field
8684
# djangorestframework
8785
# jsonfield
88-
django-allauth[saml]==0.57.2
86+
django-allauth[saml,socialaccount]==0.63.1
8987
# via -r requirements/pip.in
9088
django-annoying==0.10.6
9189
# via -r requirements/pip.in
@@ -226,8 +224,6 @@ python-dateutil==2.9.0.post0
226224
# botocore
227225
# elasticsearch-dsl
228226
# python-crontab
229-
python3-openid==3.2.0
230-
# via django-allauth
231227
python3-saml==1.16.0
232228
# via django-allauth
233229
pytz==2024.1

requirements/testing.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
-r pip.txt
44

5-
sphinx
5+
sphinx[test]
66
django-dynamic-fixture
77
pytest
88
pytest-custom-exit-code

requirements/testing.txt

+9-9
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,10 @@ cssselect==1.2.0
9191
# via
9292
# -r requirements/pip.txt
9393
# pyquery
94+
cython==3.0.10
95+
# via sphinx
9496
defusedxml==0.7.1
95-
# via
96-
# -r requirements/pip.txt
97-
# python3-openid
97+
# via sphinx
9898
distlib==0.3.8
9999
# via
100100
# -r requirements/pip.txt
@@ -125,7 +125,7 @@ django==4.2.13
125125
# django-timezone-field
126126
# djangorestframework
127127
# jsonfield
128-
django-allauth[saml]==0.57.2
128+
django-allauth[saml,socialaccount]==0.63.1
129129
# via -r requirements/pip.txt
130130
django-annoying==0.10.6
131131
# via -r requirements/pip.txt
@@ -317,6 +317,7 @@ pytest==8.2.0
317317
# pytest-custom-exit-code
318318
# pytest-django
319319
# pytest-mock
320+
# sphinx
320321
pytest-cov==5.0.0
321322
# via -r requirements/testing.in
322323
pytest-custom-exit-code==0.3.0
@@ -335,10 +336,6 @@ python-dateutil==2.9.0.post0
335336
# botocore
336337
# elasticsearch-dsl
337338
# python-crontab
338-
python3-openid==3.2.0
339-
# via
340-
# -r requirements/pip.txt
341-
# django-allauth
342339
python3-saml==1.16.0
343340
# via
344341
# -r requirements/pip.txt
@@ -396,7 +393,7 @@ slumber==0.7.1
396393
# via -r requirements/pip.txt
397394
snowballstemmer==2.2.0
398395
# via sphinx
399-
sphinx==7.3.7
396+
sphinx[test]==7.3.7
400397
# via -r requirements/testing.in
401398
sphinxcontrib-applehelp==1.0.8
402399
# via sphinx
@@ -483,3 +480,6 @@ xmlsec==1.3.14
483480
# python3-saml
484481
yamale==2.2.0
485482
# via -r requirements/testing.in
483+
484+
# The following packages are considered to be unsafe in a requirements file:
485+
# setuptools

0 commit comments

Comments
 (0)