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 v1.1.x
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.
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
Hashes for allianceauth_graphql-0.14.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d76734905e50e4a5d258df7e50d673ada4fa7bcdb436faf59d38a00ae4ceb730 |
|
MD5 | c156f00e9538415d999cdbd85d5a877e |
|
BLAKE2b-256 | 9578352909b34fa00f1401d10cbb202c6ad2a23455eed6ea17a5ce4d7432ebe7 |
Hashes for allianceauth_graphql-0.14.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 775e49e931a60c496a520738730952a77a71be86bcec07ad165b9ee23050f874 |
|
MD5 | f49c1f039b92d68392c59a11a8b269bb |
|
BLAKE2b-256 | 1f0b12f2419e51586359795cd11fdaf253e1915671e4d91f23f13e3cb338e050 |