mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2026-11-08 06:52:55 +00:00
Added the auto removal of invalid keys and user api's deactivate services
This commit is contained in:
1 parent
304c1d5109
commit
c4801c8b42
4 files changed
+81
-7
No files matched your search
@@ -45,4 +45,29 @@ class EveApiManager():
|
||||
except evelink.api.APIError as error:
|
||||
print error
|
||||
|
||||
return False
|
||||
|
||||
@staticmethod
|
||||
def get_api_info(api_id, api_key):
|
||||
try:
|
||||
api = evelink.api.API(api_key=(api_id, api_key))
|
||||
account = evelink.account.Account(api=api)
|
||||
info = account.key_info()
|
||||
return info
|
||||
|
||||
except evelink.api.APIError as error:
|
||||
print error
|
||||
|
||||
return False
|
||||
|
||||
@staticmethod
|
||||
def api_key_is_valid(api_id, api_key):
|
||||
try:
|
||||
api = evelink.api.API(api_key=(api_id, api_key))
|
||||
account = evelink.account.Account(api=api)
|
||||
info = account.status()
|
||||
return True
|
||||
except evelink.api.APIError as error:
|
||||
return False
|
||||
|
||||
return False
|
||||
Reference in new issue
Block a user