Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
robertdalmeida committed Feb 5, 2024
1 parent b6f7508 commit 86b3af7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
}
}

private struct DelegatedAuthenticationPayload {
let delegatedAuthenticationOutput: String
let delete: Bool?
}

/// Handles the 3D Secure 2 fingerprint and challenge actions separately + Delegated Authentication.
@available(iOS 14.0, *)
internal class ThreeDS2PlusDACoreActionHandler: ThreeDS2CoreActionHandler {
Expand Down Expand Up @@ -172,8 +177,11 @@
/// 1. if DA has been registered on the device
/// 2. shows an approval screen if it has been registered
/// else calls the completion with a failure.
private func performDelegatedAuthentication(_ fingerprintToken: ThreeDS2Component.FingerprintToken,
completion: @escaping (Result<DelegatedAuthenticationPayload, DelegateAuthenticationError>) -> Void) {
private func performDelegatedAuthentication(
_ fingerprintToken: ThreeDS2Component.FingerprintToken,
completion: @escaping (Result<DelegatedAuthenticationPayload, DelegateAuthenticationError>
) -> Void
) {
guard let delegatedAuthenticationInput = fingerprintToken.delegatedAuthenticationSDKInput else {
completion(.failure(.authenticationFailed(cause: ThreeDS2PlusDACoreActionError.sdkInputNotAvailableForApproval)))
return
Expand All @@ -193,14 +201,12 @@
}

// MARK: Delegated Authentication Approval

private struct DelegatedAuthenticationPayload {
let delegatedAuthenticationOutput: String
let delete: Bool?
}

private func showApprovalScreen(delegatedAuthenticationInput: String,
completion: @escaping (Result<DelegatedAuthenticationPayload, DelegateAuthenticationError>) -> Void) {

private func showApprovalScreen(
delegatedAuthenticationInput: String,
completion: @escaping (Result<DelegatedAuthenticationPayload, DelegateAuthenticationError>
) -> Void
) {
presenter.showApprovalScreen(
component: self,
approveAuthenticationHandler: { [weak self] in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@ import XCTest
}

func testSettingThreeDSRequestorAppURL() throws {
guard #available(iOS 14.0, *) else {
// XCTestCase does not respect @available so we have skip all tests here
throw XCTSkip("Unsupported iOS version")
}

let sut = ThreeDS2PlusDACoreActionHandler(context: Dummy.context,
appearanceConfiguration: ADYAppearanceConfiguration(),
delegatedAuthenticationConfiguration: Self.delegatedAuthenticationConfigurations, presentationDelegate: nil)
Expand All @@ -68,11 +63,6 @@ import XCTest
}

func testWrappedComponent() throws {
guard #available(iOS 14.0, *) else {
// XCTestCase does not respect @available so we have skip all tests here
throw XCTSkip("Unsupported iOS version")
}

let sut = ThreeDS2PlusDACoreActionHandler(context: Dummy.context,
appearanceConfiguration: ADYAppearanceConfiguration(),
delegatedAuthenticationConfiguration: Self.delegatedAuthenticationConfigurations, presentationDelegate: nil)
Expand All @@ -88,11 +78,6 @@ import XCTest
}

func testFingerprintFlowSuccess() throws {
guard #available(iOS 14.0, *) else {
// XCTestCase does not respect @available so we have skip all tests here
throw XCTSkip("Unsupported iOS version")
}

let service = AnyADYServiceMock()
service.authenticationRequestParameters = authenticationRequestParameters

Expand Down Expand Up @@ -124,11 +109,6 @@ import XCTest
}

func testInvalidFingerprintToken() throws {
guard #available(iOS 14.0, *) else {
// XCTestCase does not respect @available so we have skip all tests here
throw XCTSkip("Unsupported iOS version")
}

let service = AnyADYServiceMock()
service.authenticationRequestParameters = authenticationRequestParameters

Expand Down Expand Up @@ -213,11 +193,6 @@ import XCTest
}

func testChallengeFlowFailure() throws {
guard #available(iOS 14.0, *) else {
// XCTestCase does not respect @available so we have skip all tests here
throw XCTSkip("Unsupported iOS version")
}

let service = AnyADYServiceMock()
service.authenticationRequestParameters = authenticationRequestParameters
let mockedTransaction = AnyADYTransactionMock(parameters: authenticationRequestParameters)
Expand Down Expand Up @@ -256,11 +231,6 @@ import XCTest
}

func testChallengeFlowMissingTransaction() throws {
guard #available(iOS 14.0, *) else {
// XCTestCase does not respect @available so we have skip all tests here
throw XCTSkip("Unsupported iOS version")
}

let service = AnyADYServiceMock()

let authenticationServiceMock = AuthenticationServiceMock()
Expand Down Expand Up @@ -288,11 +258,6 @@ import XCTest
}

func testInvalidChallengeToken() throws {
guard #available(iOS 14.0, *) else {
// XCTestCase does not respect @available so we have skip all tests here
throw XCTSkip("Unsupported iOS version")
}

let service = AnyADYServiceMock()
service.authenticationRequestParameters = authenticationRequestParameters
let mockedTransaction = AnyADYTransactionMock(parameters: authenticationRequestParameters)
Expand Down

0 comments on commit 86b3af7

Please sign in to comment.