-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Additional OAuth and Certificate Infos (#325)
* #267 - added a info view as tableview header for showing additional informations for OAuth 2 login - added additional informations for certificate validation as label and text * better value handling * changed function name to better reflect, what it does * now using theme colors * fixed typo * Fix for http connections and OAuth authentication - new sdk is used, which supports warnings for https connections - for http connections, continue only, if OAuthInfoHeader was shown to the user, before OAuth authentication is performed * fixed ui test for OAuth http test, added additional Continue step * - correct handling of OAuth Header in edit mode - remove certificate description, if certificate was removed from bookmark - added new helper methods for updating header / footer title in TableView Section without loosing text field focus * - fixed wrong table header view height, if it was not set - fixed additional continue step in edit mode for http token based connections * fixed ui test, because password field is not visible on iPhone 8 (used test device)
- Loading branch information
Showing
16 changed files
with
469 additions
and
6 deletions.
There are no files selected for viewing
Submodule ios-sdk
updated
14 files
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// | ||
// OCCertificate+Extension.swift | ||
// ownCloud | ||
// | ||
// Created by Matthias Hühne on 19.03.19. | ||
// Copyright © 2019 ownCloud GmbH. All rights reserved. | ||
// | ||
|
||
/* | ||
* Copyright (C) 2019, ownCloud GmbH. | ||
* | ||
* This code is covered by the GNU Public License Version 3. | ||
* | ||
* For distribution utilizing Apple mechanisms please see https://owncloud.org/contribute/iOS-license-exception/ | ||
* You should have received a copy of this license along with this program. If not, see <http://www.gnu.org/licenses/gpl-3.0.en.html>. | ||
* | ||
*/ | ||
|
||
import UIKit | ||
import ownCloudSDK | ||
|
||
extension OCCertificate { | ||
|
||
func validationResult(completionHandler: @escaping (_ status: OCCertificateValidationResult, _ shortDescription : String, _ longDescription : String, _ color : UIColor, _ error : Error) -> Void) { | ||
|
||
self.evaluate(completionHandler: { (_, status, error) in | ||
var color = UIColor.red | ||
var shortDescription = "" | ||
var longDescription = "" | ||
|
||
switch status { | ||
|
||
case .none: | ||
break | ||
case .error: | ||
color = Theme.shared.activeCollection.errorColor | ||
shortDescription = "Error".localized | ||
longDescription = "\("Validation Error".localized) \(error.localizedDescription)" | ||
case .reject: | ||
color = Theme.shared.activeCollection.errorColor | ||
shortDescription = "Rejected".localized | ||
longDescription = "Certificate was rejected by user.".localized | ||
case .promptUser: | ||
color = Theme.shared.activeCollection.warningColor | ||
shortDescription = "Warning".localized | ||
longDescription = "Certificate has issues.\nOpen 'Certificate Details' for more informations.".localized | ||
case .passed: | ||
color = Theme.shared.activeCollection.successColor | ||
shortDescription = "Passed".localized | ||
longDescription = "No issues found. Certificate passed validation.".localized | ||
case .userAccepted: | ||
color = Theme.shared.activeCollection.warningColor | ||
shortDescription = "Accepted".localized | ||
longDescription = "Certificate may have issues, but was accepted by user.\nOpen 'Certificate Details' for more informations.".localized | ||
} | ||
completionHandler(status, shortDescription, longDescription, color, error) | ||
}) | ||
} | ||
} |
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
Oops, something went wrong.