use waitress as http server; provide simple shell script; auth improvments

This commit is contained in:
Helmut Merz 2025-03-27 22:35:19 +01:00
parent f911dbf590
commit ec80be5f97
4 changed files with 18 additions and 1 deletions

View file

@ -3,10 +3,15 @@
from scopes.server import auth
from scopes.storage import topic
import waitress
from wsgiref.simple_server import make_server
def run(app, config):
port = int(config.server_port)
print(f'Serving on port {port}.')
waitress.serve(app, port=port)
def run_wsgiref(app, config): # obsolete
with make_server('', port, app) as httpd:
print(f'Serving on port {port}.')
try:

11
demo/shell.py Normal file
View file

@ -0,0 +1,11 @@
# scopes/demo/shell.py
# simple shell for interactive testing / accessing the database (storage)
# use: `python -i shell.py`
import config
from scopes.server import auth
from scopes.storage.folder import Root
from scopes.storage import topic
storage = config.StorageFactory(config)(config.dbschema)
root = Root(storage)

View file

@ -23,6 +23,7 @@ postgres = [
]
app = [
"python-dotenv",
"waitress",
"zope.authentication",
"zope.interface",
"zope.publisher",

View file

@ -81,7 +81,7 @@ class Authenticator(DummyFolder):
response_type='code', # 'code id_token token',
state=state, nonce=nonce,
code_challenge=codeChallenge, code_challenge_method='S256',
scope='openid profile email',
scope='openid profile email urn:zitadel:iam:user:resourceowner',
redirect_uri=self.params['callback_url'],
)
#addArgs, codeVerifier = client.add_code_challenge()