Skip to content
This repository has been archived by the owner on Jun 19, 2023. It is now read-only.

Commit

Permalink
Merge pull request #919 from owncloud/oauth_support
Browse files Browse the repository at this point in the history
OAuth2 support
  • Loading branch information
nasli authored Nov 8, 2017
2 parents 0fc1d45 + 63156dd commit fd8e411
Show file tree
Hide file tree
Showing 139 changed files with 4,635 additions and 6,697 deletions.
4 changes: 2 additions & 2 deletions OC Share Sheet/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>3.6.2</string>
<string>3.7.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<string>1.0.5</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>NSAppTransportSecurity</key>
Expand Down
6 changes: 3 additions & 3 deletions OC Share Sheet/ShareViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ fileprivate func > <T : Comparable>(lhs: T?, rhs: T?) -> Bool {



@objc class ShareViewController: UIViewController, UITableViewDelegate, UITableViewDataSource, KKPasscodeViewControllerDelegate, CheckAccessToServerDelegate {
@objc class ShareViewController: UIViewController, UITableViewDelegate, UITableViewDataSource, KKPasscodeViewControllerDelegate {

@IBOutlet weak var navigationBar: UINavigationBar?
@IBOutlet weak var shareTable: UITableView?
Expand Down Expand Up @@ -255,7 +255,7 @@ fileprivate func > <T : Comparable>(lhs: T?, rhs: T?) -> Bool {
upload.uploadFileName = fileName
upload.kindOfError = enumKindOfError.notAnError.rawValue
upload.estimateLength = fileLength
upload.userId = (user?.idUser)!
upload.userId = (user?.userId)!
upload.status = enumUpload.generatedByDocumentProvider.rawValue
upload.chunksLength = Int(k_lenght_chunk)
upload.isNotNecessaryCheckIfExist = false
Expand Down Expand Up @@ -344,7 +344,7 @@ fileprivate func > <T : Comparable>(lhs: T?, rhs: T?) -> Bool {
if error == nil {
if let url = item as? URL{

print("item as url: \(item)")
print("item as url: \(url)")

self.filesSelected.append(url)

Expand Down
2 changes: 1 addition & 1 deletion OCCommunicationLib
Submodule OCCommunicationLib updated 20 files
+3 −0 .gitignore
+3 −2 OCCommunicationLib/OCCommunicationLib/OCCapabilities.h
+119 −0 OCCommunicationLib/OCCommunicationLib/OCCapabilities.m
+71 −42 OCCommunicationLib/OCCommunicationLib/OCCommunication.h
+105 −41 OCCommunicationLib/OCCommunicationLib/OCCommunication.m
+58 −0 OCCommunicationLib/OCCommunicationLib/OCCredentialsDto.h
+105 −0 OCCommunicationLib/OCCommunicationLib/OCCredentialsDto.m
+4 −1 OCCommunicationLib/OCCommunicationLib/OCErrorMsg.h
+14 −0 OCCommunicationLib/OCCommunicationLib/OCFrameworkConstants.h
+9 −5 OCCommunicationLib/OCCommunicationLib/OCOAuth2Authentication/OCCredentialsStorage.h
+40 −0 OCCommunicationLib/OCCommunicationLib/OCOAuth2Authentication/OCOAuth2Configuration.h
+47 −0 OCCommunicationLib/OCCommunicationLib/OCOAuth2Authentication/OCOAuth2Configuration.m
+85 −0 OCCommunicationLib/OCCommunicationLib/OCOAuth2Authentication/OCOAuth2Manager.h
+333 −0 OCCommunicationLib/OCCommunicationLib/OCOAuth2Authentication/OCOAuth2Manager.m
+19 −9 OCCommunicationLib/OCCommunicationLib/OCTrustedCertificatesStore.h
+28 −9 OCCommunicationLib/OCCommunicationLib/OCWebDavClient/OCWebDAVClient.h
+358 −86 OCCommunicationLib/OCCommunicationLib/OCWebDavClient/OCWebDAVClient.m
+35 −2 OCCommunicationLib/OCCommunicationLib/Utils/UtilsFramework.m
+7 −1 OCCommunicationLib/OCCommunicationLibTests/OCCommunicationLibTests.m
+30 −8 OCCommunicationLib/ownCloud iOS library.xcodeproj/project.pbxproj
245 changes: 129 additions & 116 deletions Owncloud iOs Client.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

54 changes: 25 additions & 29 deletions Owncloud iOs Client/AppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/gpl-3.0.en.html>.
*/





#import <UIKit/UIKit.h>
#import "UserDto.h"
#import "MediaAVPlayerViewController.h"
Expand All @@ -27,11 +23,12 @@
#import "DetailViewController.h"
#import "ManageDownloads.h"
#import "CheckAccessToServer.h"
#import "UtilsLogin.h"
#import "OCOAuth2Configuration.h"

@class FilesViewController;
@class RecentViewController;
@class SettingsViewController;
@class LoginViewController;
@class HelpGuideViewController;
@class Download;
@class OCCommunication;
Expand All @@ -42,6 +39,10 @@
@class CheckHasShareSupport;
@class CheckCapabilities;

@class UniversalLoginViewController;
@class ManageAccounts;


extern NSString * CloseAlertViewWhenApplicationDidEnterBackground;
extern NSString * RefreshSharesItemsAfterCheckServerVersion;
extern NSString * NotReachableNetworkForUploadsNotification;
Expand All @@ -59,8 +60,7 @@ extern NSString * NotReachableNetworkForDownloadsNotification;

RecentViewController *_recentViewController;
FilesViewController *_filesViewController;
//Pointer to a actual files view controller where the user is.
FilesViewController *_presentFilesViewController;

//FavouritesViewController *_favouritesViewController;
SettingsViewController *_settingsViewController;
//OCTabBarController *_tabBarController;
Expand Down Expand Up @@ -108,17 +108,16 @@ extern NSString * NotReachableNetworkForDownloadsNotification;

}

@property (strong, nonatomic) LoginViewController *loginWindowViewController;
@property (strong, nonatomic) HelpGuideViewController *helpGuideWindowViewController;
@property (strong, nonatomic) UIWindow *window;
@property (strong, nonatomic) LoginViewController *loginViewController;
@property (strong, nonatomic) UserDto *activeUser;
@property (strong, nonatomic) OCTabBarController *ocTabBarController;
@property (nonatomic, strong) NSMutableArray *uploadArray;
@property (nonatomic, strong) NSMutableArray *webDavArray;
@property (nonatomic, strong) SharedViewController *sharedViewController;
@property (nonatomic, strong) RecentViewController *recentViewController;
@property (nonatomic, strong) FilesViewController *filesViewController;
//Pointer to a actual files view controller where the user is.
@property (nonatomic, strong) FilesViewController *presentFilesViewController;
@property (nonatomic, strong) SettingsViewController *settingsViewController;
@property (nonatomic, strong) UISplitViewController *splitViewController;
Expand Down Expand Up @@ -153,6 +152,7 @@ extern NSString * NotReachableNetworkForDownloadsNotification;
@property (nonatomic, strong) ManageDownloads *downloadManager;
@property (nonatomic, strong) NSString *userSessionCurrentToken;

@property (nonatomic, strong) OCOAuth2Configuration *oauth2Configuration;

/*
* Method to get a Singleton of the OCCommunication to manage all the communications
Expand Down Expand Up @@ -180,9 +180,6 @@ extern NSString * NotReachableNetworkForDownloadsNotification;
- (void) updateRecents;
- (void) updateProgressView:(NSUInteger)num withPercent:(float)percent;
- (void) restartAppAfterDeleteAllAccounts;
- (void) showLoginView;

- (void)doLoginWithOauthToken;

//Method that erase the data of the detail view in iPad.
- (void)presentWithView;
Expand Down Expand Up @@ -258,7 +255,7 @@ extern NSString * NotReachableNetworkForDownloadsNotification;
* for a specific user
*
*/
- (void) cancelTheCurrentUploadsWithTheSameUserId:(NSInteger)idUser;
- (void) cancelTheCurrentUploadsWithTheSameUserId:(NSInteger)userId;

///-----------------------------------
/// @name Cancel the Currents Uploads
Expand All @@ -271,16 +268,16 @@ extern NSString * NotReachableNetworkForDownloadsNotification;
* @param userId -> id of user
*
*/
- (void) cancelTheCurrentUploadsOfTheUser:(NSInteger)idUser;
- (void) cancelTheCurrentUploadsOfTheUser:(NSInteger)userId;

/*
* This method is called after that this class receive the notification that the user
* has resolved the credentials error.
* In this method we changed the kind of error of uploads failed "errorCredentials" to "notAndError"
* for a specific user
* @idUser -> idUser for a scpecific user.
* @userId -> userId for a scpecific user.
*/
- (void)changeTheStatusOfCredentialsFilesErrorOfAnUserId:(NSInteger)idUser;
- (void)changeTheStatusOfCredentialsFilesErrorOfAnUserId:(NSInteger)userId;


///-----------------------------------
Expand All @@ -302,19 +299,6 @@ extern NSString * NotReachableNetworkForDownloadsNotification;
*/
- (void) generateAppInterfaceFromLoginScreen:(BOOL)isFromLogin;

///-----------------------------------
/// @name Check if server support different things
///-----------------------------------

/**
* This method check if the server support multipple things:
* - If support Share
* - If support Cookies
*
*/
- (void)checkIfServerSupportThings;



//-----------------------------------
/// @name reloadTableFromDataBaseIfFileIsVisibleOnList
Expand All @@ -337,4 +321,16 @@ extern NSString * NotReachableNetworkForDownloadsNotification;

- (void) showPassCodeIfNeeded;


//---------------------------
/// @name switchActiveUser
///-------------------------

/**
* Method that switches the active user to that passed as a parameter
*
* @param user -> UserDto to set as active user
*/
- (void) switchActiveUserTo:(UserDto *) user inHardMode:(BOOL)hardMode withCompletionHandler:(void (^)(void)) completionHandler;

@end
Loading

0 comments on commit fd8e411

Please sign in to comment.