forked from community/device-mgt-plugins
parent
2b6816d7ed
commit
edaacd4989
@ -0,0 +1,120 @@
|
||||
/*
|
||||
* 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.iot.input.adapter.http.jwt;
|
||||
|
||||
import com.nimbusds.jose.JOSEException;
|
||||
import com.nimbusds.jose.JWSVerifier;
|
||||
import com.nimbusds.jose.crypto.RSASSAVerifier;
|
||||
import com.nimbusds.jwt.SignedJWT;
|
||||
import org.apache.axiom.util.base64.Base64Utils;
|
||||
import org.apache.axis2.transport.http.HTTPConstants;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.wso2.carbon.core.util.KeyStoreManager;
|
||||
import org.wso2.carbon.device.mgt.iot.input.adapter.http.util.AuthenticationInfo;
|
||||
import org.wso2.carbon.device.mgt.iot.input.adapter.internal.InputAdapterServiceDataHolder;
|
||||
import org.wso2.carbon.user.api.TenantManager;
|
||||
import org.wso2.carbon.user.api.UserStoreException;
|
||||
import org.wso2.carbon.user.api.UserStoreManager;
|
||||
import org.wso2.carbon.utils.multitenancy.MultitenantConstants;
|
||||
import org.wso2.carbon.utils.multitenancy.MultitenantUtils;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.security.interfaces.RSAPublicKey;
|
||||
import java.text.ParseException;
|
||||
|
||||
/**
|
||||
* This authenticator authenticates HTTP requests using JWT header.
|
||||
*/
|
||||
public class JWTAuthenticator {
|
||||
|
||||
private static final Log log = LogFactory.getLog(JWTAuthenticator.class);
|
||||
public static final String SIGNED_JWT_AUTH_USERNAME = "Username";
|
||||
private static final String JWT_ASSERTION_HEADER = "X-JWT-Assertion";
|
||||
|
||||
public boolean isJWTHeaderExist(HttpServletRequest request) {
|
||||
String authorizationHeader = request.getHeader(JWT_ASSERTION_HEADER);
|
||||
if((authorizationHeader != null) && !authorizationHeader.isEmpty()){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public AuthenticationInfo authenticate(HttpServletRequest request) {
|
||||
AuthenticationInfo authenticationInfo = new AuthenticationInfo();
|
||||
//Get the filesystem keystore default primary certificate
|
||||
KeyStoreManager keyStoreManager = KeyStoreManager.getInstance(MultitenantConstants.SUPER_TENANT_ID);
|
||||
try {
|
||||
keyStoreManager.getDefaultPrimaryCertificate();
|
||||
String authorizationHeader = request.getHeader(HTTPConstants.HEADER_AUTHORIZATION);
|
||||
String headerData = decodeAuthorizationHeader(authorizationHeader);
|
||||
JWSVerifier verifier =
|
||||
new RSASSAVerifier((RSAPublicKey) keyStoreManager.getDefaultPublicKey());
|
||||
SignedJWT jwsObject = SignedJWT.parse(headerData);
|
||||
if (jwsObject.verify(verifier)) {
|
||||
String username = jwsObject.getJWTClaimsSet().getStringClaim(SIGNED_JWT_AUTH_USERNAME);
|
||||
String tenantDomain = MultitenantUtils.getTenantDomain(username);
|
||||
username = MultitenantUtils.getTenantAwareUsername(username);
|
||||
TenantManager tenantManager = InputAdapterServiceDataHolder.getRealmService().
|
||||
getTenantManager();
|
||||
int tenantId = tenantManager.getTenantId(tenantDomain);
|
||||
if (tenantId == -1) {
|
||||
log.error("tenantDomain is not valid. username : " + username + ", tenantDomain " +
|
||||
": " + tenantDomain);
|
||||
} else {
|
||||
UserStoreManager userStore = InputAdapterServiceDataHolder.getRealmService().
|
||||
getTenantUserRealm(tenantId).getUserStoreManager();
|
||||
if (userStore.isExistingUser(username)) {
|
||||
authenticationInfo.setTenantId(tenantId);
|
||||
authenticationInfo.setUsername(username);
|
||||
authenticationInfo.setTenantDomain(tenantDomain);
|
||||
authenticationInfo.setAuthenticated(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (UserStoreException e) {
|
||||
log.error("Error occurred while obtaining the user.", e);
|
||||
} catch (ParseException e) {
|
||||
log.error("Error occurred while parsing the JWT header.", e);
|
||||
} catch (JOSEException e) {
|
||||
log.error("Error occurred while verifying the JWT header.", e);
|
||||
} catch (Exception e) {
|
||||
log.error("Error occurred while verifying the JWT header.", e);
|
||||
}
|
||||
return authenticationInfo;
|
||||
}
|
||||
|
||||
private String decodeAuthorizationHeader(String authorizationHeader) {
|
||||
|
||||
if(authorizationHeader == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
String[] splitValues = authorizationHeader.trim().split(" ");
|
||||
byte[] decodedBytes = Base64Utils.decode(splitValues[1].trim());
|
||||
if (decodedBytes != null) {
|
||||
return new String(decodedBytes);
|
||||
} else {
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Error decoding authorization header.");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,174 @@
|
||||
/*
|
||||
* 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.iot.input.adapter.http.oauth;
|
||||
|
||||
import org.apache.axis2.context.ServiceContext;
|
||||
import org.apache.axis2.transport.http.HTTPConstants;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.commons.pool.impl.GenericObjectPool;
|
||||
import org.wso2.carbon.device.mgt.iot.input.adapter.http.util.AuthenticationInfo;
|
||||
import org.wso2.carbon.device.mgt.iot.input.adapter.internal.InputAdapterServiceDataHolder;
|
||||
import org.wso2.carbon.event.input.adapter.core.InputEventAdapterConfiguration;
|
||||
import org.wso2.carbon.identity.oauth2.stub.OAuth2TokenValidationServiceStub;
|
||||
import org.wso2.carbon.identity.oauth2.stub.dto.OAuth2TokenValidationRequestDTO;
|
||||
import org.wso2.carbon.identity.oauth2.stub.dto.OAuth2TokenValidationRequestDTO_OAuth2AccessToken;
|
||||
import org.wso2.carbon.identity.oauth2.stub.dto.OAuth2TokenValidationResponseDTO;
|
||||
import org.wso2.carbon.user.api.UserStoreException;
|
||||
import org.wso2.carbon.user.core.service.RealmService;
|
||||
import org.wso2.carbon.utils.multitenancy.MultitenantUtils;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.rmi.RemoteException;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* Authenticate use oauth validator
|
||||
*/
|
||||
public class OAuthAuthenticator {
|
||||
private static String cookie;
|
||||
private GenericObjectPool stubs;
|
||||
|
||||
private static final Pattern PATTERN = Pattern.compile("[B|b]earer\\s");
|
||||
private static final String TOKEN_TYPE = "bearer";
|
||||
private static final String AUTHORIZATION_HEADER = "Authorization";
|
||||
private static Log log = LogFactory.getLog(OAuthAuthenticator.class);
|
||||
|
||||
public OAuthAuthenticator(InputEventAdapterConfiguration eventAdapterConfiguration) {
|
||||
this.stubs = new GenericObjectPool(new OAuthTokenValidaterStubFactory(eventAdapterConfiguration));
|
||||
}
|
||||
|
||||
public AuthenticationInfo authenticate(HttpServletRequest req) {
|
||||
AuthenticationInfo authenticationInfo = new AuthenticationInfo();
|
||||
String bearerToken = getBearerToken(req);
|
||||
if (bearerToken == null) {
|
||||
return authenticationInfo;
|
||||
}
|
||||
try {
|
||||
authenticationInfo = validateToken(bearerToken);
|
||||
} catch (Exception e) {
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("checkAuthentication() fail: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
return authenticationInfo;
|
||||
}
|
||||
|
||||
private String getBearerToken(HttpServletRequest request) {
|
||||
String authorizationHeader = request.getHeader(AUTHORIZATION_HEADER);
|
||||
if (authorizationHeader != null) {
|
||||
Matcher matcher = PATTERN.matcher(authorizationHeader);
|
||||
if (matcher.find()) {
|
||||
authorizationHeader = authorizationHeader.substring(matcher.end());
|
||||
}
|
||||
}
|
||||
return authorizationHeader;
|
||||
}
|
||||
|
||||
/**
|
||||
* This creates an AuthenticationInfo object that is used for authorization. This method will validate the token
|
||||
* and
|
||||
* sets the required parameters to the object.
|
||||
*
|
||||
* @param token that needs to be validated.
|
||||
* @param tokenValidationServiceStub stub that is used to call the external service.
|
||||
* @return AuthenticationInfo This contains the information related to authenticated client.
|
||||
* @throws RemoteException that triggers when failing to call the external service..
|
||||
*/
|
||||
private AuthenticationInfo getAuthenticationInfo(String token,
|
||||
OAuth2TokenValidationServiceStub tokenValidationServiceStub)
|
||||
throws RemoteException, UserStoreException {
|
||||
AuthenticationInfo authenticationInfo = new AuthenticationInfo();
|
||||
OAuth2TokenValidationRequestDTO validationRequest = new OAuth2TokenValidationRequestDTO();
|
||||
OAuth2TokenValidationRequestDTO_OAuth2AccessToken accessToken =
|
||||
new OAuth2TokenValidationRequestDTO_OAuth2AccessToken();
|
||||
accessToken.setTokenType(TOKEN_TYPE);
|
||||
accessToken.setIdentifier(token);
|
||||
validationRequest.setAccessToken(accessToken);
|
||||
boolean authenticated;
|
||||
OAuth2TokenValidationResponseDTO tokenValidationResponse;
|
||||
tokenValidationResponse = tokenValidationServiceStub.validate(validationRequest);
|
||||
if (tokenValidationResponse == null) {
|
||||
authenticationInfo.setAuthenticated(false);
|
||||
return authenticationInfo;
|
||||
}
|
||||
authenticated = tokenValidationResponse.getValid();
|
||||
if (authenticated) {
|
||||
String authorizedUser = tokenValidationResponse.getAuthorizedUser();
|
||||
String username = MultitenantUtils.getTenantAwareUsername(authorizedUser);
|
||||
String tenantDomain = MultitenantUtils.getTenantDomain(authorizedUser);
|
||||
authenticationInfo.setUsername(username);
|
||||
authenticationInfo.setTenantDomain(tenantDomain);
|
||||
RealmService realmService = InputAdapterServiceDataHolder.getRealmService();
|
||||
int tenantId = realmService.getTenantManager().getTenantId(authenticationInfo.getTenantDomain());
|
||||
authenticationInfo.setTenantId(tenantId);
|
||||
} else {
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Token validation failed for token: " + token);
|
||||
}
|
||||
}
|
||||
ServiceContext serviceContext = tokenValidationServiceStub._getServiceClient()
|
||||
.getLastOperationContext().getServiceContext();
|
||||
cookie = (String) serviceContext.getProperty(HTTPConstants.COOKIE_STRING);
|
||||
authenticationInfo.setAuthenticated(authenticated);
|
||||
return authenticationInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method gets a string accessToken and validates it
|
||||
*
|
||||
* @param token which need to be validated.
|
||||
* @return AuthenticationInfo with the validated results.
|
||||
*/
|
||||
private AuthenticationInfo validateToken(String token) {
|
||||
OAuth2TokenValidationServiceStub tokenValidationServiceStub = null;
|
||||
try {
|
||||
Object stub = this.stubs.borrowObject();
|
||||
if (stub != null) {
|
||||
tokenValidationServiceStub = (OAuth2TokenValidationServiceStub) stub;
|
||||
if (cookie != null) {
|
||||
tokenValidationServiceStub._getServiceClient().getOptions().setProperty(
|
||||
HTTPConstants.COOKIE_STRING, cookie);
|
||||
}
|
||||
return getAuthenticationInfo(token, tokenValidationServiceStub);
|
||||
} else {
|
||||
log.warn("Stub initialization failed.");
|
||||
}
|
||||
} catch (RemoteException e) {
|
||||
log.error("Error on connecting with the validation endpoint.", e);
|
||||
} catch (Exception e) {
|
||||
log.error("Error occurred in borrowing an validation stub from the pool.", e);
|
||||
|
||||
} finally {
|
||||
try {
|
||||
if (tokenValidationServiceStub != null) {
|
||||
this.stubs.returnObject(tokenValidationServiceStub);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn("Error occurred while returning the object back to the oauth token validation service " +
|
||||
"stub pool.", e);
|
||||
}
|
||||
}
|
||||
AuthenticationInfo authenticationInfo = new AuthenticationInfo();
|
||||
authenticationInfo.setAuthenticated(false);
|
||||
authenticationInfo.setTenantId(-1);
|
||||
return authenticationInfo;
|
||||
}
|
||||
}
|
14
components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.input.adapter/src/main/java/org/wso2/carbon/device/mgt/iot/input/adapter/internal/EventAdapterServiceComponent.java → components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.input.adapter/src/main/java/org/wso2/carbon/device/mgt/iot/input/adapter/internal/InputAdapterServiceComponent.java
14
components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.input.adapter/src/main/java/org/wso2/carbon/device/mgt/iot/input/adapter/internal/EventAdapterServiceComponent.java → components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.input.adapter/src/main/java/org/wso2/carbon/device/mgt/iot/input/adapter/internal/InputAdapterServiceComponent.java
8
components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.input.adapter/src/main/java/org/wso2/carbon/device/mgt/iot/input/adapter/internal/EventAdapterServiceDataHolder.java → components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.input.adapter/src/main/java/org/wso2/carbon/device/mgt/iot/input/adapter/internal/InputAdapterServiceDataHolder.java
8
components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.input.adapter/src/main/java/org/wso2/carbon/device/mgt/iot/input/adapter/internal/EventAdapterServiceDataHolder.java → components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.input.adapter/src/main/java/org/wso2/carbon/device/mgt/iot/input/adapter/internal/InputAdapterServiceDataHolder.java
8
components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/MQTTEventAdapter.java → components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/i18n/MQTTEventAdapter.java
8
components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/MQTTEventAdapter.java → components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/i18n/MQTTEventAdapter.java
4
components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/MQTTEventAdapterFactory.java → components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/i18n/MQTTEventAdapterFactory.java
4
components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/MQTTEventAdapterFactory.java → components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/i18n/MQTTEventAdapterFactory.java
4
components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/internal/MQTTEventAdapterServiceComponent.java → components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/i18n/internal/MQTTEventAdapterServiceComponent.java
4
components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/internal/MQTTEventAdapterServiceComponent.java → components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/i18n/internal/MQTTEventAdapterServiceComponent.java
2
components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/util/Constants.java → components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/i18n/util/Constants.java
2
components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/util/Constants.java → components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/i18n/util/Constants.java
2
components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/util/MQTTAdapterPublisher.java → components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/i18n/util/MQTTAdapterPublisher.java
2
components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/util/MQTTAdapterPublisher.java → components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/i18n/util/MQTTAdapterPublisher.java
2
components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/util/MQTTBrokerConnectionConfiguration.java → components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/i18n/util/MQTTBrokerConnectionConfiguration.java
2
components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/util/MQTTBrokerConnectionConfiguration.java → components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/i18n/util/MQTTBrokerConnectionConfiguration.java
2
components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/util/MQTTEventAdapterConstants.java → components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/i18n/util/MQTTEventAdapterConstants.java
2
components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/util/MQTTEventAdapterConstants.java → components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/i18n/util/MQTTEventAdapterConstants.java
2
components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/util/MQTTUtil.java → components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/i18n/util/MQTTUtil.java
2
components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/util/MQTTUtil.java → components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/i18n/util/MQTTUtil.java
2
components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/util/RegistrationProfile.java → components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/i18n/util/RegistrationProfile.java
2
components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/util/RegistrationProfile.java → components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/i18n/util/RegistrationProfile.java
@ -1,4 +1,4 @@
|
||||
package org.wso2.carbon.device.mgt.iot.output.adapter.xmpp.util;
|
||||
package org.wso2.carbon.device.mgt.iot.output.adapter.xmpp.i18n.util;
|
||||
|
||||
/**
|
||||
* This class represents the data that are required to register
|
0
components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.mqtt/src/main/resources/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/i18n/Resources.properties → components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.mqtt/src/main/resources/org/wso2/carbon/device/mgt/iot/output/adapter/mqtt/i18n/Resources.properties
0
components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.mqtt/src/main/resources/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/i18n/Resources.properties → components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.mqtt/src/main/resources/org/wso2/carbon/device/mgt/iot/output/adapter/mqtt/i18n/Resources.properties
8
components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.xmpp/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/XMPPEventAdapter.java → components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.xmpp/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/i18n/XMPPEventAdapter.java
8
components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.xmpp/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/XMPPEventAdapter.java → components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.xmpp/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/i18n/XMPPEventAdapter.java
4
components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.xmpp/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/XMPPEventAdapterFactory.java → components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.xmpp/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/i18n/XMPPEventAdapterFactory.java
4
components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.xmpp/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/XMPPEventAdapterFactory.java → components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.xmpp/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/i18n/XMPPEventAdapterFactory.java
4
components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.xmpp/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/internal/XMPPEventAdapterServiceComponent.java → components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.xmpp/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/i18n/internal/XMPPEventAdapterServiceComponent.java
4
components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.xmpp/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/internal/XMPPEventAdapterServiceComponent.java → components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.xmpp/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/i18n/internal/XMPPEventAdapterServiceComponent.java
2
components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.xmpp/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/util/XMPPAdapterPublisher.java → components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.xmpp/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/i18n/util/XMPPAdapterPublisher.java
2
components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.xmpp/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/util/XMPPAdapterPublisher.java → components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.xmpp/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/i18n/util/XMPPAdapterPublisher.java
2
components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.xmpp/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/util/XMPPEventAdapterConstants.java → components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.xmpp/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/i18n/util/XMPPEventAdapterConstants.java
2
components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.xmpp/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/util/XMPPEventAdapterConstants.java → components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.xmpp/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/i18n/util/XMPPEventAdapterConstants.java
2
components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.xmpp/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/util/XMPPServerConnectionConfiguration.java → components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.xmpp/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/i18n/util/XMPPServerConnectionConfiguration.java
2
components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.xmpp/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/util/XMPPServerConnectionConfiguration.java → components/iot-plugins/iot-base-plugin/org.wso2.carbon.device.mgt.iot.output.adapter.xmpp/src/main/java/org/wso2/carbon/device/mgt/iot/output/adapter/xmpp/i18n/util/XMPPServerConnectionConfiguration.java
@ -0,0 +1,128 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
~ Copyright (c) 2016, 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.
|
||||
-->
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
|
||||
<parent>
|
||||
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
|
||||
<artifactId>iot-base-plugin-feature</artifactId>
|
||||
<version>2.1.0-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>org.wso2.carbon.device.mgt.iot.adapter.feature</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>2.1.0-SNAPSHOT</version>
|
||||
<name>WSO2 Carbon - IoT Device Management Feature</name>
|
||||
<url>http://wso2.org</url>
|
||||
<description>This feature contains the adapter bundles required for IoT Server</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
|
||||
<artifactId>org.wso2.carbon.device.mgt.iot.output.adapter.mqtt</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
|
||||
<artifactId>org.wso2.carbon.device.mgt.iot.output.adapter.xmpp</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
|
||||
<artifactId>org.wso2.carbon.device.mgt.iot.input.adapter</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-resources</id>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>copy-resources</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>src/main/resources</outputDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>resources</directory>
|
||||
<includes>
|
||||
<include>build.properties</include>
|
||||
<include>p2.inf</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.wso2.maven</groupId>
|
||||
<artifactId>carbon-p2-plugin</artifactId>
|
||||
<version>${carbon.p2.plugin.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>p2-feature-generation</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>p2-feature-gen</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<id>org.wso2.carbon.device.mgt.iot.adapter</id>
|
||||
<propertiesFile>../../../features/etc/feature.properties</propertiesFile>
|
||||
<adviceFile>
|
||||
<properties>
|
||||
<propertyDef>org.wso2.carbon.p2.category.type:server</propertyDef>
|
||||
<propertyDef>org.eclipse.equinox.p2.type.group:false</propertyDef>
|
||||
</properties>
|
||||
</adviceFile>
|
||||
<bundles>
|
||||
<bundleDef>
|
||||
org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.iot.output.adapter.mqtt:${carbon.devicemgt.plugins.version}
|
||||
</bundleDef>
|
||||
<bundleDef>
|
||||
org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.iot.output.adapter.xmpp:${carbon.devicemgt.plugins.version}
|
||||
</bundleDef>
|
||||
<bundleDef>
|
||||
org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.iot.input.adapter:${carbon.devicemgt.plugins.version}
|
||||
</bundleDef>
|
||||
</bundles>
|
||||
<importFeatures>
|
||||
<importFeatureDef>
|
||||
org.wso2.carbon.event.output.adapter.server:${carbon.analytics.common.version}
|
||||
</importFeatureDef>
|
||||
<importFeatureDef>
|
||||
org.wso2.carbon.event.input.adapter.server:${carbon.analytics.common.version}
|
||||
</importFeatureDef>
|
||||
<importFeatureDef>
|
||||
org.wso2.carbon.identity.jwt.client.extension:${carbon.devicemgt.version}
|
||||
</importFeatureDef>
|
||||
</importFeatures>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
@ -0,0 +1,19 @@
|
||||
#
|
||||
# Copyright (c) 2016, 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.
|
||||
#
|
||||
|
||||
custom = true
|
@ -0,0 +1 @@
|
||||
instructions.configure = \
|
Loading…
Reference in new issue