forked from community/device-mgt-plugins
Merge branch 'release-3.0.x' of https://github.com/wso2/carbon-device-mgt-plugins into release-3.0.x
commit
d918e32d59
@ -1,6 +1,6 @@
|
||||
#Wed May 11 14:40:10 IST 2016
|
||||
#Mon Jan 09 12:13:26 IST 2017
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
|
||||
|
@ -1,6 +1,9 @@
|
||||
{
|
||||
"deviceType": {
|
||||
"label": "Android Sense",
|
||||
"category": "iot"
|
||||
"category": "iot",
|
||||
"scopes" : [
|
||||
"perm:android-sense:enroll"
|
||||
]
|
||||
}
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
/*
|
||||
* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you under the Apache License,
|
||||
* Version 2.0 (the "License"); you may not use this file except
|
||||
* in compliance with the License.
|
||||
* you may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.wso2.carbon.device.mgt.output.adapter.websocket.authorization;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.wso2.carbon.base.MultitenantConstants;
|
||||
import org.wso2.carbon.device.mgt.output.adapter.websocket.internal.WebsocketEventAdaptorServiceDataHolder;
|
||||
import org.wso2.carbon.registry.api.Resource;
|
||||
import org.wso2.carbon.registry.core.Registry;
|
||||
import org.wso2.carbon.registry.core.exceptions.RegistryException;
|
||||
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
/**
|
||||
* Utility class which holds necessary utility methods required for persisting permissions in
|
||||
* registry.
|
||||
*/
|
||||
public class PermissionUtil {
|
||||
|
||||
public static final String PERMISSION_PROPERTY_NAME = "name";
|
||||
private static Log log = LogFactory.getLog(DeviceAuthorizer.class);
|
||||
|
||||
public static void putPermission(String permission) {
|
||||
try {
|
||||
StringTokenizer tokenizer = new StringTokenizer(permission, "/");
|
||||
String lastToken = "", currentToken, tempPath;
|
||||
while (tokenizer.hasMoreTokens()) {
|
||||
currentToken = tokenizer.nextToken();
|
||||
tempPath = lastToken + "/" + currentToken;
|
||||
if (!checkResourceExists(tempPath)) {
|
||||
createRegistryCollection(tempPath, currentToken);
|
||||
|
||||
}
|
||||
lastToken = tempPath;
|
||||
}
|
||||
} catch (org.wso2.carbon.registry.api.RegistryException e) {
|
||||
log.error("Failed to creation permission in registry" + permission, e);
|
||||
}
|
||||
}
|
||||
|
||||
public static void createRegistryCollection(String path, String resourceName)
|
||||
throws org.wso2.carbon.registry.api.RegistryException {
|
||||
Resource resource = getGovernanceRegistry().newCollection();
|
||||
resource.addProperty(PERMISSION_PROPERTY_NAME, resourceName);
|
||||
getGovernanceRegistry().beginTransaction();
|
||||
getGovernanceRegistry().put(path, resource);
|
||||
getGovernanceRegistry().commitTransaction();
|
||||
}
|
||||
|
||||
public static boolean checkResourceExists(String path)
|
||||
throws RegistryException {
|
||||
return getGovernanceRegistry().resourceExists(path);
|
||||
}
|
||||
|
||||
public static Registry getGovernanceRegistry() throws RegistryException {
|
||||
return WebsocketEventAdaptorServiceDataHolder.getRegistryService()
|
||||
.getGovernanceSystemRegistry(MultitenantConstants.SUPER_TENANT_ID);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><api xmlns="http://ws.apache.org/ns/synapse" name="admin--Windows 10 Device management" context="/api/device-mgt/windows/v1.0/management/devicemgt">
|
||||
<resource methods="HEAD DELETE POST GET OPTIONS PATCH PUT" url-mapping="/*" faultSequence="fault">
|
||||
<inSequence>
|
||||
<property name="isDefault" expression="$trp:WSO2_AM_API_DEFAULT_VERSION"/>
|
||||
<filter source="$ctx:isDefault" regex="true">
|
||||
<then>
|
||||
<log level="custom">
|
||||
<property name="STATUS" value="Faulty invoking through default API.Dropping message to avoid recursion.."/>
|
||||
</log>
|
||||
<payloadFactory media-type="xml">
|
||||
<format>
|
||||
<am:fault xmlns:am="http://wso2.org/apimanager">
|
||||
<am:code>500</am:code>
|
||||
<am:type>Status report</am:type>
|
||||
<am:message>Internal Server Error</am:message>
|
||||
<am:description>Faulty invoking through default API</am:description>
|
||||
</am:fault>
|
||||
</format>
|
||||
<args/>
|
||||
</payloadFactory>
|
||||
<property name="HTTP_SC" value="500" scope="axis2"/>
|
||||
<property name="RESPONSE" value="true"/>
|
||||
<header name="To" action="remove"/>
|
||||
<property name="NO_ENTITY_BODY" scope="axis2" action="remove"/>
|
||||
<property name="ContentType" scope="axis2" action="remove"/>
|
||||
<property name="Authorization" scope="transport" action="remove"/>
|
||||
<property name="Host" scope="transport" action="remove"/>
|
||||
<property name="Accept" scope="transport" action="remove"/>
|
||||
<send/>
|
||||
</then>
|
||||
<else>
|
||||
<header name="WSO2_AM_API_DEFAULT_VERSION" scope="transport" value="true"/>
|
||||
<property name="uri.var.portnum" expression="get-property('http.nio.port')"/>
|
||||
<send>
|
||||
<endpoint>
|
||||
<http uri-template="http://localhost:{uri.var.portnum}/api/device-mgt/windows/v1.0/management/devicemgt/1.0.0">
|
||||
<timeout>
|
||||
<duration>60000</duration>
|
||||
<responseAction>fault</responseAction>
|
||||
</timeout>
|
||||
</http>
|
||||
</endpoint>
|
||||
</send>
|
||||
</else>
|
||||
</filter>
|
||||
</inSequence>
|
||||
<outSequence>
|
||||
<property name="FORCE_HTTP_CONTENT_LENGTH" scope="axis2" value="true"/>
|
||||
<property name="COPY_CONTENT_LENGTH_FROM_INCOMING" value="true" scope="axis2"/>
|
||||
<send/>
|
||||
</outSequence>
|
||||
</resource>
|
||||
<handlers>
|
||||
<handler class="org.wso2.carbon.apimgt.gateway.handlers.common.SynapsePropertiesHandler"/>
|
||||
</handlers>
|
||||
</api>
|
@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><api xmlns="http://ws.apache.org/ns/synapse" name="admin--Windows 10 Device management" context="/api/device-mgt/windows/v1.0/management/devicemgt/1.0.0" version="1.0.0" version-type="context">
|
||||
<resource methods="POST" url-mapping="/pending-operations" faultSequence="fault">
|
||||
<inSequence>
|
||||
<property name="api.ut.backendRequestTime" expression="get-property('SYSTEM_TIME')"/>
|
||||
<property name="AM_KEY_TYPE" value="PRODUCTION" scope="default"/>
|
||||
<filter source="$ctx:AM_KEY_TYPE" regex="PRODUCTION">
|
||||
<then>
|
||||
<send>
|
||||
<endpoint name="admin--Windows 10 Device management_APIproductionEndpoint_0">
|
||||
<http uri-template="https://localhost:9443/api/device-mgt/windows/v1.0/management/devicemgt"/>
|
||||
<property name="ENDPOINT_ADDRESS" value="https://localhost:9443/api/device-mgt/windows/v1.0/management/devicemgt"/>
|
||||
</endpoint>
|
||||
</send>
|
||||
</then>
|
||||
<else>
|
||||
<sequence key="_sandbox_key_error_"/>
|
||||
</else>
|
||||
</filter>
|
||||
</inSequence>
|
||||
<outSequence>
|
||||
<class name="org.wso2.carbon.apimgt.gateway.handlers.analytics.APIMgtResponseHandler"/>
|
||||
<send/>
|
||||
</outSequence>
|
||||
</resource>
|
||||
<handlers>
|
||||
<handler class="org.wso2.carbon.apimgt.gateway.handlers.common.APIMgtLatencyStatsHandler"/>
|
||||
<handler class="org.wso2.carbon.apimgt.gateway.handlers.security.CORSRequestHandler">
|
||||
<property name="apiImplementationType" value="ENDPOINT"/>
|
||||
</handler>
|
||||
</handlers>
|
||||
</api>
|
@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><api xmlns="http://ws.apache.org/ns/synapse" name="admin--Windows 10 Enrollment Service" context="/api/device-mgt/windows/v1.0/deviceenrolment/enrollment">
|
||||
<resource methods="HEAD DELETE POST GET OPTIONS PATCH PUT" url-mapping="/*" faultSequence="fault">
|
||||
<inSequence>
|
||||
<property name="isDefault" expression="$trp:WSO2_AM_API_DEFAULT_VERSION"/>
|
||||
<filter source="$ctx:isDefault" regex="true">
|
||||
<then>
|
||||
<log level="custom">
|
||||
<property name="STATUS" value="Faulty invoking through default API.Dropping message to avoid recursion.."/>
|
||||
</log>
|
||||
<payloadFactory media-type="xml">
|
||||
<format>
|
||||
<am:fault xmlns:am="http://wso2.org/apimanager">
|
||||
<am:code>500</am:code>
|
||||
<am:type>Status report</am:type>
|
||||
<am:message>Internal Server Error</am:message>
|
||||
<am:description>Faulty invoking through default API</am:description>
|
||||
</am:fault>
|
||||
</format>
|
||||
<args/>
|
||||
</payloadFactory>
|
||||
<property name="HTTP_SC" value="500" scope="axis2"/>
|
||||
<property name="RESPONSE" value="true"/>
|
||||
<header name="To" action="remove"/>
|
||||
<property name="NO_ENTITY_BODY" scope="axis2" action="remove"/>
|
||||
<property name="ContentType" scope="axis2" action="remove"/>
|
||||
<property name="Authorization" scope="transport" action="remove"/>
|
||||
<property name="Host" scope="transport" action="remove"/>
|
||||
<property name="Accept" scope="transport" action="remove"/>
|
||||
<send/>
|
||||
</then>
|
||||
<else>
|
||||
<header name="WSO2_AM_API_DEFAULT_VERSION" scope="transport" value="true"/>
|
||||
<property name="uri.var.portnum" expression="get-property('http.nio.port')"/>
|
||||
<send>
|
||||
<endpoint>
|
||||
<http uri-template="http://localhost:{uri.var.portnum}/api/device-mgt/windows/v1.0/deviceenrolment/enrollment/1.0.0">
|
||||
<timeout>
|
||||
<duration>60000</duration>
|
||||
<responseAction>fault</responseAction>
|
||||
</timeout>
|
||||
</http>
|
||||
</endpoint>
|
||||
</send>
|
||||
</else>
|
||||
</filter>
|
||||
</inSequence>
|
||||
<outSequence>
|
||||
<property name="FORCE_HTTP_CONTENT_LENGTH" scope="axis2" value="true"/>
|
||||
<property name="COPY_CONTENT_LENGTH_FROM_INCOMING" value="true" scope="axis2"/>
|
||||
<send/>
|
||||
</outSequence>
|
||||
</resource>
|
||||
<handlers>
|
||||
<handler class="org.wso2.carbon.apimgt.gateway.handlers.common.SynapsePropertiesHandler"/>
|
||||
</handlers>
|
||||
</api>
|
@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><api xmlns="http://ws.apache.org/ns/synapse" name="admin--Windows 10 Enrollment Service" context="/api/device-mgt/windows/v1.0/deviceenrolment/enrollment/1.0.0" version="1.0.0" version-type="context">
|
||||
<resource methods="POST" url-mapping="/*" faultSequence="fault">
|
||||
<inSequence>
|
||||
<property name="api.ut.backendRequestTime" expression="get-property('SYSTEM_TIME')"/>
|
||||
<property name="AM_KEY_TYPE" value="PRODUCTION" scope="default"/>
|
||||
<filter source="$ctx:AM_KEY_TYPE" regex="PRODUCTION">
|
||||
<then>
|
||||
<send>
|
||||
<endpoint name="admin--Windows 10 Enrollment Service_APIproductionEndpoint_0">
|
||||
<http uri-template="https://localhost:9443/api/device-mgt/windows/v1.0/deviceenrolment/enrollment"/>
|
||||
<property name="ENDPOINT_ADDRESS" value="https://localhost:9443/api/device-mgt/windows/v1.0/deviceenrolment/enrollment"/>
|
||||
</endpoint>
|
||||
</send>
|
||||
</then>
|
||||
<else>
|
||||
<sequence key="_sandbox_key_error_"/>
|
||||
</else>
|
||||
</filter>
|
||||
</inSequence>
|
||||
<outSequence>
|
||||
<class name="org.wso2.carbon.apimgt.gateway.handlers.analytics.APIMgtResponseHandler"/>
|
||||
<property name="FORCE_HTTP_CONTENT_LENGTH" scope="axis2" value="true"/>
|
||||
<property name="COPY_CONTENT_LENGTH_FROM_INCOMING" value="true" scope="axis2"/>
|
||||
<send/>
|
||||
</outSequence>
|
||||
</resource>
|
||||
<handlers>
|
||||
<handler class="org.wso2.carbon.apimgt.gateway.handlers.common.APIMgtLatencyStatsHandler"/>
|
||||
<handler class="org.wso2.carbon.apimgt.gateway.handlers.security.CORSRequestHandler">
|
||||
<property name="apiImplementationType" value="ENDPOINT"/>
|
||||
</handler>
|
||||
</handlers>
|
||||
</api>
|
@ -0,0 +1,54 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><api xmlns="http://ws.apache.org/ns/synapse" name="admin--Windows 8.1 Device Management Service" context="/api/device-mgt/windows/v1.0/syncml">
|
||||
<resource methods="HEAD DELETE POST GET OPTIONS PATCH PUT" url-mapping="/*" faultSequence="fault">
|
||||
<inSequence>
|
||||
<property name="isDefault" expression="$trp:WSO2_AM_API_DEFAULT_VERSION"/>
|
||||
<filter source="$ctx:isDefault" regex="true">
|
||||
<then>
|
||||
<log level="custom">
|
||||
<property name="STATUS" value="Faulty invoking through default API.Dropping message to avoid recursion.."/>
|
||||
</log>
|
||||
<payloadFactory media-type="xml">
|
||||
<format>
|
||||
<am:fault xmlns:am="http://wso2.org/apimanager">
|
||||
<am:code>500</am:code>
|
||||
<am:type>Status report</am:type>
|
||||
<am:message>Internal Server Error</am:message>
|
||||
<am:description>Faulty invoking through default API</am:description>
|
||||
</am:fault>
|
||||
</format>
|
||||
<args/>
|
||||
</payloadFactory>
|
||||
<property name="HTTP_SC" value="500" scope="axis2"/>
|
||||
<property name="RESPONSE" value="true"/>
|
||||
<header name="To" action="remove"/>
|
||||
<property name="NO_ENTITY_BODY" scope="axis2" action="remove"/>
|
||||
<property name="ContentType" scope="axis2" action="remove"/>
|
||||
<property name="Authorization" scope="transport" action="remove"/>
|
||||
<property name="Host" scope="transport" action="remove"/>
|
||||
<property name="Accept" scope="transport" action="remove"/>
|
||||
<send/>
|
||||
</then>
|
||||
<else>
|
||||
<header name="WSO2_AM_API_DEFAULT_VERSION" scope="transport" value="true"/>
|
||||
<property name="uri.var.portnum" expression="get-property('http.nio.port')"/>
|
||||
<send>
|
||||
<endpoint>
|
||||
<http uri-template="http://localhost:{uri.var.portnum}/api/device-mgt/windows/v1.0/syncml/1.0.0">
|
||||
<timeout>
|
||||
<duration>60000</duration>
|
||||
<responseAction>fault</responseAction>
|
||||
</timeout>
|
||||
</http>
|
||||
</endpoint>
|
||||
</send>
|
||||
</else>
|
||||
</filter>
|
||||
</inSequence>
|
||||
<outSequence>
|
||||
<send/>
|
||||
</outSequence>
|
||||
</resource>
|
||||
<handlers>
|
||||
<handler class="org.wso2.carbon.apimgt.gateway.handlers.common.SynapsePropertiesHandler"/>
|
||||
</handlers>
|
||||
</api>
|
@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><api xmlns="http://ws.apache.org/ns/synapse" name="admin--Windows 8.1 Device Management Service" context="/api/device-mgt/windows/v1.0/syncml/1.0.0" version="1.0.0" version-type="context">
|
||||
<resource methods="POST" url-mapping="/request" faultSequence="fault">
|
||||
<inSequence>
|
||||
<property name="api.ut.backendRequestTime" expression="get-property('SYSTEM_TIME')"/>
|
||||
<property name="AM_KEY_TYPE" value="PRODUCTION" scope="default"/>
|
||||
<filter source="$ctx:AM_KEY_TYPE" regex="PRODUCTION">
|
||||
<then>
|
||||
<send>
|
||||
<endpoint name="admin--Windows 8.1 Device Management Service_APIproductionEndpoint_0">
|
||||
<http uri-template="https://localhost:9443/api/device-mgt/windows/v1.0/syncml"/>
|
||||
<property name="ENDPOINT_ADDRESS" value="https://localhost:9443/api/device-mgt/windows/v1.0/syncml"/>
|
||||
</endpoint>
|
||||
</send>
|
||||
</then>
|
||||
<else>
|
||||
<sequence key="_sandbox_key_error_"/>
|
||||
</else>
|
||||
</filter>
|
||||
</inSequence>
|
||||
<outSequence>
|
||||
<class name="org.wso2.carbon.apimgt.gateway.handlers.analytics.APIMgtResponseHandler"/>
|
||||
<send/>
|
||||
</outSequence>
|
||||
</resource>
|
||||
<handlers>
|
||||
<handler class="org.wso2.carbon.apimgt.gateway.handlers.common.APIMgtLatencyStatsHandler"/>
|
||||
<handler class="org.wso2.carbon.apimgt.gateway.handlers.security.CORSRequestHandler">
|
||||
<property name="apiImplementationType" value="ENDPOINT"/>
|
||||
</handler>
|
||||
</handlers>
|
||||
</api>
|
@ -0,0 +1,54 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><api xmlns="http://ws.apache.org/ns/synapse" name="admin--Windows 8.1 Enrollment Service" context="/api/device-mgt/windows/v1.0/deviceenrolment/wstep">
|
||||
<resource methods="HEAD DELETE POST GET OPTIONS PATCH PUT" url-mapping="/*" faultSequence="fault">
|
||||
<inSequence>
|
||||
<property name="isDefault" expression="$trp:WSO2_AM_API_DEFAULT_VERSION"/>
|
||||
<filter source="$ctx:isDefault" regex="true">
|
||||
<then>
|
||||
<log level="custom">
|
||||
<property name="STATUS" value="Faulty invoking through default API.Dropping message to avoid recursion.."/>
|
||||
</log>
|
||||
<payloadFactory media-type="xml">
|
||||
<format>
|
||||
<am:fault xmlns:am="http://wso2.org/apimanager">
|
||||
<am:code>500</am:code>
|
||||
<am:type>Status report</am:type>
|
||||
<am:message>Internal Server Error</am:message>
|
||||
<am:description>Faulty invoking through default API</am:description>
|
||||
</am:fault>
|
||||
</format>
|
||||
<args/>
|
||||
</payloadFactory>
|
||||
<property name="HTTP_SC" value="500" scope="axis2"/>
|
||||
<property name="RESPONSE" value="true"/>
|
||||
<header name="To" action="remove"/>
|
||||
<property name="NO_ENTITY_BODY" scope="axis2" action="remove"/>
|
||||
<property name="ContentType" scope="axis2" action="remove"/>
|
||||
<property name="Authorization" scope="transport" action="remove"/>
|
||||
<property name="Host" scope="transport" action="remove"/>
|
||||
<property name="Accept" scope="transport" action="remove"/>
|
||||
<send/>
|
||||
</then>
|
||||
<else>
|
||||
<header name="WSO2_AM_API_DEFAULT_VERSION" scope="transport" value="true"/>
|
||||
<property name="uri.var.portnum" expression="get-property('http.nio.port')"/>
|
||||
<send>
|
||||
<endpoint>
|
||||
<http uri-template="http://localhost:{uri.var.portnum}/api/device-mgt/windows/v1.0/deviceenrolment/wstep/1.0.0">
|
||||
<timeout>
|
||||
<duration>60000</duration>
|
||||
<responseAction>fault</responseAction>
|
||||
</timeout>
|
||||
</http>
|
||||
</endpoint>
|
||||
</send>
|
||||
</else>
|
||||
</filter>
|
||||
</inSequence>
|
||||
<outSequence>
|
||||
<send/>
|
||||
</outSequence>
|
||||
</resource>
|
||||
<handlers>
|
||||
<handler class="org.wso2.carbon.apimgt.gateway.handlers.common.SynapsePropertiesHandler"/>
|
||||
</handlers>
|
||||
</api>
|
@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><api xmlns="http://ws.apache.org/ns/synapse" name="admin--Windows 8.1 Enrollment Service" context="/api/device-mgt/windows/v1.0/deviceenrolment/wstep/1.0.0" version="1.0.0" version-type="context">
|
||||
<resource methods="POST" url-mapping="/*" faultSequence="fault">
|
||||
<inSequence>
|
||||
<property name="api.ut.backendRequestTime" expression="get-property('SYSTEM_TIME')"/>
|
||||
<property name="AM_KEY_TYPE" value="PRODUCTION" scope="default"/>
|
||||
<filter source="$ctx:AM_KEY_TYPE" regex="PRODUCTION">
|
||||
<then>
|
||||
<send>
|
||||
<endpoint name="admin--Windows 8.1 Enrollment Service_APIproductionEndpoint_0">
|
||||
<http uri-template="https://localhost:9443/api/device-mgt/windows/v1.0/deviceenrolment/wstep"/>
|
||||
<property name="ENDPOINT_ADDRESS" value="https://localhost:9443/api/device-mgt/windows/v1.0/deviceenrolment/wstep"/>
|
||||
</endpoint>
|
||||
</send>
|
||||
</then>
|
||||
<else>
|
||||
<sequence key="_sandbox_key_error_"/>
|
||||
</else>
|
||||
</filter>
|
||||
</inSequence>
|
||||
<outSequence>
|
||||
<class name="org.wso2.carbon.apimgt.gateway.handlers.analytics.APIMgtResponseHandler"/>
|
||||
<send/>
|
||||
</outSequence>
|
||||
</resource>
|
||||
<handlers>
|
||||
<handler class="org.wso2.carbon.apimgt.gateway.handlers.common.APIMgtLatencyStatsHandler"/>
|
||||
<handler class="org.wso2.carbon.apimgt.gateway.handlers.security.CORSRequestHandler">
|
||||
<property name="apiImplementationType" value="ENDPOINT"/>
|
||||
</handler>
|
||||
</handlers>
|
||||
</api>
|
@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><api xmlns="http://ws.apache.org/ns/synapse" name="admin--Windows Discovery Service" context="/api/device-mgt/windows/v1.0/discovery/post">
|
||||
<resource methods="HEAD DELETE POST GET OPTIONS PATCH PUT" url-mapping="/*" faultSequence="fault">
|
||||
<inSequence>
|
||||
<property name="isDefault" expression="$trp:WSO2_AM_API_DEFAULT_VERSION"/>
|
||||
<filter source="$ctx:isDefault" regex="true">
|
||||
<then>
|
||||
<log level="custom">
|
||||
<property name="STATUS" value="Faulty invoking through default API.Dropping message to avoid recursion.."/>
|
||||
</log>
|
||||
<payloadFactory media-type="xml">
|
||||
<format>
|
||||
<am:fault xmlns:am="http://wso2.org/apimanager">
|
||||
<am:code>500</am:code>
|
||||
<am:type>Status report</am:type>
|
||||
<am:message>Internal Server Error</am:message>
|
||||
<am:description>Faulty invoking through default API</am:description>
|
||||
</am:fault>
|
||||
</format>
|
||||
<args/>
|
||||
</payloadFactory>
|
||||
<property name="HTTP_SC" value="500" scope="axis2"/>
|
||||
<property name="RESPONSE" value="true"/>
|
||||
<header name="To" action="remove"/>
|
||||
<property name="NO_ENTITY_BODY" scope="axis2" action="remove"/>
|
||||
<property name="ContentType" scope="axis2" action="remove"/>
|
||||
<property name="Authorization" scope="transport" action="remove"/>
|
||||
<property name="Host" scope="transport" action="remove"/>
|
||||
<property name="Accept" scope="transport" action="remove"/>
|
||||
<send/>
|
||||
</then>
|
||||
<else>
|
||||
<header name="WSO2_AM_API_DEFAULT_VERSION" scope="transport" value="true"/>
|
||||
<property name="uri.var.portnum" expression="get-property('http.nio.port')"/>
|
||||
<send>
|
||||
<endpoint>
|
||||
<http uri-template="http://localhost:{uri.var.portnum}/api/device-mgt/windows/v1.0/discovery/post/1.0.0">
|
||||
<timeout>
|
||||
<duration>60000</duration>
|
||||
<responseAction>fault</responseAction>
|
||||
</timeout>
|
||||
</http>
|
||||
</endpoint>
|
||||
</send>
|
||||
</else>
|
||||
</filter>
|
||||
</inSequence>
|
||||
<outSequence>
|
||||
<property name="FORCE_HTTP_CONTENT_LENGTH" scope="axis2" value="true"/>
|
||||
<property name="COPY_CONTENT_LENGTH_FROM_INCOMING" value="true" scope="axis2"/>
|
||||
<send/>
|
||||
</outSequence>
|
||||
</resource>
|
||||
<handlers>
|
||||
<handler class="org.wso2.carbon.apimgt.gateway.handlers.common.SynapsePropertiesHandler"/>
|
||||
</handlers>
|
||||
</api>
|
@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><api xmlns="http://ws.apache.org/ns/synapse" name="admin--Windows Discovery Service" context="/api/device-mgt/windows/v1.0/discovery/post/1.0.0" version="1.0.0" version-type="context">
|
||||
<resource methods="POST" url-mapping="/*" faultSequence="fault">
|
||||
<inSequence>
|
||||
<property name="api.ut.backendRequestTime" expression="get-property('SYSTEM_TIME')"/>
|
||||
<property name="AM_KEY_TYPE" value="PRODUCTION" scope="default"/>
|
||||
<filter source="$ctx:AM_KEY_TYPE" regex="PRODUCTION">
|
||||
<then>
|
||||
<send>
|
||||
<endpoint name="admin--Windows Discovery Service_APIproductionEndpoint_0">
|
||||
<http uri-template="https://localhost:9443/api/device-mgt/windows/v1.0/discovery/post"/>
|
||||
<property name="ENDPOINT_ADDRESS" value="https://localhost:9443/api/device-mgt/windows/v1.0/discovery/post"/>
|
||||
</endpoint>
|
||||
</send>
|
||||
</then>
|
||||
<else>
|
||||
<sequence key="_sandbox_key_error_"/>
|
||||
</else>
|
||||
</filter>
|
||||
</inSequence>
|
||||
<outSequence>
|
||||
<class name="org.wso2.carbon.apimgt.gateway.handlers.analytics.APIMgtResponseHandler"/>
|
||||
<property name="FORCE_HTTP_CONTENT_LENGTH" scope="axis2" value="true"/>
|
||||
<property name="COPY_CONTENT_LENGTH_FROM_INCOMING" value="true" scope="axis2"/>
|
||||
<send/>
|
||||
</outSequence>
|
||||
</resource>
|
||||
<handlers>
|
||||
<handler class="org.wso2.carbon.apimgt.gateway.handlers.common.APIMgtLatencyStatsHandler"/>
|
||||
<handler class="org.wso2.carbon.apimgt.gateway.handlers.security.CORSRequestHandler">
|
||||
<property name="apiImplementationType" value="ENDPOINT"/>
|
||||
</handler>
|
||||
</handlers>
|
||||
</api>
|
@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><api xmlns="http://ws.apache.org/ns/synapse" name="admin--Windows Enrollment policy Service" context="/api/device-mgt/windows/v1.0/certificatepolicy/xcep">
|
||||
<resource methods="HEAD DELETE POST GET OPTIONS PATCH PUT" url-mapping="/*" faultSequence="fault">
|
||||
<inSequence>
|
||||
<property name="isDefault" expression="$trp:WSO2_AM_API_DEFAULT_VERSION"/>
|
||||
<filter source="$ctx:isDefault" regex="true">
|
||||
<then>
|
||||
<log level="custom">
|
||||
<property name="STATUS" value="Faulty invoking through default API.Dropping message to avoid recursion.."/>
|
||||
</log>
|
||||
<payloadFactory media-type="xml">
|
||||
<format>
|
||||
<am:fault xmlns:am="http://wso2.org/apimanager">
|
||||
<am:code>500</am:code>
|
||||
<am:type>Status report</am:type>
|
||||
<am:message>Internal Server Error</am:message>
|
||||
<am:description>Faulty invoking through default API</am:description>
|
||||
</am:fault>
|
||||
</format>
|
||||
<args/>
|
||||
</payloadFactory>
|
||||
<property name="HTTP_SC" value="500" scope="axis2"/>
|
||||
<property name="RESPONSE" value="true"/>
|
||||
<header name="To" action="remove"/>
|
||||
<property name="NO_ENTITY_BODY" scope="axis2" action="remove"/>
|
||||
<property name="ContentType" scope="axis2" action="remove"/>
|
||||
<property name="Authorization" scope="transport" action="remove"/>
|
||||
<property name="Host" scope="transport" action="remove"/>
|
||||
<property name="Accept" scope="transport" action="remove"/>
|
||||
<send/>
|
||||
</then>
|
||||
<else>
|
||||
<header name="WSO2_AM_API_DEFAULT_VERSION" scope="transport" value="true"/>
|
||||
<property name="uri.var.portnum" expression="get-property('http.nio.port')"/>
|
||||
<send>
|
||||
<endpoint>
|
||||
<http uri-template="http://localhost:{uri.var.portnum}/api/device-mgt/windows/v1.0/certificatepolicy/xcep/1.0.0">
|
||||
<timeout>
|
||||
<duration>60000</duration>
|
||||
<responseAction>fault</responseAction>
|
||||
</timeout>
|
||||
</http>
|
||||
</endpoint>
|
||||
</send>
|
||||
</else>
|
||||
</filter>
|
||||
</inSequence>
|
||||
<outSequence>
|
||||
<property name="FORCE_HTTP_CONTENT_LENGTH" scope="axis2" value="true"/>
|
||||
<property name="COPY_CONTENT_LENGTH_FROM_INCOMING" value="true" scope="axis2"/>
|
||||
<send/>
|
||||
</outSequence>
|
||||
</resource>
|
||||
<handlers>
|
||||
<handler class="org.wso2.carbon.apimgt.gateway.handlers.common.SynapsePropertiesHandler"/>
|
||||
</handlers>
|
||||
</api>
|
@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><api xmlns="http://ws.apache.org/ns/synapse" name="admin--Windows Enrollment policy Service" context="/api/device-mgt/windows/v1.0/certificatepolicy/xcep/1.0.0" version="1.0.0" version-type="context">
|
||||
<resource methods="POST" url-mapping="/*" faultSequence="fault">
|
||||
<inSequence>
|
||||
<property name="api.ut.backendRequestTime" expression="get-property('SYSTEM_TIME')"/>
|
||||
<property name="AM_KEY_TYPE" value="PRODUCTION" scope="default"/>
|
||||
<filter source="$ctx:AM_KEY_TYPE" regex="PRODUCTION">
|
||||
<then>
|
||||
<send>
|
||||
<endpoint name="admin--Windows Enrollment policy Service_APIproductionEndpoint_0">
|
||||
<http uri-template="https://localhost:9443/api/device-mgt/windows/v1.0/certificatepolicy/xcep"/>
|
||||
<property name="ENDPOINT_ADDRESS" value="https://localhost:9443/api/device-mgt/windows/v1.0/certificatepolicy/xcep"/>
|
||||
</endpoint>
|
||||
</send>
|
||||
</then>
|
||||
<else>
|
||||
<sequence key="_sandbox_key_error_"/>
|
||||
</else>
|
||||
</filter>
|
||||
</inSequence>
|
||||
<outSequence>
|
||||
<class name="org.wso2.carbon.apimgt.gateway.handlers.analytics.APIMgtResponseHandler"/>
|
||||
<property name="FORCE_HTTP_CONTENT_LENGTH" scope="axis2" value="true"/>
|
||||
<property name="COPY_CONTENT_LENGTH_FROM_INCOMING" value="true" scope="axis2"/>
|
||||
<send/>
|
||||
</outSequence>
|
||||
</resource>
|
||||
<handlers>
|
||||
<handler class="org.wso2.carbon.apimgt.gateway.handlers.common.APIMgtLatencyStatsHandler"/>
|
||||
<handler class="org.wso2.carbon.apimgt.gateway.handlers.security.CORSRequestHandler">
|
||||
<property name="apiImplementationType" value="ENDPOINT"/>
|
||||
</handler>
|
||||
</handlers>
|
||||
</api>
|
Loading…
Reference in new issue