\r
package org.commscope.tr069adapter.acs.cpe.handler;\r
\r
+\r
import java.nio.charset.StandardCharsets;\r
import java.util.Base64;\r
\r
import org.slf4j.Logger;\r
import org.slf4j.LoggerFactory;\r
import org.springframework.beans.factory.annotation.Autowired;\r
+import org.springframework.beans.factory.annotation.Value;\r
import org.springframework.http.ResponseEntity;\r
import org.springframework.stereotype.Component;\r
import org.springframework.web.client.RestTemplate;\r
@Autowired\r
RestTemplate restTemplate;\r
\r
+ @Value("${config.isDeviceAuthorizationEnabled:true}")\r
+ private boolean isDeviceAuthorizationEnabled;\r
+\r
public void setFactorySrvcDependencyConfig(\r
FactorySrvcDependencyConfig factorySrvcDependencyConfig) {\r
this.factorySrvcDependencyConfig = factorySrvcDependencyConfig;\r
* @return\r
*/\r
public Boolean isDeviceAuthorized(Inform inform, String authorization) {\r
+ if(!isDeviceAuthorizationEnabled){\r
+ logger.debug("Device authentication is not needed here. Hence always authorizing.");\r
+ return true;\r
+ }\r
if (authorization == null) {\r
logger.debug("HTTP Challenge failed as Authorization header does not exist");\r
return false;\r