Skip to content

Commit

Permalink
Merge pull request #23 from nevissecurity/feature/NEVISACCESSAPP-5565-…
Browse files Browse the repository at this point in the history
…Update-example-app-to-use-SDK-3.6.0

NEVISACCESSAPP-5565: Update example app to use SDK 3.6.0
  • Loading branch information
tamas-toth authored Feb 6, 2024
2 parents cf6f4f4 + b61fcc1 commit ae9734d
Show file tree
Hide file tree
Showing 14 changed files with 41 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
workflow_dispatch:

env:
XCODE_VERSION: '15.0.1'
XCODE_VERSION: '15.2'
CURRENT_BUILD_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}

jobs:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ on:
pull_request:
branches: [ 'main' ]
types: [opened, edited, synchronize, reopened]
workflow_dispatch:

env:
XCODE_VERSION: '15.0.1'
XCODE_VERSION: '15.2'

jobs:
pr:
Expand Down
1 change: 1 addition & 0 deletions .swiftformat
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
--disable blankLinesAtStartOfScope
--disable redundantFileprivate
--disable wrapMultilineStatementBraces
--disable preferForLoop

# File options
--exclude Pods
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source "https://rubygems.org"

gem 'activesupport', '~> 7.0.8'
gem 'cocoapods'
# Cocoapods 1.15.1 does not download the SDK frameworks during `pod install`
gem 'cocoapods', '1.15.0'
gem 'fastlane'

plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
Expand Down
4 changes: 2 additions & 2 deletions NevisExampleApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 3.5.0;
MARKETING_VERSION = 3.6.0;
PRODUCT_BUNDLE_IDENTIFIER = ch.nevis.mobile.authentication.sdk.ios.example;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
Expand Down Expand Up @@ -1038,7 +1038,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 3.5.0;
MARKETING_VERSION = 3.6.0;
PRODUCT_BUNDLE_IDENTIFIER = ch.nevis.mobile.authentication.sdk.ios.example;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
Expand Down
2 changes: 2 additions & 0 deletions NevisExampleApp/Dependency Provider/AppAssembly.swift
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ private extension AppAssembly {
authenticatorSelector: authenticatorSelector,
pinEnroller: res~>,
biometricUserVerifier: res~>,
devicePasscodeUserVerifier: res~>,
appCoordinator: res~>,
errorHandlerChain: res~>,
logger: res~>)
Expand Down Expand Up @@ -239,6 +240,7 @@ private extension AppAssembly {
pinEnroller: res~>,
pinUserVerifier: res~>,
biometricUserVerifier: res~>,
devicePasscodeUserVerifier: res~>,
appCoordinator: res~>,
errorHandlerChain: res~>,
logger: res~>)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class DevicePasscodeUserVerifierImpl {
// MARK: - DevicePasscodeUserVerifier

extension DevicePasscodeUserVerifierImpl: DevicePasscodeUserVerifier {
func verifyDevicePasscode(context _: NevisMobileAuthentication.DevicePasscodeUserVerificationContext, handler: NevisMobileAuthentication.DevicePasscodeUserVerificationHandler) {
func verifyDevicePasscode(context _: DevicePasscodeUserVerificationContext, handler: DevicePasscodeUserVerificationHandler) {
logger.log("Please start device passcode user verification.")
logger.log("Performing automatic user verification.")
handler.verify()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ final class OutOfBandOperationHandlerImpl {
/// The biometric user verifier.
private let biometricUserVerifier: BiometricUserVerifier

/// The device passcode user verifier.
private let devicePasscodeUserVerifier: DevicePasscodeUserVerifier

/// The application coordinator.
private let appCoordinator: AppCoordinator

Expand All @@ -58,6 +61,7 @@ final class OutOfBandOperationHandlerImpl {
/// - pinEnroller: The PIN enroller.
/// - pinUserVerifier: The PIN user verifier.
/// - biometricUserVerifier: The biometric user verifier.
/// - devicePasscodeUserVerifier: The device passcode user verifier.
/// - appCoordinator: The application coordinator.
/// - errorHandlerChain: The error handler chain.
/// - logger: The logger.
Expand All @@ -68,6 +72,7 @@ final class OutOfBandOperationHandlerImpl {
pinEnroller: PinEnroller,
pinUserVerifier: PinUserVerifier,
biometricUserVerifier: BiometricUserVerifier,
devicePasscodeUserVerifier: DevicePasscodeUserVerifier,
appCoordinator: AppCoordinator,
errorHandlerChain: ErrorHandlerChain,
logger: SDKLogger) {
Expand All @@ -78,6 +83,7 @@ final class OutOfBandOperationHandlerImpl {
self.pinEnroller = pinEnroller
self.pinUserVerifier = pinUserVerifier
self.biometricUserVerifier = biometricUserVerifier
self.devicePasscodeUserVerifier = devicePasscodeUserVerifier
self.appCoordinator = appCoordinator
self.errorHandlerChain = errorHandlerChain
self.logger = logger
Expand Down Expand Up @@ -150,6 +156,7 @@ private extension OutOfBandOperationHandlerImpl {
.authenticatorSelector(registrationAuthenticatorSelector)
.pinEnroller(pinEnroller)
.biometricUserVerifier(biometricUserVerifier)
.devicePasscodeUserVerifier(devicePasscodeUserVerifier)
.onSuccess {
self.logger.log("Out-of-Band registration succeeded.", color: .green)
self.appCoordinator.navigateToResult(with: .success(operation: .registration))
Expand All @@ -171,6 +178,7 @@ private extension OutOfBandOperationHandlerImpl {
.authenticatorSelector(authenticationAuthenticatorSelector)
.pinUserVerifier(pinUserVerifier)
.biometricUserVerifier(biometricUserVerifier)
.devicePasscodeUserVerifier(devicePasscodeUserVerifier)
.onSuccess { _ in
self.logger.log("Out-of-Band authentication succeeded.", color: .green)
self.appCoordinator.navigateToResult(with: .success(operation: .authentication))
Expand Down
10 changes: 5 additions & 5 deletions NevisExampleApp/Interaction/PinChangerImpl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ extension PinChangerImpl: PinChanger {
appCoordinator.navigateToPin(with: parameter)
}

/// You can add custom PIN policy by overriding the `pinPolicy` getter
/// The default is `PinPolicy(minLength: 6, maxLength: 6)`
/// func pinPolicy() -> PinPolicy {
/// PinPolicy(minLength: 5, maxLength: 8)
/// }
/// You can add custom PIN policy by overriding the `pinPolicy` getter.
/// The default minimum and maximum PIN length is 6 without any furhter validation during PIN enrollment or change.
// func pinPolicy() -> PinPolicy {
// // custom PinPolicy implementation
// }
}
10 changes: 5 additions & 5 deletions NevisExampleApp/Interaction/PinEnrollerImpl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ extension PinEnrollerImpl: PinEnroller {
appCoordinator.navigateToPin(with: parameter)
}

/// You can add custom PIN policy by overriding the `pinPolicy` getter
/// The default is `PinPolicy(minLength: 6, maxLength: 6)`
/// func pinPolicy() -> PinPolicy {
/// PinPolicy(minLength: 5, maxLength: 8)
/// }
/// You can add custom PIN policy by overriding the `pinPolicy` getter.
/// The default minimum and maximum PIN length is 6 without any furhter validation during PIN enrollment or change.
// func pinPolicy() -> PinPolicy {
// // custom PinPolicy implementation
// }
}
2 changes: 1 addition & 1 deletion NevisExampleApp/Resources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>3.5.0</string>
<string>3.6.0</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
Expand Down
2 changes: 2 additions & 0 deletions NevisExampleApp/Screens/Pin/PinScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ private extension PinScreen {
addItem($0, topSpacing: 16)
$0.setHeight(with: 40)
$0.keyboardType = .numberPad
$0.isSecureTextEntry = true
$0.inputAccessoryView = keyboardToolbar
$0.superview?.isHidden = presenter.getOperation() != .credentialChange
}
Expand All @@ -146,6 +147,7 @@ private extension PinScreen {
addItem($0, topSpacing: 16)
$0.setHeight(with: 40)
$0.keyboardType = .numberPad
$0.isSecureTextEntry = true
$0.inputAccessoryView = keyboardToolbar
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ final class UsernamePasswordLoginPresenter {
/// The biometric user verifier.
private let biometricUserVerifier: BiometricUserVerifier

/// The device passcode user verifier.
private let devicePasscodeUserVerifier: DevicePasscodeUserVerifier

/// The application coordinator.
private let appCoordinator: AppCoordinator

Expand All @@ -53,6 +56,7 @@ final class UsernamePasswordLoginPresenter {
/// - authenticatorSelector: The authenticator selector.
/// - pinEnroller: The PIN enroller.
/// - biometricUserVerifier: The biometric user verifier.
/// - devicePasscodeUserVerifier: The device passcode user verifier.
/// - appCoordinator: The application coordinator.
/// - errorHandlerChain: The error handler chain.
/// - logger: The logger.
Expand All @@ -62,6 +66,7 @@ final class UsernamePasswordLoginPresenter {
authenticatorSelector: AuthenticatorSelector,
pinEnroller: PinEnroller,
biometricUserVerifier: BiometricUserVerifier,
devicePasscodeUserVerifier: DevicePasscodeUserVerifier,
appCoordinator: AppCoordinator,
errorHandlerChain: ErrorHandlerChain,
logger: SDKLogger) {
Expand All @@ -71,6 +76,7 @@ final class UsernamePasswordLoginPresenter {
self.authenticatorSelector = authenticatorSelector
self.pinEnroller = pinEnroller
self.biometricUserVerifier = biometricUserVerifier
self.devicePasscodeUserVerifier = devicePasscodeUserVerifier
self.appCoordinator = appCoordinator
self.errorHandlerChain = errorHandlerChain
self.logger = logger
Expand Down Expand Up @@ -157,6 +163,7 @@ private extension UsernamePasswordLoginPresenter {
.authenticatorSelector(authenticatorSelector)
.pinEnroller(pinEnroller)
.biometricUserVerifier(biometricUserVerifier)
.devicePasscodeUserVerifier(devicePasscodeUserVerifier)
.onSuccess {
self.appCoordinator.navigateToResult(with: .success(operation: .registration))
}
Expand Down
4 changes: 2 additions & 2 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ target 'NevisExampleApp' do
pod 'Swinject', '= 2.8.3'
pod 'SwinjectAutoregistration', '= 2.8.3'
pod 'Then', '= 3.0.0'
pod 'NevisMobileAuthentication', '~> 3.5.0', :configurations => ['Release']
pod 'NevisMobileAuthentication-Debug', '~> 3.5.0', :configurations => ['Debug']
pod 'NevisMobileAuthentication', '~> 3.6.0', :configurations => ['Release']
pod 'NevisMobileAuthentication-Debug', '~> 3.6.0', :configurations => ['Debug']
end

post_install do |installer|
Expand Down

0 comments on commit ae9734d

Please sign in to comment.