allianceauth-graphql


Nameallianceauth-graphql JSON
Version 1.3.0 PyPI version JSON
download
home_page
SummaryGraphQL integration for AllianceAuth
upload_time2024-03-17 11:13:16
maintainer
docs_urlNone
author
requires_python~=3.8
license
keywords allianceauth eveonline allianceauth_graphql graphql
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            # allianceauth-graphql

[![version](https://img.shields.io/pypi/v/allianceauth_graphql.svg)](https://pypi.python.org/pypi/allianceauth_graphql)
[![GitHub issues](https://img.shields.io/github/issues/Maestro-Zacht/allianceauth-graphql)](https://github.com/Maestro-Zacht/allianceauth-graphql/issues)
[![github](https://img.shields.io/badge/docs-github-brightgreen)](https://github.com/Maestro-Zacht/allianceauth-graphql)
[![codecov](https://codecov.io/gh/Maestro-Zacht/allianceauth-graphql/branch/main/graph/badge.svg?token=S138BBQ4XA)](https://codecov.io/gh/Maestro-Zacht/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
--------------

1. `pip install allianceauth-graphql`.
2. Add the following apps to the bottom of your `INSTALLED_APPS` in the local.py settings file:
    ```python
    'allianceauth_graphql',
    'graphene_django',
    "graphql_jwt.refresh_token.apps.RefreshTokenConfig",
    ```
3. Add the following settings to your local.py file:
    ```python
    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.
4. Edit your projects url.py file:

   > It should looks something like this

    ```python
    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:
    
    ```python
    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'
    ```
5. Run migrations.
6. If you have `SHOW_GRAPHIQL` setting set to `True` (see below), run collectstatics
7. 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](https://github.com/audreyr/cookiecutter) and the [audreyr/cookiecutter-pypackage](https://github.com/audreyr/cookiecutter-pypackage) project template.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "allianceauth-graphql",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "~=3.8",
    "maintainer_email": "",
    "keywords": "allianceauth,eveonline,allianceauth_graphql,GraphQL",
    "author": "",
    "author_email": "Matteo Ghia <matteo.ghia@yahoo.it>",
    "download_url": "https://files.pythonhosted.org/packages/04/80/e31075e7505a9a8314e9ff412926af8310e4994cbcb854c8b126c622615f/allianceauth_graphql-1.3.0.tar.gz",
    "platform": null,
    "description": "# allianceauth-graphql\n\n[![version](https://img.shields.io/pypi/v/allianceauth_graphql.svg)](https://pypi.python.org/pypi/allianceauth_graphql)\n[![GitHub issues](https://img.shields.io/github/issues/Maestro-Zacht/allianceauth-graphql)](https://github.com/Maestro-Zacht/allianceauth-graphql/issues)\n[![github](https://img.shields.io/badge/docs-github-brightgreen)](https://github.com/Maestro-Zacht/allianceauth-graphql)\n[![codecov](https://codecov.io/gh/Maestro-Zacht/allianceauth-graphql/branch/main/graph/badge.svg?token=S138BBQ4XA)](https://codecov.io/gh/Maestro-Zacht/allianceauth-graphql)\n\n\nGraphQL integration for AllianceAuth\n\n\nFree software: GNU General Public License v3\n\n\nThis version is in beta, please open an issue if you face any bug.\n\nCompatibility\n=============\n\nVersions `>=0.16` are only compatible with AllianceAuth v3.\n\nSetup\n=====\n\nThe following is assuming you have a functioning AllianceAuth installation.\n\n\nInstall plugin\n--------------\n\n1. `pip install allianceauth-graphql`.\n2. Add the following apps to the bottom of your `INSTALLED_APPS` in the local.py settings file:\n    ```python\n    'allianceauth_graphql',\n    'graphene_django',\n    \"graphql_jwt.refresh_token.apps.RefreshTokenConfig\",\n    ```\n3. Add the following settings to your local.py file:\n    ```python\n    from datetime import timedelta\n\n    # ...\n\n    GRAPHENE = {\n        'SCHEMA': 'allianceauth_graphql.schema.schema',\n        \"MIDDLEWARE\": [\n            \"graphql_jwt.middleware.JSONWebTokenMiddleware\",\n        ],\n    }\n\n    AUTHENTICATION_BACKENDS += [\n        \"graphql_jwt.backends.JSONWebTokenBackend\",\n    ]\n\n    GRAPHQL_JWT = {\n        \"JWT_VERIFY_EXPIRATION\": True,\n        \"JWT_LONG_RUNNING_REFRESH_TOKEN\": True,\n        \"JWT_EXPIRATION_DELTA\": timedelta(days=1),\n        \"JWT_REFRESH_EXPIRATION_DELTA\": timedelta(days=7),\n    }\n    ```\n    Feel free to edit the expiration limits of your tokens.\n4. Edit your projects url.py file:\n\n   > It should looks something like this\n\n    ```python\n    from django.conf.urls import include\n    from allianceauth import urls\n    from django.urls import re_path\n\n    urlpatterns = [\n        re_path(r'', include(urls)),\n    ]\n\n    handler500 = 'allianceauth.views.Generic500Redirect'\n    handler404 = 'allianceauth.views.Generic404Redirect'\n    handler403 = 'allianceauth.views.Generic403Redirect'\n    handler400 = 'allianceauth.views.Generic400Redirect'\n    ```\n\n   > After the edit:\n    \n    ```python\n    from django.conf.urls import include\n    from allianceauth import urls\n    from allianceauth_graphql import urls as aa_gql_urls\n    from django.urls import re_path\n\n    urlpatterns = [\n        re_path(r'', include(urls)),\n        re_path(r'graphql/', include(aa_gql_urls)),\n    ]\n\n    handler500 = 'allianceauth.views.Generic500Redirect'\n    handler404 = 'allianceauth.views.Generic404Redirect'\n    handler403 = 'allianceauth.views.Generic403Redirect'\n    handler400 = 'allianceauth.views.Generic400Redirect'\n    ```\n5. Run migrations.\n6. If you have `SHOW_GRAPHIQL` setting set to `True` (see below), run collectstatics\n7. Restart AllianceAuth.\n\n\nCommunity Creations Integration\n-------------------------------\n\nCurrently the package supports the integration with the following community packages:\n* allianceauth-pve: v1.11.x\n\nBe sure to check if you have the right versions of these package or the GraphQL will not have the same behaviour as the apps.\n\n\nSettings\n--------\n\n| Setting              | Default                   | Description                                                                                                                                 |\n| -------------------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |\n| SHOW_GRAPHIQL        | `True`                    | Shows the graphiql UI in the browser                                                                                                        |\n| 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 |\n| 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>`   |\n| REDIRECT_PATH        | `/registration/callback/` | Path to append to REDIRECT_SITE for building the redirect URL                                                                               |\n\n\n\nCredits\n=======\nThis package was created with [Cookiecutter](https://github.com/audreyr/cookiecutter) and the [audreyr/cookiecutter-pypackage](https://github.com/audreyr/cookiecutter-pypackage) project template.\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "GraphQL integration for AllianceAuth",
    "version": "1.3.0",
    "project_urls": {
        "Changelog": "https://github.com/Maestro-Zacht/allianceauth-graphql/releases",
        "Homepage": "https://github.com/Maestro-Zacht/allianceauth-graphql",
        "Source": "https://github.com/Maestro-Zacht/allianceauth-graphql",
        "Tracker": "https://github.com/Maestro-Zacht/allianceauth-graphql/issues"
    },
    "split_keywords": [
        "allianceauth",
        "eveonline",
        "allianceauth_graphql",
        "graphql"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a4fb5b9af59bb0ae1a6f486587f1d3769e3dc52f87071a2ba86b85d1d4e5d17a",
                "md5": "a4756e5481bc10adc097fff218972236",
                "sha256": "7b6a07191d39b835512262b6f5a8b26d5ff78d49f74551b8b9946aed6b0857f5"
            },
            "downloads": -1,
            "filename": "allianceauth_graphql-1.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a4756e5481bc10adc097fff218972236",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "~=3.8",
            "size": 76346,
            "upload_time": "2024-03-17T11:13:13",
            "upload_time_iso_8601": "2024-03-17T11:13:13.947328Z",
            "url": "https://files.pythonhosted.org/packages/a4/fb/5b9af59bb0ae1a6f486587f1d3769e3dc52f87071a2ba86b85d1d4e5d17a/allianceauth_graphql-1.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0480e31075e7505a9a8314e9ff412926af8310e4994cbcb854c8b126c622615f",
                "md5": "f717fb65fd69a9a0914acf3c55347b71",
                "sha256": "a09a43758ed87cb215e443cfb4caa97a6edfd65e465f27c52cb1784e2338e096"
            },
            "downloads": -1,
            "filename": "allianceauth_graphql-1.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "f717fb65fd69a9a0914acf3c55347b71",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "~=3.8",
            "size": 47270,
            "upload_time": "2024-03-17T11:13:16",
            "upload_time_iso_8601": "2024-03-17T11:13:16.034276Z",
            "url": "https://files.pythonhosted.org/packages/04/80/e31075e7505a9a8314e9ff412926af8310e4994cbcb854c8b126c622615f/allianceauth_graphql-1.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-17 11:13:16",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Maestro-Zacht",
    "github_project": "allianceauth-graphql",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "tox": true,
    "lcname": "allianceauth-graphql"
}
        
Elapsed time: 0.20873s