mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 22:39:36 +08:00
e3e73a3091
This is part 2 (of 3) for passkeys support. This adds a hidden site setting plus routes and controller actions. 1. registering passkeys Passkeys are registered in a two-step process. First, `create_passkey` returns details for the browser to create a passkey. This includes - a challenge - the relying party ID and Origin - the user's secure identifier - the supported algorithms - the user's existing passkeys (if any) Then the browser creates a key with this information, and submits it to the server via `register_passkey`. 2. authenticating passkeys A similar process happens here as well. First, a challenge is created and sent to the browser. Then the browser makes a public key credential and submits it to the server via `passkey_auth_perform`. 3. renaming/deleting passkeys These routes allow changing the name of a key and deleting it. 4. checking if session is trusted for sensitive actions Since a passkey is a password replacement, we want to make sure to confirm the user's identity before allowing adding/deleting passkeys. The u/trusted-session GET route returns success if user has confirmed their session (and failed if user hasn't). In the frontend (in the next PR), we're using these routes to show the password confirmation screen. The `/u/confirm-session` route allows the user to confirm their session with a password. The latter route's functionality already existed in core, under the 2FA flow, but it has been abstracted into its own here so it can be used independently. Co-authored-by: Alan Guo Xiang Tan <gxtan1990@gmail.com> |
||
---|---|---|
.. | ||
about_serializer_spec.rb | ||
admin_plugin_serializer_spec.rb | ||
admin_user_action_serializer_spec.rb | ||
admin_user_list_serializer_spec.rb | ||
basic_group_serializer_spec.rb | ||
basic_group_user_serializer_spec.rb | ||
basic_post_serializer_spec.rb | ||
basic_reviewable_flagged_post_serializer_spec.rb | ||
basic_reviewable_queued_post_serializer_spec.rb | ||
basic_reviewable_serializer_spec.rb | ||
basic_reviewable_user_serializer_spec.rb | ||
basic_user_serializer_spec.rb | ||
basic_user_with_status_serializer_spec.rb | ||
category_detailed_serializer_spec.rb | ||
category_serializer_spec.rb | ||
category_upload_serializer_spec.rb | ||
current_user_serializer_spec.rb | ||
detailed_user_badge_serializer_spec.rb | ||
directory_item_serializer_spec.rb | ||
emoji_serializer_spec.rb | ||
found_user_serializer_spec.rb | ||
found_user_with_status_serializer_spec.rb | ||
group_show_serializer_spec.rb | ||
group_user_serializer_spec.rb | ||
invite_serializer_spec.rb | ||
listable_topic_serializer_spec.rb | ||
new_post_result_serializer_spec.rb | ||
notification_serializer_spec.rb | ||
pending_post_serializer_spec.rb | ||
post_revision_serializer_spec.rb | ||
post_serializer_spec.rb | ||
poster_serializer_spec.rb | ||
reviewable_flagged_post_serializer_spec.rb | ||
reviewable_queued_post_serializer_spec.rb | ||
reviewable_score_serializer_spec.rb | ||
reviewable_serializer_spec.rb | ||
reviewable_user_serializer_spec.rb | ||
single_sign_on_record_serializer_spec.rb | ||
site_serializer_spec.rb | ||
suggested_topic_serializer_spec.rb | ||
tag_group_serializer_spec.rb | ||
tag_serializer_spec.rb | ||
theme_serializer_spec.rb | ||
topic_link_serializer_spec.rb | ||
topic_list_item_serializer_spec.rb | ||
topic_list_serializer_spec.rb | ||
topic_tracking_state_item_serializer_spec.rb | ||
topic_tracking_state_serializer_spec.rb | ||
topic_view_details_serializer_spec.rb | ||
topic_view_posts_serializer_spec.rb | ||
topic_view_serializer_spec.rb | ||
upload_serializer_spec.rb | ||
user_auth_token_serializer_spec.rb | ||
user_badge_serializer_spec.rb | ||
user_bookmark_list_serializer_spec.rb | ||
user_card_serializer_spec.rb | ||
user_post_bookmark_serializer_spec.rb | ||
user_serializer_spec.rb | ||
user_status_serializer_spec.rb | ||
user_summary_serializer_spec.rb | ||
web_hook_post_serializer_spec.rb | ||
web_hook_topic_view_serializer_spec.rb | ||
web_hook_user_serializer_spec.rb | ||
wizard_serializer_spec.rb |