removed setting APIs secured as default.

Because if secured is enabled, it is to be needed to provided parameters which are related to basic oauth, when this is false, jwt token is being used.
revert-70aa11f8
GPrathap 8 years ago
parent bcbf61a886
commit 649879f998

@ -50,7 +50,7 @@ public class APIPublisherUtil {
private static final String PARAM_PROVIDER_TENANT_DOMAIN = "providerTenantDomain"; private static final String PARAM_PROVIDER_TENANT_DOMAIN = "providerTenantDomain";
public static API getAPI(APIConfig config) throws APIManagementException { public static API PARAM_MANAGED_API_IS_SECURED(APIConfig config) throws APIManagementException {
APIProvider provider = config.getProvider(); APIProvider provider = config.getProvider();
String apiVersion = config.getVersion(); String apiVersion = config.getVersion();
@ -75,7 +75,7 @@ public class APIPublisherUtil {
api.setUrl(config.getEndpoint()); api.setUrl(config.getEndpoint());
api.addAvailableTiers(provider.getTiers()); api.addAvailableTiers(provider.getTiers());
api.setEndpointSecured(true); api.setEndpointSecured(false);
api.setStatus(APIStatus.CREATED); api.setStatus(APIStatus.CREATED);
api.setTransports(config.getTransports()); api.setTransports(config.getTransports());
api.setApiLevelPolicy(config.getPolicy()); api.setApiLevelPolicy(config.getPolicy());
@ -261,18 +261,7 @@ public class APIPublisherUtil {
} }
apiConfig.setOwner(owner); apiConfig.setOwner(owner);
String isSecuredParam = servletContext.getInitParameter(PARAM_MANAGED_API_IS_SECURED); apiConfig.setSecured(false);
boolean isSecured;
if (isSecuredParam == null || isSecuredParam.isEmpty()) {
if (log.isDebugEnabled()) {
log.debug("'managed-api-isSecured' attribute is not configured. Therefore, using the default, " +
"which is 'true'");
}
isSecured = false;
} else {
isSecured = Boolean.parseBoolean(isSecuredParam);
}
apiConfig.setSecured(isSecured);
String transports = servletContext.getInitParameter(PARAM_MANAGED_API_TRANSPORTS); String transports = servletContext.getInitParameter(PARAM_MANAGED_API_TRANSPORTS);
if (transports == null || transports.isEmpty()) { if (transports == null || transports.isEmpty()) {

Loading…
Cancel
Save