feat(download-clients): rtorrent support Digest Auth (#1596)

* feat(download-clients): rtorrent support basic auth

* feat(download-client): implement new auth logic

* fix(download-client): tests store

* chore(deps): update go-rtorrent to v1.11.0
This commit is contained in:
ze0s 2024-08-28 12:21:56 +02:00 committed by GitHub
parent 861f30c144
commit 0d53f7e5fc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 231 additions and 71 deletions

View file

@ -14,7 +14,7 @@ import { classNames, sleep } from "@utils";
import { DEBUG } from "@components/debug";
import { APIClient } from "@api/APIClient";
import { DownloadClientKeys } from "@api/query_keys";
import { DownloadClientTypeOptions, DownloadRuleConditionOptions } from "@domain/constants";
import { DownloadClientAuthType, DownloadClientTypeOptions, DownloadRuleConditionOptions } from "@domain/constants";
import Toast from "@components/notifications/Toast";
import { useToggle } from "@hooks/hooks";
import { DeleteModal } from "@components/modals";
@ -34,6 +34,12 @@ interface InitialValuesSettings {
username: string;
password: string;
};
auth?: {
enabled: boolean;
type: string;
username: string;
password: string;
};
rules?: {
enabled?: boolean;
ignore_slow_torrents?: boolean;
@ -267,12 +273,19 @@ function FormFieldsRTorrent() {
/>
)}
<SwitchGroupWide name="settings.basic.auth" label="Basic auth" />
<SwitchGroupWide name="settings.auth.enabled" label="Auth" />
{settings.basic?.auth === true && (
{settings.auth?.enabled && (
<>
<TextFieldWide name="settings.basic.username" label="Username" />
<PasswordFieldWide name="settings.basic.password" label="Password" />
<SelectFieldBasic
name="settings.auth.type"
label="Auth type"
placeholder="Select auth type"
options={DownloadClientAuthType}
tooltip={<p>This should in most cases be Basic Auth, but some providers use Digest Auth.</p>}
/>
<TextFieldWide name="settings.auth.username" label="Username" />
<PasswordFieldWide name="settings.auth.password" label="Password" />
</>
)}
</div>