Skip to content

[feature/kiteworks-build] Kiteworks Integration #1479

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 22 commits into
base: master
Choose a base branch
from

Conversation

Matthias-Huehne-Kiteworks
Copy link

@Matthias-Huehne-Kiteworks Matthias-Huehne-Kiteworks commented Jul 21, 2025

Description

This PR adds Kiteworks integration to the iOS ownCloud app.
The SDK was adopted to detect a Kiteworks server and proceed with the needed logic.

The iOS app got some adoption regarding sidebar items and not to show folder sizes (as it is not available on Kiteworks server).

Related Issue

Motivation and Context

How Has This Been Tested?

  • login wih a Kiteworks (Test-)server URL
  • login with an ownCloud server URL (to check if ownCloud login is still working)

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • Added an issue with details about all relevant changes in the iOS documentation repository.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • Added changelog files for the fixed issues in folder changelog/unreleased

felix-schwarz and others added 16 commits October 16, 2024 17:46
…d client_secret in case token endpoint does not support passing them via Basic Auth (RFC 6749, section 2.3.1), new parameter `authentication-oauth2.post-client-id-and-secret`
- Fastlane: Copy Branding.plist file into the correct folder.
…kiteworks-build

# Conflicts:
#	ios-sdk
#	ownCloud Action Extension/InfoPlist.xcstrings
#	ownCloud Share Extension/InfoPlist.xcstrings
#	ownCloud.xcodeproj/project.pbxproj
#	ownCloud/Resources/InfoPlist.xcstrings
…uthentication steps. Reusing a single connection for all steps ensures that the Kiteworks product name can be retrieved from status.php in OCConnection+Tools, allowing the 'kwdav' prefix to be added to server URL paths.
- merge with master v12.5.0
- hide collection size for Kiteworks server (always 0 bytes)
@CLAassistant
Copy link

CLAassistant commented Jul 21, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
2 out of 3 committers have signed the CLA.

✅ felix-schwarz
✅ hosy
❌ Matthias-Huehne-Kiteworks
You have signed the CLA already but the status is still pending? Let us recheck it.

- reset entitlements and Info.plist files to vanilla values
- deleted branding assets
@hosy hosy requested a review from felix-schwarz July 22, 2025 08:36
let connection = OCConnection(bookmark: bmark)
self.connection = connection
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A new OCConnection is instantiated on purpose for each step calling this method, to always start at from a fresh slate. What problem does instantiating only one OCConnection and keeping it around solve?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I do not have this change I lose the server status in the setup process and I cannot access later the Kiteworks product.

Copy link
Contributor

@felix-schwarz felix-schwarz Jul 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I see that in the SDK, you implement OCConnection.isKiteworksServer as

- (BOOL)isKiteworksServer
 {
     return (([((NSDictionary *)self.bookmark.userInfo[@"statusInfo"])[@"product"] isEqual:@"kiteworks"] || [self.product isEqualToString:@"kiteworks"]));
 }

which depends on the statusInfo (OCBookmarkUserInfoKeyStatusInfo) stored in the bookmark in -[OCConnection connectWithCompletionHandler:], which will only be called at the point where authentication is already set up. That info should also not get lost when not re-using the OCConnection, as it that info is stored in the OCBookmark that's being operated on during setup.

[Addition lateron: I only just saw that you're also using a new OCConnection.product property here, whose value will indeed vanish with the instance. However, instead of storing that value in the OCConnection.product (where it'll go away), only to then check it later, please consider checking it right for equality with kiteworks right away - and if it is equal, store it as kiteworks capability as suggested below.]

A more stable and easier way to store that info would be using -[OCBookmark addCapability:] and -[OCBookmark hasCapability:], which is already used to mark a bookmark as supporting drives (spaces) and favorites. Here's how that looks for drive support:

- (BOOL)useDriveAPI
{
	return (self.capabilities.spacesEnabled.boolValue || [self.bookmark hasCapability:OCBookmarkCapabilityDrives]);
}

A benefit is that you can use that OCConnection.isKiteworksServer, but also directly with OCBookmark anywhere via f.ex.[bookmark hasCapability:OCBookmarkCapabilityKiteworks].

At any rate, persisting and re-using the OCConnection instance should not be needed as

  • the info should be stored in the OCBookmark - from where a new OCConnection instance can also fetch it
  • this is not how OCConnection was used until now, so using it like this is uncharted territory and might have unwanted side-effects

let connection = OCConnection(bookmark: bmark)
self.connection = connection
Copy link
Contributor

@felix-schwarz felix-schwarz Jul 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I see that in the SDK, you implement OCConnection.isKiteworksServer as

- (BOOL)isKiteworksServer
 {
     return (([((NSDictionary *)self.bookmark.userInfo[@"statusInfo"])[@"product"] isEqual:@"kiteworks"] || [self.product isEqualToString:@"kiteworks"]));
 }

which depends on the statusInfo (OCBookmarkUserInfoKeyStatusInfo) stored in the bookmark in -[OCConnection connectWithCompletionHandler:], which will only be called at the point where authentication is already set up. That info should also not get lost when not re-using the OCConnection, as it that info is stored in the OCBookmark that's being operated on during setup.

[Addition lateron: I only just saw that you're also using a new OCConnection.product property here, whose value will indeed vanish with the instance. However, instead of storing that value in the OCConnection.product (where it'll go away), only to then check it later, please consider checking it right for equality with kiteworks right away - and if it is equal, store it as kiteworks capability as suggested below.]

A more stable and easier way to store that info would be using -[OCBookmark addCapability:] and -[OCBookmark hasCapability:], which is already used to mark a bookmark as supporting drives (spaces) and favorites. Here's how that looks for drive support:

- (BOOL)useDriveAPI
{
	return (self.capabilities.spacesEnabled.boolValue || [self.bookmark hasCapability:OCBookmarkCapabilityDrives]);
}

A benefit is that you can use that OCConnection.isKiteworksServer, but also directly with OCBookmark anywhere via f.ex.[bookmark hasCapability:OCBookmarkCapabilityKiteworks].

At any rate, persisting and re-using the OCConnection instance should not be needed as

  • the info should be stored in the OCBookmark - from where a new OCConnection instance can also fetch it
  • this is not how OCConnection was used until now, so using it like this is uncharted territory and might have unwanted side-effects

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants