Skip to content

Commit

Permalink
feat: Separate dependencies for socialaccount
Browse files Browse the repository at this point in the history
  • Loading branch information
pennersr committed Apr 7, 2024
1 parent 71823ce commit 8172ea9
Show file tree
Hide file tree
Showing 10 changed files with 59 additions and 15 deletions.
12 changes: 12 additions & 0 deletions ChangeLog.rst
Expand Up @@ -7,6 +7,18 @@ Note worthy changes
- Added a dummy provider, useful for testing purposes: ``allauth.socialaccount.providers.dummy``.


Backwards incompatible changes
------------------------------

- The django-allauth required dependencies are now more fine grained. If you do
not use any of the social account functionality, a `pip install
django-allauth` will, e.g., no longer pull in dependencies for handling
JWT. If you are using social account functionality, install using `pip install
django-allauth[socialaccount]`. That will install the dependencies covering
most common providers. If you are using the Steam provider, install using `pip
install django-allauth[socialaccount,steam]`.


0.61.1 (2024-02-09)
*******************

Expand Down
9 changes: 8 additions & 1 deletion docs/installation/quickstart.rst
@@ -1,10 +1,15 @@
Quickstart
==========

First, Install the python package::
First, install the python package. If you do not need any of the social account
related functionality, install using::

pip install django-allauth

Otherwise, install using::

pip install django-allauth[socialaccount]

Then, assuming you have a Django project up and running, add the following to
the ``settings.py`` of your project::

Expand Down Expand Up @@ -43,6 +48,8 @@ the ``settings.py`` of your project::

'allauth',
'allauth.account',

# Optional -- requires install using `django-allauth[socialacocunt]`.
'allauth.socialaccount',
# ... include the providers you want to enable:
'allauth.socialaccount.providers.agave',
Expand Down
9 changes: 8 additions & 1 deletion docs/socialaccount/introduction.rst
@@ -1,11 +1,18 @@
Introduction
============

A social account is a user account where authentication is delegated to an external identity provider. The ``allauth.socialaccount`` app is responsible for managing social accounts. It supports:
A social account is a user account where authentication is delegated to an
external identity provider. The ``allauth.socialaccount`` app is responsible for
managing social accounts. It supports:

- Connecting one or more social accounts to a local/regular account

- Disconnecting a social account -- requires setting a password if
only the local account remains

- Optional instant-signup for social accounts -- no questions asked

Note that in order to use this functionality you need to install the ``socialaccount``
extras of the ``django-allauth`` package::

pip install django-allauth[socialaccount]
15 changes: 10 additions & 5 deletions docs/socialaccount/providers/openid.rst
@@ -1,11 +1,16 @@
OpenID
------

The OpenID provider does not require any settings per se. However, a typical
OpenID login page presents the user with a predefined list of OpenID providers
and allows the user to input their own OpenID identity URL in case their
provider is not listed by default. The list of providers displayed by the
builtin templates can be configured as follows:
The OpenID provider requires dependencies that are not installed by
default. Install using::

$ pip install django-allauth[socialaccount,openid]

The provider does not require any settings per se. However, a typical OpenID
login page presents the user with a predefined list of OpenID providers and
allows the user to input their own OpenID identity URL in case their provider is
not listed by default. The list of providers displayed by the builtin templates
can be configured as follows:

.. code-block:: python
Expand Down
5 changes: 5 additions & 0 deletions docs/socialaccount/providers/steam.rst
Expand Up @@ -4,6 +4,11 @@ Steam
Steam is an OpenID-compliant provider. However, the `steam` provider allows
access to more of the user's details such as username, full name, avatar, etc.

Its implementation requires dependencies that are not installed by
default. Install using::

$ pip install django-allauth[socialaccount,steam]

You need to register an API key here:
https://steamcommunity.com/dev/apikey

Expand Down
2 changes: 1 addition & 1 deletion examples/react-spa/backend/requirements.txt
@@ -1 +1 @@
django-allauth==0.60.1
django-allauth[mfa,socialaccount]==0.60.1
2 changes: 1 addition & 1 deletion examples/regular-django/README.org
Expand Up @@ -20,7 +20,7 @@ django-allauth example application in this directory:
cd django-allauth/examples/regular-django
virtualenv venv
. venv/bin/activate
pip install "../..[mfa,saml]"
pip install "../..[mfa,saml,socialaccount]"
#+end_src

Now we need to create the database tables and an admin user.
Expand Down
2 changes: 1 addition & 1 deletion examples/regular-django/requirements.txt
@@ -1 +1 @@
django-allauth[mfa,saml]==0.60.1
django-allauth[mfa,saml,socialaccount]==0.60.1
15 changes: 10 additions & 5 deletions setup.cfg
Expand Up @@ -47,15 +47,20 @@ tests_require =
pytest-django >= 4.5.2
install_requires =
Django >= 3.2
python3-openid >= 3.0.8
requests-oauthlib >= 0.3.0
requests >= 2.0.0
pyjwt[crypto] >= 1.7

[options.extras_require]
saml = python3-saml>=1.15.0,<2.0.0
mfa =
qrcode >= 7.0.0
openid =
python3-openid >= 3.0.8
saml =
python3-saml>=1.15.0,<2.0.0
steam =
python3-openid >= 3.0.8
socialaccount =
requests-oauthlib >= 0.3.0
requests >= 2.0.0
pyjwt[crypto] >= 1.7

[options.packages.find]
exclude =
Expand Down
3 changes: 3 additions & 0 deletions tox.ini
Expand Up @@ -29,6 +29,9 @@ deps =
python3-saml>=1.15.0,<2.0.0
extras =
mfa
openid
socialaccount
steam
commands =
coverage run -m pytest {posargs:allauth}
coverage report
Expand Down

0 comments on commit 8172ea9

Please sign in to comment.