dsh-auth-remote 0.2.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/CHANGELOG.zh-CN.md +21 -0
- package/CONTRIBUTING.md +2 -0
- package/CONTRIBUTING.zh-CN.md +2 -0
- package/README.md +33 -47
- package/README.zh-CN.md +33 -47
- package/dist/cli.js +63 -530
- package/dist/cli.js.map +4 -4
- package/dist/client.js +917 -135
- package/dist/client.js.map +3 -3
- package/dist/index.js +124 -67
- package/dist/index.js.map +4 -4
- package/dist/login.css +0 -21
- package/dist/login.css.map +2 -2
- package/dist/login.js +892 -155
- package/dist/login.js.map +3 -3
- package/dist/types/adapters/dsh/browser-capability.d.ts.map +1 -1
- package/dist/types/adapters/dsh/compatibility.d.ts +1 -1
- package/dist/types/adapters/dsh/compatibility.d.ts.map +1 -1
- package/dist/types/adapters/dsh/liveshare.d.ts +4 -0
- package/dist/types/adapters/dsh/liveshare.d.ts.map +1 -0
- package/dist/types/adapters/dsh/runtime-capabilities.d.ts +6 -11
- package/dist/types/adapters/dsh/runtime-capabilities.d.ts.map +1 -1
- package/dist/types/adapters/dsh/webserver.d.ts +8 -4
- package/dist/types/adapters/dsh/webserver.d.ts.map +1 -1
- package/dist/types/cli/ipc-client.d.ts.map +1 -1
- package/dist/types/cli/messages.d.ts +56 -0
- package/dist/types/cli/messages.d.ts.map +1 -0
- package/dist/types/cli/profile.d.ts.map +1 -1
- package/dist/types/cli/prompt.d.ts.map +1 -1
- package/dist/types/config.d.ts +2 -2
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/http/account-login.d.ts.map +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/shared/dsh-support.d.ts.map +1 -1
- package/dist/types/shared/i18n.d.ts +878 -105
- package/dist/types/shared/i18n.d.ts.map +1 -1
- package/dist/types/shared/locales/de.d.ts +145 -0
- package/dist/types/shared/locales/de.d.ts.map +1 -0
- package/dist/types/shared/locales/en.d.ts +0 -49
- package/dist/types/shared/locales/en.d.ts.map +1 -1
- package/dist/types/shared/locales/es.d.ts +145 -0
- package/dist/types/shared/locales/es.d.ts.map +1 -0
- package/dist/types/shared/locales/fr.d.ts +145 -0
- package/dist/types/shared/locales/fr.d.ts.map +1 -0
- package/dist/types/shared/locales/ja.d.ts +145 -0
- package/dist/types/shared/locales/ja.d.ts.map +1 -0
- package/dist/types/shared/locales/pt.d.ts +145 -0
- package/dist/types/shared/locales/pt.d.ts.map +1 -0
- package/dist/types/shared/locales/ru.d.ts +145 -0
- package/dist/types/shared/locales/ru.d.ts.map +1 -0
- package/dist/types/shared/locales/zh.d.ts +0 -49
- package/dist/types/shared/locales/zh.d.ts.map +1 -1
- package/docs/deployment.md +30 -22
- package/docs/deployment.zh-CN.md +30 -22
- package/docs/development.md +70 -56
- package/docs/development.zh-CN.md +70 -56
- package/docs/legacy-compatibility.md +149 -80
- package/docs/legacy-compatibility.zh-CN.md +149 -80
- package/docs/releasing.md +15 -9
- package/docs/releasing.zh-CN.md +15 -9
- package/docs/reverse-proxy.md +2 -2
- package/docs/reverse-proxy.zh-CN.md +2 -2
- package/docs/support-history.md +67 -60
- package/docs/support-history.zh-CN.md +67 -60
- package/examples/web-profile-auth-remote.patch.yml +1 -1
- package/package.json +19 -22
- package/dist/types/cli/language.d.ts +0 -14
- package/dist/types/cli/language.d.ts.map +0 -1
package/dist/cli.js
CHANGED
|
@@ -485,33 +485,33 @@ var TOTP_PERIOD_MS = 3e4;
|
|
|
485
485
|
function base32(bytes) {
|
|
486
486
|
let bits = 0;
|
|
487
487
|
let value = 0;
|
|
488
|
-
let
|
|
488
|
+
let output = "";
|
|
489
489
|
for (const byte of bytes) {
|
|
490
490
|
value = value << 8 | byte;
|
|
491
491
|
bits += 8;
|
|
492
492
|
while (bits >= 5) {
|
|
493
|
-
|
|
493
|
+
output += alphabet[value >>> bits - 5 & 31];
|
|
494
494
|
bits -= 5;
|
|
495
495
|
}
|
|
496
496
|
}
|
|
497
|
-
if (bits > 0)
|
|
498
|
-
return
|
|
497
|
+
if (bits > 0) output += alphabet[value << 5 - bits & 31];
|
|
498
|
+
return output;
|
|
499
499
|
}
|
|
500
500
|
function fromBase32(value) {
|
|
501
501
|
let bits = 0;
|
|
502
502
|
let accum = 0;
|
|
503
|
-
const
|
|
503
|
+
const output = [];
|
|
504
504
|
for (const char of value) {
|
|
505
505
|
const digit = alphabet.indexOf(char);
|
|
506
506
|
if (digit < 0) throw new Error("auth-remote: invalid TOTP secret");
|
|
507
507
|
accum = accum << 5 | digit;
|
|
508
508
|
bits += 5;
|
|
509
509
|
if (bits >= 8) {
|
|
510
|
-
|
|
510
|
+
output.push(accum >>> bits - 8 & 255);
|
|
511
511
|
bits -= 8;
|
|
512
512
|
}
|
|
513
513
|
}
|
|
514
|
-
return Buffer.from(
|
|
514
|
+
return Buffer.from(output);
|
|
515
515
|
}
|
|
516
516
|
function generateTotpSecret() {
|
|
517
517
|
return base32(randomBytes3(20));
|
|
@@ -999,155 +999,13 @@ import { lstat as lstat3 } from "node:fs/promises";
|
|
|
999
999
|
import { connect } from "node:net";
|
|
1000
1000
|
import { dirname } from "node:path";
|
|
1001
1001
|
|
|
1002
|
-
// src/
|
|
1003
|
-
var
|
|
1004
|
-
errorNetwork: "Connection failed. Check your network and try again.",
|
|
1002
|
+
// src/cli/messages.ts
|
|
1003
|
+
var messages = {
|
|
1005
1004
|
errorRateLimited: "Too many attempts. Try again in about {seconds} seconds.",
|
|
1006
|
-
errorUnauthorized: "Your session has expired. Sign in again.",
|
|
1007
|
-
errorServiceUnavailable: "The service is temporarily unavailable. Try again later.",
|
|
1008
|
-
errorGeneric: "The operation could not be completed. Try again.",
|
|
1009
|
-
accountLoginDisabled: "Manual account sign-in is disabled. Refresh this page to use the native sign-in entry.",
|
|
1010
|
-
settingsLoginConfiguration: "Sign-in preferences",
|
|
1011
|
-
settingsManualDescription: "Authorize in a new tab, then paste the callback address.",
|
|
1012
|
-
settingsManualAccountLogin: "Remote DeepSeek account sign-in",
|
|
1013
|
-
settingsManualConfigUnavailable: "Sign-in preferences are temporarily unavailable.",
|
|
1014
|
-
settingsManualUnavailable: "Manual account sign-in is unavailable in this DSH environment.",
|
|
1015
|
-
settingsManualSaveFailed: "Could not save this preference. Check the current value and try again.",
|
|
1016
|
-
settingsSaving: "Saving\u2026",
|
|
1017
|
-
settingsRetry: "Retry",
|
|
1018
|
-
accountLoginTitle: "Sign in to DeepSeek",
|
|
1019
|
-
accountLoginStepOpen: "Sign in to DeepSeek in a new tab.",
|
|
1020
|
-
accountLoginStepCopy: "Copy the full address after authorization and paste it here.",
|
|
1021
|
-
accountLoginCallbackLabel: "Full callback address",
|
|
1022
|
-
accountLoginCallbackHint: "A connection error or 404 after authorization is expected. Copy the full address.",
|
|
1023
|
-
accountLoginOpen: "Open sign-in page",
|
|
1024
|
-
accountLoginConfirm: "Confirm sign-in",
|
|
1025
|
-
accountLoginCancel: "Cancel",
|
|
1026
|
-
accountLoginUseApiKey: "Use API key",
|
|
1027
|
-
accountLoginClose: "Close",
|
|
1028
|
-
accountLoginRetry: "Start again",
|
|
1029
|
-
accountLoginReopen: "Reopen authorization page",
|
|
1030
|
-
accountLoginPopupBlocked: "The new tab was blocked.",
|
|
1031
|
-
accountLoginInitializing: "Preparing authorization\u2026",
|
|
1032
|
-
accountLoginWaiting: "Authorization lasts at most 10 minutes.",
|
|
1033
|
-
accountLoginExchanging: "Completing sign-in\u2026",
|
|
1034
|
-
accountLoginInvalidCallback: "This callback address does not match the current authorization. Copy the full address, including code and state, from the latest authorization tab.",
|
|
1035
|
-
accountLoginExpired: "This authorization has expired. Start again.",
|
|
1036
|
-
accountLoginMismatch: "This authorization is no longer available in this session. Close this dialog and start again.",
|
|
1037
|
-
accountLoginBusy: "Another authorization is in progress. Finish or cancel it before starting again.",
|
|
1038
|
-
accountLoginUnavailable: "This DSH version does not provide compatible account sign-in.",
|
|
1039
|
-
accountLoginFailed: "Authorization could not be completed. Start again and submit the address from the new tab.",
|
|
1040
|
-
accountLoginNoResponse: "The DeepSeek platform did not respond. Check the DSH server\u2019s network connection and start again.",
|
|
1041
|
-
loginInitialTitle: "Sign in",
|
|
1042
|
-
loginInitialLoading: "Checking sign-in status\u2026",
|
|
1043
|
-
loginLanguageLabel: "Language",
|
|
1044
|
-
loginSetupTitle: "Set up your account first",
|
|
1045
|
-
loginSetupDescription: "Run this command in a terminal on the server running DSH, then create a username and password when prompted. The web page cannot create the account.",
|
|
1046
|
-
loginSetupCopy: "Copy command",
|
|
1047
|
-
loginSetupRecheck: "I finished setup",
|
|
1048
|
-
loginSetupCopied: "Command copied.",
|
|
1049
|
-
loginSetupCopyFallback: "Select and copy the command manually.",
|
|
1050
|
-
loginSetupNotFound: "No account was found. Check that the command used this profile, then try again.",
|
|
1051
|
-
loginTitle: "Sign in",
|
|
1052
|
-
loginUsername: "Username",
|
|
1053
|
-
loginPassword: "Password",
|
|
1054
|
-
loginContinue: "Continue",
|
|
1055
|
-
loginMfaTitle: "Verify your second factor",
|
|
1056
|
-
loginMfaDescription: "Enter the six-digit code from your authenticator or a one-time backup code. This challenge expires in five minutes.",
|
|
1057
|
-
loginMfaCode: "Verification or backup code",
|
|
1058
|
-
loginMfaSubmit: "Verify and sign in",
|
|
1059
|
-
loginBackToPassword: "Back to password sign-in",
|
|
1060
|
-
loginMfaExhausted: "This challenge is exhausted. Enter your password again.",
|
|
1061
|
-
loginBindingTitle: "Connect an authenticator",
|
|
1062
|
-
loginBindingDescription: "Scan the QR code with your authenticator, or enter the secret below. After confirmation, ten one-time backup codes will appear and you will need to sign in again.",
|
|
1063
|
-
loginBindingQrAlt: "Authenticator setup QR code",
|
|
1064
|
-
loginBindingManualSecret: "Manual secret",
|
|
1065
|
-
loginBindingCode: "Six-digit code from the authenticator",
|
|
1066
|
-
loginBindingConfirm: "Confirm setup",
|
|
1067
|
-
loginBindingRestart: "Sign in again",
|
|
1068
|
-
loginBindingQrUnavailable: "The QR code is unavailable. Use the manual secret above.",
|
|
1069
|
-
loginBindingExhausted: "This setup challenge is exhausted. Enter your password again.",
|
|
1070
|
-
loginBackupTitle: "Save your backup codes",
|
|
1071
|
-
loginBackupDescription: "These codes are shown only once. Store them safely; each code can be used only once. Sign in again after saving them.",
|
|
1072
|
-
loginBackupSaved: "I saved them; sign in again",
|
|
1073
|
-
loginOptionalTitle: "Protect your account",
|
|
1074
|
-
loginOptionalDescription: "This profile lets you connect an authenticator later. Connecting one now adds protection; you can also do it in Security settings.",
|
|
1075
|
-
loginOptionalBindNow: "Connect TOTP now",
|
|
1076
|
-
loginOptionalSkip: "Skip and enter DSH",
|
|
1077
|
-
loginOptionalVerifyTitle: "Verify again before setup",
|
|
1078
|
-
loginOptionalVerifyDescription: "Enter your current password to protect your account.",
|
|
1079
|
-
loginOptionalCurrentPassword: "Current password",
|
|
1080
|
-
loginOptionalStart: "Start setup",
|
|
1081
|
-
loginOptionalSkipLater: "Connect later and enter DSH",
|
|
1082
|
-
loginReasonExpired: "Your session has expired. Sign in again.",
|
|
1083
|
-
loginReasonUpdated: "Security settings changed. Sign in again.",
|
|
1084
|
-
loginReasonSignedOut: "You signed out of this session.",
|
|
1085
|
-
loginUnavailableTitle: "Sign-in is temporarily unavailable",
|
|
1086
|
-
loginUnavailableDescription: "The service status is unavailable. Check the connection and retry.",
|
|
1087
|
-
loginRetry: "Check again",
|
|
1088
|
-
loginErrorInvalidCredentials: "The username or password is incorrect. Try again.",
|
|
1089
|
-
loginErrorInvalidFactor: "The verification or backup code is incorrect. After five failed attempts, you must enter your password again.",
|
|
1090
|
-
loginErrorChallenge: "This verification expired. Enter your username and password again.",
|
|
1091
|
-
loginErrorUninitialized: "The account is not set up. Run the setup command in the server terminal.",
|
|
1092
|
-
settingsClose: "Close",
|
|
1093
|
-
settingsCancel: "Cancel",
|
|
1094
|
-
settingsOverview: "Account overview",
|
|
1095
|
-
settingsUsername: "DSH sign-in username",
|
|
1096
|
-
settingsCreatedAt: "Signed in at",
|
|
1097
|
-
settingsExpiresAt: "Session expires at",
|
|
1098
|
-
settingsActiveSessions: "Active sessions",
|
|
1099
|
-
settingsTotpRequired: "TOTP is required by configuration and cannot be turned off.",
|
|
1100
|
-
settingsPasswordTitle: "Password",
|
|
1101
|
-
settingsSignOutCurrentDescription: "Sign out this session? Other sessions will stay signed in.",
|
|
1102
|
-
settingsSectionLabel: "Security & sign-in",
|
|
1103
|
-
settingsSectionAria: "Security & sign-in settings",
|
|
1104
|
-
settingsTitle: "Security & sign-in",
|
|
1105
|
-
settingsAccountSummary: "Account: {username} \xB7 TOTP: {totp}",
|
|
1106
|
-
settingsTotpEnabled: "Enabled",
|
|
1107
|
-
settingsTotpNotBound: "Not connected",
|
|
1108
|
-
settingsLoading: "Loading account status\u2026",
|
|
1109
|
-
settingsChangePassword: "Change password",
|
|
1110
|
-
settingsBindTotp: "Turn on TOTP",
|
|
1111
|
-
settingsRebindTotp: "Reconnect TOTP",
|
|
1112
|
-
settingsSessions: "Session management",
|
|
1113
|
-
settingsPasswordMismatch: "The new passwords do not match.",
|
|
1114
|
-
settingsPasswordDescription: "After this change, every device must sign in again.",
|
|
1115
|
-
settingsCurrentPassword: "Current password",
|
|
1116
|
-
settingsCurrentCode: "Current verification or backup code",
|
|
1117
|
-
settingsNewPassword: "New password",
|
|
1118
|
-
settingsConfirmPassword: "Confirm new password",
|
|
1119
|
-
settingsSavePassword: "Save new password",
|
|
1120
|
-
settingsBindDescription: "Enter your current credentials. After connecting the new authenticator, every device must sign in again.",
|
|
1121
|
-
settingsStartBinding: "Start setup",
|
|
1122
|
-
settingsDisableTotp: "Turn off TOTP",
|
|
1123
|
-
settingsDisableDescription: "After turning off TOTP, every device must sign in again.",
|
|
1124
|
-
settingsScanQr: "Scan the QR code",
|
|
1125
|
-
settingsQrAlt: "Authenticator setup QR code",
|
|
1126
|
-
settingsQrUnavailable: "The QR code is unavailable. Use the manual secret below.",
|
|
1127
|
-
settingsQrLoading: "Generating the QR code; you can use the manual secret below.",
|
|
1128
|
-
settingsManualSecret: "Manual secret:",
|
|
1129
|
-
settingsNewCode: "Six-digit code from the new authenticator",
|
|
1130
|
-
settingsConfirmBinding: "Confirm setup",
|
|
1131
|
-
settingsRestartBinding: "Start over",
|
|
1132
|
-
settingsSignOutCurrent: "Sign out this session",
|
|
1133
|
-
settingsSignOutAll: "Sign out all sessions",
|
|
1134
|
-
settingsSignOutAllDescription: "Enter your current credentials. All sessions, including this one, and open connections will be revoked.",
|
|
1135
|
-
settingsOldBackupInvalid: "Your previous backup codes no longer work.",
|
|
1136
|
-
settingsCopyAll: "Copy all",
|
|
1137
|
-
settingsBackupCopied: "Backup codes copied.",
|
|
1138
|
-
settingsBackupCopyFailed: "Could not copy. Select the codes and copy them manually.",
|
|
1139
|
-
settingsBackupTitle: "Save your backup codes",
|
|
1140
|
-
settingsBackupDescription: "These codes are shown only once. Store them safely; each code can be used only once.",
|
|
1141
|
-
settingsBackupSaved: "I saved them; sign in again",
|
|
1142
|
-
settingsErrorInvalidCredentials: "The current password is incorrect.",
|
|
1143
|
-
settingsErrorInvalidFactor: "The current verification or backup code is incorrect.",
|
|
1144
|
-
settingsErrorInvalidInput: "The input is invalid. Passwords must meet the server length rules.",
|
|
1145
|
-
settingsErrorChallenge: "The setup challenge expired. Start setup again.",
|
|
1146
|
-
settingsErrorTotpRequired: "This profile requires TOTP, so it cannot be turned off.",
|
|
1147
1005
|
cliHelp: `dsh-auth-remote {version}
|
|
1148
1006
|
|
|
1149
1007
|
Usage:
|
|
1150
|
-
dsh plugin --profile web exec dsh-auth-remote
|
|
1008
|
+
dsh plugin --profile web exec dsh-auth-remote COMMAND
|
|
1151
1009
|
|
|
1152
1010
|
Commands:
|
|
1153
1011
|
init Create the single account interactively
|
|
@@ -1157,7 +1015,6 @@ Commands:
|
|
|
1157
1015
|
revoke-sessions Sign out every device
|
|
1158
1016
|
|
|
1159
1017
|
Options:
|
|
1160
|
-
--lang en|zh Choose the language for human-readable output
|
|
1161
1018
|
--help, -h Show this help
|
|
1162
1019
|
--version, -v Show the package version
|
|
1163
1020
|
|
|
@@ -1185,9 +1042,6 @@ The command uses the profile selected by dsh plugin exec and the caller's DSH_HO
|
|
|
1185
1042
|
cliOffline: "Offline",
|
|
1186
1043
|
cliCompleted: "{command} completed; the change is durable and effective.",
|
|
1187
1044
|
cliErrorInvalidArguments: "Invalid command or arguments. Use --help.",
|
|
1188
|
-
cliErrorInvalidLanguage: "Invalid --lang value. Use en or zh.",
|
|
1189
|
-
cliErrorDuplicateLanguage: "Specify --lang only once.",
|
|
1190
|
-
cliErrorMissingLanguage: "Missing value for --lang. Use en or zh.",
|
|
1191
1045
|
cliErrorPasswordsMismatch: "The passwords do not match.",
|
|
1192
1046
|
cliErrorConfirmationMismatch: "The confirmation did not match the target profile.",
|
|
1193
1047
|
cliErrorPasswordLength: "Password must contain 12\u2013256 Unicode characters.",
|
|
@@ -1211,293 +1065,17 @@ The command uses the profile selected by dsh plugin exec and the caller's DSH_HO
|
|
|
1211
1065
|
cliErrorBusy: "The service is busy. Try again later.",
|
|
1212
1066
|
cliErrorUnknown: "The operation failed. Check status before trying again."
|
|
1213
1067
|
};
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
errorRateLimited: "\u5C1D\u8BD5\u8FC7\u4E8E\u9891\u7E41\uFF0C\u8BF7\u7EA6 {seconds} \u79D2\u540E\u91CD\u8BD5\u3002",
|
|
1219
|
-
errorUnauthorized: "\u4F1A\u8BDD\u5DF2\u5931\u6548\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55\u3002",
|
|
1220
|
-
errorServiceUnavailable: "\u670D\u52A1\u6682\u65F6\u4E0D\u53EF\u7528\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",
|
|
1221
|
-
errorGeneric: "\u64CD\u4F5C\u672A\u5B8C\u6210\uFF0C\u8BF7\u91CD\u8BD5\u3002",
|
|
1222
|
-
accountLoginDisabled: "\u624B\u52A8\u8D26\u53F7\u767B\u5F55\u5DF2\u5173\u95ED\u3002\u8BF7\u5237\u65B0\u9875\u9762\uFF0C\u4F7F\u7528\u539F\u751F\u767B\u5F55\u5165\u53E3\u3002",
|
|
1223
|
-
settingsLoginConfiguration: "\u767B\u5F55\u914D\u7F6E",
|
|
1224
|
-
settingsManualDescription: "\u5728\u65B0\u6807\u7B7E\u9875\u6388\u6743\u540E\uFF0C\u7C98\u8D34\u56DE\u8C03\u5730\u5740\u767B\u5F55\u3002",
|
|
1225
|
-
settingsManualAccountLogin: "\u8FDC\u7A0B DeepSeek \u8D26\u53F7\u767B\u5F55",
|
|
1226
|
-
settingsManualConfigUnavailable: "\u767B\u5F55\u914D\u7F6E\u6682\u65F6\u4E0D\u53EF\u7528\u3002",
|
|
1227
|
-
settingsManualUnavailable: "\u5F53\u524D DSH \u73AF\u5883\u4E0D\u652F\u6301\u624B\u52A8\u8D26\u53F7\u767B\u5F55\u3002",
|
|
1228
|
-
settingsManualSaveFailed: "\u914D\u7F6E\u4FDD\u5B58\u5931\u8D25\u3002\u8BF7\u68C0\u67E5\u5F53\u524D\u503C\u540E\u91CD\u8BD5\u3002",
|
|
1229
|
-
settingsSaving: "\u6B63\u5728\u4FDD\u5B58\u2026",
|
|
1230
|
-
settingsRetry: "\u91CD\u8BD5",
|
|
1231
|
-
accountLoginTitle: "\u767B\u5F55 DeepSeek \u8D26\u53F7",
|
|
1232
|
-
accountLoginStepOpen: "\u5728\u65B0\u6807\u7B7E\u9875\u5B8C\u6210 DeepSeek \u767B\u5F55\u3002",
|
|
1233
|
-
accountLoginStepCopy: "\u590D\u5236\u6388\u6743\u540E\u5730\u5740\u680F\u7684\u5B8C\u6574\u5730\u5740\uFF0C\u8FD4\u56DE\u6B64\u5904\u7C98\u8D34\u3002",
|
|
1234
|
-
accountLoginCallbackLabel: "\u5B8C\u6574\u56DE\u8C03\u5730\u5740",
|
|
1235
|
-
accountLoginCallbackHint: "\u6388\u6743\u540E\u5373\u4F7F\u9875\u9762\u663E\u793A\u8FDE\u63A5\u5931\u8D25\u6216 404\uFF0C\u4E5F\u53EF\u4EE5\u590D\u5236\u5B8C\u6574\u5730\u5740\u3002",
|
|
1236
|
-
accountLoginOpen: "\u6253\u5F00\u767B\u5F55\u9875",
|
|
1237
|
-
accountLoginConfirm: "\u786E\u8BA4\u767B\u5F55",
|
|
1238
|
-
accountLoginCancel: "\u53D6\u6D88",
|
|
1239
|
-
accountLoginUseApiKey: "\u4F7F\u7528 API Key",
|
|
1240
|
-
accountLoginClose: "\u5173\u95ED",
|
|
1241
|
-
accountLoginRetry: "\u91CD\u65B0\u5F00\u59CB",
|
|
1242
|
-
accountLoginReopen: "\u91CD\u65B0\u6253\u5F00\u6388\u6743\u9875",
|
|
1243
|
-
accountLoginPopupBlocked: "\u65B0\u6807\u7B7E\u9875\u88AB\u6D4F\u89C8\u5668\u62E6\u622A\u3002",
|
|
1244
|
-
accountLoginInitializing: "\u6B63\u5728\u51C6\u5907\u6388\u6743\u2026",
|
|
1245
|
-
accountLoginWaiting: "\u6388\u6743\u6709\u6548\u671F\u6700\u957F 10 \u5206\u949F\u3002",
|
|
1246
|
-
accountLoginExchanging: "\u6B63\u5728\u5B8C\u6210\u767B\u5F55\u2026",
|
|
1247
|
-
accountLoginInvalidCallback: "\u56DE\u8C03\u5730\u5740\u4E0E\u5F53\u524D\u6388\u6743\u4E0D\u5339\u914D\uFF0C\u8BF7\u4ECE\u6700\u8FD1\u4E00\u6B21\u6388\u6743\u6807\u7B7E\u9875\u590D\u5236\u5305\u542B code \u548C state \u7684\u5B8C\u6574\u5730\u5740\u3002",
|
|
1248
|
-
accountLoginExpired: "\u672C\u6B21\u6388\u6743\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u5F00\u59CB\u3002",
|
|
1249
|
-
accountLoginMismatch: "\u5F53\u524D\u4F1A\u8BDD\u5DF2\u65E0\u6CD5\u7EE7\u7EED\u6B64\u6388\u6743\uFF0C\u8BF7\u5173\u95ED\u5F39\u7A97\u540E\u91CD\u65B0\u5F00\u59CB\u3002",
|
|
1250
|
-
accountLoginBusy: "\u5DF2\u6709\u6388\u6743\u6B63\u5728\u8FDB\u884C\uFF0C\u8BF7\u5148\u5B8C\u6210\u6216\u53D6\u6D88\u540E\u518D\u5F00\u59CB\u3002",
|
|
1251
|
-
accountLoginUnavailable: "\u5F53\u524D DSH \u7248\u672C\u672A\u63D0\u4F9B\u517C\u5BB9\u7684\u8D26\u53F7\u767B\u5F55\u529F\u80FD\u3002",
|
|
1252
|
-
accountLoginFailed: "\u672A\u80FD\u5B8C\u6210\u6388\u6743\uFF0C\u8BF7\u91CD\u65B0\u5F00\u59CB\uFF0C\u5E76\u63D0\u4EA4\u65B0\u6807\u7B7E\u9875\u4E2D\u7684\u56DE\u8C03\u5730\u5740\u3002",
|
|
1253
|
-
accountLoginNoResponse: "DeepSeek \u5E73\u53F0\u672A\u54CD\u5E94\uFF0C\u8BF7\u68C0\u67E5 DSH \u670D\u52A1\u5668\u7684\u7F51\u7EDC\u8FDE\u63A5\u540E\u91CD\u65B0\u5F00\u59CB\u3002",
|
|
1254
|
-
loginInitialTitle: "\u767B\u5F55",
|
|
1255
|
-
loginInitialLoading: "\u6B63\u5728\u68C0\u67E5\u767B\u5F55\u72B6\u6001\u2026",
|
|
1256
|
-
loginLanguageLabel: "\u8BED\u8A00",
|
|
1257
|
-
loginSetupTitle: "\u5148\u521D\u59CB\u5316\u8D26\u53F7",
|
|
1258
|
-
loginSetupDescription: "\u8BF7\u5728\u8FD0\u884C DSH \u7684\u670D\u52A1\u5668\u7EC8\u7AEF\u8F93\u5165\u4E0B\u5217\u547D\u4EE4\uFF0C\u7136\u540E\u6309\u63D0\u793A\u521B\u5EFA\u7528\u6237\u540D\u548C\u5BC6\u7801\u3002\u7F51\u9875\u4E0D\u4F1A\u521B\u5EFA\u8D26\u53F7\u3002",
|
|
1259
|
-
loginSetupCopy: "\u590D\u5236\u547D\u4EE4",
|
|
1260
|
-
loginSetupRecheck: "\u6211\u5DF2\u5B8C\u6210\u521D\u59CB\u5316",
|
|
1261
|
-
loginSetupCopied: "\u547D\u4EE4\u5DF2\u590D\u5236\u3002",
|
|
1262
|
-
loginSetupCopyFallback: "\u8BF7\u624B\u52A8\u9009\u62E9\u5E76\u590D\u5236\u547D\u4EE4\u3002",
|
|
1263
|
-
loginSetupNotFound: "\u5C1A\u672A\u68C0\u6D4B\u5230\u8D26\u53F7\u3002\u8BF7\u786E\u8BA4\u547D\u4EE4\u4F7F\u7528\u4E86\u5F53\u524D profile\uFF0C\u518D\u91CD\u65B0\u68C0\u67E5\u3002",
|
|
1264
|
-
loginTitle: "\u767B\u5F55",
|
|
1265
|
-
loginUsername: "\u7528\u6237\u540D",
|
|
1266
|
-
loginPassword: "\u5BC6\u7801",
|
|
1267
|
-
loginContinue: "\u7EE7\u7EED",
|
|
1268
|
-
loginMfaTitle: "\u9A8C\u8BC1\u7B2C\u4E8C\u56E0\u7D20",
|
|
1269
|
-
loginMfaDescription: "\u8F93\u5165\u8EAB\u4EFD\u9A8C\u8BC1\u5668\u4E2D\u7684 6 \u4F4D\u6570\u5B57\uFF0C\u6216\u8F93\u5165\u4E00\u6B21\u6027\u5907\u7528\u7801\u3002\u6311\u6218 5 \u5206\u949F\u540E\u5931\u6548\u3002",
|
|
1270
|
-
loginMfaCode: "\u9A8C\u8BC1\u7801\u6216\u5907\u7528\u7801",
|
|
1271
|
-
loginMfaSubmit: "\u9A8C\u8BC1\u5E76\u767B\u5F55",
|
|
1272
|
-
loginBackToPassword: "\u8FD4\u56DE\u5BC6\u7801\u767B\u5F55",
|
|
1273
|
-
loginMfaExhausted: "\u672C\u6B21\u6311\u6218\u5DF2\u7528\u5C3D\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165\u5BC6\u7801\u3002",
|
|
1274
|
-
loginBindingTitle: "\u7ED1\u5B9A\u8EAB\u4EFD\u9A8C\u8BC1\u5668",
|
|
1275
|
-
loginBindingDescription: "\u4F7F\u7528\u8EAB\u4EFD\u9A8C\u8BC1\u5668\u626B\u63CF\u4E8C\u7EF4\u7801\uFF0C\u6216\u624B\u52A8\u8F93\u5165\u4E0B\u65B9\u5BC6\u94A5\u3002\u786E\u8BA4\u6210\u529F\u540E\u5C06\u663E\u793A 10 \u4E2A\u4E00\u6B21\u6027\u5907\u7528\u7801\uFF0C\u5E76\u8981\u6C42\u91CD\u65B0\u767B\u5F55\u3002",
|
|
1276
|
-
loginBindingQrAlt: "\u8EAB\u4EFD\u9A8C\u8BC1\u5668\u7ED1\u5B9A\u4E8C\u7EF4\u7801",
|
|
1277
|
-
loginBindingManualSecret: "\u624B\u5DE5\u5BC6\u94A5",
|
|
1278
|
-
loginBindingCode: "\u8EAB\u4EFD\u9A8C\u8BC1\u5668\u4E2D\u7684 6 \u4F4D\u9A8C\u8BC1\u7801",
|
|
1279
|
-
loginBindingConfirm: "\u786E\u8BA4\u7ED1\u5B9A",
|
|
1280
|
-
loginBindingRestart: "\u91CD\u65B0\u767B\u5F55",
|
|
1281
|
-
loginBindingQrUnavailable: "\u4E8C\u7EF4\u7801\u6682\u4E0D\u53EF\u7528\uFF0C\u8BF7\u4F7F\u7528\u4E0A\u65B9\u624B\u5DE5\u5BC6\u94A5\u3002",
|
|
1282
|
-
loginBindingExhausted: "\u7ED1\u5B9A\u6311\u6218\u5DF2\u7528\u5C3D\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165\u5BC6\u7801\u3002",
|
|
1283
|
-
loginBackupTitle: "\u4FDD\u5B58\u5907\u7528\u7801",
|
|
1284
|
-
loginBackupDescription: "\u8FD9\u4E9B\u5907\u7528\u7801\u53EA\u4F1A\u663E\u793A\u8FD9\u4E00\u6B21\u3002\u8BF7\u5B58\u653E\u5728\u5B89\u5168\u7684\u4F4D\u7F6E\uFF0C\u6BCF\u4E2A\u5907\u7528\u7801\u53EA\u80FD\u4F7F\u7528\u4E00\u6B21\u3002\u4FDD\u5B58\u540E\u91CD\u65B0\u767B\u5F55\u3002",
|
|
1285
|
-
loginBackupSaved: "\u6211\u5DF2\u4FDD\u5B58\uFF0C\u91CD\u65B0\u767B\u5F55",
|
|
1286
|
-
loginOptionalTitle: "\u4FDD\u62A4\u4F60\u7684\u8D26\u53F7",
|
|
1287
|
-
loginOptionalDescription: "\u5F53\u524D profile \u5141\u8BB8\u7A0D\u540E\u7ED1\u5B9A\u8EAB\u4EFD\u9A8C\u8BC1\u5668\u3002\u73B0\u5728\u7ED1\u5B9A\u53EF\u4EE5\u589E\u52A0\u4FDD\u62A4\uFF1B\u8DF3\u8FC7\u540E\u4E5F\u53EF\u5728\u5B89\u5168\u8BBE\u7F6E\u4E2D\u7ED1\u5B9A\u3002",
|
|
1288
|
-
loginOptionalBindNow: "\u73B0\u5728\u7ED1\u5B9A TOTP",
|
|
1289
|
-
loginOptionalSkip: "\u8DF3\u8FC7\uFF0C\u8FDB\u5165 DSH",
|
|
1290
|
-
loginOptionalVerifyTitle: "\u518D\u6B21\u9A8C\u8BC1\u540E\u7ED1\u5B9A",
|
|
1291
|
-
loginOptionalVerifyDescription: "\u4E3A\u4FDD\u62A4\u8D26\u53F7\uFF0C\u8BF7\u518D\u6B21\u8F93\u5165\u5F53\u524D\u5BC6\u7801\u3002",
|
|
1292
|
-
loginOptionalCurrentPassword: "\u5F53\u524D\u5BC6\u7801",
|
|
1293
|
-
loginOptionalStart: "\u5F00\u59CB\u7ED1\u5B9A",
|
|
1294
|
-
loginOptionalSkipLater: "\u7A0D\u540E\u7ED1\u5B9A\uFF0C\u8FDB\u5165 DSH",
|
|
1295
|
-
loginReasonExpired: "\u4F1A\u8BDD\u5DF2\u5931\u6548\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55\u3002",
|
|
1296
|
-
loginReasonUpdated: "\u5B89\u5168\u8BBE\u7F6E\u5DF2\u66F4\u65B0\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55\u3002",
|
|
1297
|
-
loginReasonSignedOut: "\u5DF2\u9000\u51FA\u5F53\u524D\u4F1A\u8BDD\u3002",
|
|
1298
|
-
loginUnavailableTitle: "\u6682\u65F6\u65E0\u6CD5\u767B\u5F55",
|
|
1299
|
-
loginUnavailableDescription: "\u670D\u52A1\u72B6\u6001\u6682\u65F6\u65E0\u6CD5\u53D6\u5F97\uFF0C\u8BF7\u68C0\u67E5\u8FDE\u63A5\u5E76\u91CD\u8BD5\u3002",
|
|
1300
|
-
loginRetry: "\u91CD\u65B0\u68C0\u67E5",
|
|
1301
|
-
loginErrorInvalidCredentials: "\u7528\u6237\u540D\u6216\u5BC6\u7801\u4E0D\u6B63\u786E\uFF0C\u8BF7\u91CD\u8BD5\u3002",
|
|
1302
|
-
loginErrorInvalidFactor: "\u9A8C\u8BC1\u7801\u6216\u5907\u7528\u7801\u4E0D\u6B63\u786E\uFF1B\u8FDE\u7EED\u5931\u8D25 5 \u6B21\u540E\u9700\u91CD\u65B0\u8F93\u5165\u5BC6\u7801\u3002",
|
|
1303
|
-
loginErrorChallenge: "\u672C\u6B21\u9A8C\u8BC1\u5DF2\u5931\u6548\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165\u7528\u6237\u540D\u548C\u5BC6\u7801\u3002",
|
|
1304
|
-
loginErrorUninitialized: "\u8D26\u53F7\u5C1A\u672A\u521D\u59CB\u5316\uFF0C\u8BF7\u5148\u5728\u670D\u52A1\u5668\u7EC8\u7AEF\u8FD0\u884C\u521D\u59CB\u5316\u547D\u4EE4\u3002",
|
|
1305
|
-
settingsClose: "\u5173\u95ED",
|
|
1306
|
-
settingsCancel: "\u53D6\u6D88",
|
|
1307
|
-
settingsOverview: "\u8D26\u6237\u6982\u89C8",
|
|
1308
|
-
settingsUsername: "DSH \u767B\u5F55\u7528\u6237\u540D",
|
|
1309
|
-
settingsCreatedAt: "\u672C\u6B21\u767B\u5F55\u65F6\u95F4",
|
|
1310
|
-
settingsExpiresAt: "\u5F53\u524D\u4F1A\u8BDD\u5230\u671F\u65F6\u95F4",
|
|
1311
|
-
settingsActiveSessions: "\u6709\u6548\u4F1A\u8BDD\u6570\u91CF",
|
|
1312
|
-
settingsTotpRequired: "\u914D\u7F6E\u8981\u6C42\u5F00\u542F TOTP\uFF0C\u65E0\u6CD5\u5173\u95ED\u3002",
|
|
1313
|
-
settingsPasswordTitle: "\u5BC6\u7801",
|
|
1314
|
-
settingsSignOutCurrentDescription: "\u786E\u5B9A\u9000\u51FA\u5F53\u524D\u4F1A\u8BDD\uFF1F\u5176\u4ED6\u4F1A\u8BDD\u5C06\u7EE7\u7EED\u4FDD\u6301\u767B\u5F55\u3002",
|
|
1315
|
-
settingsSectionLabel: "\u5B89\u5168\u4E0E\u767B\u5F55",
|
|
1316
|
-
settingsSectionAria: "\u5B89\u5168\u4E0E\u767B\u5F55\u8BBE\u7F6E",
|
|
1317
|
-
settingsTitle: "\u5B89\u5168\u4E0E\u767B\u5F55",
|
|
1318
|
-
settingsAccountSummary: "\u8D26\u53F7\uFF1A{username} \xB7 TOTP\uFF1A{totp}",
|
|
1319
|
-
settingsTotpEnabled: "\u5DF2\u542F\u7528",
|
|
1320
|
-
settingsTotpNotBound: "\u672A\u7ED1\u5B9A",
|
|
1321
|
-
settingsLoading: "\u6B63\u5728\u8BFB\u53D6\u8D26\u53F7\u72B6\u6001\u2026",
|
|
1322
|
-
settingsChangePassword: "\u4FEE\u6539\u5BC6\u7801",
|
|
1323
|
-
settingsBindTotp: "\u5F00\u542F TOTP",
|
|
1324
|
-
settingsRebindTotp: "\u91CD\u65B0\u7ED1\u5B9A TOTP",
|
|
1325
|
-
settingsSessions: "\u4F1A\u8BDD\u7BA1\u7406",
|
|
1326
|
-
settingsPasswordMismatch: "\u4E24\u6B21\u8F93\u5165\u7684\u65B0\u5BC6\u7801\u4E0D\u4E00\u81F4\u3002",
|
|
1327
|
-
settingsPasswordDescription: "\u5B8C\u6210\u540E\u6240\u6709\u8BBE\u5907\u90FD\u9700\u8981\u91CD\u65B0\u767B\u5F55\u3002",
|
|
1328
|
-
settingsCurrentPassword: "\u5F53\u524D\u5BC6\u7801",
|
|
1329
|
-
settingsCurrentCode: "\u5F53\u524D\u9A8C\u8BC1\u7801\u6216\u5907\u7528\u7801",
|
|
1330
|
-
settingsNewPassword: "\u65B0\u5BC6\u7801",
|
|
1331
|
-
settingsConfirmPassword: "\u518D\u6B21\u8F93\u5165\u65B0\u5BC6\u7801",
|
|
1332
|
-
settingsSavePassword: "\u4FDD\u5B58\u65B0\u5BC6\u7801",
|
|
1333
|
-
settingsBindDescription: "\u8BF7\u8F93\u5165\u5F53\u524D\u51ED\u8BC1\uFF1B\u65B0\u7ED1\u5B9A\u5B8C\u6210\u540E\u6240\u6709\u8BBE\u5907\u90FD\u9700\u8981\u91CD\u65B0\u767B\u5F55\u3002",
|
|
1334
|
-
settingsStartBinding: "\u5F00\u59CB\u7ED1\u5B9A",
|
|
1335
|
-
settingsDisableTotp: "\u5173\u95ED TOTP",
|
|
1336
|
-
settingsDisableDescription: "\u5173\u95ED\u540E\u6240\u6709\u8BBE\u5907\u90FD\u9700\u8981\u91CD\u65B0\u767B\u5F55\u3002",
|
|
1337
|
-
settingsScanQr: "\u626B\u63CF\u4E8C\u7EF4\u7801",
|
|
1338
|
-
settingsQrAlt: "\u8EAB\u4EFD\u9A8C\u8BC1\u5668\u7ED1\u5B9A\u4E8C\u7EF4\u7801",
|
|
1339
|
-
settingsQrUnavailable: "\u4E8C\u7EF4\u7801\u6682\u4E0D\u53EF\u7528\uFF0C\u8BF7\u4F7F\u7528\u4E0B\u65B9\u624B\u5DE5\u5BC6\u94A5\u3002",
|
|
1340
|
-
settingsQrLoading: "\u4E8C\u7EF4\u7801\u751F\u6210\u4E2D\uFF1B\u4E5F\u53EF\u4EE5\u4F7F\u7528\u4E0B\u65B9\u624B\u5DE5\u5BC6\u94A5\u3002",
|
|
1341
|
-
settingsManualSecret: "\u624B\u5DE5\u5BC6\u94A5\uFF1A",
|
|
1342
|
-
settingsNewCode: "\u65B0\u8EAB\u4EFD\u9A8C\u8BC1\u5668\u7684 6 \u4F4D\u9A8C\u8BC1\u7801",
|
|
1343
|
-
settingsConfirmBinding: "\u786E\u8BA4\u7ED1\u5B9A",
|
|
1344
|
-
settingsRestartBinding: "\u91CD\u65B0\u5F00\u59CB",
|
|
1345
|
-
settingsSignOutCurrent: "\u9000\u51FA\u5F53\u524D\u4F1A\u8BDD",
|
|
1346
|
-
settingsSignOutAll: "\u9000\u51FA\u6240\u6709\u4F1A\u8BDD",
|
|
1347
|
-
settingsSignOutAllDescription: "\u8BF7\u8F93\u5165\u5F53\u524D\u51ED\u8BC1\uFF1B\u63D0\u4EA4\u540E\u5305\u62EC\u5F53\u524D\u4F1A\u8BDD\u5728\u5185\u7684\u5168\u90E8\u4F1A\u8BDD\u548C\u957F\u8FDE\u63A5\u90FD\u4F1A\u5931\u6548\u3002",
|
|
1348
|
-
settingsOldBackupInvalid: "\u65E7\u5907\u7528\u7801\u5DF2\u5931\u6548\u3002",
|
|
1349
|
-
settingsCopyAll: "\u590D\u5236\u5168\u90E8",
|
|
1350
|
-
settingsBackupCopied: "\u5907\u7528\u7801\u5DF2\u590D\u5236\u3002",
|
|
1351
|
-
settingsBackupCopyFailed: "\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u9009\u4E2D\u5907\u7528\u7801\u624B\u52A8\u590D\u5236\u3002",
|
|
1352
|
-
settingsBackupTitle: "\u4FDD\u5B58\u5907\u7528\u7801",
|
|
1353
|
-
settingsBackupDescription: "\u8FD9\u4E9B\u5907\u7528\u7801\u53EA\u4F1A\u663E\u793A\u8FD9\u4E00\u6B21\u3002\u8BF7\u5B58\u653E\u5728\u5B89\u5168\u7684\u4F4D\u7F6E\uFF0C\u6BCF\u4E2A\u5907\u7528\u7801\u53EA\u80FD\u4F7F\u7528\u4E00\u6B21\u3002",
|
|
1354
|
-
settingsBackupSaved: "\u6211\u5DF2\u4FDD\u5B58\uFF0C\u91CD\u65B0\u767B\u5F55",
|
|
1355
|
-
settingsErrorInvalidCredentials: "\u5F53\u524D\u5BC6\u7801\u4E0D\u6B63\u786E\u3002",
|
|
1356
|
-
settingsErrorInvalidFactor: "\u5F53\u524D\u9A8C\u8BC1\u7801\u6216\u5907\u7528\u7801\u4E0D\u6B63\u786E\u3002",
|
|
1357
|
-
settingsErrorInvalidInput: "\u8F93\u5165\u4E0D\u7B26\u5408\u8981\u6C42\uFF1B\u5BC6\u7801\u9700\u7B26\u5408\u670D\u52A1\u7AEF\u957F\u5EA6\u89C4\u5219\u3002",
|
|
1358
|
-
settingsErrorChallenge: "\u7ED1\u5B9A\u6311\u6218\u5DF2\u5931\u6548\uFF0C\u8BF7\u91CD\u65B0\u5F00\u59CB\u7ED1\u5B9A\u3002",
|
|
1359
|
-
settingsErrorTotpRequired: "\u5F53\u524D profile \u8981\u6C42 TOTP\uFF0C\u65E0\u6CD5\u5173\u95ED\u3002",
|
|
1360
|
-
cliHelp: `dsh-auth-remote {version}
|
|
1361
|
-
|
|
1362
|
-
\u7528\u6CD5\uFF1A
|
|
1363
|
-
dsh plugin --profile web exec dsh-auth-remote [--lang en|zh] COMMAND
|
|
1364
|
-
|
|
1365
|
-
\u547D\u4EE4\uFF1A
|
|
1366
|
-
init \u5728\u7EC8\u7AEF\u4EA4\u4E92\u521D\u59CB\u5316\u5355\u7528\u6237\u8D26\u53F7
|
|
1367
|
-
status [--json] \u67E5\u770B\u4E0D\u542B\u79D8\u5BC6\u7684\u8BA4\u8BC1\u72B6\u6001
|
|
1368
|
-
reset-password \u91CD\u7F6E\u5BC6\u7801\u5E76\u64A4\u9500\u5168\u90E8\u4F1A\u8BDD
|
|
1369
|
-
reset-totp \u6E05\u9664 TOTP\u3001\u5907\u7528\u7801\u53CA\u5168\u90E8\u4F1A\u8BDD
|
|
1370
|
-
revoke-sessions \u9000\u51FA\u6240\u6709\u8BBE\u5907
|
|
1371
|
-
|
|
1372
|
-
\u9009\u9879\uFF1A
|
|
1373
|
-
--lang en|zh \u9009\u62E9\u4EBA\u7C7B\u53EF\u8BFB\u8F93\u51FA\u7684\u8BED\u8A00
|
|
1374
|
-
--help, -h \u663E\u793A\u5E2E\u52A9
|
|
1375
|
-
--version, -v \u663E\u793A\u5305\u7248\u672C
|
|
1376
|
-
|
|
1377
|
-
\u547D\u4EE4\u4F7F\u7528 dsh plugin exec \u9009\u5B9A\u7684 profile \u548C\u8C03\u7528\u8005\u7684 DSH_HOME\u3002
|
|
1378
|
-
`,
|
|
1379
|
-
cliPromptUsername: "\u7528\u6237\u540D: ",
|
|
1380
|
-
cliPromptPassword: "\u5BC6\u7801: ",
|
|
1381
|
-
cliPromptPasswordAgain: "\u518D\u6B21\u8F93\u5165\u5BC6\u7801: ",
|
|
1382
|
-
cliPromptNewPassword: "\u65B0\u5BC6\u7801: ",
|
|
1383
|
-
cliPromptNewPasswordAgain: "\u518D\u6B21\u8F93\u5165\u65B0\u5BC6\u7801: ",
|
|
1384
|
-
cliPromptConfirmTarget: "\u8F93\u5165 {profile} \u4EE5\u786E\u8BA4 {command}: ",
|
|
1385
|
-
cliTargetProfile: "\u76EE\u6807 profile: {profile}",
|
|
1386
|
-
cliDataFile: "\u6570\u636E\u6587\u4EF6: {path}",
|
|
1387
|
-
cliStatusProfile: "profile: {profile}",
|
|
1388
|
-
cliStatusAccount: "\u8D26\u53F7: {state}",
|
|
1389
|
-
cliStatusTotp: "TOTP: {state}",
|
|
1390
|
-
cliStatusSessions: "\u6709\u6548\u4F1A\u8BDD: {count}",
|
|
1391
|
-
cliStatusService: "\u670D\u52A1: {state}",
|
|
1392
|
-
cliInitialized: "\u5DF2\u521D\u59CB\u5316",
|
|
1393
|
-
cliNotInitialized: "\u672A\u521D\u59CB\u5316",
|
|
1394
|
-
cliTotpEnabled: "\u5DF2\u542F\u7528",
|
|
1395
|
-
cliTotpDisabled: "\u672A\u542F\u7528",
|
|
1396
|
-
cliOnlineReady: "\u5728\u7EBF\u4E14\u5C31\u7EEA",
|
|
1397
|
-
cliOnlineNotReady: "\u5728\u7EBF\u4F46\u672A\u5C31\u7EEA",
|
|
1398
|
-
cliOffline: "\u79BB\u7EBF",
|
|
1399
|
-
cliCompleted: "{command} \u5DF2\u5B8C\u6210\uFF1B\u53D8\u66F4\u5DF2\u6301\u4E45\u5316\u5E76\u751F\u6548\u3002",
|
|
1400
|
-
cliErrorInvalidArguments: "\u547D\u4EE4\u6216\u53C2\u6570\u65E0\u6548\uFF0C\u8BF7\u4F7F\u7528 --help\u3002",
|
|
1401
|
-
cliErrorInvalidLanguage: "--lang \u7684\u503C\u65E0\u6548\uFF0C\u8BF7\u4F7F\u7528 en \u6216 zh\u3002",
|
|
1402
|
-
cliErrorDuplicateLanguage: "--lang \u53EA\u80FD\u6307\u5B9A\u4E00\u6B21\u3002",
|
|
1403
|
-
cliErrorMissingLanguage: "--lang \u7F3A\u5C11\u503C\uFF0C\u8BF7\u4F7F\u7528 en \u6216 zh\u3002",
|
|
1404
|
-
cliErrorPasswordsMismatch: "\u4E24\u6B21\u8F93\u5165\u7684\u5BC6\u7801\u4E0D\u4E00\u81F4\u3002",
|
|
1405
|
-
cliErrorConfirmationMismatch: "\u786E\u8BA4\u8F93\u5165\u4E0E\u76EE\u6807 profile \u4E0D\u4E00\u81F4\u3002",
|
|
1406
|
-
cliErrorPasswordLength: "\u5BC6\u7801\u987B\u5305\u542B 12\u2013256 \u4E2A Unicode \u5B57\u7B26\u3002",
|
|
1407
|
-
cliErrorTerminalRequired: "\u6B64\u64CD\u4F5C\u9700\u8981\u4EA4\u4E92\u7EC8\u7AEF\u3002",
|
|
1408
|
-
cliErrorTerminalClosed: "\u7EC8\u7AEF\u8F93\u5165\u5DF2\u5173\u95ED\u3002",
|
|
1409
|
-
cliErrorCancelled: "\u5DF2\u53D6\u6D88\u3002",
|
|
1410
|
-
cliErrorProfileDirectory: "\u5F53\u524D\u76EE\u5F55\u4E0D\u662F DSH_HOME \u4E0B\u9009\u5B9A\u7684 DSH profile\u3002",
|
|
1411
|
-
cliErrorProfileManifest: "\u7F3A\u5C11 profile \u7684 package.json\u3002",
|
|
1412
|
-
cliErrorUnsafeManagementDirectory: "\u7BA1\u7406\u76EE\u5F55\u6743\u9650\u4E0D\u5B89\u5168\u3002",
|
|
1413
|
-
cliErrorUnsafeManagementSocket: "\u7BA1\u7406 socket \u6743\u9650\u4E0D\u5B89\u5168\u3002",
|
|
1414
|
-
cliErrorManagementUnavailable: "\u7BA1\u7406 socket \u4E0D\u53EF\u7528\u3002",
|
|
1415
|
-
cliErrorOutcomeUnknown: "\u7BA1\u7406\u8BF7\u6C42\u5DF2\u65AD\u5F00\u6216\u8D85\u65F6\uFF0C\u7ED3\u679C\u672A\u77E5\uFF1B\u518D\u6B21\u64CD\u4F5C\u524D\u8BF7\u5148\u68C0\u67E5\u72B6\u6001\u3002",
|
|
1416
|
-
cliErrorOfflineLock: "\u670D\u52A1\u4ECD\u6301\u6709 profile \u9501\u4E14\u7BA1\u7406 socket \u4E0D\u53EF\u7528\uFF0C\u5DF2\u62D2\u7EDD\u79BB\u7EBF\u64CD\u4F5C\u3002",
|
|
1417
|
-
cliErrorInvalidCredentials: "\u5F53\u524D\u51ED\u8BC1\u4E0D\u6B63\u786E\u3002",
|
|
1418
|
-
cliErrorAlreadyInitialized: "\u8D26\u53F7\u5DF2\u521D\u59CB\u5316\u3002",
|
|
1419
|
-
cliErrorInvalidInput: "\u8F93\u5165\u65E0\u6548\u3002",
|
|
1420
|
-
cliErrorInvalidFactor: "\u9A8C\u8BC1\u7801\u6216\u5907\u7528\u7801\u4E0D\u6B63\u786E\u3002",
|
|
1421
|
-
cliErrorUninitialized: "\u8D26\u53F7\u5C1A\u672A\u521D\u59CB\u5316\u3002",
|
|
1422
|
-
cliErrorTotpRequired: "\u6B64 profile \u8981\u6C42 TOTP\u3002",
|
|
1423
|
-
cliErrorConflict: "\u8D26\u53F7\u72B6\u6001\u5DF2\u53D8\u5316\uFF0C\u8BF7\u68C0\u67E5\u72B6\u6001\u540E\u91CD\u8BD5\u3002",
|
|
1424
|
-
cliErrorBusy: "\u670D\u52A1\u6B63\u5FD9\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",
|
|
1425
|
-
cliErrorUnknown: "\u64CD\u4F5C\u5931\u8D25\uFF1B\u518D\u6B21\u64CD\u4F5C\u524D\u8BF7\u5148\u68C0\u67E5\u72B6\u6001\u3002"
|
|
1426
|
-
};
|
|
1427
|
-
|
|
1428
|
-
// src/shared/i18n.ts
|
|
1429
|
-
var dictionaries = { en, zh };
|
|
1430
|
-
function parseExactLocale(value) {
|
|
1431
|
-
return value === "en" || value === "zh" ? value : null;
|
|
1432
|
-
}
|
|
1433
|
-
function localeFromLanguageTag(value) {
|
|
1434
|
-
return value && /^zh(?:[-_.@]|$)/iu.test(value.trim()) ? "zh" : "en";
|
|
1435
|
-
}
|
|
1436
|
-
function normalizeLocale(value) {
|
|
1437
|
-
return parseExactLocale(value) ?? "en";
|
|
1438
|
-
}
|
|
1439
|
-
function formatMessage(locale, key, ...args) {
|
|
1440
|
-
const template = dictionaries[normalizeLocale(locale)][key];
|
|
1441
|
-
const values = args[0] ?? {};
|
|
1442
|
-
return template.replace(/\{([A-Za-z][A-Za-z0-9]*)\}/gu, (_match, name) => {
|
|
1443
|
-
if (!Object.hasOwn(values, name)) throw new Error(`Missing i18n parameter ${name} for ${key}`);
|
|
1444
|
-
return String(values[name]);
|
|
1068
|
+
function cliText(key, params = {}) {
|
|
1069
|
+
return messages[key].replace(/\{([A-Za-z][A-Za-z0-9]*)\}/gu, (_match, name) => {
|
|
1070
|
+
if (!Object.hasOwn(params, name)) throw new Error(`Missing CLI parameter ${name} for ${key}`);
|
|
1071
|
+
return String(params[name]);
|
|
1445
1072
|
});
|
|
1446
1073
|
}
|
|
1447
|
-
|
|
1448
|
-
// src/cli/language.ts
|
|
1449
1074
|
var CliDiagnostic = class extends Error {
|
|
1450
|
-
constructor(key
|
|
1451
|
-
super(
|
|
1452
|
-
this.key = key;
|
|
1453
|
-
this.locale = locale;
|
|
1075
|
+
constructor(key) {
|
|
1076
|
+
super(cliText(key));
|
|
1454
1077
|
}
|
|
1455
|
-
key;
|
|
1456
|
-
locale;
|
|
1457
1078
|
};
|
|
1458
|
-
function environmentLocale(env) {
|
|
1459
|
-
const value = [env.LC_ALL, env.LC_MESSAGES, env.LANG].find(
|
|
1460
|
-
(candidate) => candidate !== void 0 && candidate.trim().length > 0
|
|
1461
|
-
);
|
|
1462
|
-
return localeFromLanguageTag(value);
|
|
1463
|
-
}
|
|
1464
|
-
function parseLanguage(input, env = process.env) {
|
|
1465
|
-
let locale = environmentLocale(env);
|
|
1466
|
-
let explicit = false;
|
|
1467
|
-
const args = [];
|
|
1468
|
-
for (let index = 0; index < input.length; index++) {
|
|
1469
|
-
const token = input[index];
|
|
1470
|
-
if (token !== "--lang" && !token.startsWith("--lang=")) {
|
|
1471
|
-
args.push(token);
|
|
1472
|
-
continue;
|
|
1473
|
-
}
|
|
1474
|
-
if (explicit)
|
|
1475
|
-
throw new CliDiagnostic(
|
|
1476
|
-
"cliErrorDuplicateLanguage",
|
|
1477
|
-
"dsh-auth-remote: --lang may be specified only once",
|
|
1478
|
-
locale
|
|
1479
|
-
);
|
|
1480
|
-
explicit = true;
|
|
1481
|
-
const value = token === "--lang" ? input[++index] : token.slice("--lang=".length);
|
|
1482
|
-
if (value === void 0 || value.length === 0 || value.startsWith("--"))
|
|
1483
|
-
throw new CliDiagnostic(
|
|
1484
|
-
"cliErrorMissingLanguage",
|
|
1485
|
-
"dsh-auth-remote: --lang requires en or zh",
|
|
1486
|
-
locale
|
|
1487
|
-
);
|
|
1488
|
-
if (value !== "en" && value !== "zh")
|
|
1489
|
-
throw new CliDiagnostic(
|
|
1490
|
-
"cliErrorInvalidLanguage",
|
|
1491
|
-
"dsh-auth-remote: invalid --lang value; use en or zh",
|
|
1492
|
-
locale
|
|
1493
|
-
);
|
|
1494
|
-
locale = value;
|
|
1495
|
-
}
|
|
1496
|
-
return { locale, args };
|
|
1497
|
-
}
|
|
1498
|
-
function cliText(locale, key, params = {}) {
|
|
1499
|
-
return formatMessage(locale, key, params);
|
|
1500
|
-
}
|
|
1501
1079
|
|
|
1502
1080
|
// src/cli/ipc-client.ts
|
|
1503
1081
|
var AdminUnavailable = class extends Error {
|
|
@@ -1529,10 +1107,7 @@ async function inspectSocket(path) {
|
|
|
1529
1107
|
throw error;
|
|
1530
1108
|
}
|
|
1531
1109
|
if (!directory.isDirectory() || directory.uid !== process.getuid?.() || (directory.mode & 511) !== 448)
|
|
1532
|
-
throw new CliDiagnostic(
|
|
1533
|
-
"cliErrorUnsafeManagementDirectory",
|
|
1534
|
-
"dsh-auth-remote: unsafe management directory"
|
|
1535
|
-
);
|
|
1110
|
+
throw new CliDiagnostic("cliErrorUnsafeManagementDirectory");
|
|
1536
1111
|
let socket;
|
|
1537
1112
|
try {
|
|
1538
1113
|
socket = await lstat3(path);
|
|
@@ -1541,10 +1116,7 @@ async function inspectSocket(path) {
|
|
|
1541
1116
|
throw error;
|
|
1542
1117
|
}
|
|
1543
1118
|
if (!socket.isSocket() || socket.uid !== process.getuid?.() || (socket.mode & 511) !== 384)
|
|
1544
|
-
throw new CliDiagnostic(
|
|
1545
|
-
"cliErrorUnsafeManagementSocket",
|
|
1546
|
-
"dsh-auth-remote: unsafe management socket"
|
|
1547
|
-
);
|
|
1119
|
+
throw new CliDiagnostic("cliErrorUnsafeManagementSocket");
|
|
1548
1120
|
return true;
|
|
1549
1121
|
}
|
|
1550
1122
|
async function requestAdmin(path, request) {
|
|
@@ -1631,26 +1203,16 @@ async function resolveProfileTarget(cwd = process.cwd(), env = process.env) {
|
|
|
1631
1203
|
const name = basename(dir);
|
|
1632
1204
|
const info = await lstat4(dir);
|
|
1633
1205
|
if (!info.isDirectory() || info.uid !== process.getuid?.() || dirname2(dir) !== profiles || name === "node_modules" || name === "." || name === "..")
|
|
1634
|
-
throw new CliDiagnostic(
|
|
1635
|
-
"cliErrorProfileDirectory",
|
|
1636
|
-
"dsh-auth-remote: current directory is not the selected DSH profile under DSH_HOME"
|
|
1637
|
-
);
|
|
1206
|
+
throw new CliDiagnostic("cliErrorProfileDirectory");
|
|
1638
1207
|
let manifest2;
|
|
1639
1208
|
try {
|
|
1640
1209
|
manifest2 = await lstat4(join3(dir, "package.json"));
|
|
1641
1210
|
} catch (error) {
|
|
1642
1211
|
if (typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT")
|
|
1643
|
-
throw new CliDiagnostic(
|
|
1644
|
-
"cliErrorProfileManifest",
|
|
1645
|
-
"dsh-auth-remote: profile package.json is missing"
|
|
1646
|
-
);
|
|
1212
|
+
throw new CliDiagnostic("cliErrorProfileManifest");
|
|
1647
1213
|
throw error;
|
|
1648
1214
|
}
|
|
1649
|
-
if (!manifest2.isFile())
|
|
1650
|
-
throw new CliDiagnostic(
|
|
1651
|
-
"cliErrorProfileManifest",
|
|
1652
|
-
"dsh-auth-remote: profile package.json is missing"
|
|
1653
|
-
);
|
|
1215
|
+
if (!manifest2.isFile()) throw new CliDiagnostic("cliErrorProfileManifest");
|
|
1654
1216
|
return {
|
|
1655
1217
|
name,
|
|
1656
1218
|
dir,
|
|
@@ -1662,14 +1224,11 @@ async function resolveProfileTarget(cwd = process.cwd(), env = process.env) {
|
|
|
1662
1224
|
|
|
1663
1225
|
// src/cli/prompt.ts
|
|
1664
1226
|
var TerminalPrompt = class {
|
|
1665
|
-
constructor(input = process.stdin,
|
|
1227
|
+
constructor(input = process.stdin, output = process.stdout) {
|
|
1666
1228
|
this.input = input;
|
|
1667
|
-
this.output =
|
|
1668
|
-
if (!input.isTTY || !
|
|
1669
|
-
throw new CliDiagnostic(
|
|
1670
|
-
"cliErrorTerminalRequired",
|
|
1671
|
-
"dsh-auth-remote: an interactive terminal is required"
|
|
1672
|
-
);
|
|
1229
|
+
this.output = output;
|
|
1230
|
+
if (!input.isTTY || !output.isTTY || typeof input.setRawMode !== "function")
|
|
1231
|
+
throw new CliDiagnostic("cliErrorTerminalRequired");
|
|
1673
1232
|
this.previousRaw = input.isRaw;
|
|
1674
1233
|
input.setRawMode(true);
|
|
1675
1234
|
input.resume();
|
|
@@ -1697,8 +1256,7 @@ var TerminalPrompt = class {
|
|
|
1697
1256
|
};
|
|
1698
1257
|
async take() {
|
|
1699
1258
|
while (this.pending.length === 0) {
|
|
1700
|
-
if (this.closed || this.ended)
|
|
1701
|
-
throw new CliDiagnostic("cliErrorTerminalClosed", "dsh-auth-remote: terminal input closed");
|
|
1259
|
+
if (this.closed || this.ended) throw new CliDiagnostic("cliErrorTerminalClosed");
|
|
1702
1260
|
await new Promise((resolve2) => {
|
|
1703
1261
|
this.wake = resolve2;
|
|
1704
1262
|
});
|
|
@@ -1711,8 +1269,7 @@ var TerminalPrompt = class {
|
|
|
1711
1269
|
return char;
|
|
1712
1270
|
}
|
|
1713
1271
|
async ask(label, secret = false, maxCharacters = 256) {
|
|
1714
|
-
if (this.closed)
|
|
1715
|
-
throw new CliDiagnostic("cliErrorTerminalClosed", "dsh-auth-remote: terminal input closed");
|
|
1272
|
+
if (this.closed) throw new CliDiagnostic("cliErrorTerminalClosed");
|
|
1716
1273
|
this.output.write(label);
|
|
1717
1274
|
const answer = [];
|
|
1718
1275
|
let escape = false;
|
|
@@ -1726,10 +1283,8 @@ var TerminalPrompt = class {
|
|
|
1726
1283
|
escape = true;
|
|
1727
1284
|
continue;
|
|
1728
1285
|
}
|
|
1729
|
-
if (char === "")
|
|
1730
|
-
|
|
1731
|
-
if (char === "")
|
|
1732
|
-
throw new CliDiagnostic("cliErrorTerminalClosed", "dsh-auth-remote: terminal input closed");
|
|
1286
|
+
if (char === "") throw new CliDiagnostic("cliErrorCancelled");
|
|
1287
|
+
if (char === "") throw new CliDiagnostic("cliErrorTerminalClosed");
|
|
1733
1288
|
if (char === "\r" || char === "\n") {
|
|
1734
1289
|
if (char === "\r") this.skipLf = true;
|
|
1735
1290
|
this.output.write("\n");
|
|
@@ -1762,8 +1317,6 @@ var TerminalPrompt = class {
|
|
|
1762
1317
|
|
|
1763
1318
|
// src/cli/index.ts
|
|
1764
1319
|
var manifest = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
|
|
1765
|
-
var currentLocale = environmentLocale(process.env);
|
|
1766
|
-
var output = (key, params = {}) => cliText(currentLocale, key, params);
|
|
1767
1320
|
function authErrorKey(code) {
|
|
1768
1321
|
switch (code) {
|
|
1769
1322
|
case "already_initialized":
|
|
@@ -1786,19 +1339,19 @@ function authErrorKey(code) {
|
|
|
1786
1339
|
return "cliErrorUnknown";
|
|
1787
1340
|
}
|
|
1788
1341
|
}
|
|
1789
|
-
function errorText(error
|
|
1790
|
-
if (error instanceof CliDiagnostic) return
|
|
1791
|
-
if (error instanceof PasswordValidationError) return cliText(
|
|
1792
|
-
if (error instanceof AdminOutcomeUnknown) return cliText(
|
|
1793
|
-
if (error instanceof AdminUnavailable) return cliText(
|
|
1342
|
+
function errorText(error) {
|
|
1343
|
+
if (error instanceof CliDiagnostic) return error.message;
|
|
1344
|
+
if (error instanceof PasswordValidationError) return cliText("cliErrorPasswordLength");
|
|
1345
|
+
if (error instanceof AdminOutcomeUnknown) return cliText("cliErrorOutcomeUnknown");
|
|
1346
|
+
if (error instanceof AdminUnavailable) return cliText("cliErrorManagementUnavailable");
|
|
1794
1347
|
if (error instanceof AdminRejected || error instanceof AuthError) {
|
|
1795
1348
|
if (error.code === "rate_limited")
|
|
1796
|
-
return cliText(
|
|
1349
|
+
return cliText("errorRateLimited", {
|
|
1797
1350
|
seconds: error instanceof AuthError ? error.retryAfter ?? 1 : 1
|
|
1798
1351
|
});
|
|
1799
|
-
return cliText(
|
|
1352
|
+
return cliText(authErrorKey(error.code));
|
|
1800
1353
|
}
|
|
1801
|
-
return cliText(
|
|
1354
|
+
return cliText("cliErrorUnknown");
|
|
1802
1355
|
}
|
|
1803
1356
|
async function offline(target, request) {
|
|
1804
1357
|
let store;
|
|
@@ -1806,10 +1359,7 @@ async function offline(target, request) {
|
|
|
1806
1359
|
store = await AuthStateStore.open(target.dir);
|
|
1807
1360
|
} catch (error) {
|
|
1808
1361
|
if (error instanceof Error && /state lock held|state lock is held/u.test(error.message))
|
|
1809
|
-
throw new CliDiagnostic(
|
|
1810
|
-
"cliErrorOfflineLock",
|
|
1811
|
-
"dsh-auth-remote: management socket is unavailable while the service holds the profile lock; refusing offline access"
|
|
1812
|
-
);
|
|
1362
|
+
throw new CliDiagnostic("cliErrorOfflineLock");
|
|
1813
1363
|
throw error;
|
|
1814
1364
|
}
|
|
1815
1365
|
const auth = new AuthService(store, { requireTotp: false, sessionHours: 168 });
|
|
@@ -1847,35 +1397,23 @@ async function interactiveRequest(target, command) {
|
|
|
1847
1397
|
const prompt = new TerminalPrompt();
|
|
1848
1398
|
try {
|
|
1849
1399
|
if (command === "init") {
|
|
1850
|
-
const username = await prompt.ask(
|
|
1851
|
-
const password = await prompt.ask(
|
|
1852
|
-
const again = await prompt.ask(
|
|
1853
|
-
if (password !== again)
|
|
1854
|
-
throw new CliDiagnostic(
|
|
1855
|
-
"cliErrorPasswordsMismatch",
|
|
1856
|
-
"dsh-auth-remote: passwords do not match"
|
|
1857
|
-
);
|
|
1400
|
+
const username = await prompt.ask(cliText("cliPromptUsername"), false, 64);
|
|
1401
|
+
const password = await prompt.ask(cliText("cliPromptPassword"), true, 256);
|
|
1402
|
+
const again = await prompt.ask(cliText("cliPromptPasswordAgain"), true, 256);
|
|
1403
|
+
if (password !== again) throw new CliDiagnostic("cliErrorPasswordsMismatch");
|
|
1858
1404
|
validatePassword(password);
|
|
1859
1405
|
return { version: ADMIN_PROTOCOL_VERSION, command, username, password };
|
|
1860
1406
|
}
|
|
1861
1407
|
const confirmation = await prompt.ask(
|
|
1862
|
-
|
|
1408
|
+
cliText("cliPromptConfirmTarget", { profile: target.name, command }),
|
|
1863
1409
|
false,
|
|
1864
1410
|
64
|
|
1865
1411
|
);
|
|
1866
|
-
if (confirmation !== target.name)
|
|
1867
|
-
throw new CliDiagnostic(
|
|
1868
|
-
"cliErrorConfirmationMismatch",
|
|
1869
|
-
"dsh-auth-remote: confirmation did not match the target profile"
|
|
1870
|
-
);
|
|
1412
|
+
if (confirmation !== target.name) throw new CliDiagnostic("cliErrorConfirmationMismatch");
|
|
1871
1413
|
if (command === "reset-password") {
|
|
1872
|
-
const password = await prompt.ask(
|
|
1873
|
-
const again = await prompt.ask(
|
|
1874
|
-
if (password !== again)
|
|
1875
|
-
throw new CliDiagnostic(
|
|
1876
|
-
"cliErrorPasswordsMismatch",
|
|
1877
|
-
"dsh-auth-remote: passwords do not match"
|
|
1878
|
-
);
|
|
1414
|
+
const password = await prompt.ask(cliText("cliPromptNewPassword"), true, 256);
|
|
1415
|
+
const again = await prompt.ask(cliText("cliPromptNewPasswordAgain"), true, 256);
|
|
1416
|
+
if (password !== again) throw new CliDiagnostic("cliErrorPasswordsMismatch");
|
|
1879
1417
|
validatePassword(password);
|
|
1880
1418
|
return { version: ADMIN_PROTOCOL_VERSION, command, password };
|
|
1881
1419
|
}
|
|
@@ -1885,11 +1423,9 @@ async function interactiveRequest(target, command) {
|
|
|
1885
1423
|
}
|
|
1886
1424
|
}
|
|
1887
1425
|
async function main() {
|
|
1888
|
-
const
|
|
1889
|
-
currentLocale = parsed.locale;
|
|
1890
|
-
const args = parsed.args;
|
|
1426
|
+
const args = process.argv.slice(2);
|
|
1891
1427
|
if (args.length === 0 || args.length === 1 && ["--help", "-h"].includes(args[0])) {
|
|
1892
|
-
process.stdout.write(
|
|
1428
|
+
process.stdout.write(cliText("cliHelp", { version: manifest.version }));
|
|
1893
1429
|
return;
|
|
1894
1430
|
}
|
|
1895
1431
|
if (args.length === 1 && ["--version", "-v"].includes(args[0])) {
|
|
@@ -1901,15 +1437,12 @@ async function main() {
|
|
|
1901
1437
|
if (!["init", "status", "reset-password", "reset-totp", "revoke-sessions"].includes(
|
|
1902
1438
|
command ?? ""
|
|
1903
1439
|
) || (command === "status" ? args.length > 2 || args.length === 2 && args[1] !== "--json" : args.length !== 1))
|
|
1904
|
-
throw new CliDiagnostic(
|
|
1905
|
-
"cliErrorInvalidArguments",
|
|
1906
|
-
"dsh-auth-remote: invalid command or arguments; use --help"
|
|
1907
|
-
);
|
|
1440
|
+
throw new CliDiagnostic("cliErrorInvalidArguments");
|
|
1908
1441
|
const target = await resolveProfileTarget();
|
|
1909
1442
|
if (command !== "status")
|
|
1910
1443
|
process.stdout.write(
|
|
1911
|
-
`${
|
|
1912
|
-
${
|
|
1444
|
+
`${cliText("cliTargetProfile", { profile: target.name })}
|
|
1445
|
+
${cliText("cliDataFile", { path: target.statePath })}
|
|
1913
1446
|
`
|
|
1914
1447
|
);
|
|
1915
1448
|
const request = command === "status" ? { version: ADMIN_PROTOCOL_VERSION, command: "status" } : await interactiveRequest(target, command);
|
|
@@ -1924,17 +1457,17 @@ ${output("cliDataFile", { path: target.statePath })}
|
|
|
1924
1457
|
else
|
|
1925
1458
|
process.stdout.write(
|
|
1926
1459
|
[
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
state:
|
|
1460
|
+
cliText("cliStatusProfile", { profile: target.name }),
|
|
1461
|
+
cliText("cliDataFile", { path: target.statePath }),
|
|
1462
|
+
cliText("cliStatusAccount", {
|
|
1463
|
+
state: cliText(status.initialized ? "cliInitialized" : "cliNotInitialized")
|
|
1931
1464
|
}),
|
|
1932
|
-
|
|
1933
|
-
state:
|
|
1465
|
+
cliText("cliStatusTotp", {
|
|
1466
|
+
state: cliText(status.totpEnabled ? "cliTotpEnabled" : "cliTotpDisabled")
|
|
1934
1467
|
}),
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
state:
|
|
1468
|
+
cliText("cliStatusSessions", { count: status.activeSessions }),
|
|
1469
|
+
cliText("cliStatusService", {
|
|
1470
|
+
state: cliText(
|
|
1938
1471
|
status.online ? status.ready ? "cliOnlineReady" : "cliOnlineNotReady" : "cliOffline"
|
|
1939
1472
|
)
|
|
1940
1473
|
})
|
|
@@ -1942,11 +1475,11 @@ ${output("cliDataFile", { path: target.statePath })}
|
|
|
1942
1475
|
);
|
|
1943
1476
|
return;
|
|
1944
1477
|
}
|
|
1945
|
-
process.stdout.write(`${
|
|
1478
|
+
process.stdout.write(`${cliText("cliCompleted", { command })}
|
|
1946
1479
|
`);
|
|
1947
1480
|
}
|
|
1948
1481
|
void main().catch((error) => {
|
|
1949
|
-
process.stderr.write(`${errorText(error
|
|
1482
|
+
process.stderr.write(`${errorText(error)}
|
|
1950
1483
|
`);
|
|
1951
1484
|
process.exitCode = 1;
|
|
1952
1485
|
});
|