Repository navigation
5.0.0
What's New
- Replaced the AWS, pCloud, Box, Google Drive and Dropbox SDKs with direct REST calls on one hardened URLSession layer, so the library depends only on AppAuth, MSAL, cryptolib-swift, GRDB, JOSESwift and CocoaLumberjack (#47, #48, #49, #50, #51)
- Added a library-owned OAuth token store for Box, Dropbox, Google Drive and pCloud (
OAuthPersistence), shared between the app and its extensions, which refreshes each token at most once across processes. Logins stored by the former SDKs keep working without a new sign-in (#49, #50, #51, #52) - Added background sessions for every network provider through
withBackgroundSession(credential:…, sessionIdentifier:sharedContainerIdentifier:). Only transfers run in the background; all other requests run on a foreground session. Releasing a provider no longer cancels its running transfers (#46, #52) - Added
hasStoredLogin()andcachedUsername()to the Box, Dropbox, Google Drive and pCloud credentials to read the stored login without a request - Cancelling the task of a login dismisses the sign-in page and throws
CancellationError. A denied consent throwsCocoaError(.userCancelled)(#52) - Added S3 region correction and a path-style fallback at login (
S3Authenticator.verifyCredentialreturns the corrected credential),S3Credential.forcePathStyle, and multipart uploads for files over 4768 MiB (#53) - Added
CloudProviderError.invalidPath,deletionIncomplete,moveCompletedWithSourceRemaininganduploadSourceSizeMismatch, so callers can tell an unusable path, a partly refused delete, a move that left leftovers at its source, and a local file that changed during an upload from other failures (#69) - pCloud listings honor
maxPageSize, and the identifier caches of Box, pCloud, Google Drive and Microsoft Graph live on disk, which keeps large folders within the File Provider's memory limit (#57) - Microsoft Graph requests only the fields it reads and downloads from the pre-authenticated download URL, saving one request per download (#68)
- Temporary files live in one folder per process, and the folders of processes that iOS killed are deleted, so interrupted uploads no longer leave encrypted copies behind (#66)
Breaking Changes
- Setups are values passed wherever a credential or login is created. The
.constantsglobals andDropboxClientSetupare removed (#52) - Credentials take a user ID and a setup and keep their tokens in the setup's
OAuthPersistence(#49, #50, #51, #52) - Authenticators are
@MainActorenums that take a setup and return the credential (#52) - The provider-specific error enums (
BoxError,DropboxError,GoogleDriveError,MicrosoftGraphError,PCloudError,LocalFileSystemProviderError,WebDAVProviderError,VaultFormatError,URLSessionError, …) andWebDAVClientare internal. Match onCloudProviderError(#52) WebDAVProvideris renamed toWebDAVCloudProviderand takes aWebDAVCredential. Its HTTP failures areWebDAVError(#52)- Only a 401 or a missing-scope 403 maps to
CloudProviderError.unauthorized. Item-level 403s from Google Drive, Box, Microsoft Graph and WebDAV and LocalFS'sfileReadNoPermissionpass through as raw errors (#67, #70) - Removed the dependencies on aws-sdk-ios-spm, box-ios-sdk, google-api-objectivec-client-for-rest, GTMAppAuth, gtm-session-fetcher, pcloud-sdk-swift and SwiftyDropbox, and updated cryptolib-swift to 3.0.0, MSAL to 2.18.1 and GRDB to 7.12.0
Migrating from 4.x
- The library no longer depends on aws-sdk-ios-spm, box-ios-sdk, google-api-objectivec-client-for-rest, GTMAppAuth, gtm-session-fetcher, pcloud-sdk-swift or SwiftyDropbox. If your app keeps using one of them, add the package to your app yourself.
- The library depends on cryptolib-swift 3.0.0, MSAL 2.18.1 (
.upToNextMinorinstead of exact) and GRDB 7.12.0. If your app also depends on one of them, update it accordingly. cryptolib-swift 3.0.0 has breaking changes of its own, see its release notes. - Create one
OAuthPersistenceper process with.keychain(accessGroup:tokenLockDirectory:services:), with the same values in the app and every extension, and pass it toBoxSetup,DropboxSetup,GoogleDriveSetupandPCloudSetup.tokenLockDirectorymust be a directory in the App Group container. To keep reading existing logins in place, pass the keychain services your app used so far: the Box service,OAuthPersistence.legacyDropboxService(keychainService:)with the formerDropboxSetupkeychainService(or the bundle ID if you passednil), and the pCloud SDK's service. Google Drive logins stay in GTMAppAuth's item. See OAuth Persistence. For other storage, implementOAuthTokenStorageand use.custom(storage:tokenLockDirectory:), which replaces the Box SDK'sTokenStorage. - Replace the setups and their
.constantswith values that you pass along:BoxSetup(clientID:clientSecret:oauth:)replacesinit(clientId:clientSecret:sharedContainerIdentifier:).DropboxSetup(appKey:oauth:)replacesinit(appKey:sharedContainerIdentifier:keychainService:forceForegroundSession:).DropboxClientSetupis removed.GoogleDriveSetup(clientID:redirectURL:oauth:)replacesinit(clientId:redirectURL:sharedContainerIdentifier:).PCloudSetup(appKey:oauth:)replacesinit(appKey:sharedContainerIdentifier:).MicrosoftGraphSetup(clientApplication:)replacesinit(clientApplication:sharedContainerIdentifier:).- The setups of Box, Dropbox, Google Drive and pCloud are structs now.
- Re-create credentials from the user ID:
BoxCredential(userID:setup:),DropboxCredential(userID:setup:),GoogleDriveCredential(userID:setup:)andPCloudCredential(userID:setup:)throw, andMicrosoftGraphCredential(identifier:type:setup:)replacesinit(identifier:scopes:)andinit(identifier:type:). Removed:BoxCredential(tokenStorage:)andgetUserID(),DropboxCredential(tokenUID:),tokenUID,isAuthorizedandsetAuthorizedClient(),GoogleDriveCredential.driveService,isAuthorized,save(authState:)andgetAccountID(), andPCloudCredential(user:),userandcreateBackgroundClient(with:sessionIdentifier:). Each credential hasuserID. deauthenticate()of the Box, Dropbox, Google Drive and pCloud credentials isasync throws. A Google Drive sign-out deletes the stored login without revoking its token, because Google revokes a token for all of the user's devices. pCloud's only deletes, because pCloud offers no revocation.BoxCredentialErrorsandDropboxCredentialErrorsare renamed toBoxCredentialErrorandDropboxCredentialError.PCloudCredentialError,GoogleDriveAuthenticatorError,OAuthTokenEndpointErrorandOAuthTokenStoreErrorare new.- Sign in with the setup:
BoxAuthenticator.authenticate(from:setup:),DropboxAuthenticator.authenticate(from:setup:),GoogleDriveAuthenticator.authenticate(from:setup:)andPCloudAuthenticator.authenticate(from:setup:)return the credential.GoogleDriveAuthenticator.authenticate(credential:from:)andBoxAuthenticator.authenticate(from:tokenStorage:)are removed.MicrosoftGraphAuthenticator.authenticate(from:for:setup:)replacesauthenticate(from:for:)andauthenticate(from:with:).DropboxAuthenticator.handleRedirectURL(_:setup:)replaceshandleRedirectURL(_:).DropboxAuthenticator.authenticateis static.GoogleDriveAuthenticator.currentAuthorizationFlowis removed. The Google login completes without forwarding its redirect.- Handle
GoogleDriveAuthenticatorError.driveAccessNotGranted, which Google Drive throws when the user unticks Drive access on Google's consent screen. - Handle
CancellationErrorfrom a login whose task was cancelled.
- Create background providers with
withBackgroundSession(credential:maxPageSize:sessionIdentifier:sharedContainerIdentifier:), which every network provider has now. It replacesPCloudCredential.createBackgroundClient,WebDAVClient.withBackgroundSessionand the formerS3CloudProvider.withBackgroundSession(credential:sharedContainerIdentifier:maxPageSize:). Box, Google Drive and Microsoft Graph take the newsharedContainerIdentifierthere: pass the App Group in an extension andnilin the app. Use one session identifier per account. - Replace
PCloudCloudProvider(client:)withPCloudCloudProvider(credential:maxPageSize:),BoxCloudProvider(credential:maxPageSize:urlSessionConfiguration:)withBoxCloudProvider(credential:maxPageSize:), andWebDAVProvider(with:maxPageSize:)withWebDAVCloudProvider(credential:maxPageSize:). The pCloud and WebDAV initializers throw.WebDAVAuthenticator.verifyCredential(_:)replacesverifyClient(client:). - Store the credential that
S3Authenticator.verifyCredential(_:)returns, because it may carry a corrected region, endpoint orforcePathStyle. - Stop matching on the provider-specific error types that are internal now, and handle the new
CloudProviderErrorcases in exhaustive switches:invalidPath,deletionIncomplete,moveCompletedWithSourceRemaininganduploadSourceSizeMismatch.WebDAVError(httpError(statusCode:),unexpectedResponse) is public. - Expect raw errors instead of
unauthorizedfor item-level 403s (Google Drive, Box, Microsoft Graph, WebDAV) and for an unreadable local file, so that the app doesn't ask the user to sign in again for them. CloudItemMetadataisEquatable.UnverifiedVaultConfig,VaultConfigandTLSCertificateValidatorarefinal, and the credentials arefinalandSendable.
Bug Fixes
- Fixed overlapping listings of one folder on WebDAV and the local file system returning duplicated, shifted or empty pages (#56)
- Fixed WebDAV metadata requests running as data tasks on a background session, which stalled listings in the File Provider (#46)
- Fixed S3 folder deletes and moves reporting success when S3 refused to delete some keys, and acting on keys outside the folder (#63, #69)
- Fixed S3 listings of an empty folder beside a same-named object, an S3 listing page holding one item more than
maxPageSize, and more rejected S3 credentials reported asunauthorized(#61, #62) - Fixed listings placing items whose name is no single path component (e.g.
a/b,..) at the wrong path (#58) - Fixed VF6 folders that old Cryptomator versions shortened at 129 characters missing from listings (#61)
- Fixed overwriting a long-named file in a VF7/VF8 vault failing with
itemAlreadyExists, and leftover.c9sdirectories failing a listing (#71) - Fixed large vault listings and folder deletes timing out by running at most 8 item operations at once (#71)
- Fixed vault folder deletes that could follow a corrupt dir file into the vault root, an ancestor or a Google Drive shortcut or Graph remote item, or delete a folder another device had moved away (#73, #74)
- Fixed shortened-name files whose content doesn't hash to the listed name being accepted (#59, #60)
- Fixed HTTPS→HTTP redirects being followed and WebDAV passwords being sent over a downgraded hop
- Fixed debug logs containing tokens, presigned URLs, upload-session URLs or file-link paths (#46, #47, #48, #68)
Full Changelog: 4.0.0...5.0.0