-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
38 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
20 changes: 20 additions & 0 deletions
20
Sources/CryptomatorCloudAccess/OneDrive/MSClientFactory+UnauthenticatedClient.swift
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// | ||
// MSClientFactory+UnauthenticatedClient.swift | ||
// CryptomatorCloudAccess | ||
// | ||
// Created by Tobias Hagemann on 12.09.24. | ||
// Copyright © 2024 Skymatic GmbH. All rights reserved. | ||
// | ||
|
||
import MSGraphClientSDK | ||
|
||
extension MSClientFactory { | ||
static func createUnauthenticatedHTTPClient(with urlSessionConfiguration: URLSessionConfiguration) -> MSHTTPClient { | ||
let redirectHandler = MSMiddlewareFactory.createMiddleware(.redirect) as MSGraphMiddleware | ||
let retryHandler = MSMiddlewareFactory.createMiddleware(.retry) as MSGraphMiddleware | ||
let sessionManager = MSURLSessionManager(sessionConfiguration: urlSessionConfiguration) | ||
redirectHandler.setNext(retryHandler) | ||
retryHandler.setNext(sessionManager) | ||
return MSClientFactory.createHTTPClient(with: redirectHandler) | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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