Skip to content

Commit

Permalink
Merge pull request #54 from saltedge/dev
Browse files Browse the repository at this point in the history
Dev->Master
  • Loading branch information
ConstantinKV authored Oct 6, 2020
2 parents eee0dbd + 1df3c11 commit cd08cc9
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 29 deletions.
18 changes: 13 additions & 5 deletions Example/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,19 @@ target 'saltedge-ios_Example' do
pod 'PKHUD', '~> 5.0'
pod 'SDWebImage', '~> 5.0'
pod 'SDWebImageSVGKitPlugin'
end

target 'saltedge-ios_Tests' do
inherit! :search_paths
target 'saltedge-ios_Tests' do
inherit! :search_paths
pod 'SaltEdge-iOS-Swift', :path => '../'
pod 'Quick'
pod 'Nimble'
end

pod 'Quick', '~> 1.3.2'
pod 'Nimble', '~> 7.3.1'
end
post_install do |pi|
pi.pods_project.targets.each do |t|
t.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '10.0'
end
end
end
30 changes: 15 additions & 15 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
PODS:
- CocoaLumberjack (3.6.1):
- CocoaLumberjack/Core (= 3.6.1)
- CocoaLumberjack/Core (3.6.1)
- Nimble (7.3.4)
- CocoaLumberjack (3.7.0):
- CocoaLumberjack/Core (= 3.7.0)
- CocoaLumberjack/Core (3.7.0)
- Nimble (9.0.0)
- PKHUD (5.3.0)
- Quick (1.3.4)
- Quick (3.0.0)
- SaltEdge-iOS-Swift (3.3.6):
- TrustKit
- SDWebImage (5.7.1):
- SDWebImage/Core (= 5.7.1)
- SDWebImage/Core (5.7.1)
- SDWebImage (5.9.2):
- SDWebImage/Core (= 5.9.2)
- SDWebImage/Core (5.9.2)
- SDWebImageSVGKitPlugin (1.2.0):
- SDWebImage/Core (~> 5.6)
- SVGKit (>= 2.1)
Expand All @@ -18,9 +18,9 @@ PODS:
- TrustKit (1.6.5)

DEPENDENCIES:
- Nimble (~> 7.3.1)
- Nimble
- PKHUD (~> 5.0)
- Quick (~> 1.3.2)
- Quick
- SaltEdge-iOS-Swift (from `../`)
- SDWebImage (~> 5.0)
- SDWebImageSVGKitPlugin
Expand All @@ -41,16 +41,16 @@ EXTERNAL SOURCES:
:path: "../"

SPEC CHECKSUMS:
CocoaLumberjack: b17ae15142558d08bbacf69775fa10c4abbebcc9
Nimble: 051e3d8912d40138fa5591c78594f95fb172af37
CocoaLumberjack: e8955b9d337ac307103b0a34fd141c32f27e53c5
Nimble: 3b4ec3fd40f1dc178058e0981107721c615643d8
PKHUD: 98f3e4bc904b9c916f1c5bb6d765365b5357291b
Quick: f4f7f063c524394c73ed93ac70983c609805d481
Quick: 6d9559f40647bc4d510103842ef2fdd882d753e2
SaltEdge-iOS-Swift: dd3c81d3f969eb4a7148e5f79e210a13d0628278
SDWebImage: 5d4cf6afccd9ac1d2ee701ed0c4917cbb1b80536
SDWebImage: 0b42b8719ab0c5257177d5894306e8a336b21cbb
SDWebImageSVGKitPlugin: 06a811c05b9e839982baeb5251d15fe7a79abb82
SVGKit: 652cdf7bef8bec8564d04a8511d3ab50c7595fac
TrustKit: 073855e3adecd317417bda4ac9e9ac54a2e3b9f2

PODFILE CHECKSUM: c7895d8d67f16ad7e339c8bb0369e370283b78d1
PODFILE CHECKSUM: 571d1eb7bfecd2002bb7e1babcc966a9bccbf0a4

COCOAPODS: 1.9.3
18 changes: 9 additions & 9 deletions Example/Tests/Helpers/HPKPParserSpec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ class HPKPParserSpec: QuickSpec {
]
let expectedMaxAge: Double = 5184000
let expectedIncludeSubDomains: Bool = true

let (actualPins, actualMaxAge, actualIncludeSubdomains) = try! HPKPParser.parse(string)

expect(actualPins).to(equal(expectedPins))
expect(actualMaxAge).to(equal(expectedMaxAge))
expect(actualIncludeSubdomains).to(equal(expectedIncludeSubDomains))
}
}

context("when it is valid HPKP string withoud includeSubDomains option") {
it("should return pins, maxAge options and includeSubdomains as false") {
let string = "pin-sha256=\"cUPcTAZWKaASuYWhhneDttWpY3oBAkE3h2+soZS7sWs=\"; pin-sha256=\"M8HztCzM3elUxkcjR2S5P4hhyBNf6lHkmjAHKhpGPWE=\"; max-age=5184000;"
Expand All @@ -41,15 +41,15 @@ class HPKPParserSpec: QuickSpec {
]
let expectedMaxAge: Double = 5184000
let expectedIncludeSubDomains: Bool = false

let (actualPins, actualMaxAge, actualIncludeSubdomains) = try! HPKPParser.parse(string)

expect(actualPins).to(equal(expectedPins))
expect(actualMaxAge).to(equal(expectedMaxAge))
expect(actualIncludeSubdomains).to(equal(expectedIncludeSubDomains))
}
}

context("when pins are missing") {
it("should throw pinsMissing error") {
let string = "max-age=5184000; includeSubDomains;"
Expand All @@ -63,17 +63,17 @@ class HPKPParserSpec: QuickSpec {
context("when maxAge is not a number") {
it("should throw couldNotParseMaxAge error") {
let string = "pin-sha256=\"cUPcTAZWKaASuYWhhneDttWpY3oBAkE3h2+soZS7sWs=\"; pin-sha256=\"M8HztCzM3elUxkcjR2S5P4hhyBNf6lHkmjAHKhpGPWE=\"; max-age=51abc84000;"

expect{ try HPKPParser.parse(string) }.to(throwError { (error: HPKPParserError) in
expect(error.localizedDescription).to(equal(HPKPParserError.couldNotParseMaxAge.localizedDescription))
})
}
}

context("when maxAge is missing") {
it("should throw maxAgeMissing error") {
let string = "pin-sha256=\"cUPcTAZWKaASuYWhhneDttWpY3oBAkE3h2+soZS7sWs=\"; pin-sha256=\"M8HztCzM3elUxkcjR2S5P4hhyBNf6lHkmjAHKhpGPWE=\";"

expect{ try HPKPParser.parse(string) }.to(throwError { (error: HPKPParserError) in
expect(error.localizedDescription).to(equal(HPKPParserError.maxAgeMissing.localizedDescription))
})
Expand Down
10 changes: 10 additions & 0 deletions Example/saltedge-ios.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -469,11 +469,15 @@
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-saltedge-ios_Tests/Pods-saltedge-ios_Tests-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/SaltEdge-iOS-Swift/SaltEdge.framework",
"${BUILT_PRODUCTS_DIR}/TrustKit/TrustKit.framework",
"${BUILT_PRODUCTS_DIR}/Nimble/Nimble.framework",
"${BUILT_PRODUCTS_DIR}/Quick/Quick.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SaltEdge.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/TrustKit.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Nimble.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Quick.framework",
);
Expand Down Expand Up @@ -680,6 +684,7 @@
baseConfigurationReference = 9272D600EC690297D58E6E14 /* Pods-saltedge-ios_Example.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
DEVELOPMENT_TEAM = 8QFQG87EDC;
INFOPLIST_FILE = "saltedge-ios/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
Expand All @@ -696,6 +701,7 @@
baseConfigurationReference = 08D24DDB328B0CE27A561D9C /* Pods-saltedge-ios_Example.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
DEVELOPMENT_TEAM = 8QFQG87EDC;
INFOPLIST_FILE = "saltedge-ios/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
Expand All @@ -711,13 +717,15 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 34DF42CCB71418C78C58590B /* Pods-saltedge-ios_Tests.debug.xcconfig */;
buildSettings = {
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
DEVELOPMENT_TEAM = 8QFQG87EDC;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
INFOPLIST_FILE = Tests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks $(FRAMEWORK_SEARCH_PATHS)";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -729,9 +737,11 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 088762EB23D8C3470C71837E /* Pods-saltedge-ios_Tests.release.xcconfig */;
buildSettings = {
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
DEVELOPMENT_TEAM = 8QFQG87EDC;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = Tests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks $(FRAMEWORK_SEARCH_PATHS)";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down

0 comments on commit cd08cc9

Please sign in to comment.