SAPcpmsLockWipePolicyApplyStep
open class SAPcpmsLockWipePolicyApplyStep : OnboardingStep
Instantiates an OnboardingStep
capable of applying the SAPcpmsLockWipePolicy
parameters in the onboard / restore flow.
The SAPcpmsSettings
(downloaded form mobile services) contains a blockWipingPolicy part. This policy can be enabeled/disabled depending on mobile services settings.
The policy contains the blockDisconnectedPeriod and wipeDisconnectedPeriod integer values.
E.g.:
blockWipingPolicy
: {
blockWipeEnabled
: true,
blockDisconnectedPeriod
: 1,
wipeDisconnectedPeriod
: 20
}
The lock disconnected period describes after how many days should lock the user.
The wipe disconnected period describes after how many days should wipe the user.
The start date of the calculation is based on the last successful server communication.
Prerequisite: the SAPcpmsSettingsDownloadStep
should be in the flow before the SAPcpmsLockWipePolicyApplyStep
.
The step fails with SAPcpmsLockWipePolicyError
if the user should lock or wipe by the application or if an internal error occurs.
If SAPcpmsLockWipePolicy
and stored Date
exists the step checks the dates
If SAPcpmsLockWipePolicy
exists and stored Date
doesn’t exist the step stores the current date and checks the dates
If SAPcpmsLockWipePolicy
doesn’t exist and stored Date
exists the step deletes the date
If SAPcpmsLockWipePolicy
and stored Date
doesn’t exist the step doesn’t do anything
-
Key of SAPcpmsLockWipingPolicy in the context
Declaration
Swift
public let sapcpmsLockWipingPolicyInfoKey: OnboardingInfoKey
-
Initializes the object
Declaration
Swift
public init(sapcpmsLockWipingPolicyInfoKey: OnboardingInfoKey = .sapcpmsLockWipingPolicy)
Parameters
settingsParameters
The SAPcpmsSettingsParameters necessary to create the SAPcpmsUserRoles component
store
The store used to store/read the last successful authentication date
infoKey
The onboarding info key for an instance of
SAPcpmsLockWipingPolicy
-
Onboarding function with context for SAPcpmsLockWipePolicy apply
Declaration
Swift
open func onboard(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void)
Parameters
context
OnboardingContext
object which contains every information for the OnboardingStepcompletionHandler
must be called by the implementers when the step finishes
-
Restore function with context for SAPcpmsLockWipePolicy apply
Declaration
Swift
open func restore(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void)
Parameters
context
OnboardingContext
object which contains every information for the OnboardingStepcompletionHandler
must be called by the implementers when the step finishes
-
Reset function with context for SAPcpmsLockWipePolicy apply
Declaration
Swift
open func reset(context: OnboardingContext, completionHandler: @escaping () -> Void)
Parameters
context
OnboardingContext
object which contains every information for the OnboardingStepcompletionHandler
must be called by the implementers when the step finishes
-
Onboarding function without context for SAPcpmsLockWipePolicy apply If you want to download the configured ClientResources from mobile services then use the other onboard() function with
OnboardingContext
support, or use ‘SAPcpmsClientResources’ component from SAPFoundation framework.Declaration
Swift
open func onboard(sapURLSession: SAPURLSession, credentialStore: CodableStoring, authenticationURL: URL, completionHandler: @escaping (Error?) -> Void)
Parameters
sapURLSession
SAPURLSession
that handle the connection to download settingsauthenticationURL
URL
to the authentication endpointcompletionHandler
called when the process finished. Error filled on failure.
-
Restore function without context for SAPcpmsLockWipePolicy apply
Declaration
Swift
open func restore(sapURLSession: SAPURLSession, credentialStore: CodableStoring, authenticationURL: URL, lockWipeDays: SAPcpmsLockWipePolicy?, completionHandler: @escaping (Error?) -> Void)
Parameters
sapURLSession
SAPURLSession
that handle the connection to download settingsauthenticationURL
URL
to the authentication endpointcompletionHandler
called when the process finished. Error filled on failure.
-
This function resets the modifications of the SAPcpmsLockWipePolicy
Declaration
Swift
open func reset(completionHandler: @escaping () -> Void)
Parameters
completionHandler
called when the process finished.