зеркало из https://github.com/mozilla/doorman.git
Fix demo with new OIDC conformant mode
Since the `groups` are not sent in JWT payload anymore, Doorman returns a list of principals that only contains the userid. Ref #55
This commit is contained in:
Родитель
5037c8fab4
Коммит
4d9b181c57
|
@ -60,8 +60,8 @@ def hello():
|
||||||
@authorized(resource="record", action="list")
|
@authorized(resource="record", action="list")
|
||||||
def records():
|
def records():
|
||||||
authz = _app_ctx_stack.top.authz
|
authz = _app_ctx_stack.top.authz
|
||||||
email_principal = authz["principals"][1]
|
main_principal = authz["principals"][0]
|
||||||
records = Records.list(author=email_principal)
|
records = Records.list(author=main_principal)
|
||||||
return jsonify(records)
|
return jsonify(records)
|
||||||
|
|
||||||
|
|
||||||
|
@ -88,8 +88,8 @@ def record(name):
|
||||||
# Save content on PUT
|
# Save content on PUT
|
||||||
if request.method == "PUT":
|
if request.method == "PUT":
|
||||||
body = request.data.decode("utf-8")
|
body = request.data.decode("utf-8")
|
||||||
email_principal = authz["principals"][1]
|
main_principal = authz["principals"][0]
|
||||||
record = Records.save(name, body, email_principal)
|
record = Records.save(name, body, main_principal)
|
||||||
|
|
||||||
return jsonify(record)
|
return jsonify(record)
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче