Skip to content
Merged

e2ee #155

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions Sources/NextcloudKit/NextcloudKit+E2EE.swift
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
})
}


Check warning on line 122 in Sources/NextcloudKit/NextcloudKit+E2EE.swift

View workflow job for this annotation

GitHub Actions / Lint

Vertical Whitespace Violation: Limit vertical whitespace to a single empty line; currently 2 (vertical_whitespace)
func getE2EEMetadata(fileId: String,
e2eToken: String?,
account: String,
Expand Down Expand Up @@ -163,6 +163,25 @@
}
}

// Async wrapper for getE2EEMetadata
func getE2EEMetadataAsync(fileId: String,
e2eToken: String? = nil,
account: String,
options: NKRequestOptions = NKRequestOptions(),
taskHandler: @escaping (_ task: URLSessionTask) -> Void = { _ in }) async -> (account: String, e2eMetadata: String?, signature: String?, responseData: AFDataResponse<Data>?, error: NKError) {

Check warning on line 171 in Sources/NextcloudKit/NextcloudKit+E2EE.swift

View workflow job for this annotation

GitHub Actions / Lint

Opening Brace Spacing Violation: Opening braces should be preceded by a single space and on the same line as the declaration (opening_brace)
await withCheckedContinuation { continuation in
getE2EEMetadata(
fileId: fileId,
e2eToken: e2eToken,
account: account,
options: options,
taskHandler: taskHandler
) { account, e2eMetadata, signature, responseData, error in
continuation.resume(returning: (account: account, e2eMetadata: e2eMetadata, signature: signature, responseData: responseData, error: error))
}
}
}

func putE2EEMetadata(fileId: String,
e2eToken: String,
e2eMetadata: String?,
Expand Down
Loading