Skip to content

Commit 7fd464b

Browse files
committed
feat(auth)!: migrate WebAuthn to Passkey with cloud sync and enhanced management
- Migrate traditional WebAuthn to Passkey to support cloud synchronization and username-less authentication - Rename all backend WebAuthn APIs to Passkey for improved standardization - Enable Passkey by default to align with current industry adoption trends - Display user device IP and User-Agent (UA) in Passkey management page for better device identification - Add upgrade flow to migrate legacy WebAuthn credentials to new Passkey format - Prevent creation of new Passkeys until legacy credentials are upgraded or removed to avoid post-upgrade incompatibility
1 parent 91004bd commit 7fd464b

11 files changed

Lines changed: 212 additions & 162 deletions

File tree

.github/ISSUE_TEMPLATE/do-not-submit-any-issue-here.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
name: Do not submit any issue here
33
about: Please go to the `OpenList` repo if you hava issue to submit.
44
title: Do not submit any issue here
5-
labels: ''
6-
assignees: ''
7-
5+
labels: ""
6+
assignees: ""
87
---
9-
10-

public/static/epub.js/viewer.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html>
33
<head>
44
<meta charset="utf-8" />
@@ -323,7 +323,7 @@
323323
restore: true,
324324
reload: true,
325325
spreads: true,
326-
}
326+
},
327327
)
328328
var rendition = book.renderTo("viewer", {
329329
width: "100%",
@@ -344,7 +344,7 @@
344344
: rendition.next()
345345
e.preventDefault()
346346
},
347-
false
347+
false,
348348
)
349349

350350
var prev = document.getElementById("prev")
@@ -356,7 +356,7 @@
356356
: rendition.prev()
357357
e.preventDefault()
358358
},
359-
false
359+
false,
360360
)
361361

362362
var keyListener = function (e) {

public/streamer/mitm.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
sw = swReg.active
5959
resolve()
6060
}
61-
})
61+
}),
6262
)
6363
})
6464
)
@@ -89,7 +89,7 @@
8989

9090
// pass along version for possible backwards compatibility in sw.js
9191
data.streamSaverVersion = new URLSearchParams(location.search).get(
92-
"version"
92+
"version",
9393
)
9494

9595
if (data.streamSaverVersion === "1.2.0") {
@@ -99,7 +99,7 @@
9999
/** @since v2.0.0 */
100100
if (!data.headers) {
101101
console.warn(
102-
"[StreamSaver] pass `data.headers` that you would like to pass along to the service worker\nit should be a 2D array or a key/val object that fetch's Headers api accepts"
102+
"[StreamSaver] pass `data.headers` that you would like to pass along to the service worker\nit should be a 2D array or a key/val object that fetch's Headers api accepts",
103103
)
104104
} else {
105105
// test if it's correct
@@ -110,7 +110,7 @@
110110
/** @since v2.0.0 */
111111
if (typeof data.filename === "string") {
112112
console.warn(
113-
"[StreamSaver] You shouldn't send `data.filename` anymore. It should be included in the Content-Disposition header option"
113+
"[StreamSaver] You shouldn't send `data.filename` anymore. It should be included in the Content-Disposition header option",
114114
)
115115
// Do what File constructor do with fileNames
116116
data.filename = data.filename.replace(/\//g, ":")
@@ -119,21 +119,21 @@
119119
/** @since v2.0.0 */
120120
if (data.size) {
121121
console.warn(
122-
"[StreamSaver] You shouldn't send `data.size` anymore. It should be included in the content-length header option"
122+
"[StreamSaver] You shouldn't send `data.size` anymore. It should be included in the content-length header option",
123123
)
124124
}
125125

126126
/** @since v2.0.0 */
127127
if (data.readableStream) {
128128
console.warn(
129-
"[StreamSaver] You should send the readableStream in the messageChannel, not through mitm"
129+
"[StreamSaver] You should send the readableStream in the messageChannel, not through mitm",
130130
)
131131
}
132132

133133
/** @since v2.0.0 */
134134
if (!data.pathname) {
135135
console.warn(
136-
"[StreamSaver] Please send `data.pathname` (eg: /pictures/summer.jpg)"
136+
"[StreamSaver] Please send `data.pathname` (eg: /pictures/summer.jpg)",
137137
)
138138
data.pathname = Math.random().toString().slice(-6) + "/" + data.filename
139139
}

public/streamer/sw.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ self.onfetch = (event) => {
112112
if (headers.has("Content-Disposition")) {
113113
responseHeaders.set(
114114
"Content-Disposition",
115-
headers.get("Content-Disposition")
115+
headers.get("Content-Disposition"),
116116
)
117117
}
118118

@@ -131,7 +131,7 @@ self.onfetch = (event) => {
131131
.replace(/\*/g, "%2A")
132132
responseHeaders.set(
133133
"Content-Disposition",
134-
"attachment; filename*=UTF-8''" + fileName
134+
"attachment; filename*=UTF-8''" + fileName,
135135
)
136136
}
137137

src/lang/en/login.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
"forget_url": "https://doc.oplist.org/faq/howto#how-to-get-password-if-i-forget-it",
99
"clear": "Clear",
1010
"login": "Login",
11+
"continue_with_passkey": "Continue with passkey",
12+
"passkey_input_username": "Enter username for legacy security key",
1113
"use_guest": "Browse as a guest",
12-
"success": "Login successfully"
14+
"success": "Login successfully",
15+
"passkey_legacy_upgrade_tip": "You are using a legacy security key. After login, please add a new passkey in Profile for passwordless sign-in."
1316
}

src/lang/en/settings.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,5 @@
141141
"upload_task_threads_num": "Upload task threads num",
142142
"version": "Version",
143143
"video_autoplay": "Video autoplay",
144-
"video_types": "Video types",
145-
"webauthn_login_enabled": "Webauthn login enabled"
144+
"video_types": "Video types"
146145
}

src/lang/en/users.json

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,17 @@
4545
"sso_login": "Single Sign-On Login",
4646
"connect_sso": "Connect to Single Sign-On Platform",
4747
"disconnect_sso": "Disconnect from Single Sign-On Platform",
48-
"webauthn": "WebAuthn",
49-
"add_webauthn": "Add a WebAuthn credential",
50-
"add_webauthn_success": "WebAuthn credential successfully added!",
51-
"webauthn_not_supported": "WebAuthn is not supported in your browser or you are in an unsafe origin",
48+
"webauthn": "Passkey",
49+
"add_webauthn": "Add a passkey",
50+
"add_webauthn_success": "Passkey added successfully!",
51+
"webauthn_not_supported": "Passkey is not supported in your browser or your origin is not secure",
52+
"webauthn_creator_ip": "Creator IP",
53+
"webauthn_creator_ua": "Creator User-Agent",
54+
"update_to_passkey": "Update to Passkey",
55+
"upgrade_to_passkey_success": "Updated to passkey successfully and removed the legacy key.",
56+
"upgrade_to_passkey_keep_old": "Passkey updated, but failed to remove the legacy key. The legacy key is kept.",
57+
"passkey_add_blocked_by_legacy": "Legacy security key detected. Please upgrade it or delete it before adding a new passkey.",
58+
"unknown": "Unknown",
5259
"ssh_keys": {
5360
"heading": "SSH keys",
5461
"add_heading": "Add new SSH key",

0 commit comments

Comments
 (0)