mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2026-02-10 17:16:22 +01:00
Use local swagger spec files (#866)
Allows auth to keep working if CCP changes "latest" definition. Requires adarnauth-esi>=1.4
This commit is contained in:
@@ -6,6 +6,9 @@ import json
|
||||
from bravado.exception import HTTPNotFound, HTTPUnprocessableEntity
|
||||
import evelink
|
||||
import logging
|
||||
import os
|
||||
|
||||
SWAGGER_SPEC_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'swagger.json')
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -228,7 +231,7 @@ class EveProvider(object):
|
||||
@python_2_unicode_compatible
|
||||
class EveSwaggerProvider(EveProvider):
|
||||
def __init__(self, token=None, adapter=None):
|
||||
self.client = esi_client_factory(token=token, Alliance='v2', Character='v4', Corporation='v2', Universe='v2')
|
||||
self.client = esi_client_factory(token=token, spec_file=SWAGGER_SPEC_PATH)
|
||||
self.adapter = adapter or self
|
||||
|
||||
def __str__(self):
|
||||
@@ -237,7 +240,7 @@ class EveSwaggerProvider(EveProvider):
|
||||
def get_alliance(self, alliance_id):
|
||||
try:
|
||||
data = self.client.Alliance.get_alliances_alliance_id(alliance_id=alliance_id).result()
|
||||
corps = esi_client_factory(Alliance='v1').Alliance.get_alliances_alliance_id_corporations(alliance_id=alliance_id).result()
|
||||
corps = self.client.Alliance.get_alliances_alliance_id_corporations(alliance_id=alliance_id).result()
|
||||
model = Alliance(
|
||||
self.adapter,
|
||||
alliance_id,
|
||||
|
||||
1
eveonline/swagger.json
Normal file
1
eveonline/swagger.json
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user