GraphQL integration for AllianceAuth
Project description
allianceauth-graphql
GraphQL integration for AllianceAuth
Free software: GNU General Public License v3
This version is in alpha, please open an issue if you face any bug.
Setup
The following is assuming you have a functioning AllianceAuth installation.
Install plugin
-
pip install allianceauth-graphql
. -
Add the following apps to the bottom of your
INSTALLED_APPS
in the local.py settings file:'allianceauth_graphql', 'graphene_django', "graphql_jwt.refresh_token.apps.RefreshTokenConfig",
-
Add the following settings to your local.py file:
from datetime import timedelta # ... GRAPHENE = { 'SCHEMA': 'allianceauth_graphql.schema.schema', "MIDDLEWARE": [ "graphql_jwt.middleware.JSONWebTokenMiddleware", ], } AUTHENTICATION_BACKENDS += [ "graphql_jwt.backends.JSONWebTokenBackend", ] GRAPHQL_JWT = { "JWT_VERIFY_EXPIRATION": True, "JWT_LONG_RUNNING_REFRESH_TOKEN": True, "JWT_EXPIRATION_DELTA": timedelta(days=1), "JWT_REFRESH_EXPIRATION_DELTA": timedelta(days=7), }
Feel free to edit the expiration limits of your tokens.
-
Edit your projects url.py file:
It should looks something like this
from django.conf.urls import include, url from allianceauth import urls urlpatterns = [ url(r'', include(urls)), ] handler500 = 'allianceauth.views.Generic500Redirect' handler404 = 'allianceauth.views.Generic404Redirect' handler403 = 'allianceauth.views.Generic403Redirect' handler400 = 'allianceauth.views.Generic400Redirect'
After the edit:
from django.conf.urls import include, url from allianceauth import urls from allianceauth_graphql import urls as aa_gql_urls urlpatterns = [ url(r'', include(urls)), url(r'graphql/', include(aa_gql_urls)), ] handler500 = 'allianceauth.views.Generic500Redirect' handler404 = 'allianceauth.views.Generic404Redirect' handler403 = 'allianceauth.views.Generic403Redirect' handler400 = 'allianceauth.views.Generic400Redirect'
-
Run migrations.
-
If you have
SHOW_GRAPHIQL
setting set toTrue
(see below), run collectstatics -
Restart AllianceAuth.
Community Creations Integration
Currently the package supports the integration with the following community packages:
- allianceauth-pve
To install the dependencies needed, run pip install allianceauth-graphql[package1,package2]
for all the packages you want to integrate.
Settings
Setting | Default | Description |
---|---|---|
SHOW_GRAPHIQL | True |
Shows the graphiql UI in the browser |
GRAPHQL_LOGIN_SCOPES | ['publicData'] |
Tokens needed. Unlike AllianceAuth pages, you need to login with the scopes you'll use, otherwise you won't be able to perform some queries |
REDIRECT_SITE | No default | The URL domain for redirecting after email verification. It has to have the protocol and not the slash at the end: http(s)://<yoursite> |
REDIRECT_PATH | /registration/callback/ |
Path to append to REDIRECT_SITE for building the redirect URL |
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
History
v0.5.2
- Support for allianceauth-pve v0.3.0
v0.5.1
- Fixed community creations dyncamic import.
- Added extras_requires in pip install.
v0.5.0 (2022-04-08)
- Added support for allianceauth-pve package.
v0.4.0 (2022-04-06)
- Implemented the 3 steps registration.
v0.3.1 (2022-04-05)
- Fixed wrong id reference in addCharacter mutation.
v0.3.0 (2022-04-05)
Implemented all the views in the authentication app:
- Change main character
- Add a character
- User's groups
- User's alts
v0.2.1 (2022-04-04)
- Updated history and readme, no change to the code.
v0.2.0 (2022-04-04)
- Working login with django-graphql-jwt.
v0.1.1 (2022-04-02)
- Working /graphql/ endpoint and updated requirements.
v0.1.0 (2022-03-18)
- First release on PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file allianceauth_graphql-0.5.4.tar.gz
.
File metadata
- Download URL: allianceauth_graphql-0.5.4.tar.gz
- Upload date:
- Size: 13.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1c1378c67c55a2b2b1853dc5bfe0d0da57696d2a1cdc558075e5fcc4b636238 |
|
MD5 | 9b3f3f37d3ecd4278fd04f4d54280f78 |
|
BLAKE2b-256 | 62e67faf6077c183f480df8ad9c5f548184e8e7d7028aac064525a331ce6ec30 |
File details
Details for the file allianceauth_graphql-0.5.4-py2.py3-none-any.whl
.
File metadata
- Download URL: allianceauth_graphql-0.5.4-py2.py3-none-any.whl
- Upload date:
- Size: 16.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79396937d7159a363ac00df9171d2d8b6d68f966d8380b570c47acbb049a04a4 |
|
MD5 | 94d2c9c33e8c40a98ff5e032937df4d3 |
|
BLAKE2b-256 | d5a0db008dc024027aae8b9035580a45c362f5b70a4aa38f748b532095cf8ef4 |