Class: Merchantconfig
- Inherits:
-
Object
- Object
- Merchantconfig
- Defined in:
- lib/AuthenticationSDK/core/MerchantConfig.rb
Overview
This fuction has all the merchantConfig properties getters and setters methods
Instance Attribute Summary collapse
-
#accessToken ⇒ Object
Returns the value of attribute accessToken.
-
#authenticationType ⇒ Object
Returns the value of attribute authenticationType.
-
#clientCertDirectory ⇒ Object
Returns the value of attribute clientCertDirectory.
-
#clientId ⇒ Object
Returns the value of attribute clientId.
-
#clientSecret ⇒ Object
Returns the value of attribute clientSecret.
-
#defaultCustomHeaders ⇒ Object
Returns the value of attribute defaultCustomHeaders.
-
#defaultDeveloperId ⇒ Object
Returns the value of attribute defaultDeveloperId.
-
#enableClientCert ⇒ Object
Returns the value of attribute enableClientCert.
-
#getId ⇒ Object
Returns the value of attribute getId.
-
#intermediateHost ⇒ Object
Returns the value of attribute intermediateHost.
-
#keyAlias ⇒ Object
Returns the value of attribute keyAlias.
-
#keyFilename ⇒ Object
Returns the value of attribute keyFilename.
-
#keyPass ⇒ Object
Returns the value of attribute keyPass.
-
#keysDirectory ⇒ Object
Returns the value of attribute keysDirectory.
-
#log_config ⇒ Object
Returns the value of attribute log_config.
-
#log_obj ⇒ Object
Returns the value of attribute log_obj.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#mapToControlMLEonAPI ⇒ Object
Returns the value of attribute mapToControlMLEonAPI.
-
#merchantId ⇒ Object
getter and setter methods.
-
#merchantKeyId ⇒ Object
Returns the value of attribute merchantKeyId.
-
#merchantSecretKey ⇒ Object
Returns the value of attribute merchantSecretKey.
-
#mleKeyAlias ⇒ Object
Returns the value of attribute mleKeyAlias.
-
#pemFileDirectory ⇒ Object
Returns the value of attribute pemFileDirectory.
-
#portfolioID ⇒ Object
Returns the value of attribute portfolioID.
-
#privateKey ⇒ Object
Returns the value of attribute privateKey.
-
#proxyAddress ⇒ Object
Returns the value of attribute proxyAddress.
-
#proxyPort ⇒ Object
Returns the value of attribute proxyPort.
-
#refreshToken ⇒ Object
Returns the value of attribute refreshToken.
-
#requestHost ⇒ Object
Returns the value of attribute requestHost.
-
#requestJsonData ⇒ Object
Returns the value of attribute requestJsonData.
-
#requestTarget ⇒ Object
Returns the value of attribute requestTarget.
-
#requestType ⇒ Object
Returns the value of attribute requestType.
-
#requestUrl ⇒ Object
Returns the value of attribute requestUrl.
-
#solutionId ⇒ Object
Returns the value of attribute solutionId.
-
#sslClientCert ⇒ Object
Returns the value of attribute sslClientCert.
-
#sslKeyPassword ⇒ Object
Returns the value of attribute sslKeyPassword.
-
#useMetaKey ⇒ Object
Returns the value of attribute useMetaKey.
-
#useMLEGlobally ⇒ Object
Returns the value of attribute useMLEGlobally.
Instance Method Summary collapse
-
#initialize(cybsPropertyObj) ⇒ Merchantconfig
constructor
A new instance of Merchantconfig.
- #logAllProperties(propertyObj) ⇒ Object
-
#validateMerchantDetails ⇒ Object
fall back logic.
- #validateMLEConfiguration ⇒ Object
Constructor Details
#initialize(cybsPropertyObj) ⇒ Merchantconfig
Returns a new instance of Merchantconfig.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/AuthenticationSDK/core/MerchantConfig.rb', line 9 def initialize(cybsPropertyObj) # Common Parameters @merchantId = cybsPropertyObj['merchantID'] @runEnvironment = cybsPropertyObj['runEnvironment'] @intermediateHost = cybsPropertyObj['intermediateHost'] @defaultDeveloperId = cybsPropertyObj['defaultDeveloperId'] @authenticationType = cybsPropertyObj['authenticationType'] @proxyAddress = cybsPropertyObj['proxyAddress'] @proxyPort = cybsPropertyObj['proxyPort'] @getId = '' @requestHost = '' @requestTarget = '' @requestJsonData = '' # HTTP Parameters @merchantSecretKey = cybsPropertyObj['merchantsecretKey'] @merchantKeyId = cybsPropertyObj['merchantKeyId'] # JWT Parameters @keysDirectory = cybsPropertyObj['keysDirectory'] @keyAlias = cybsPropertyObj['keyAlias'] @keyPass = cybsPropertyObj['keyPass'] @keyFilename = cybsPropertyObj['keyFilename'] @useMetaKey = cybsPropertyObj['useMetaKey'] @portfolioID = cybsPropertyObj['portfolioID'] @solutionId = cybsPropertyObj['solutionId'] # MutualAuth & OAuth Parameters @enableClientCert = cybsPropertyObj['enableClientCert'] @clientCertDirectory = cybsPropertyObj['clientCertDirectory'] @sslClientCert = cybsPropertyObj['sslClientCert'] @privateKey = cybsPropertyObj['privateKey'] @sslKeyPassword = cybsPropertyObj['sslKeyPassword'] @clientId = cybsPropertyObj['clientId'] @clientSecret = cybsPropertyObj['clientSecret'] @accessToken = cybsPropertyObj['accessToken'] @refreshToken = cybsPropertyObj['refreshToken'] # LogConfiguration @log_config = LogConfiguration.new(cybsPropertyObj['logConfiguration']) # Custom Default Headers @defaultCustomHeaders = cybsPropertyObj['defaultCustomHeaders'] # Path to client JWE pem file directory @pemFileDirectory = cybsPropertyObj['pemFileDirectory'] @mleKeyAlias = cybsPropertyObj['mleKeyAlias'] @useMLEGlobally = cybsPropertyObj['useMLEGlobally'] @mapToControlMLEonAPI = cybsPropertyObj['mapToControlMLEonAPI'] validateMerchantDetails logAllProperties(cybsPropertyObj) validateMLEConfiguration end |
Instance Attribute Details
#accessToken ⇒ Object
Returns the value of attribute accessToken.
315 316 317 |
# File 'lib/AuthenticationSDK/core/MerchantConfig.rb', line 315 def accessToken @accessToken end |
#authenticationType ⇒ Object
Returns the value of attribute authenticationType.
298 299 300 |
# File 'lib/AuthenticationSDK/core/MerchantConfig.rb', line 298 def authenticationType @authenticationType end |
#clientCertDirectory ⇒ Object
Returns the value of attribute clientCertDirectory.
309 310 311 |
# File 'lib/AuthenticationSDK/core/MerchantConfig.rb', line 309 def clientCertDirectory @clientCertDirectory end |
#clientId ⇒ Object
Returns the value of attribute clientId.
313 314 315 |
# File 'lib/AuthenticationSDK/core/MerchantConfig.rb', line 313 def clientId @clientId end |
#clientSecret ⇒ Object
Returns the value of attribute clientSecret.
314 315 316 |
# File 'lib/AuthenticationSDK/core/MerchantConfig.rb', line 314 def clientSecret @clientSecret end |
#defaultCustomHeaders ⇒ Object
Returns the value of attribute defaultCustomHeaders.
328 329 330 |
# File 'lib/AuthenticationSDK/core/MerchantConfig.rb', line 328 def defaultCustomHeaders @defaultCustomHeaders end |
#defaultDeveloperId ⇒ Object
Returns the value of attribute defaultDeveloperId.
302 303 304 |
# File 'lib/AuthenticationSDK/core/MerchantConfig.rb', line 302 def defaultDeveloperId @defaultDeveloperId end |
#enableClientCert ⇒ Object
Returns the value of attribute enableClientCert.
308 309 310 |
# File 'lib/AuthenticationSDK/core/MerchantConfig.rb', line 308 def enableClientCert @enableClientCert end |
#getId ⇒ Object
Returns the value of attribute getId.
320 321 322 |
# File 'lib/AuthenticationSDK/core/MerchantConfig.rb', line 320 def getId @getId end |
#intermediateHost ⇒ Object
Returns the value of attribute intermediateHost.
301 302 303 |
# File 'lib/AuthenticationSDK/core/MerchantConfig.rb', line 301 def intermediateHost @intermediateHost end |
#keyAlias ⇒ Object
Returns the value of attribute keyAlias.
303 304 305 |
# File 'lib/AuthenticationSDK/core/MerchantConfig.rb', line 303 def keyAlias @keyAlias end |
#keyFilename ⇒ Object
Returns the value of attribute keyFilename.
305 306 307 |
# File 'lib/AuthenticationSDK/core/MerchantConfig.rb', line 305 def keyFilename @keyFilename end |
#keyPass ⇒ Object
Returns the value of attribute keyPass.
304 305 306 |
# File 'lib/AuthenticationSDK/core/MerchantConfig.rb', line 304 def keyPass @keyPass end |
#keysDirectory ⇒ Object
Returns the value of attribute keysDirectory.
299 300 301 |
# File 'lib/AuthenticationSDK/core/MerchantConfig.rb', line 299 def keysDirectory @keysDirectory end |
#log_config ⇒ Object
Returns the value of attribute log_config.
322 323 324 |
# File 'lib/AuthenticationSDK/core/MerchantConfig.rb', line 322 def log_config @log_config end |
#log_obj ⇒ Object
Returns the value of attribute log_obj.
326 327 328 |
# File 'lib/AuthenticationSDK/core/MerchantConfig.rb', line 326 def log_obj @log_obj end |
#logger ⇒ Object
Returns the value of attribute logger.
321 322 323 |
# File 'lib/AuthenticationSDK/core/MerchantConfig.rb', line 321 def logger @logger end |
#mapToControlMLEonAPI ⇒ Object
Returns the value of attribute mapToControlMLEonAPI.
331 332 333 |
# File 'lib/AuthenticationSDK/core/MerchantConfig.rb', line 331 def mapToControlMLEonAPI @mapToControlMLEonAPI end |
#merchantId ⇒ Object
getter and setter methods
295 296 297 |
# File 'lib/AuthenticationSDK/core/MerchantConfig.rb', line 295 def merchantId @merchantId end |
#merchantKeyId ⇒ Object
Returns the value of attribute merchantKeyId.
297 298 299 |
# File 'lib/AuthenticationSDK/core/MerchantConfig.rb', line 297 def merchantKeyId @merchantKeyId end |
#merchantSecretKey ⇒ Object
Returns the value of attribute merchantSecretKey.
296 297 298 |
# File 'lib/AuthenticationSDK/core/MerchantConfig.rb', line 296 def merchantSecretKey @merchantSecretKey end |
#mleKeyAlias ⇒ Object
Returns the value of attribute mleKeyAlias.
332 333 334 |
# File 'lib/AuthenticationSDK/core/MerchantConfig.rb', line 332 def mleKeyAlias @mleKeyAlias end |
#pemFileDirectory ⇒ Object
Returns the value of attribute pemFileDirectory.
329 330 331 |
# File 'lib/AuthenticationSDK/core/MerchantConfig.rb', line 329 def pemFileDirectory @pemFileDirectory end |
#portfolioID ⇒ Object
Returns the value of attribute portfolioID.
307 308 309 |
# File 'lib/AuthenticationSDK/core/MerchantConfig.rb', line 307 def portfolioID @portfolioID end |
#privateKey ⇒ Object
Returns the value of attribute privateKey.
312 313 314 |
# File 'lib/AuthenticationSDK/core/MerchantConfig.rb', line 312 def privateKey @privateKey end |
#proxyAddress ⇒ Object
Returns the value of attribute proxyAddress.
323 324 325 |
# File 'lib/AuthenticationSDK/core/MerchantConfig.rb', line 323 def proxyAddress @proxyAddress end |
#proxyPort ⇒ Object
Returns the value of attribute proxyPort.
324 325 326 |
# File 'lib/AuthenticationSDK/core/MerchantConfig.rb', line 324 def proxyPort @proxyPort end |
#refreshToken ⇒ Object
Returns the value of attribute refreshToken.
316 317 318 |
# File 'lib/AuthenticationSDK/core/MerchantConfig.rb', line 316 def refreshToken @refreshToken end |
#requestHost ⇒ Object
Returns the value of attribute requestHost.
300 301 302 |
# File 'lib/AuthenticationSDK/core/MerchantConfig.rb', line 300 def requestHost @requestHost end |
#requestJsonData ⇒ Object
Returns the value of attribute requestJsonData.
317 318 319 |
# File 'lib/AuthenticationSDK/core/MerchantConfig.rb', line 317 def requestJsonData @requestJsonData end |
#requestTarget ⇒ Object
Returns the value of attribute requestTarget.
325 326 327 |
# File 'lib/AuthenticationSDK/core/MerchantConfig.rb', line 325 def requestTarget @requestTarget end |
#requestType ⇒ Object
Returns the value of attribute requestType.
319 320 321 |
# File 'lib/AuthenticationSDK/core/MerchantConfig.rb', line 319 def requestType @requestType end |
#requestUrl ⇒ Object
Returns the value of attribute requestUrl.
318 319 320 |
# File 'lib/AuthenticationSDK/core/MerchantConfig.rb', line 318 def requestUrl @requestUrl end |
#solutionId ⇒ Object
Returns the value of attribute solutionId.
327 328 329 |
# File 'lib/AuthenticationSDK/core/MerchantConfig.rb', line 327 def solutionId @solutionId end |
#sslClientCert ⇒ Object
Returns the value of attribute sslClientCert.
310 311 312 |
# File 'lib/AuthenticationSDK/core/MerchantConfig.rb', line 310 def sslClientCert @sslClientCert end |
#sslKeyPassword ⇒ Object
Returns the value of attribute sslKeyPassword.
311 312 313 |
# File 'lib/AuthenticationSDK/core/MerchantConfig.rb', line 311 def sslKeyPassword @sslKeyPassword end |
#useMetaKey ⇒ Object
Returns the value of attribute useMetaKey.
306 307 308 |
# File 'lib/AuthenticationSDK/core/MerchantConfig.rb', line 306 def useMetaKey @useMetaKey end |
#useMLEGlobally ⇒ Object
Returns the value of attribute useMLEGlobally.
330 331 332 |
# File 'lib/AuthenticationSDK/core/MerchantConfig.rb', line 330 def useMLEGlobally @useMLEGlobally end |
Instance Method Details
#logAllProperties(propertyObj) ⇒ Object
277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 |
# File 'lib/AuthenticationSDK/core/MerchantConfig.rb', line 277 def logAllProperties(propertyObj) merchantConfig = '' hiddenProperties = (Constants::HIDDEN_MERCHANT_PROPERTIES).split(',') hiddenPropArray = Array.new hiddenProperties.each do |value| hiddenPropArray << value.strip end hiddenPropArray.each do |prop| propertyObj.each do |key, value| if key == prop propertyObj.delete(key) end end end @log_obj.logger.info('Merchant Configuration :\n' + propertyObj.to_s) end |
#validateMerchantDetails ⇒ Object
fall back logic
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 |
# File 'lib/AuthenticationSDK/core/MerchantConfig.rb', line 58 def validateMerchantDetails() = '' @log_config.validate() @log_obj = Log.new @log_config, "MerchantConfig" @log_obj.logger.info('START> =======================================') if !.to_s.empty? @log_obj.logger.warn(ExceptionHandler.new.new_api_warning ) end if @authenticationType.to_s.empty? err = StandardError.new(Constants::ERROR_PREFIX + Constants::AUTH_TYPE_MANDATORY) @log_obj.logger.error(ExceptionHandler.new.new_api_exception err) raise err end if !@authenticationType.instance_of? String err = StandardError.new(Constants::ERROR_PREFIX+ Constants::AUTH_ERROR) @log_obj.logger.error(ExceptionHandler.new.new_api_exception err) raise err end if !@runEnvironment.to_s.empty? if !@runEnvironment.instance_of? String @requestHost = @runEnvironment.to_s end if Constants::OLD_RUN_ENVIRONMENT_CONSTANTS.include?(@runEnvironment.upcase) err = StandardError.new(Constants::ERROR_PREFIX + Constants::DEPRECATED_ENVIRONMENT) @log_obj.logger.error(ExceptionHandler.new.new_api_exception err) raise err else @requestHost = @runEnvironment end elsif @runEnvironment.to_s.empty? err = StandardError.new(Constants::ERROR_PREFIX + Constants::RUN_ENVIRONMENT) @log_obj.logger.error(ExceptionHandler.new.new_api_exception err) raise err end if !@enableClientCert.nil? && @enableClientCert if @sslClientCert.to_s.empty? err = StandardError.new(Constants::ERROR_PREFIX + Constants::SSL_CLIENT_CERT_EMPTY) @log_obj.logger.error(ExceptionHandler.new.new_api_exception err) raise err elsif !@sslClientCert.instance_of? String @sslClientCert=@sslClientCert.to_s end if @privateKey.to_s.empty? err = StandardError.new(Constants::ERROR_PREFIX + Constants::PRIVATE_KEY_EMPTY) @log_obj.logger.error(ExceptionHandler.new.new_api_exception err) raise err elsif !@privateKey.instance_of? String @privateKey=@privateKey.to_s end if @sslKeyPassword.to_s.empty? err = Constants::WARNING_PREFIX + Constants::SSL_KEY_PASSWORD_EMPTY @log_obj.logger.warn(ExceptionHandler.new.new_api_warning err) raise err elsif !@sslKeyPassword.instance_of? String @sslKeyPassword=@sslKeyPassword.to_s end if @clientCertDirectory.to_s.empty? err = StandardError.new(Constants::ERROR_PREFIX + Constants::CLIENT_CERT_DIR_EMPTY) @log_obj.logger.error(ExceptionHandler.new.new_api_exception err) raise err elsif !@clientCertDirectory.instance_of? String @clientCertDirectory=@clientCertDirectory.to_s end end if @authenticationType.upcase == Constants::AUTH_TYPE_JWT if @merchantId.to_s.empty? err = StandardError.new(Constants::ERROR_PREFIX + Constants::MERCHANT_ID_NULL) @log_obj.logger.error(ExceptionHandler.new.new_api_exception err) raise err elsif !@merchantId.instance_of? String @merchantId=@merchantId.to_s end if @keyAlias.to_s.empty? @keyAlias = @merchantId @log_obj.logger.warn(ExceptionHandler.new.new_api_warning Constants::WARNING_PREFIX + Constants::KEY_ALIAS_NULL_EMPTY) elsif !@keyAlias.instance_of? String @keyAlias=@keyAlias.to_s elsif @keyAlias != @merchantId @keyAlias = @merchantId @log_obj.logger.warn(ExceptionHandler.new.new_api_warning Constants::WARNING_PREFIX + Constants::INCORRECT_KEY_ALIAS) end if @keyPass.to_s.empty? @keyPass = @merchantId @log_obj.logger.warn(ExceptionHandler.new.new_api_warning Constants::WARNING_PREFIX + Constants::KEY_PASS_NULL) elsif !@keyPass.instance_of? String @keyPass=@keyPass.to_s end if @keysDirectory.to_s.empty? @keysDirectory = Constants::DEFAULT_KEY_DIRECTORY @log_obj.logger.warn(ExceptionHandler.new.new_api_warning Constants::WARNING_PREFIX + Constants::KEY_DIRECTORY_EMPTY + @keysDirectory) elsif !@keysDirectory.instance_of? String @keysDirectory=@keysDirectory.to_s end if @keyFilename.to_s.empty? @keyFilename = @merchantId @log_obj.logger.warn(ExceptionHandler.new.new_api_warning Constants::WARNING_PREFIX + Constants::KEY_FILE_NAME_NULL_EMPTY) elsif !@keyFilename.instance_of? String @keyFilename=@keyFilename.to_s end end if @authenticationType.upcase == Constants::AUTH_TYPE_MUTUAL_AUTH if @clientId.to_s.empty? err = StandardError.new(Constants::ERROR_PREFIX + Constants::CLIENT_ID_EMPTY) @log_obj.logger.error(ExceptionHandler.new.new_api_exception err) raise err elsif !@clientId.instance_of? String @clientId=@clientId.to_s end if @clientSecret.to_s.empty? err = StandardError.new(Constants::ERROR_PREFIX + Constants::CLIENT_SECRET_EMPTY) @log_obj.logger.error(ExceptionHandler.new.new_api_exception err) raise err elsif !@clientSecret.instance_of? String @clientSecret=@clientSecret.to_s end end if @authenticationType.upcase == Constants::AUTH_TYPE_OAUTH if @accessToken.to_s.empty? err = StandardError.new(Constants::ERROR_PREFIX + Constants::ACCESS_TOKEN_EMPTY) @log_obj.logger.error(ExceptionHandler.new.new_api_exception err) raise err elsif !@accessToken.instance_of? String @accessToken=@accessToken.to_s end if @refreshToken.to_s.empty? err = StandardError.new(Constants::ERROR_PREFIX + Constants::REFRESH_TOKEN_EMPTY) @log_obj.logger.error(ExceptionHandler.new.new_api_exception err) raise err elsif !@refreshToken.instance_of? String @refreshToken=@refreshToken.to_s end end if @authenticationType.upcase == Constants::AUTH_TYPE_HTTP if @merchantId.to_s.empty? err = StandardError.new(Constants::ERROR_PREFIX + Constants::MERCHANT_ID_NULL) @log_obj.logger.error(ExceptionHandler.new.new_api_exception err) raise err elsif !@merchantId.instance_of? String @merchantId=@merchantId.to_s end if @merchantKeyId.to_s.empty? err = StandardError.new(Constants::ERROR_PREFIX+ Constants::MERCHANT_KEY_ID_MANDATORY) @log_obj.logger.error(ExceptionHandler.new.new_api_exception err) raise err elsif !@merchantKeyId.instance_of? String @merchantKeyId=@merchantKeyId.to_s end if @merchantSecretKey.to_s.empty? err = StandardError.new(Constants::ERROR_PREFIX+ Constants::MERCHANT_SECRET_KEY_MANDATORY) @log_obj.logger.error(ExceptionHandler.new.new_api_exception err) raise err elsif !@merchantSecretKey.instance_of? String @merchantSecretKey=@merchantSecretKey.to_s end end if @useMetaKey && @portfolioID.to_s.empty? err = StandardError.new(Constants::ERROR_PREFIX+ Constants::PORTFOLIO_ID_MANDATORY) @log_obj.logger.error(ExceptionHandler.new.new_api_exception err) raise err end if !@proxyAddress.instance_of? String @proxyAddress=@proxyAddress.to_s end if !@proxyPort.instance_of? String @proxyPort=@proxyPort.to_s end unless @pemFileDirectory.instance_of? String @pemFileDirectory = @pemFileDirectory.to_s end end |
#validateMLEConfiguration ⇒ Object
233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 |
# File 'lib/AuthenticationSDK/core/MerchantConfig.rb', line 233 def validateMLEConfiguration if @useMLEGlobally.nil? @useMLEGlobally = false end unless [true, false].include?(@useMLEGlobally) err = StandardError.new(Constants::ERROR_PREFIX + "useMLEGlobally must be a boolean") @log_obj.logger.error(ExceptionHandler.new.new_api_exception err) raise err end unless @mapToControlMLEonAPI.nil? unless @mapToControlMLEonAPI.is_a?(Hash) && @mapToControlMLEonAPI.keys.all? {|k| k.is_a?(String)} && @mapToControlMLEonAPI.values.all? { |v| [true, false].include?(v) } err = StandardError.new(Constants::ERROR_PREFIX + "mapToControlMLEonAPI must be a map with boolean values") @log_obj.logger.error(ExceptionHandler.new.new_api_exception err) raise err end end !@mleKeyAlias.nil? && unless @mleKeyAlias.instance_of? String (err = StandardError.new(Constants::ERROR_PREFIX + "mleKeyAlias must be a string")) @log_obj.logger.error(ExceptionHandler.new.new_api_exception err) raise err end if @mleKeyAlias.to_s.empty? @mleKeyAlias = Constants::DEFAULT_ALIAS_FOR_MLE_CERT end mle_configured = @useMLEGlobally if !@mapToControlMLEonAPI.nil? && !@mapToControlMLEonAPI.empty? @mapToControlMLEonAPI.each do |_, value| unless [true, false].include?(value) && value mle_configured = true break end end end if mle_configured && !Constants::AUTH_TYPE_JWT.eql?(@authenticationType) err = StandardError.new(Constants::ERROR_PREFIX + "MLE can only be used with JWT authentication") @log_obj.logger.error(ExceptionHandler.new.new_api_exception err) raise err end end |