Skip to content

Commit

Permalink
Merge branch 'develop' into releases/1.4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
kober32 committed Aug 25, 2022
2 parents 3d64060 + a40eb13 commit 064ba55
Show file tree
Hide file tree
Showing 25 changed files with 452 additions and 342 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ on:
jobs:
build:
name: Build
runs-on: macos-11.0
runs-on: macos-12
steps:
- name: Checkout the repo
uses: actions/checkout@v2
- name: Building
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./scripts/build.sh
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ on:
jobs:
pod:
name: Pod Lib Lint
runs-on: macos-11.0
runs-on: macos-12
steps:
- name: Checkout the repo
uses: actions/checkout@v2
- name: Lint
run: pod lib lint --allow-warnings
swift:
name: Swift Lint
runs-on: macos-11.0
runs-on: macos-12
steps:
- name: Checkout the repo
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
jobs:
publish:
name: Publish
runs-on: macos-latest
runs-on: macos-12
steps:
- name: Checkout the repo
uses: actions/checkout@v2
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,20 @@ on:
jobs:
tests:
name: Tests
runs-on: macos-11.0
runs-on: macos-12
steps:
- name: Checkout the repo
uses: actions/checkout@v2
- name: Runing Tests
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
APP_KEY: ${{ secrets.TESTS_APP_KEY }}
APP_SECRET: ${{ secrets.TESTS_APP_SECRET }}
MASTER_SERVER_PUBLIC_KEY : ${{ secrets.TESTS_MASTER_SERVER_PUBLIC_KEY }}
CL_URL: ${{ secrets.TESTS_CL_URL }}
CL_LGN: ${{ secrets.TESTS_CL_LGN }}
CL_PWD: ${{ secrets.TESTS_CL_PWD }}
CL_AID: ${{ secrets.TESTS_CL_AID }}
OP_URL: ${{ secrets.TESTS_OP_URL }}
ER_URL: ${{ secrets.TESTS_ER_URL }}
run: ./scripts/test.sh -destination "platform=iOS Simulator,OS=15.2,name=iPhone SE (2nd generation)" -appkey "$APP_KEY" -appsecret "$APP_SECRET" -masterspk "$MASTER_SERVER_PUBLIC_KEY" -er "$ER_URL" -op "$OP_URL" -cl "$CL_URL" -clu "$CL_LGN" -clp "$CL_PWD"
run: ./scripts/test.sh -appkey "$APP_KEY" -appsecret "$APP_SECRET" -masterspk "$MASTER_SERVER_PUBLIC_KEY" -er "$ER_URL" -op "$OP_URL" -cl "$CL_URL" -clu "$CL_LGN" -clp "$CL_PWD" -cla "$CL_AID"
3 changes: 1 addition & 2 deletions Cartfile
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
github "wultra/powerauth-mobile-sdk" "release/1.6.x"
github "wultra/networking-apple" "release/1.0.x"
github "wultra/networking-apple" "release/1.1.x"
5 changes: 3 additions & 2 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
github "wultra/networking-apple" "7543f158013c92889fcb349ec789ce90a9f22910"
github "wultra/powerauth-mobile-sdk" "b86c15ced7303dd446619a8d714470660d55407b"
binary "https://raw.githubusercontent.com/wultra/powerauth-mobile-sdk-spm/develop/PowerAuth2.json" "1.7.1"
binary "https://raw.githubusercontent.com/wultra/powerauth-mobile-sdk-spm/develop/PowerAuthCore.json" "1.7.1"
github "wultra/networking-apple" "eaf413b0ef0fcf2c5cef9c3ff0735b2643450e8c"
4 changes: 2 additions & 2 deletions Deploy/WultraMobileTokenSDK.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ Pod::Spec.new do |s|
# 'Common' subspec
s.subspec 'Common' do |sub|
sub.source_files = 'WultraMobileTokenSDK/Common/**/*.swift'
sub.dependency 'PowerAuth2', '>= 1.6'
sub.dependency 'WultraPowerAuthNetworking', '>= 1.0.2'
sub.dependency 'PowerAuth2', '>= 1.7'
sub.dependency 'WultraPowerAuthNetworking', '>= 1.1.4'
end

# 'Operations' subspec
Expand Down
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ let package = Package(
.library(name: "WultraMobileTokenSDK", targets: ["WultraMobileTokenSDK"])
],
dependencies: [
.package(name: "PowerAuth2", url: "https://github.com/wultra/powerauth-mobile-sdk-spm.git", .upToNextMinor(from: "1.6.2")),
.package(name: "WultraPowerAuthNetworking", url: "https://github.com/wultra/networking-apple.git", .upToNextMinor(from: "1.1.3"))
.package(name: "PowerAuth2", url: "https://github.com/wultra/powerauth-mobile-sdk-spm.git", .upToNextMinor(from: "1.7.0")),
.package(name: "WultraPowerAuthNetworking", url: "https://github.com/wultra/networking-apple.git", .upToNextMinor(from: "1.1.4"))
],
targets: [
.target(
Expand Down
4 changes: 2 additions & 2 deletions WultraMobileTokenSDK.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ Pod::Spec.new do |s|
# 'Common' subspec
s.subspec 'Common' do |sub|
sub.source_files = 'WultraMobileTokenSDK/Common/**/*.swift'
sub.dependency 'PowerAuth2', '>= 1.6'
sub.dependency 'WultraPowerAuthNetworking', '>= 1.0.2'
sub.dependency 'PowerAuth2', '>= 1.7'
sub.dependency 'WultraPowerAuthNetworking', '>= 1.1.4'
end

# 'Operations' subspec
Expand Down
28 changes: 23 additions & 5 deletions WultraMobileTokenSDK.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
objects = {

/* Begin PBXBuildFile section */
DC059A3E244DDC0900B24878 /* WMTConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC059A3D244DDC0900B24878 /* WMTConfig.swift */; };
DC06D01F25AC74E400F2EA69 /* WMTLock.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC06D01E25AC74E400F2EA69 /* WMTLock.swift */; };
DC395C0A24E55B9B0007C36E /* PushParserTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC395C0924E55B9B0007C36E /* PushParserTests.swift */; };
DC3D0B372480F3C7000DC4D9 /* WMTOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC3D0B362480F3C7000DC4D9 /* WMTOperation.swift */; };
Expand Down Expand Up @@ -63,7 +62,6 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
DC059A3D244DDC0900B24878 /* WMTConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WMTConfig.swift; sourceTree = "<group>"; };
DC06D01E25AC74E400F2EA69 /* WMTLock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WMTLock.swift; sourceTree = "<group>"; };
DC395C0924E55B9B0007C36E /* PushParserTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PushParserTests.swift; sourceTree = "<group>"; };
DC3D0B362480F3C7000DC4D9 /* WMTOperation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WMTOperation.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -165,13 +163,13 @@
isa = PBXGroup;
children = (
DC5F6DE724E14FA100D351D3 /* Configs */,
DC616235248508F8000DED17 /* QROperationParserTests.swift */,
DC616237248508F8000DED17 /* Info.plist */,
DC61624124852B6D000DED17 /* NetworkingObjectsTests.swift */,
DCE660D024CEBECA00870E53 /* IntegrationTests.swift */,
DCE660D224CEF56400870E53 /* IntegrationUtils.swift */,
DC395C0924E55B9B0007C36E /* PushParserTests.swift */,
DC6EDB7825A49ED900A229E4 /* OperationExpirationTests.swift */,
DC616235248508F8000DED17 /* QROperationParserTests.swift */,
);
path = WultraMobileTokenSDKTests;
sourceTree = "<group>";
Expand Down Expand Up @@ -246,7 +244,6 @@
DC81D1CE24502E0300F80CD6 /* Common */ = {
isa = PBXGroup;
children = (
DC059A3D244DDC0900B24878 /* WMTConfig.swift */,
DCC5CCCD244DB0AD004679AC /* WMTLogger.swift */,
DC06D01E25AC74E400F2EA69 /* WMTLock.swift */,
DC9511F826EA02C100FF40AD /* WPNIntegration.swift */,
Expand Down Expand Up @@ -366,6 +363,7 @@
DCC5CC962449EE21004679AC /* Sources */,
DCC5CC972449EE21004679AC /* Frameworks */,
DCC5CC982449EE21004679AC /* Resources */,
DCDA0A3128A6851400EDB6D4 /* Swift Lint */,
);
buildRules = (
);
Expand Down Expand Up @@ -432,6 +430,27 @@
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
DCDA0A3128A6851400EDB6D4 /* Swift Lint */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = "Swift Lint";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if ! [ -x \"$(command -v swiftlint)\" ]; then\n echo 'warning: swiftlint is not installed on this computer.' >&2\n exit 0\nfi\n\nswiftlint\n";
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
DC61622F248508F8000DED17 /* Sources */ = {
isa = PBXSourcesBuildPhase;
Expand All @@ -455,7 +474,6 @@
DCC5CCB52449F8E9004679AC /* WMTOperationAttributeAmount.swift in Sources */,
DCC5CCD6244DBB7F004679AC /* WMTPushRegistrationData.swift in Sources */,
DC3D0B392480F886000DC4D9 /* WMTLocalOperation.swift in Sources */,
DC059A3E244DDC0900B24878 /* WMTConfig.swift in Sources */,
DCD8B336246C1BAF00385F02 /* WMTRejectionReason.swift in Sources */,
DCC5CCD8244DBBBD004679AC /* WMTAuthorizationData.swift in Sources */,
DC3D0B372480F3C7000DC4D9 /* WMTOperation.swift in Sources */,
Expand Down
50 changes: 0 additions & 50 deletions WultraMobileTokenSDK/Common/WMTConfig.swift

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,23 @@ import Foundation
/// Allowed signature types that can be used for operation approval.
public class WMTAllowedOperationSignature: Codable {

/// If operation should be signed with 1 or 2 factor authentication
/// If operation should be signed with 1 or 2 factor authentication.
public let signatureType: SignatureType

/// What factors ("password" or/and "biometry") can be used for signing this operation.
/// What factors are needed to signing this operation.
public let signatureFactors: [SignatureFactors]

/// Helper getter if biometry factor is allowed.
public var isBiometryAllowed: Bool { return signatureFactors.contains(.possessionBiometry) }

// MARK: - INNER CLASSES

public enum SignatureType: String, Codable {
case singleFactor = "1FA"
case twoFactors = "2FA"
// 3-factor scheme is not used in mobile token
// case threeFactors = "3FA"
}

public enum SignatureFactors: String, Codable {
case possession = "possession"
case possessionKnowledge = "possession_knowledge"
case possessionBiometry = "possession_biometry"
}
Expand All @@ -58,3 +58,8 @@ public class WMTAllowedOperationSignature: Codable {
case signatureFactors = "variants"
}
}

public extension WMTAllowedOperationSignature {
/// Helper getter if biometry factor is allowed.
var isBiometryAllowed: Bool { return signatureFactors.contains(.possessionBiometry) }
}
4 changes: 0 additions & 4 deletions WultraMobileTokenSDK/Operations/QR/WMTQROperation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ public struct WMTQROperation {
return nonce
}

internal var uriIdForOfflineSigning: String {
return "/operation/authorize/offline"
}

internal var dataForOfflineSigning: Data {
return "\(operationId)&\(operationData.sourceString)".data(using: .utf8)!
}
Expand Down
18 changes: 6 additions & 12 deletions WultraMobileTokenSDK/Operations/QR/WMTQROperationParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -303,19 +303,13 @@ public class WMTQROperationParser {
bic = nil
}
let allowedChars = "01234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ"
for c in iban {
if allowedChars.firstIndex(of: c) == nil {
// Invalid character in IBAN
return nil
}
if iban.contains(where: { !allowedChars.contains($0) }) {
// Invalid character in IBAN
return nil
}
if let bic = bic {
for c in bic {
if allowedChars.firstIndex(of: c) == nil {
// Invalid character in BIC
return nil
}
}
if bic?.contains(where: { !allowedChars.contains($0) }) == true {
// Invalid character in BIC
return nil
}
return .account(iban: iban, bic: bic)
}
Expand Down
Loading

0 comments on commit 064ba55

Please sign in to comment.