Skip to content

Commit

Permalink
Update webdav - support auto auth - fixes #1290
Browse files Browse the repository at this point in the history
  • Loading branch information
perry-mitchell committed Mar 19, 2024
1 parent 6686647 commit e439f6a
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 93 deletions.
128 changes: 40 additions & 88 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@
"@buttercup/importer": "^3.1.0",
"@buttercup/secure-file-host": "^0.3.0",
"@electron/remote": "^2.0.8",
"buttercup": "^7.6.0",
"buttercup": "^7.7.0",
"debounce": "^1.2.1",
"debounce-promise": "^3.1.2",
"delayable-setinterval": "^0.1.1",
Expand All @@ -227,7 +227,7 @@
"stacktracey": "^2.1.7",
"statuses": "^2.0.1",
"untildify": "^5.0.0",
"webdav": "^5.3.0",
"webdav": "^5.5.0",
"zod": "^3.22.4"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion source/main/library/build.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// This file updated automatically: changes made here will be overwritten!

export const VERSION = "2.26.0";
export const VERSION = "2.26.1";
3 changes: 2 additions & 1 deletion source/renderer/actions/webdav.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { createClient } from "webdav";
import { AuthType, createClient } from "webdav";
import { Layerr } from "layerr";
import { logInfo } from "../library/log";

export async function testWebDAV(url: string, username?: string, password?: string): Promise<void> {
const authentication = !!(username && password);
const client = authentication
? createClient(url, {
authType: AuthType.Auto,
username,
password
})
Expand Down
3 changes: 2 additions & 1 deletion source/renderer/library/fsInterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
} from "@buttercup/file-interface";
import { GoogleDriveClient } from "@buttercup/googledrive-client";
import { DropboxClient } from "@buttercup/dropbox-client";
import { createClient as createWebdavClient } from "webdav";
import { AuthType, createClient as createWebdavClient } from "webdav";
import { SourceType } from "../types";

export interface FSInstanceSettings {
Expand All @@ -25,6 +25,7 @@ export function getFSInstance(type: SourceType, settings: FSInstanceSettings): F
case SourceType.WebDAV:
return new WebDAVInterface({
webdavClient: createWebdavClient(settings.endpoint as string, {
authType: AuthType.Auto,
username: settings.username,
password: settings.password
})
Expand Down

0 comments on commit e439f6a

Please sign in to comment.