mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 06:42:16 +00:00
Fix EVE API proxy to "handle" new style keys BODGE FIX HOOOO
This commit is contained in:
@@ -19,6 +19,7 @@ from gargoyle import gargoyle
|
||||
from api.models import AuthAPIKey, AuthAPILog
|
||||
from eve_proxy.models import CachedDocument
|
||||
from eve_proxy.exceptions import *
|
||||
from eve_api.app_defines import *
|
||||
from eve_api.models import EVEAccount, EVEPlayerCharacter
|
||||
from sso.models import ServiceAccount, Service
|
||||
from hr.app_defines import *
|
||||
@@ -128,9 +129,16 @@ class EveAPIProxyHandler(BaseHandler):
|
||||
for key, value in request.GET.items():
|
||||
params[key.lower()] = value
|
||||
|
||||
if 'userid' in params:
|
||||
if 'userid' in params or 'keyid' in params:
|
||||
obj = get_object_or_404(EVEAccount, pk=params['userid'])
|
||||
params['apikey'] = obj.api_key
|
||||
|
||||
# "Fix" new style keys
|
||||
if obj.api_keytype >= 3:
|
||||
params['keyid'] = params['userid']
|
||||
del params['userid']
|
||||
params['vcode'] = obj.api_key
|
||||
else:
|
||||
params['apikey'] = obj.api_key
|
||||
|
||||
try:
|
||||
cached_doc = CachedDocument.objects.api_query(url_path, params, service=request.api_key.name)
|
||||
|
||||
@@ -13,7 +13,7 @@ DATABASES = {
|
||||
|
||||
## EVE Proxy
|
||||
|
||||
EVE_API_URL = "https://apitest.eveonline.com"
|
||||
EVE_API_URL = "https://api.eveonline.com"
|
||||
EVE_PROXY_KEEP_LOGS = 30
|
||||
|
||||
## SSO
|
||||
|
||||
2
fabfile.py
vendored
2
fabfile.py
vendored
@@ -19,7 +19,7 @@ def production():
|
||||
env.uwsgiconfig = os.path.join(env.path, '..', 'etc', 'uwsgi', 'dreddit-auth.ini')
|
||||
env.password = sha1('%s-%s' % (env.user, env.vhost)).hexdigest()
|
||||
|
||||
env.celeryconf = '-l INFO --settings=%(config)s --pidfile=logs/%%n.pid --logfile=logs/%%n.log -n auth.pleaseignore.com bulk default fastresponse -Q:bulk bulk -Q:fastresponse fastresponse -c 5 -c:bulk 3 -c:fastresponse 3 -B --scheduler=djcelery.schedulers.DatabaseScheduler' % env
|
||||
env.celeryconf = '-l INFO --settings=%(config)s --pidfile=logs/%%n.pid --logfile=logs/%%n.log -n auth.pleaseignore.com bulk default fastresponse -Q:bulk bulk -Q:fastresponse fastresponse -c 5 -c:bulk 3 -c:fastresponse 3 -B:default --scheduler=djcelery.schedulers.DatabaseScheduler' % env
|
||||
|
||||
|
||||
def test():
|
||||
|
||||
Reference in New Issue
Block a user