From 77fedaaeaa09d3be2d7021ed1fed70d0c57a3054 Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Tue, 15 Apr 2025 18:32:12 +0200 Subject: [PATCH] auth: remove obsolete definistions --- loops/server/auth.py | 22 ---------------------- loops/server/main.py | 3 +-- 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/loops/server/auth.py b/loops/server/auth.py index 37a33b8..5c91e10 100644 --- a/loops/server/auth.py +++ b/loops/server/auth.py @@ -11,33 +11,11 @@ from zope.publisher.interfaces.browser import IBrowserRequest, IBrowserPage from zope.publisher.browser import BrowserPage from zope.security.proxy import removeSecurityProxy -def registerAuthentication(config): - registerAuthUtility(config) - #registerAuthViews(config) - def registerAuthUtility(config): baseAuth = getUtility(IAuthentication) print('*** registerAuthUtility, baseAuth:', baseAuth) provideUtility(auth.OidcAuthentication(baseAuth)) -def registerAuthViews(config): - provideAdapter(LoginView, (Interface, IBrowserRequest), IBrowserPage, - name='auth_login') - provideAdapter(callback, (Interface, IBrowserRequest), IBrowserPage, - name='auth_callback') - -@implementer(IBrowserPage) -def login(context, request): - removeSecurityProxy(context) - auth.Authenticator(request).login() - return context - -@implementer(IBrowserPage) -def callback(context, request): - removeSecurityProxy(context) - auth.Authenticator(request).callback() - return DummyView(context, request) - class LoginView: diff --git a/loops/server/main.py b/loops/server/main.py index 969f409..96a53f5 100644 --- a/loops/server/main.py +++ b/loops/server/main.py @@ -23,8 +23,7 @@ def main(): zope_conf = getattr(config, 'zope_conf', 'zope.conf') print(f'starting loops server... - conf: {zope_conf}') app = getWSGIApplication(zope_conf) - #auth.registerAuthUtility(config) - auth.registerAuthentication(config) + auth.registerAuthUtility(config) run(app, config) if __name__ == '__main__':