Add page for security keys with stubbed data

This adds a new platform admin settings row, leading a page which
shows any existing keys and allows a new one to be registered. Until
the APIs for this are implemented, the user API client just returns
some stubbed data for manual testing.

This also includes a basic JavaScript module to do the main work of
registering a new authenticator, to be implemented in the next commits.

Some more minor notes:

- Setting the headings in the mapping_table is necessary to get the
horizontal rule along the top (to match the design).

- Setting caption to False in the mapping_table is necessary to stop
an extra margin appearing at the top.
This commit is contained in:
Ben Thorner
2021-05-07 15:00:01 +01:00
parent e7d6eebdfe
commit ebb82b2e80
13 changed files with 208 additions and 3 deletions

View File

@@ -23,7 +23,11 @@ from app.main.forms import (
TwoFactorForm,
)
from app.models.user import User
from app.utils import user_is_gov_user, user_is_logged_in
from app.utils import (
user_is_gov_user,
user_is_logged_in,
user_is_platform_admin,
)
NEW_EMAIL = 'new-email'
NEW_MOBILE = 'new-mob'
@@ -225,3 +229,11 @@ def user_profile_disable_platform_admin_view():
'views/user-profile/disable-platform-admin-view.html',
form=form
)
@main.route("/user-profile/security-keys", methods=['GET'])
@user_is_platform_admin
def user_profile_security_keys():
return render_template(
'views/user-profile/security-keys.html',
)