Initial commit

This commit is contained in:
2023-04-30 17:22:13 +01:00
commit 9f10d2ed7d
9 changed files with 229 additions and 0 deletions

27
app.py Normal file
View File

@@ -0,0 +1,27 @@
from flask import Flask, request, abort
import yaml
app = Flask(__name__)
with open('config.yaml', 'rb') as fobj:
data = yaml.load(fobj, yaml.SafeLoader)
@app.route("/.well-known/webfinger")
def webfinger():
resource = request.args.get('resource')
if resource.split('@')[1] != data['domain']:
abort(404)
return {
'subject': resource,
'links': [{
'rel': "http://openid.net/specs/connect/1.0/issuer",
'href': data['oidc_href'],
}]
}
if __name__ == '__main__':
app.run(host='0.0.0.0', port=8000)