GraphQL integration for AllianceAuth
Project description
allianceauth-graphql
GraphQL integration for AllianceAuth
Free software: GNU General Public License v3
This version is in beta, please open an issue if you face any bug.
Compatibility
Versions >=0.16
are only compatible with AllianceAuth v3.
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 from allianceauth import urls from django.urls import re_path urlpatterns = [ re_path(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 from allianceauth import urls from allianceauth_graphql import urls as aa_gql_urls from django.urls import re_path urlpatterns = [ re_path(r'', include(urls)), re_path(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.11.x
Be sure to check if you have the right versions of these package or the GraphQL will not have the same behaviour as the apps.
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
File details
Details for the file allianceauth_graphql-1.2.4.tar.gz
.
File metadata
- Download URL: allianceauth_graphql-1.2.4.tar.gz
- Upload date:
- Size: 46.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47767499f0e62a9a5422165e79fd895039bb05358f48c5417e3af488d62bc403 |
|
MD5 | c2b0fdbc550c754fe21b6339cfccf474 |
|
BLAKE2b-256 | 958f8dac4495f6f6b6bd3878bccdca3bed8b4067aa5d4534b5d6dba998aecbdc |
File details
Details for the file allianceauth_graphql-1.2.4-py3-none-any.whl
.
File metadata
- Download URL: allianceauth_graphql-1.2.4-py3-none-any.whl
- Upload date:
- Size: 75.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9157d5601a24aff8710903d37825c287557602ce1eb0ea8d120d9b760610efc5 |
|
MD5 | 0517804a36bace0a31f12c072ef5a31f |
|
BLAKE2b-256 | f41f75c1fb1e791afaea3d92b863e9d5a1bee8ffcf2abbdf90a101f8880d7eed |