DiscoveryServiceConfigurationTransformer

open class DiscoveryServiceConfigurationTransformer : ConfigurationTransforming

Transforms the Discovery Service configuration structure. Creates more objects using the structure: - SAPcpmsSettingsParameters - authenticationURL - SAMLAuthenticationParameters - OAuth2AuthenticationParameters

The structure:

{
  "auth": [{
      "type": <#String#>,
      "config": <#[String: String]#>
  }],
  "host": "<#host URL string#>",
  "port": 443,
  "protocol": "https"
}
  • the key used to store the SAPcpmsSettingsParameters in the result

    Declaration

    Swift

    open var sapcpmsSettingsParametersKey: OnboardingInfoKey
  • the key used to store the authenticationURL in the result

    Declaration

    Swift

    open var authenticationURLKey: OnboardingInfoKey
  • the key used to store the SAMLAuthenticationParameters in the result

    Declaration

    Swift

    open var samlOnboardingInfoKey: OnboardingInfoKey
  • the key used to store the OAuth2AuthenticationParameters in the result

    Declaration

    Swift

    open var oauthAuthorizationCodeGrantOnboardingInfoKey: OnboardingInfoKey
  • the key used to store the OAuth2PasswordAuthenticationParameters in the result

    Declaration

    Swift

    open var oauthPasswordGrantOnboardingInfoKey: OnboardingInfoKey
  • the application identifier used to create the SAPcpmsSettingsParameters

    Declaration

    Swift

    open var applicationID: String
  • the version of the application used to create the SAPcpmsSettingsParameters

    Declaration

    Swift

    open var applicationVersion: String
  • the unique device identifier used to create the SAPcpmsSettingsParameters

    Declaration

    Swift

    open var deviceID: String
  • the path used to create the authenticationURL

    Declaration

    Swift

    open var authenticationPath: String
  • Transformer used to transform the custom config data. The whole configuration will be passed to this transformer and the result of it will be merged to the final resulting dictionary. If a key already exist created by the default transforming the key will be overwritten with the data created with this transformer

    Declaration

    Swift

    open var customConfigurationTransformer: ConfigurationTransforming?
  • Initializes the transformer which can be used to transform Discovery Service Configuration to a dictionary

    Declaration

    Swift

    public init(applicationID: String? = nil, applicationVersion: String? = nil, deviceID: String? = nil, authenticationPath: String? = nil, customConfigurationTransformer: ConfigurationTransforming? = nil)

    Parameters

    applicationID

    application identifier of the SAPcpms application

    authenticationPath

    path part of the URL will be appended to the “protocol://host:port” in the config structure to create the authenticationURL

    customConfigurationTransformer

    a transformer used to transform the custom config data. The whole configuration will be passed to this transformer and the result of it will be merged to the final resulting dictionary. If a key already exist created by the default transforming the key will be overwritten with the data created with this transformer. The customConfigurationTransformer parameter in case of SAPcpmsUserIdentityDiscovery scenario could be an instance of SAPcpmsUserIdentityDiscoveryConfigurationTransformer. In that case the ConfigurationProvider.plist should containt the structure in the root of the plist that is defined in the documentation of SAPcpmsUserIdentityDiscoveryConfigurationTransformer.

  • Handles the whole configuration transforming into [OnboardingInfokey: Any] structure

    Throws

    OnboardingError.invalidArgument or errors thrown by tranformers

    Declaration

    Swift

    open func transform(config: Any) throws -> [OnboardingInfoKey : Any]

    Parameters

    config

    [String: Any] structure

    Return Value

    [OnboardingInfokey: Any] dictionary