Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
kober32 committed Feb 3, 2022
2 parents eb78617 + 83500cc commit 65553cb
Show file tree
Hide file tree
Showing 18 changed files with 443 additions and 213 deletions.
3 changes: 2 additions & 1 deletion Cartfile
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
github "wultra/powerauth-mobile-sdk" ~> 1.6.1
binary "https://raw.githubusercontent.com/wultra/powerauth-mobile-sdk-spm/develop/PowerAuth2.json" ~> 1.6.2
binary "https://raw.githubusercontent.com/wultra/powerauth-mobile-sdk-spm/develop/PowerAuthCore.json" ~> 1.6.2
3 changes: 2 additions & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
github "wultra/powerauth-mobile-sdk" "1.6.2"
binary "https://raw.githubusercontent.com/wultra/powerauth-mobile-sdk-spm/develop/PowerAuth2.json" "1.6.2"
binary "https://raw.githubusercontent.com/wultra/powerauth-mobile-sdk-spm/develop/PowerAuthCore.json" "1.6.2"
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ let package = Package(
targets: ["WultraPowerAuthNetworking"])
],
dependencies: [
.package(name: "PowerAuth2", url: "https://github.com/wultra/powerauth-mobile-sdk-spm.git", .branch("develop"))
.package(name: "PowerAuth2", url: "https://github.com/wultra/powerauth-mobile-sdk-spm.git", .upToNextMinor(from: "1.6.2"))
],
targets: [
.target(
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# PowerAuth Networking for Apple platforms.

[![build](https://github.com/wultra/networking-apple/actions/workflows/build.yml/badge.svg)](https://github.com/wultra/networking-apple/actions/workflows/build.yml) [![pod](https://img.shields.io/cocoapods/v/WultraPowerAuthNetworking)](https://cocoapods.org/pods/WultraMobileTokenSDK) ![date](https://img.shields.io/github/release-date/wultra/networking-apple) ![platform](https://img.shields.io/cocoapods/p/WultraPowerAuthNetworking) [![license](https://img.shields.io/github/license/wultra/networking-apple)](LICENSE)
[![build](https://github.com/wultra/networking-apple/actions/workflows/build.yml/badge.svg)](https://github.com/wultra/networking-apple/actions/workflows/build.yml) ![spm](https://img.shields.io/github/v/release/wultra/networking-apple?color=F05138&label=Swift%20Package%20Manager) [![pod](https://img.shields.io/cocoapods/v/WultraPowerAuthNetworking)](https://cocoapods.org/pods/WultraMobileTokenSDK) ![date](https://img.shields.io/github/release-date/wultra/networking-apple) ![platform](https://img.shields.io/cocoapods/p/WultraPowerAuthNetworking) [![license](https://img.shields.io/github/license/wultra/networking-apple)](LICENSE)

A high-level networking SDK for PowerAuth-based endpoints.

Expand Down
48 changes: 44 additions & 4 deletions Sources/WultraPowerauthNetworking/WPNBaseNetworkingObjects.swift
Original file line number Diff line number Diff line change
Expand Up @@ -126,21 +126,42 @@ public class WPNResponseArray<T: Decodable>: WPNResponseBase {
}
}

/// Known values of rest api errors
/// Known values of REST API errors
public enum WPNKnownRestApiError: String, Decodable {

// COMMON ERRORS

/// When unexpected error happened.
case genericError = "ERROR_GENERIC"

/// General authentication failure (wrong password, wrong activation state, etc...)
case authenticationFailure = "POWERAUTH_AUTH_FAIL"

/// Failed to register push notifications
case pushRegistrationFailed = "PUSH_REGISTRATION_FAILED"

/// Invalid request sent - missing request object in request
case invalidRequest = "INVALID_REQUEST"

/// Activation is not valid (it is different from configured activation)
case invalidActivation = "INVALID_ACTIVATION"

/// Error during activfation
case activationError = "ERR_ACTIVATION"

/// Error in case that PowerAuth authentication fails
case authenticationError = "ERR_AUTHENTICATION"

/// Error during secure vault unlocking
case secureVaultError = "ERR_SECURE_VAULT"

/// Returned in case encryption or decryption fails
case encryptionError = "ERR_ENCRYPTION"

// PUSH ERRORS

/// Failed to register push notifications
case pushRegistrationFailed = "PUSH_REGISTRATION_FAILED"

// OPERATIONS ERRORS

/// Operation is already finished
case operationAlreadyFinished = "OPERATION_ALREADY_FINISHED"

Expand All @@ -152,6 +173,25 @@ public enum WPNKnownRestApiError: String, Decodable {

/// Operation is expired
case operationExpired = "OPERATION_EXPIRED"

// ACTIVATION SPAWN ERRORS

/// Unable to fetch activation code.
case activationCodeFailed = "ACTIVATION_CODE_FAILED"

// IDENTITY ONBOARDING ERRORS

/// Onboarding process failed or failed to start
case onboardingFailed = "ONBOARDING_FAILED"

/// Failed to resend onboarding OTP (probably requested too soon)
case onboardingOtpFailed = "ONBOARDING_OTP_FAILED"

/// Document is invalid
case invalidDocument = "INVALID_DOCUMENT"

/// Identity verification failed
case identityVerificationFailed = "IDENTITY_VERIFICATION_FAILED"
}

/// Error passed in a response, when the error is returned from an endpoint.
Expand Down
10 changes: 10 additions & 0 deletions Sources/WultraPowerauthNetworking/WPNConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,18 @@ public struct WPNConfig {
public let sslValidation: WPNSSLValidationStrategy

/// The timeout interval to use when waiting for backend data.
///
/// Value can be overridden for each `post` call in `WPNNetworkingService`.
/// Default value is 20.
public let timeoutIntervalForRequest: TimeInterval

/// Create instance of the config
/// - Parameters:
/// - baseUrl: Base URL for service requests.
/// - sslValidation: SSL validation strategy for the request.
/// - timeoutIntervalForRequest: The timeout interval to use when waiting for backend data.
/// Value can be overridden for each `post` call in `WPNNetworkingService`.
/// Default value is 20.
public init(baseUrl: URL, sslValidation: WPNSSLValidationStrategy, timeoutIntervalForRequest: TimeInterval = 20) {
self.baseUrl = baseUrl
self.sslValidation = sslValidation
Expand Down
Loading

0 comments on commit 65553cb

Please sign in to comment.