Commit 55c939c3 authored by Lukas Burgey's avatar Lukas Burgey

Simplify service routing key

parent 95e1914a
......@@ -229,12 +229,9 @@ def topic_endpoint_apiclient(request, apiclient):
routing_key = request.POST.get('routing_key', '')
if name == 'services':
if routing_key.startswith('service.'):
match = re.search('service.(.+)', routing_key)
if match:
service_name = match.group(1)
if apiclient.site.services.filter(name=service_name).exists():
return ALLOW
# TODO is this check sufficient?
if apiclient.site.services.filter(name=routing_key).exists():
return ALLOW
elif name == 'sites':
if routing_key == apiclient.site.name:
return topic_auth_decision(request, ALLOW)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment