Add Basic Auth support for WebDAV and DAV clients#131
Open
Leoyzen wants to merge 1 commit intoAtalayaLabs:mainfrom
Open
Add Basic Auth support for WebDAV and DAV clients#131Leoyzen wants to merge 1 commit intoAtalayaLabs:mainfrom
Leoyzen wants to merge 1 commit intoAtalayaLabs:mainfrom
Conversation
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
This PR implements HTTP Basic Authentication support in the
auth_middleware, enabling compatibility with standard WebDAV, CalDAV, and CardDAV clients that rely on username/password authentication.Problem: The documentation claimed Basic Auth was supported for DAV clients (in
doc/webdav-integration-guide.md,doc/dav-integration.md, anddoc/webdav-technical-spec.md), but theauth_middlewareonly implemented Bearer Token (JWT) authentication. This caused 401 Unauthorized errors when users tried to connect with standard WebDAV clients like macOS Finder, Windows File Explorer, Cyberduck, and DAVx5.Solution: Modified
src/interfaces/middleware/auth.rsto support dual authentication modes:Authorization: Bearer <jwt>- Used by web frontend and API clientsAuthorization: Basic <base64(username:password)>- Used by WebDAV/CalDAV/CardDAV clientsKey Changes:
decode_basic_auth()helper function for base64 credential decodingauthenticate_basic_auth()async function for username/password validationauthenticate_bearer_token()async function (refactored from original middleware)AuthError::InvalidBasicAutherror variant with proper HTTP 401 responseauth_middlewareto detect auth scheme from header prefix and route appropriatelyRelated Issue
Fixes: Documentation inconsistency where Basic Auth was documented but not actually implemented.
Type of Change
Please check the option that best describes your change:
How Has This Been Tested?
Manual Testing:
Python Client Test:
Test Configuration:
OXICLOUD_ENABLE_AUTH=trueChecklist:
Notes:
base64::decode()which can be addressed in a future cleanup PR (does not affect functionality)