ahserver/ah.py

23 lines
531 B
Python
Raw Permalink Normal View History

2024-09-23 14:20:23 +08:00
from ahserver.configuredServer import ConfiguredServer
from ahserver.auth_api import AuthAPI
"""
need to implement your AuthAPI
class MyAuthAPI:
def needAuth(self,path):
return Fasle # do not need authentication
return True # need authentication
async def getPermissionNeed(self,path):
return 'admin'
async def checkUserPassword(self,user_id,password):
return True
async def getUserPermissions(self,user):
return ['admin','view']
"""
if __name__ == '__main__':
server = ConfiguredServer(AuthAPI)
server.run()