mirror of https://gitlab.com/bashrc2/epicyon
Check for system accounts during authorization
parent
88cc48480f
commit
eb44a66066
31
daemon.py
31
daemon.py
|
@ -1120,21 +1120,22 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
tokenStr = tokenStr.split(';')[0].strip()
|
tokenStr = tokenStr.split(';')[0].strip()
|
||||||
if self.server.tokensLookup.get(tokenStr):
|
if self.server.tokensLookup.get(tokenStr):
|
||||||
nickname = self.server.tokensLookup[tokenStr]
|
nickname = self.server.tokensLookup[tokenStr]
|
||||||
self.authorizedNickname = nickname
|
if not isSystemAccount(nickname):
|
||||||
# default to the inbox of the person
|
self.authorizedNickname = nickname
|
||||||
if self.path == '/':
|
# default to the inbox of the person
|
||||||
self.path = '/users/' + nickname + '/inbox'
|
if self.path == '/':
|
||||||
# check that the path contains the same nickname
|
self.path = '/users/' + nickname + '/inbox'
|
||||||
# as the cookie otherwise it would be possible
|
# check that the path contains the same nickname
|
||||||
# to be authorized to use an account you don't own
|
# as the cookie otherwise it would be possible
|
||||||
if '/' + nickname + '/' in self.path:
|
# to be authorized to use an account you don't own
|
||||||
return True
|
if '/' + nickname + '/' in self.path:
|
||||||
elif '/' + nickname + '?' in self.path:
|
return True
|
||||||
return True
|
elif '/' + nickname + '?' in self.path:
|
||||||
elif self.path.endswith('/' + nickname):
|
return True
|
||||||
return True
|
elif self.path.endswith('/' + nickname):
|
||||||
print('AUTH: nickname ' + nickname +
|
return True
|
||||||
' was not found in path ' + self.path)
|
print('AUTH: nickname ' + nickname +
|
||||||
|
' was not found in path ' + self.path)
|
||||||
return False
|
return False
|
||||||
print('AUTH: epicyon cookie ' +
|
print('AUTH: epicyon cookie ' +
|
||||||
'authorization failed, header=' +
|
'authorization failed, header=' +
|
||||||
|
|
Loading…
Reference in New Issue