mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2026-02-06 15:16:20 +01:00
EVE Swagger Interface (#591)
FAT uses ESI tokens to get character location/ship - closes #564 Pull corp memebrship data from ESI Additional permissions for non-api viewing. - migration to convert permissions from old users. Standardize EVE datasource responses. - allow different sources for EVE data types. Allow empty values for character alliance id and name Allow multiple corps and alliances to be considered 'members'
This commit is contained in:
@@ -23,9 +23,5 @@ def auth_settings(request):
|
||||
'MEMBER_API_MASK': settings.MEMBER_API_MASK,
|
||||
'MEMBER_API_ACCOUNT': settings.MEMBER_API_ACCOUNT,
|
||||
'JABBER_URL': settings.JABBER_URL,
|
||||
'ALLIANCE_NAME': settings.ALLIANCE_NAME,
|
||||
'ALLIANCE_ID': settings.ALLIANCE_ID,
|
||||
'CORP_NAME': settings.CORP_NAME,
|
||||
'CORP_ID': settings.CORP_ID,
|
||||
'IS_CORP': settings.IS_CORP,
|
||||
}
|
||||
'SITE_NAME': settings.SITE_NAME,
|
||||
}
|
||||
|
||||
@@ -319,7 +319,6 @@ class EveApiManager:
|
||||
def validate_api(api_id, api_key, user):
|
||||
try:
|
||||
info = EveApiManager.get_api_info(api_id, api_key).result
|
||||
chars = EveApiManager.get_characters_from_api(api_id, api_key).result
|
||||
except evelink.api.APIError as e:
|
||||
if int(e.code) == 222:
|
||||
raise EveApiManager.ApiInvalidError(api_id)
|
||||
@@ -329,6 +328,7 @@ class EveApiManager:
|
||||
auth, c = AuthServicesInfo.objects.get_or_create(user=user)
|
||||
states = [auth.state]
|
||||
from authentication.tasks import determine_membership_by_character # circular import issue
|
||||
chars = info['characters']
|
||||
for char in chars:
|
||||
evechar = EveCharacter()
|
||||
evechar.character_name = chars[char]['name']
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
from __future__ import unicode_literals
|
||||
import requests
|
||||
import json
|
||||
|
||||
|
||||
class EveWhoManager:
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
@staticmethod
|
||||
def get_corporation_members(corpid):
|
||||
url = "http://evewho.com/api.php?type=corplist&id=%s" % corpid
|
||||
jsondata = requests.get(url).content
|
||||
data = json.loads(jsondata.decode())
|
||||
|
||||
members = {}
|
||||
page_count = 0
|
||||
while len(data["characters"]):
|
||||
for row in data["characters"]:
|
||||
members[int(row["character_id"])] = {"name": row["name"], "id": int(row["character_id"])}
|
||||
page_count += 1
|
||||
jsondata = requests.get(url + "&page=%i" % page_count).content
|
||||
data = json.loads(jsondata.decode())
|
||||
|
||||
return members
|
||||
Reference in New Issue
Block a user