feat: add digest authentication

This commit is contained in:
Udhay-Adithya
2025-07-03 19:24:56 +05:30
parent 6c5862cd85
commit 92af4fba77
18 changed files with 1026 additions and 160 deletions

View File

@@ -20,14 +20,22 @@ Future<(HttpResponse?, Duration?, String?)> sendHttpRequest(
HttpRequestModel requestModel, {
SupportedUriSchemes defaultUriScheme = kDefaultUriScheme,
bool noSSL = false,
bool enableAuth = true,
}) async {
if (httpClientManager.wasRequestCancelled(requestId)) {
httpClientManager.removeCancelledRequest(requestId);
}
final client = httpClientManager.createClient(requestId, noSSL: noSSL);
// Handle authentication
final authenticatedRequestModel = handleAuth(requestModel, authData);
HttpRequestModel authenticatedRequestModel = requestModel.copyWith();
try {
if (enableAuth) {
authenticatedRequestModel = await handleAuth(requestModel, authData);
}
} catch (e) {
return (null, null, e.toString());
}
(Uri?, String?) uriRec = getValidRequestUri(
authenticatedRequestModel.url,