mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
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:
parent
861f30c144
commit
0d53f7e5fc
11 changed files with 231 additions and 71 deletions
|
@ -129,7 +129,7 @@ export const Tooltip = ({
|
|||
{...getTooltipProps({
|
||||
className: classNames(
|
||||
maxWidth,
|
||||
"rounded-md border border-gray-300 text-black text-xs normal-case tracking-normal font-normal shadow-lg dark:text-white dark:border-gray-700 dark:shadow-2xl"
|
||||
"z-10 rounded-md border border-gray-300 text-black text-xs normal-case tracking-normal font-normal shadow-lg dark:text-white dark:border-gray-700 dark:shadow-2xl"
|
||||
),
|
||||
onClick: (e: React.MouseEvent) => e.stopPropagation()
|
||||
})}
|
||||
|
|
|
@ -474,6 +474,21 @@ export const DownloadRuleConditionOptions: OptionBasic[] = [
|
|||
}
|
||||
];
|
||||
|
||||
export const DownloadClientAuthType: OptionBasic[] = [
|
||||
{
|
||||
label: "None",
|
||||
value: "NONE"
|
||||
},
|
||||
{
|
||||
label: "Basic Auth",
|
||||
value: "BASIC_AUTH"
|
||||
},
|
||||
{
|
||||
label: "Digest Auth",
|
||||
value: "DIGEST_AUTH"
|
||||
}
|
||||
];
|
||||
|
||||
const logLevel = ["DEBUG", "INFO", "WARN", "ERROR", "TRACE"] as const;
|
||||
|
||||
export const LogLevelOptions = logLevel.map(v => ({ value: v, label: v, key: v }));
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue