Skip to content

Commit

Permalink
Auth token not mandatory, can be provided in env var
Browse files Browse the repository at this point in the history
  • Loading branch information
cybermaggedon committed Dec 2, 2024
1 parent 07580a7 commit 94df352
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions trustgraph-flow/trustgraph/api/gateway/endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ async def handle(self, request):
return web.HTTPUnauthorized()
token = tokens[1]
except:
return web.HTTPUnauthorized()
token = ""

if not self.auth.permitted(tokens[1], self.operation):
if not self.auth.permitted(token, self.operation):
return web.HTTPUnauthorized()

try:
Expand Down
2 changes: 1 addition & 1 deletion trustgraph-flow/trustgraph/api/gateway/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
default_pulsar_host = os.getenv("PULSAR_HOST", "pulsar://pulsar:6650")
default_timeout = 600
default_port = 8088
default_api_token = None
default_api_token = os.getenv("GATEWAY_SECRET", "")

class Api:

Expand Down
2 changes: 1 addition & 1 deletion trustgraph-flow/trustgraph/api/gateway/socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ async def handle(self, request):
try:
token = request.query['token']
except:
return web.HTTPUnauthorized()
token = ""

if not self.auth.permitted(token, self.operation):
return web.HTTPUnauthorized()
Expand Down

0 comments on commit 94df352

Please sign in to comment.