diff --git a/README.md b/README.md index b24f2f4e..c05b97b6 100644 --- a/README.md +++ b/README.md @@ -1,127 +1,8 @@ -# WSO2 API Manager 2.1.0 Kubernetes/Openshift Resources -*Kubernetes/Openshift Resources for container-based deployments of WSO2 API Manager (APIM)* +# Kubernetes Resources for WSO2 API Manager +*Kubernetes Resources for container-based deployments of WSO2 API Manager deployment patterns* -## Quick Start Guide +This repository contains Kubernetes resources required for, ->In the context of this document, `KUBERNETES_HOME` will refer to a local copy of -[`wso2/kubernetes-apim`](https://github.com/wso2/kubernetes-apim/) git repository. +* [WSO2 API Manager pattern 1](pattern-1) -##### 1. Checkout WSO2 kubernetes-apim repository using `git clone`: -``` -git clone https://github.com/wso2/kubernetes-apim.git -git checkout tags/v2.1.0-2 -``` - -##### 2. Pull required Docker images from [`WSO2 Docker Registry`](https://docker.wso2.com) using `docker pull`: -``` -docker login docker.wso2.com - -docker pull docker.wso2.com/wso2am-analytics-kubernetes:2.1.0 -docker pull docker.wso2.com/wso2am-kubernetes:2.1.0 -docker pull docker.wso2.com/apim-rdbms-kubernetes:2.1.0 -``` - -> You can also build the docker images by following the guide in `KUBERNETES_HOME/base/README.md`. Same images can be used for Openshift. - -##### 3. Copy the Images into Kubernetes/Openshift nodes or to a Registry: -Copy the required Docker images over to the Kubernetes Nodes (ex: use `docker save` to create a tar file of the -required image, `scp` the tar file to each node, and then use `docker load` to load the image from the copied tar file -on the nodes). Alternatively, if a private Docker registry is used, transfer the images there. - -##### 4. Prerequisites for the deployment - - * Network File System (NFS) is used as the persistent volume for API Manager servers. Therefore setting up NFS is required to deploy any pattern. - Complete the following. - - 1. Update the NFS server IP in `KUBERNETES_HOME/pattern-X/artifacts/volumes/persistent-volumes.yaml' - 2. Create required directories in NFS server for each pattern as mentioned in `KUBERNETES_HOME/pattern-X/artifacts/volumes/persistent-volumes.yaml` - eg: For pattern-1, create directories as '/exports/pattern-1/apim' - - * It is recommend to use a mysql or any database cluster in a production environment. Only 1 mysql container is used with host path mount in these deployments. - - -##### 5. Deploy Kubernetes/Openshift Resources: - -* Deploy on Kubernetes - - 1. Create a namespace called wso2. - ``` - kubectl create namespace wso2 - ``` - 2. Create a service account called wso2svcacct in wso2 namespace. - ``` - kubectl create serviceaccount wso2svcacct -n wso2 - ``` - 3. Deploy any pattern by running `deploy-kubernetes.sh` script inside pattern folder (KUBERNETES_HOME/pattern-X/). - ``` - ./deploy-kubernetes.sh - ``` - 4. Access Management Console - Using the following command to list ingresses in the deployment. - ``` - kubectl get ingress - ``` - Add relevant hosts and IP addresses to /etc/hosts file. - - > Sample Access URLs (This will vary based on the pattern) - > https://wso2apim - > https://wso2apim-analytics - > https://wso2apim-gw - - 5. Undeploy any pattern by running `undeploy-kubernetes.sh` script inside pattern folder (KUBERNETES_HOME/pattern-X/). - ``` - ./undeploy-kubernetes.sh - ``` - -* Deploy on Openshift - - 1. Create a user called admin and assign the cluster-admin role. (Cluster-admin user is used to deploy openshift artifacts) - ``` - oc login -u system:admin - oc create user admin --full-name=admin - oc adm policy add-cluster-role-to-user cluster-admin admin - ``` - 2. Create a new project called wso2. - ``` - oc new-project wso2 --description="WSO2 API Manager 2.1.0" --display-name="wso2" - ``` - - 3. Create a service account called wso2svcacct in wso2 project and assign anyuid security context constraint. - ``` - oc create serviceaccount wso2svcacct - oc adm policy add-scc-to-user anyuid -z wso2svcacct -n wso2 - ``` - 4. Deploy any pattern by running `deploy-openshift.sh` script inside pattern folder (KUBERNETES_HOME/pattern-X/). - ``` - ./deploy-openshift.sh - ``` - 5. Access Management Console - Using the following command to list the routes in the deployment. - ``` - oc get routes - ``` - Add relevant hosts and IP addresses to /etc/hosts file. - - > Sample Access URLs (This will vary based on the pattern) - > https://wso2apim - > https://wso2apim-analytics - > https://wso2apim-gw - - 6. Undeploy any pattern by running `undeploy-openshift.sh` script inside pattern folder (KUBERNETES_HOME/pattern-X/). - ``` - ./undeploy-openshift.sh - ``` - -##### 6. How to customize for a deployment - -* Configurations are bind with wso2 namespace. If you are changing the hostnames or the namespace, do the following. - 1. Change wso2.svc to `.svc` in all the configuration files. - 2. Update the KUBERNETES_NAMESPACE parameter with the correct namespace in all the axis2.xml files. - 3. Update docker base images. - - Use a CA signed certificate and update client-truststore.jks and wso2carbon.jks files - -
- -> Tested in OpenShift v3.6.0 and Kubernetes v1.6.1 - -> NFS is tested in Kubernetes v1.6.1 \ No newline at end of file +* [WSO2 API Manager pattern 2](pattern-2) diff --git a/base/README.md b/base/README.md deleted file mode 100644 index 9c433e85..00000000 --- a/base/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# Building the docker images - -##### 1. Download the relevant files - -For analytics - -- wso2am-analytics-2.1.0.zip -- jdk-8u*-linux-x64.tar.gz (Any JDK 8u* version) -- dnsjava-2.1.8.jar (http://www.dnsjava.org/) -- [`kubernetes-membership-scheme-1.0.1.jar`](https://github.com/wso2/kubernetes-common/releases/tag/v1.0.1) -- mysql-connector-java-5*-bin.jar (Any mysql connector 5* version) - - -Add the above files to analytics/files location. - -For apim - -- wso2am-2.1.0.zip -- jdk-8u*-linux-x64.tar.gz (Any JDK 8u* version) -- dnsjava-2.1.8.jar (http://www.dnsjava.org/) -- [`kubernetes-membership-scheme-1.0.1.jar`](https://github.com/wso2/kubernetes-common/releases/tag/v1.0.1) -- mysql-connector-java-5*-bin.jar (Any mysql connector 5* version) - -Add the above files to apim/files location. - -For is_as_km_prepacked - -- wso2is-km-2=5.3.0.zip -- jdk-8u*-linux-x64.tar.gz (Any JDK 8u* version) -- dnsjava-2.1.8.jar (http://www.dnsjava.org/) -- [`kubernetes-membership-scheme-1.0.1.jar`](https://github.com/wso2/kubernetes-common/releases/tag/v1.0.1) -- mysql-connector-java-5*-bin.jar (Any mysql connector 5* version) - -Add the above files to is_as_km_prepacked/files location. - -> mysql docker image does not need any files. - -##### 2. Build docker images - -Run build.sh -``` -./build.sh -``` \ No newline at end of file diff --git a/base/analytics/Dockerfile b/base/analytics/Dockerfile deleted file mode 100755 index a27018c7..00000000 --- a/base/analytics/Dockerfile +++ /dev/null @@ -1,100 +0,0 @@ -# ------------------------------------------------------------------------ -# -# Copyright 2017 WSO2, Inc. (http://wso2.com) -# -# Licensed 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 -# -# ------------------------------------------------------------------------ - -FROM ubuntu:16.04 -MAINTAINER WSO2 Docker Maintainers "dev@wso2.org" -ENV DEBIAN_FRONTEND noninteractive - -# defined arguments and defaults -ARG USER=wso2user -ARG USER_ID=1000000000 -# files -ARG FILES=./files -ARG USER_HOME=/home/${USER} -ARG WSO2_SERVER=wso2am-analytics -ARG WSO2_SERVER_VERSION=2.1.0 -ARG WSO2_SERVER_PACK=${WSO2_SERVER}-${WSO2_SERVER_VERSION}.zip -ARG JDK_ARCHIVE=jdk-8u*-linux-x64.tar.gz -ARG JAVA_HOME=${USER_HOME}/java -ARG STARTUP_SCRIPT=init_carbon.sh -ARG JDBC_DRIVER=mysql-connector-java-5*-bin.jar -ARG DNS_JAVA=dnsjava-2.1.8.jar -ARG KUBERNETES_MEMBERSHIP_SCHEME=kubernetes-membership-scheme-1.0.*.jar -ARG CLIENT_TRUSTSTORE=client-truststore.jks -ARG WSO2CARBON_JKS=wso2carbon.jks - -RUN apt-get update \ - && apt-get install -y --no-install-recommends --no-install-suggests \ - zip \ - unzip \ - telnet \ - iproute2 \ - sudo && rm -rf /var/lib/apt/lists/* - -RUN useradd --system --uid ${USER_ID} --gid 0 --create-home --home-dir ${USER_HOME} \ - --no-log-init ${USER} - -# copy the jdk and product packs -COPY ${FILES}/${WSO2_SERVER_PACK} ${STARTUP_SCRIPT} ${FILES}/${JDK_ARCHIVE} ${FILES}/${JDBC_DRIVER} \ - ${FILES}/${DNS_JAVA} ${FILES}/${KUBERNETES_MEMBERSHIP_SCHEME} ${FILES}/${CLIENT_TRUSTSTORE} \ - ${FILES}/${WSO2CARBON_JKS} sudoers change_ownership.sh ${USER_HOME}/ - -# and creates the init script -RUN unzip -q ${USER_HOME}/${WSO2_SERVER_PACK} -d ${USER_HOME}/ \ - && mkdir -p ${JAVA_HOME} \ - && tar -xf ${USER_HOME}/${JDK_ARCHIVE} -C ${JAVA_HOME} --strip-components=1 \ - && mkdir -p ${USER_HOME}/tmp \ - && cp ${USER_HOME}/${JDBC_DRIVER} ${USER_HOME}/${DNS_JAVA} \ - ${USER_HOME}/${WSO2_SERVER}-${WSO2_SERVER_VERSION}/repository/components/lib/ \ - && cp ${USER_HOME}/${KUBERNETES_MEMBERSHIP_SCHEME} \ - ${USER_HOME}/${WSO2_SERVER}-${WSO2_SERVER_VERSION}/repository/components/dropins/ \ - && cp ${USER_HOME}/${CLIENT_TRUSTSTORE} \ - ${USER_HOME}/${WSO2_SERVER}-${WSO2_SERVER_VERSION}/repository/resources/security/ \ - && cp ${USER_HOME}/${WSO2CARBON_JKS} \ - ${USER_HOME}/${WSO2_SERVER}-${WSO2_SERVER_VERSION}/repository/resources/security/ \ - && cp -r ${USER_HOME}/${WSO2_SERVER}-${WSO2_SERVER_VERSION}/repository/deployment/server ${USER_HOME}/tmp/ \ - && rm ${USER_HOME}/${WSO2_SERVER_PACK} \ - && rm ${USER_HOME}/${JDK_ARCHIVE} \ - && mkdir -p ${USER_HOME}/scripts/ \ - && cat ${USER_HOME}/${STARTUP_SCRIPT} > ${USER_HOME}/scripts/${STARTUP_SCRIPT} \ - && rm ${USER_HOME}/${STARTUP_SCRIPT} \ - && rm ${USER_HOME}/${JDBC_DRIVER} \ - && rm ${USER_HOME}/${DNS_JAVA} \ - && rm ${USER_HOME}/${KUBERNETES_MEMBERSHIP_SCHEME} \ - && rm ${USER_HOME}/${CLIENT_TRUSTSTORE} \ - && rm ${USER_HOME}/${WSO2CARBON_JKS} \ - && chgrp -R 0 ${USER_HOME} \ - && chmod -R g=u ${USER_HOME} \ - && chown -R ${USER_ID} ${USER_HOME} \ - && chmod -R 0774 ${USER_HOME} \ - && cat ${USER_HOME}/sudoers > /etc/sudoers \ - && rm ${USER_HOME}/sudoers \ - && cat ${USER_HOME}/change_ownership.sh > /bin/change_ownership.sh \ - && chmod 0755 /bin/change_ownership.sh - -USER ${USER_ID} -WORKDIR ${USER_HOME} - -# set java home and path variables -ENV HOME=${USER_HOME} JAVA_HOME=${JAVA_HOME} PATH=$JAVA_HOME/bin:$PATH USER_HOME=${USER_HOME} \ - WSO2_SERVER=${WSO2_SERVER} WSO2_SERVER_VERSION=${WSO2_SERVER_VERSION} - -# expose ports -EXPOSE 9764 9444 7712 7612 11225 10006 11001 11501 8082 4041 18081 12501 13001 13501 14001 14501 7078 6067 12000-12005 - -ENTRYPOINT exec ${USER_HOME}/scripts/init_carbon.sh diff --git a/base/analytics/change_ownership.sh b/base/analytics/change_ownership.sh deleted file mode 100644 index 069e6d38..00000000 --- a/base/analytics/change_ownership.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -# ------------------------------------------------------------------------ -# Copyright 2017 WSO2, Inc. (http://wso2.com) -# -# Licensed 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 -# ------------------------------------------------------------------------ - -set -e - -echo 'going to change ownership of /repository/data directory: ' -echo "user: ${USER}" -echo "user home: ${USER_HOME}" -echo "carbon server: ${WSO2_SERVER}-${WSO2_SERVER_VERSION}" - -/bin/chown -R ${USER} ${USER_HOME}/${WSO2_SERVER}-${WSO2_SERVER_VERSION}/repository/data -/bin/chgrp -R root ${USER_HOME}/${WSO2_SERVER}-${WSO2_SERVER_VERSION}/repository/data diff --git a/base/analytics/files/.gitkeep b/base/analytics/files/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/base/analytics/files/client-truststore.jks b/base/analytics/files/client-truststore.jks deleted file mode 100644 index 4cfec16a..00000000 Binary files a/base/analytics/files/client-truststore.jks and /dev/null differ diff --git a/base/analytics/files/wso2carbon.jks b/base/analytics/files/wso2carbon.jks deleted file mode 100644 index 203a46c0..00000000 Binary files a/base/analytics/files/wso2carbon.jks and /dev/null differ diff --git a/base/analytics/init_carbon.sh b/base/analytics/init_carbon.sh deleted file mode 100644 index 0946704e..00000000 --- a/base/analytics/init_carbon.sh +++ /dev/null @@ -1,133 +0,0 @@ -#!/bin/bash - -# ------------------------------------------------------------------------ -# Copyright 2017 WSO2, Inc. (http://wso2.com) -# -# Licensed 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 -# ------------------------------------------------------------------------ - -set -e -# The artifacts will be copied to the CARBON_HOME/repository/deployment/server location before the server is started. -carbon_home=${HOME}/${WSO2_SERVER}-${WSO2_SERVER_VERSION} -server_artifact_location=${carbon_home}/repository/deployment/server - -# change the user of repository/deployment/server to wso2user. -# this is done to avoid permission issues arising with volume mounts -# 24th May 18 - Removing this since the chown command fails with permission issues in some cases. -# Now, NFS server remote location is expected to have the same user (wso2user) -# and group 0 as the owner. -# sudo /bin/change_ownership.sh - -if [[ -d ${HOME}/tmp/server/ ]]; then - if [[ ! "$(ls -A ${server_artifact_location}/)" ]]; then - # There are no artifacts under CARBON_HOME/repository/deployment/server/; copy them. - echo "copying artifacts from ${HOME}/tmp/server/ to ${server_artifact_location}/ .." - cp -rf ${HOME}/tmp/server/* ${server_artifact_location}/ - fi - rm -rf ${HOME}/tmp/server/ -fi -if [[ -d ${HOME}/tmp/carbon/ ]]; then - echo "copying custom configurations and artifacts from ${HOME}/tmp/carbon/ to ${carbon_home}/ .." - cp -rf ${HOME}/tmp/carbon/* ${carbon_home}/ - rm -rf ${HOME}/tmp/carbon/ -fi - -# Copy ConfigMaps -# Mount any ConfigMap to ${carbon_home}-conf location -if [ -e ${carbon_home}-conf/bin/* ] - then cp ${carbon_home}-conf/bin/* ${carbon_home}/bin/ -fi - -if [ -e ${carbon_home}-conf/resources-security ] - then cp ${carbon_home}-conf/resources-security/* ${carbon_home}/repository/resources/security/ -fi - -if [ -e ${carbon_home}-conf/conf ] - then cp ${carbon_home}-conf/conf/* ${carbon_home}/repository/conf/ -fi - -if [ -e ${carbon_home}-conf/conf-axis2 ] - then cp ${carbon_home}-conf/conf-axis2/* ${carbon_home}/repository/conf/axis2/ -fi - -if [ -e ${carbon_home}-conf/conf-datasources ] - then cp ${carbon_home}-conf/conf-datasources/* ${carbon_home}/repository/conf/datasources/ -fi - -if [ -e ${carbon_home}-conf/conf-identity ] - then cp ${carbon_home}-conf/conf-identity/* ${carbon_home}/repository/conf/identity/ -fi - -if [ -e ${carbon_home}-conf/conf-tomcat ] - then cp ${carbon_home}-conf/conf-tomcat/* ${carbon_home}/repository/conf/tomcat/ -fi - -if [ -e ${carbon_home}-conf/conf-data-bridge ] - then cp ${carbon_home}-conf/conf-data-bridge/* ${carbon_home}/repository/conf/data-bridge/ -fi - -if [ -e ${carbon_home}-conf/conf-email ] - then cp ${carbon_home}-conf/conf-email/* ${carbon_home}/repository/conf/email/ -fi - -if [ -e ${carbon_home}-conf/conf-etc ] - then cp ${carbon_home}-conf/conf-etc/* ${carbon_home}/repository/conf/etc/ -fi - -if [ -e ${carbon_home}-conf/conf-multitenancy ] - then cp ${carbon_home}-conf/conf-multitenancy/* ${carbon_home}/repository/conf/multitenancy/ -fi - -if [ -e ${carbon_home}-conf/conf-security ] - then cp ${carbon_home}-conf/conf-security/* ${carbon_home}/repository/conf/security/ -fi - -if [ -e ${carbon_home}-conf/conf-analytics ] - then cp ${carbon_home}-conf/conf-analytics/* ${carbon_home}/repository/conf/analytics/ -fi - -if [ -e ${carbon_home}-conf/conf-analytics-spark ] - then cp ${carbon_home}-conf/conf-analytics-spark/* ${carbon_home}/repository/conf/analytics/spark/ -fi - -if [ -e ${carbon_home}-conf/conf-cep ] - then cp ${carbon_home}-conf/conf-cep/* ${carbon_home}/repository/conf/cep/ -fi - -if [ -e ${carbon_home}-conf/conf-cep-domain-template ] - then cp ${carbon_home}-conf/conf-cep-domain-template/* ${carbon_home}/repository/conf/cep/domain-template/ -fi - -if [ -e ${carbon_home}-conf/conf-cep-storm ] - then cp ${carbon_home}-conf/conf-cep-storm/* ${carbon_home}/repository/conf/cep/storm/ -fi - -if [ -e ${carbon_home}-conf/conf-template-manager ] - then cp ${carbon_home}-conf/conf-template-manager/* ${carbon_home}/repository/conf/template-manager/domain-template/ -fi - -# overwrite localMemberHost element value in axis2.xml with container ip -export local_docker_ip=$(ip route get 1 | awk '{print $NF;exit}') -export SPARK_LOCAL_IP=$local_docker_ip -axi2_xml_location=${carbon_home}/repository/conf/axis2/axis2.xml -if [[ ! -z ${local_docker_ip} ]]; then - sed -i "s#${local_docker_ip}<\/parameter>#" "${axi2_xml_location}" - if [[ $? == 0 ]]; then - echo "Successfully updated localMemberHost with ${local_docker_ip}" - else - echo "Error occurred while updating localMemberHost with ${local_docker_ip}" - fi -fi - -# Start the carbon server. -${HOME}/${WSO2_SERVER}-${WSO2_SERVER_VERSION}/bin/wso2server.sh diff --git a/base/analytics/sudoers b/base/analytics/sudoers deleted file mode 100644 index 92165b9d..00000000 --- a/base/analytics/sudoers +++ /dev/null @@ -1,50 +0,0 @@ -# ------------------------------------------------------------------------ -# Copyright 2017 WSO2, Inc. (http://wso2.com) -# -# Licensed 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 -# ------------------------------------------------------------------------ -# -# This file MUST be edited with the 'visudo' command as root. -# -# Please consider adding local content in /etc/sudoers.d/ instead of -# directly modifying this file. -# -# See the man page for details on how to write a sudoers file. -# -#Defaults env_reset -Defaults env_keep += "USER_HOME" -Defaults env_keep += "USER" -Defaults env_keep += "WSO2_SERVER_VERSION" -Defaults env_keep += "WSO2_SERVER" -Defaults mail_badpass -Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" - -# Host alias specification - -# User alias specification - -# Cmnd alias specification - -# User privilege specification -#root ALL=(ALL:ALL) ALL - -# Members of the admin group may gain root privileges -#%admin ALL=(ALL) ALL - -# Allow members of group sudo to execute any command -#%sudo ALL=(ALL:ALL) ALL - -# See sudoers(5) for more information on "#include" directives: - -#includedir /etc/sudoers.d -ALL ALL=(root) NOPASSWD: /bin/change_ownership.sh diff --git a/base/apim/Dockerfile b/base/apim/Dockerfile deleted file mode 100755 index 8b4d31ef..00000000 --- a/base/apim/Dockerfile +++ /dev/null @@ -1,103 +0,0 @@ -# ------------------------------------------------------------------------ -# -# Copyright 2017 WSO2, Inc. (http://wso2.com) -# -# Licensed 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 -# -# ------------------------------------------------------------------------ - -FROM ubuntu:16.04 -MAINTAINER WSO2 Docker Maintainers "dev@wso2.org" -ENV DEBIAN_FRONTEND noninteractive - -# defined arguments and defaults -ARG USER=wso2user -ARG USER_ID=1000000000 -# files -ARG FILES=./files -ARG USER_HOME=/home/wso2user -ARG WSO2_SERVER=wso2am -ARG WSO2_SERVER_VERSION=2.1.0 -ARG WSO2_SERVER_PACK=${WSO2_SERVER}-${WSO2_SERVER_VERSION}.zip -ARG JDK_ARCHIVE=jdk-8u*-linux-x64.tar.gz -ARG JAVA_HOME=${USER_HOME}/java -ARG STARTUP_SCRIPT=init_carbon.sh -ARG JDBC_DRIVER=mysql-connector-java-5*-bin.jar -ARG DNS_JAVA=dnsjava-2.1.8.jar -ARG KUBERNETES_MEMBERSHIP_SCHEME=kubernetes-membership-scheme-1.0.*.jar -ARG CLIENT_TRUSTSTORE=client-truststore.jks -ARG WSO2CARBON_JKS=wso2carbon.jks - -RUN apt-get update \ - && apt-get install -y --no-install-recommends --no-install-suggests \ - zip \ - unzip \ - telnet \ - iproute2 \ - sudo && rm -rf /var/lib/apt/lists/* - -# creates the user -RUN useradd --system --uid ${USER_ID} --gid 0 --create-home --home-dir ${USER_HOME} \ - --no-log-init ${USER} - -# copy the jdk and product packs -COPY ${FILES}/${WSO2_SERVER_PACK} ${STARTUP_SCRIPT} ${FILES}/${JDK_ARCHIVE} ${FILES}/${JDBC_DRIVER} \ - ${FILES}/${DNS_JAVA} ${FILES}/${KUBERNETES_MEMBERSHIP_SCHEME} ${FILES}/${CLIENT_TRUSTSTORE} \ - ${FILES}/${WSO2CARBON_JKS} sudoers change_ownership.sh ${USER_HOME}/ - -# and creates the init script -RUN unzip -q ${USER_HOME}/${WSO2_SERVER_PACK} -d ${USER_HOME}/ \ - && mkdir -p ${JAVA_HOME} \ - && tar -xf ${USER_HOME}/${JDK_ARCHIVE} -C ${JAVA_HOME} --strip-components=1 \ - && mkdir -p ${USER_HOME}/tmp \ - && cp ${USER_HOME}/${JDBC_DRIVER} ${USER_HOME}/${DNS_JAVA} \ - ${USER_HOME}/${WSO2_SERVER}-${WSO2_SERVER_VERSION}/repository/components/lib/ \ - && cp ${USER_HOME}/${KUBERNETES_MEMBERSHIP_SCHEME} \ - ${USER_HOME}/${WSO2_SERVER}-${WSO2_SERVER_VERSION}/repository/components/dropins/ \ - && cp ${USER_HOME}/${CLIENT_TRUSTSTORE} \ - ${USER_HOME}/${WSO2_SERVER}-${WSO2_SERVER_VERSION}/repository/resources/security/ \ - && cp ${USER_HOME}/${WSO2CARBON_JKS} \ - ${USER_HOME}/${WSO2_SERVER}-${WSO2_SERVER_VERSION}/repository/resources/security/ \ - && cp -r ${USER_HOME}/${WSO2_SERVER}-${WSO2_SERVER_VERSION}/repository/deployment/server ${USER_HOME}/tmp/ \ - && rm ${USER_HOME}/${WSO2_SERVER_PACK} \ - && rm ${USER_HOME}/${JDK_ARCHIVE} \ - && rm ${USER_HOME}/${JDBC_DRIVER} \ - && rm ${USER_HOME}/${DNS_JAVA} \ - && rm ${USER_HOME}/${KUBERNETES_MEMBERSHIP_SCHEME} \ - && rm ${USER_HOME}/${CLIENT_TRUSTSTORE} \ - && rm ${USER_HOME}/${WSO2CARBON_JKS} \ - && mkdir -p ${USER_HOME}/scripts/ \ - && cat ${USER_HOME}/${STARTUP_SCRIPT} > ${USER_HOME}/scripts/${STARTUP_SCRIPT} \ - && rm ${USER_HOME}/${STARTUP_SCRIPT} \ - && cat ${USER_HOME}/sudoers > /etc/sudoers \ - && rm ${USER_HOME}/sudoers \ - && cat ${USER_HOME}/change_ownership.sh > /bin/change_ownership.sh \ - && chmod 0755 /bin/change_ownership.sh \ - && rm ${USER_HOME}/change_ownership.sh \ - && chgrp -R 0 ${USER_HOME} \ - && chmod -R g=u ${USER_HOME} \ - && chown -R ${USER_ID} ${USER_HOME} \ - && chmod -R 0774 ${USER_HOME} - -# set the user, work directory and home -USER ${USER_ID} -WORKDIR ${USER_HOME} - -# set java home and path variables -ENV HOME=${USER_HOME} JAVA_HOME=${JAVA_HOME} PATH=$JAVA_HOME/bin:$PATH USER_HOME=${USER_HOME} \ - WSO2_SERVER=${WSO2_SERVER} WSO2_SERVER_VERSION=${WSO2_SERVER_VERSION} USER=${USER} - -# expose ports -EXPOSE 8280 8243 9763 9443 5672 9711 9611 7711 7611 - -ENTRYPOINT exec ${USER_HOME}/scripts/init_carbon.sh diff --git a/base/apim/change_ownership.sh b/base/apim/change_ownership.sh deleted file mode 100755 index c22f94db..00000000 --- a/base/apim/change_ownership.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -# ------------------------------------------------------------------------ -# Copyright 2017 WSO2, Inc. (http://wso2.com) -# -# Licensed 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 -# ------------------------------------------------------------------------ - -set -e - -echo 'going to change ownership of /repository/deployment/server/ directory: ' -echo "user: ${USER}" -echo "user home: ${USER_HOME}" -echo "carbon server: ${WSO2_SERVER}-${WSO2_SERVER_VERSION}" - -/bin/chown -R ${USER} ${USER_HOME}/${WSO2_SERVER}-${WSO2_SERVER_VERSION}/repository/deployment/server/ -/bin/chgrp -R root ${USER_HOME}/${WSO2_SERVER}-${WSO2_SERVER_VERSION}/repository/deployment/server/ diff --git a/base/apim/files/.gitkeep b/base/apim/files/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/base/apim/files/client-truststore.jks b/base/apim/files/client-truststore.jks deleted file mode 100644 index 7be7c085..00000000 Binary files a/base/apim/files/client-truststore.jks and /dev/null differ diff --git a/base/apim/files/wso2carbon.jks b/base/apim/files/wso2carbon.jks deleted file mode 100644 index 203a46c0..00000000 Binary files a/base/apim/files/wso2carbon.jks and /dev/null differ diff --git a/base/apim/init_carbon.sh b/base/apim/init_carbon.sh deleted file mode 100755 index 07e1fd80..00000000 --- a/base/apim/init_carbon.sh +++ /dev/null @@ -1,120 +0,0 @@ -#!/bin/bash - -# ------------------------------------------------------------------------ -# Copyright 2017 WSO2, Inc. (http://wso2.com) -# -# Licensed 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 -# ------------------------------------------------------------------------ - -set -e -carbon_home=${HOME}/${WSO2_SERVER}-${WSO2_SERVER_VERSION} -server_artifact_location=${carbon_home}/repository/deployment/server - -# change the user of repository/deployment/server to wso2user. -# this is done to avoid permission issues arising with volume mounts -# 24th May 18 - Removing this since the chown command fails with permission issues in some cases. -# Now, NFS server remote location is expected to have the same user (wso2user) -# and group 0 as the owner. -# sudo /bin/change_ownership.sh - -# Copy the backed up artifacts from ${HOME}/tmp/server/. Copying the initial artifacts to ${HOME}/tmp/server/ is done in the -# Dockerfile. This is to preserve the initial artifacts in a volume mount (the mounted directory can be empty initially). -# The artifacts will be copied to the CARBON_HOME/repository/deployment/server location before the server is started. -if [[ -d ${HOME}/tmp/server/ ]]; then - if [[ ! "$(ls -A ${server_artifact_location}/)" ]]; then - # There are no artifacts under CARBON_HOME/repository/deployment/server/; copy them. - echo "copying artifacts from ${HOME}/tmp/server/ to ${server_artifact_location}/ .." - cp -rf ${HOME}/tmp/server/* ${server_artifact_location}/ - fi - rm -rf ${HOME}/tmp/server/ -fi - -# Copy customizations done by user do the CARBON_HOME location. -if [[ -d ${HOME}/tmp/carbon/ ]]; then - echo "copying custom configurations and artifacts from ${HOME}/tmp/carbon/ to ${carbon_home}/ .." - cp -rf ${HOME}/tmp/carbon/* ${carbon_home}/ - rm -rf ${HOME}/tmp/carbon/ -fi - -# Copy ConfigMaps -# Mount any ConfigMap to ${carbon_home}-conf location -if [ -e ${carbon_home}-conf/bin/* ] - then cp ${carbon_home}-conf/bin/* ${carbon_home}/bin/ -fi - -if [ -e ${carbon_home}-conf/resources-security ] - then cp ${carbon_home}-conf/resources-security/* ${carbon_home}/repository/resources/security/ -fi - -if [ -e ${carbon_home}-conf/conf ] - then cp ${carbon_home}-conf/conf/* ${carbon_home}/repository/conf/ -fi - -if [ -e ${carbon_home}-conf/conf-axis2 ] - then cp ${carbon_home}-conf/conf-axis2/* ${carbon_home}/repository/conf/axis2/ -fi - -if [ -e ${carbon_home}-conf/conf-datasources ] - then cp ${carbon_home}-conf/conf-datasources/* ${carbon_home}/repository/conf/datasources/ -fi - -if [ -e ${carbon_home}-conf/conf-identity ] - then cp ${carbon_home}-conf/conf-identity/* ${carbon_home}/repository/conf/identity/ -fi - -if [ -e ${carbon_home}-conf/conf-identity-identity-providers ] - then cp ${carbon_home}-conf/conf-identity-identity-providers/* ${carbon_home}/repository/conf/identity/identity-providers/ -fi - -if [ -e ${carbon_home}-conf/conf-identity-service-providers ] - then cp ${carbon_home}-conf/conf-identity-service-providers/* ${carbon_home}/repository/conf/identity/service-providers/ -fi - -if [ -e ${carbon_home}-conf/conf-tomcat ] - then cp ${carbon_home}-conf/conf-tomcat/* ${carbon_home}/repository/conf/tomcat/ -fi - -if [ -e ${carbon_home}-conf/conf-data-bridge ] - then cp ${carbon_home}-conf/conf-data-bridge/* ${carbon_home}/repository/conf/data-bridge/ -fi - -if [ -e ${carbon_home}-conf/conf-email ] - then cp ${carbon_home}-conf/conf-email/* ${carbon_home}/repository/conf/email/ -fi - -if [ -e ${carbon_home}-conf/conf-etc ] - then cp ${carbon_home}-conf/conf-etc/* ${carbon_home}/repository/conf/etc/ -fi - -if [ -e ${carbon_home}-conf/conf-multitenancy ] - then cp ${carbon_home}-conf/conf-multitenancy/* ${carbon_home}/repository/conf/multitenancy/ -fi - -if [ -e ${carbon_home}-conf/conf-security ] - then cp ${carbon_home}-conf/conf-security/* ${carbon_home}/repository/conf/security/ -fi - -# overwrite localMemberHost element value in axis2.xml with container ip -export local_docker_ip=$(ip route get 1 | awk '{print $NF;exit}') -axi2_xml_location=${carbon_home}/repository/conf/axis2/axis2.xml -if [[ ! -z ${local_docker_ip} ]]; then - sed -i "s#${local_docker_ip}<\/parameter>#" "${axi2_xml_location}" - if [[ $? == 0 ]]; then - echo "Successfully updated localMemberHost with ${local_docker_ip}" - else - echo "Error occurred while updating localMemberHost with ${local_docker_ip}" - fi -fi - -# Start the carbon server. -${carbon_home}/bin/wso2server.sh diff --git a/base/apim/sudoers b/base/apim/sudoers deleted file mode 100755 index 92165b9d..00000000 --- a/base/apim/sudoers +++ /dev/null @@ -1,50 +0,0 @@ -# ------------------------------------------------------------------------ -# Copyright 2017 WSO2, Inc. (http://wso2.com) -# -# Licensed 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 -# ------------------------------------------------------------------------ -# -# This file MUST be edited with the 'visudo' command as root. -# -# Please consider adding local content in /etc/sudoers.d/ instead of -# directly modifying this file. -# -# See the man page for details on how to write a sudoers file. -# -#Defaults env_reset -Defaults env_keep += "USER_HOME" -Defaults env_keep += "USER" -Defaults env_keep += "WSO2_SERVER_VERSION" -Defaults env_keep += "WSO2_SERVER" -Defaults mail_badpass -Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" - -# Host alias specification - -# User alias specification - -# Cmnd alias specification - -# User privilege specification -#root ALL=(ALL:ALL) ALL - -# Members of the admin group may gain root privileges -#%admin ALL=(ALL) ALL - -# Allow members of group sudo to execute any command -#%sudo ALL=(ALL:ALL) ALL - -# See sudoers(5) for more information on "#include" directives: - -#includedir /etc/sudoers.d -ALL ALL=(root) NOPASSWD: /bin/change_ownership.sh diff --git a/base/build.sh b/base/build.sh deleted file mode 100755 index 226a0468..00000000 --- a/base/build.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash - -# ------------------------------------------------------------------------ -# Copyright 2017 WSO2, Inc. (http://wso2.com) -# -# Licensed 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 -# ------------------------------------------------------------------------ - -# builds the base images - apim, analytics - -set -e - -this_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) -analytics_dir=$(cd "${this_dir}/analytics"; pwd) -apim_dir=$(cd "${this_dir}/apim"; pwd) -mysql_dir=$(cd "${this_dir}/mysql"; pwd) -is_as_km_prepacked_dir=$(cd "${this_dir}/is_as_km_prepacked"; pwd) - -function docker_build() { - tag=$1 - path=$2 - docker_api_version=`docker version | grep -m2 "API version" | tail -n1 | cut -d' ' -f5 | bc -l` - echo "Building Docker image ${tag}..." - if (( $(echo ${docker_api_version} '>=' 1.25 | bc -l) )); then - docker build -t ${tag} ${path} --squash - else - echo "Docker API version is ${docker_api_version}, ignoring --squash option" - docker build -t ${tag} ${path} - fi -} - -docker_build docker.wso2.com/wso2am-kubernetes:2.1.0 $apim_dir -docker_build docker.wso2.com/wso2am-analytics-kubernetes:2.1.0 $analytics_dir -docker_build docker.wso2.com/apim-rdbms-kubernetes:2.1.0 $mysql_dir -docker_build docker.wso2.com/wso2apim-is-as-km-kubernetes:5.3.0 $is_as_km_prepacked_dir \ No newline at end of file diff --git a/base/is_as_km_prepacked/Dockerfile b/base/is_as_km_prepacked/Dockerfile deleted file mode 100755 index d103f9fd..00000000 --- a/base/is_as_km_prepacked/Dockerfile +++ /dev/null @@ -1,103 +0,0 @@ -# ------------------------------------------------------------------------ -# -# Copyright 2017 WSO2, Inc. (http://wso2.com) -# -# Licensed 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 -# -# ------------------------------------------------------------------------ - -FROM ubuntu:16.04 -MAINTAINER WSO2 Docker Maintainers "dev@wso2.org" -ENV DEBIAN_FRONTEND noninteractive - -# defined arguments and defaults -ARG USER=wso2user -ARG USER_ID=1000000000 -# files -ARG FILES=./files -ARG USER_HOME=/home/wso2user -ARG WSO2_SERVER=wso2is-km -ARG WSO2_SERVER_VERSION=5.3.0 -ARG WSO2_SERVER_PACK=${WSO2_SERVER}-${WSO2_SERVER_VERSION}.zip -ARG JDK_ARCHIVE=jdk-8u*-linux-x64.tar.gz -ARG JAVA_HOME=${USER_HOME}/java -ARG STARTUP_SCRIPT=init_carbon.sh -ARG JDBC_DRIVER=mysql-connector-java-5*-bin.jar -ARG DNS_JAVA=dnsjava-2.1.8.jar -ARG KUBERNETES_MEMBERSHIP_SCHEME=kubernetes-membership-scheme-1.0.*.jar -ARG CLIENT_TRUSTSTORE=client-truststore.jks -ARG WSO2CARBON_JKS=wso2carbon.jks - -RUN apt-get update \ - && apt-get install -y --no-install-recommends --no-install-suggests \ - zip \ - unzip \ - telnet \ - iproute2 \ - sudo && rm -rf /var/lib/apt/lists/* - -# creates the user -RUN useradd --system --uid ${USER_ID} --gid 0 --create-home --home-dir ${USER_HOME} \ - --no-log-init ${USER} - -# copy the jdk and product packs -COPY ${FILES}/${WSO2_SERVER_PACK} ${STARTUP_SCRIPT} ${FILES}/${JDK_ARCHIVE} ${FILES}/${JDBC_DRIVER} \ - ${FILES}/${DNS_JAVA} ${FILES}/${KUBERNETES_MEMBERSHIP_SCHEME} ${FILES}/${CLIENT_TRUSTSTORE} \ - ${FILES}/${WSO2CARBON_JKS} sudoers change_ownership.sh ${USER_HOME}/ - -# and creates the init script -RUN unzip -q ${USER_HOME}/${WSO2_SERVER_PACK} -d ${USER_HOME}/ \ - && mkdir -p ${JAVA_HOME} \ - && tar -xf ${USER_HOME}/${JDK_ARCHIVE} -C ${JAVA_HOME} --strip-components=1 \ - && mkdir -p ${USER_HOME}/tmp \ - && cp ${USER_HOME}/${JDBC_DRIVER} ${USER_HOME}/${DNS_JAVA} \ - ${USER_HOME}/${WSO2_SERVER}-${WSO2_SERVER_VERSION}/repository/components/lib/ \ - && cp ${USER_HOME}/${KUBERNETES_MEMBERSHIP_SCHEME} \ - ${USER_HOME}/${WSO2_SERVER}-${WSO2_SERVER_VERSION}/repository/components/dropins/ \ - && cp ${USER_HOME}/${CLIENT_TRUSTSTORE} \ - ${USER_HOME}/${WSO2_SERVER}-${WSO2_SERVER_VERSION}/repository/resources/security/ \ - && cp ${USER_HOME}/${WSO2CARBON_JKS} \ - ${USER_HOME}/${WSO2_SERVER}-${WSO2_SERVER_VERSION}/repository/resources/security/ \ - && cp -r ${USER_HOME}/${WSO2_SERVER}-${WSO2_SERVER_VERSION}/repository/deployment/server ${USER_HOME}/tmp/ \ - && rm ${USER_HOME}/${WSO2_SERVER_PACK} \ - && rm ${USER_HOME}/${JDK_ARCHIVE} \ - && rm ${USER_HOME}/${JDBC_DRIVER} \ - && rm ${USER_HOME}/${DNS_JAVA} \ - && rm ${USER_HOME}/${KUBERNETES_MEMBERSHIP_SCHEME} \ - && rm ${USER_HOME}/${CLIENT_TRUSTSTORE} \ - && rm ${USER_HOME}/${WSO2CARBON_JKS} \ - && mkdir -p ${USER_HOME}/scripts/ \ - && cat ${USER_HOME}/${STARTUP_SCRIPT} > ${USER_HOME}/scripts/${STARTUP_SCRIPT} \ - && rm ${USER_HOME}/${STARTUP_SCRIPT} \ - && cat ${USER_HOME}/sudoers > /etc/sudoers \ - && rm ${USER_HOME}/sudoers \ - && cat ${USER_HOME}/change_ownership.sh > /bin/change_ownership.sh \ - && chmod 0755 /bin/change_ownership.sh \ - && rm ${USER_HOME}/change_ownership.sh \ - && chgrp -R 0 ${USER_HOME} \ - && chmod -R g=u ${USER_HOME} \ - && chown -R ${USER_ID} ${USER_HOME} \ - && chmod -R 0774 ${USER_HOME} - -# set the user, work directory and home -USER ${USER_ID} -WORKDIR ${USER_HOME} - -# set java home and path variables -ENV HOME=${USER_HOME} JAVA_HOME=${JAVA_HOME} PATH=$JAVA_HOME/bin:$PATH USER_HOME=${USER_HOME} \ - WSO2_SERVER=${WSO2_SERVER} WSO2_SERVER_VERSION=${WSO2_SERVER_VERSION} USER=${USER} - -# expose ports -EXPOSE 9763 9443 - -ENTRYPOINT exec ${USER_HOME}/scripts/init_carbon.sh diff --git a/base/is_as_km_prepacked/change_ownership.sh b/base/is_as_km_prepacked/change_ownership.sh deleted file mode 100755 index c22f94db..00000000 --- a/base/is_as_km_prepacked/change_ownership.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -# ------------------------------------------------------------------------ -# Copyright 2017 WSO2, Inc. (http://wso2.com) -# -# Licensed 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 -# ------------------------------------------------------------------------ - -set -e - -echo 'going to change ownership of /repository/deployment/server/ directory: ' -echo "user: ${USER}" -echo "user home: ${USER_HOME}" -echo "carbon server: ${WSO2_SERVER}-${WSO2_SERVER_VERSION}" - -/bin/chown -R ${USER} ${USER_HOME}/${WSO2_SERVER}-${WSO2_SERVER_VERSION}/repository/deployment/server/ -/bin/chgrp -R root ${USER_HOME}/${WSO2_SERVER}-${WSO2_SERVER_VERSION}/repository/deployment/server/ diff --git a/base/is_as_km_prepacked/files/.gitkeep b/base/is_as_km_prepacked/files/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/base/is_as_km_prepacked/files/client-truststore.jks b/base/is_as_km_prepacked/files/client-truststore.jks deleted file mode 100644 index 59c21b5f..00000000 Binary files a/base/is_as_km_prepacked/files/client-truststore.jks and /dev/null differ diff --git a/base/is_as_km_prepacked/files/wso2carbon.jks b/base/is_as_km_prepacked/files/wso2carbon.jks deleted file mode 100644 index 7942c53c..00000000 Binary files a/base/is_as_km_prepacked/files/wso2carbon.jks and /dev/null differ diff --git a/base/is_as_km_prepacked/init_carbon.sh b/base/is_as_km_prepacked/init_carbon.sh deleted file mode 100755 index 1781c8b8..00000000 --- a/base/is_as_km_prepacked/init_carbon.sh +++ /dev/null @@ -1,117 +0,0 @@ -#!/bin/bash - -# ------------------------------------------------------------------------ -# Copyright 2017 WSO2, Inc. (http://wso2.com) -# -# Licensed 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 -# ------------------------------------------------------------------------ - -set -e -carbon_home=${HOME}/${WSO2_SERVER}-${WSO2_SERVER_VERSION} -server_artifact_location=${carbon_home}/repository/deployment/server - -# change the user of repository/deployment/server to wso2user. -# this is done to avoid permission issues arising with volume mounts -sudo /bin/change_ownership.sh - -# Copy the backed up artifacts from ${HOME}/tmp/server/. Copying the initial artifacts to ${HOME}/tmp/server/ is done in the -# Dockerfile. This is to preserve the initial artifacts in a volume mount (the mounted directory can be empty initially). -# The artifacts will be copied to the CARBON_HOME/repository/deployment/server location before the server is started. -if [[ -d ${HOME}/tmp/server/ ]]; then - if [[ ! "$(ls -A ${server_artifact_location}/)" ]]; then - # There are no artifacts under CARBON_HOME/repository/deployment/server/; copy them. - echo "copying artifacts from ${HOME}/tmp/server/ to ${server_artifact_location}/ .." - cp -rf ${HOME}/tmp/server/* ${server_artifact_location}/ - fi - rm -rf ${HOME}/tmp/server/ -fi - -# Copy customizations done by user do the CARBON_HOME location. -if [[ -d ${HOME}/tmp/carbon/ ]]; then - echo "copying custom configurations and artifacts from ${HOME}/tmp/carbon/ to ${carbon_home}/ .." - cp -rf ${HOME}/tmp/carbon/* ${carbon_home}/ - rm -rf ${HOME}/tmp/carbon/ -fi - -# Copy ConfigMaps -# Mount any ConfigMap to ${carbon_home}-conf location -if [ -e ${carbon_home}-conf/bin/* ] - then cp ${carbon_home}-conf/bin/* ${carbon_home}/bin/ -fi - -if [ -e ${carbon_home}-conf/resources-security ] - then cp ${carbon_home}-conf/resources-security/* ${carbon_home}/repository/resources/security/ -fi - -if [ -e ${carbon_home}-conf/conf ] - then cp ${carbon_home}-conf/conf/* ${carbon_home}/repository/conf/ -fi - -if [ -e ${carbon_home}-conf/conf-axis2 ] - then cp ${carbon_home}-conf/conf-axis2/* ${carbon_home}/repository/conf/axis2/ -fi - -if [ -e ${carbon_home}-conf/conf-datasources ] - then cp ${carbon_home}-conf/conf-datasources/* ${carbon_home}/repository/conf/datasources/ -fi - -if [ -e ${carbon_home}-conf/conf-identity ] - then cp ${carbon_home}-conf/conf-identity/* ${carbon_home}/repository/conf/identity/ -fi - -if [ -e ${carbon_home}-conf/conf-identity-identity-providers ] - then cp ${carbon_home}-conf/conf-identity-identity-providers/* ${carbon_home}/repository/conf/identity/identity-providers/ -fi - -if [ -e ${carbon_home}-conf/conf-identity-service-providers ] - then cp ${carbon_home}-conf/conf-identity-service-providers/* ${carbon_home}/repository/conf/identity/service-providers/ -fi - -if [ -e ${carbon_home}-conf/conf-tomcat ] - then cp ${carbon_home}-conf/conf-tomcat/* ${carbon_home}/repository/conf/tomcat/ -fi - -if [ -e ${carbon_home}-conf/conf-data-bridge ] - then cp ${carbon_home}-conf/conf-data-bridge/* ${carbon_home}/repository/conf/data-bridge/ -fi - -if [ -e ${carbon_home}-conf/conf-email ] - then cp ${carbon_home}-conf/conf-email/* ${carbon_home}/repository/conf/email/ -fi - -if [ -e ${carbon_home}-conf/conf-etc ] - then cp ${carbon_home}-conf/conf-etc/* ${carbon_home}/repository/conf/etc/ -fi - -if [ -e ${carbon_home}-conf/conf-multitenancy ] - then cp ${carbon_home}-conf/conf-multitenancy/* ${carbon_home}/repository/conf/multitenancy/ -fi - -if [ -e ${carbon_home}-conf/conf-security ] - then cp ${carbon_home}-conf/conf-security/* ${carbon_home}/repository/conf/security/ -fi - -# overwrite localMemberHost element value in axis2.xml with container ip -export local_docker_ip=$(ip route get 1 | awk '{print $NF;exit}') -axi2_xml_location=${carbon_home}/repository/conf/axis2/axis2.xml -if [[ ! -z ${local_docker_ip} ]]; then - sed -i "s#${local_docker_ip}<\/parameter>#" "${axi2_xml_location}" - if [[ $? == 0 ]]; then - echo "Successfully updated localMemberHost with ${local_docker_ip}" - else - echo "Error occurred while updating localMemberHost with ${local_docker_ip}" - fi -fi - -# Start the carbon server. -${carbon_home}/bin/wso2server.sh diff --git a/base/is_as_km_prepacked/sudoers b/base/is_as_km_prepacked/sudoers deleted file mode 100755 index 92165b9d..00000000 --- a/base/is_as_km_prepacked/sudoers +++ /dev/null @@ -1,50 +0,0 @@ -# ------------------------------------------------------------------------ -# Copyright 2017 WSO2, Inc. (http://wso2.com) -# -# Licensed 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 -# ------------------------------------------------------------------------ -# -# This file MUST be edited with the 'visudo' command as root. -# -# Please consider adding local content in /etc/sudoers.d/ instead of -# directly modifying this file. -# -# See the man page for details on how to write a sudoers file. -# -#Defaults env_reset -Defaults env_keep += "USER_HOME" -Defaults env_keep += "USER" -Defaults env_keep += "WSO2_SERVER_VERSION" -Defaults env_keep += "WSO2_SERVER" -Defaults mail_badpass -Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" - -# Host alias specification - -# User alias specification - -# Cmnd alias specification - -# User privilege specification -#root ALL=(ALL:ALL) ALL - -# Members of the admin group may gain root privileges -#%admin ALL=(ALL) ALL - -# Allow members of group sudo to execute any command -#%sudo ALL=(ALL:ALL) ALL - -# See sudoers(5) for more information on "#include" directives: - -#includedir /etc/sudoers.d -ALL ALL=(root) NOPASSWD: /bin/change_ownership.sh diff --git a/base/mysql/Dockerfile b/base/mysql/Dockerfile deleted file mode 100644 index 784c6131..00000000 --- a/base/mysql/Dockerfile +++ /dev/null @@ -1,24 +0,0 @@ -# ------------------------------------------------------------------------ -# -# Copyright 2017 WSO2, Inc. (http://wso2.com) -# -# Licensed 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 -# -# ------------------------------------------------------------------------ - -FROM mysql:5.7.19 - -MAINTAINER WSO2 Docker Maintainers "dev@wso2.org" - -# COPY MYSQL scripts for database creation. -COPY scripts/* /docker-entrypoint-initdb.d/ \ No newline at end of file diff --git a/base/mysql/scripts/mysql-apimgtdb.sql b/base/mysql/scripts/mysql-apimgtdb.sql deleted file mode 100644 index 4474dad4..00000000 --- a/base/mysql/scripts/mysql-apimgtdb.sql +++ /dev/null @@ -1,1126 +0,0 @@ -create database apimgtdb; -use apimgtdb; - --- Start of IDENTITY Tables-- - -CREATE TABLE IF NOT EXISTS IDN_BASE_TABLE ( - PRODUCT_NAME VARCHAR(20), - PRIMARY KEY (PRODUCT_NAME) -)ENGINE INNODB; - -INSERT INTO IDN_BASE_TABLE values ('WSO2 Identity Server'); - -CREATE TABLE IF NOT EXISTS IDN_OAUTH_CONSUMER_APPS ( - ID INTEGER NOT NULL AUTO_INCREMENT, - CONSUMER_KEY VARCHAR(255), - CONSUMER_SECRET VARCHAR(512), - USERNAME VARCHAR(255), - TENANT_ID INTEGER DEFAULT 0, - USER_DOMAIN VARCHAR(50), - APP_NAME VARCHAR(255), - OAUTH_VERSION VARCHAR(128), - CALLBACK_URL VARCHAR(1024), - GRANT_TYPES VARCHAR (1024), - PKCE_MANDATORY CHAR(1) DEFAULT '0', - PKCE_SUPPORT_PLAIN CHAR(1) DEFAULT '0', - APP_STATE VARCHAR (25) DEFAULT 'ACTIVE', - CONSTRAINT CONSUMER_KEY_CONSTRAINT UNIQUE (CONSUMER_KEY), - PRIMARY KEY (ID) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS IDN_OAUTH1A_REQUEST_TOKEN ( - REQUEST_TOKEN VARCHAR(255), - REQUEST_TOKEN_SECRET VARCHAR(512), - CONSUMER_KEY_ID INTEGER, - CALLBACK_URL VARCHAR(1024), - SCOPE VARCHAR(2048), - AUTHORIZED VARCHAR(128), - OAUTH_VERIFIER VARCHAR(512), - AUTHZ_USER VARCHAR(512), - TENANT_ID INTEGER DEFAULT -1, - PRIMARY KEY (REQUEST_TOKEN), - FOREIGN KEY (CONSUMER_KEY_ID) REFERENCES IDN_OAUTH_CONSUMER_APPS(ID) ON DELETE CASCADE -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS IDN_OAUTH1A_ACCESS_TOKEN ( - ACCESS_TOKEN VARCHAR(255), - ACCESS_TOKEN_SECRET VARCHAR(512), - CONSUMER_KEY_ID INTEGER, - SCOPE VARCHAR(2048), - AUTHZ_USER VARCHAR(512), - TENANT_ID INTEGER DEFAULT -1, - PRIMARY KEY (ACCESS_TOKEN), - FOREIGN KEY (CONSUMER_KEY_ID) REFERENCES IDN_OAUTH_CONSUMER_APPS(ID) ON DELETE CASCADE -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS IDN_OAUTH2_ACCESS_TOKEN ( - TOKEN_ID VARCHAR (255), - ACCESS_TOKEN VARCHAR(255), - REFRESH_TOKEN VARCHAR(255), - CONSUMER_KEY_ID INTEGER, - AUTHZ_USER VARCHAR (100), - TENANT_ID INTEGER, - USER_DOMAIN VARCHAR(50), - USER_TYPE VARCHAR (25), - GRANT_TYPE VARCHAR (50), - TIME_CREATED TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - REFRESH_TOKEN_TIME_CREATED TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - VALIDITY_PERIOD BIGINT, - REFRESH_TOKEN_VALIDITY_PERIOD BIGINT, - TOKEN_SCOPE_HASH VARCHAR(32), - TOKEN_STATE VARCHAR(25) DEFAULT 'ACTIVE', - TOKEN_STATE_ID VARCHAR (128) DEFAULT 'NONE', - SUBJECT_IDENTIFIER VARCHAR(255), - PRIMARY KEY (TOKEN_ID), - FOREIGN KEY (CONSUMER_KEY_ID) REFERENCES IDN_OAUTH_CONSUMER_APPS(ID) ON DELETE CASCADE, - CONSTRAINT CON_APP_KEY UNIQUE (CONSUMER_KEY_ID,AUTHZ_USER,TENANT_ID,USER_DOMAIN,USER_TYPE,TOKEN_SCOPE_HASH, - TOKEN_STATE,TOKEN_STATE_ID) -)ENGINE INNODB; - -CREATE INDEX IDX_AT_CK_AU ON IDN_OAUTH2_ACCESS_TOKEN(CONSUMER_KEY_ID, AUTHZ_USER, TOKEN_STATE, USER_TYPE); - -CREATE INDEX IDX_TC ON IDN_OAUTH2_ACCESS_TOKEN(TIME_CREATED); - -CREATE INDEX IDX_AT ON IDN_OAUTH2_ACCESS_TOKEN(ACCESS_TOKEN); - -CREATE TABLE IF NOT EXISTS IDN_OAUTH2_AUTHORIZATION_CODE ( - CODE_ID VARCHAR (255), - AUTHORIZATION_CODE VARCHAR(512), - CONSUMER_KEY_ID INTEGER, - CALLBACK_URL VARCHAR(1024), - SCOPE VARCHAR(2048), - AUTHZ_USER VARCHAR (100), - TENANT_ID INTEGER, - USER_DOMAIN VARCHAR(50), - TIME_CREATED TIMESTAMP, - VALIDITY_PERIOD BIGINT, - STATE VARCHAR (25) DEFAULT 'ACTIVE', - TOKEN_ID VARCHAR(255), - SUBJECT_IDENTIFIER VARCHAR(255), - PKCE_CODE_CHALLENGE VARCHAR(255), - PKCE_CODE_CHALLENGE_METHOD VARCHAR(128), - PRIMARY KEY (CODE_ID), - FOREIGN KEY (CONSUMER_KEY_ID) REFERENCES IDN_OAUTH_CONSUMER_APPS(ID) ON DELETE CASCADE -)ENGINE INNODB; - -CREATE INDEX IDX_AUTHORIZATION_CODE ON IDN_OAUTH2_AUTHORIZATION_CODE (AUTHORIZATION_CODE,CONSUMER_KEY_ID); - -CREATE TABLE IF NOT EXISTS IDN_OAUTH2_ACCESS_TOKEN_SCOPE ( - TOKEN_ID VARCHAR (255), - TOKEN_SCOPE VARCHAR (60), - TENANT_ID INTEGER DEFAULT -1, - PRIMARY KEY (TOKEN_ID, TOKEN_SCOPE), - FOREIGN KEY (TOKEN_ID) REFERENCES IDN_OAUTH2_ACCESS_TOKEN(TOKEN_ID) ON DELETE CASCADE -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS IDN_OAUTH2_SCOPE ( - SCOPE_ID INT(11) NOT NULL AUTO_INCREMENT, - SCOPE_KEY VARCHAR(100) NOT NULL, - NAME VARCHAR(255) NULL, - DESCRIPTION VARCHAR(512) NULL, - TENANT_ID INT(11) NOT NULL DEFAULT 0, - ROLES VARCHAR (500) NULL, - PRIMARY KEY (SCOPE_ID) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS IDN_OAUTH2_RESOURCE_SCOPE ( - RESOURCE_PATH VARCHAR(255) NOT NULL, - SCOPE_ID INTEGER (11) NOT NULL, - TENANT_ID INTEGER DEFAULT -1, - PRIMARY KEY (RESOURCE_PATH), - FOREIGN KEY (SCOPE_ID) REFERENCES IDN_OAUTH2_SCOPE (SCOPE_ID) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS IDN_SCIM_GROUP ( - ID INTEGER AUTO_INCREMENT, - TENANT_ID INTEGER NOT NULL, - ROLE_NAME VARCHAR(255) NOT NULL, - ATTR_NAME VARCHAR(1024) NOT NULL, - ATTR_VALUE VARCHAR(1024), - PRIMARY KEY (ID) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS IDN_OPENID_REMEMBER_ME ( - USER_NAME VARCHAR(255) NOT NULL, - TENANT_ID INTEGER DEFAULT 0, - COOKIE_VALUE VARCHAR(1024), - CREATED_TIME TIMESTAMP, - PRIMARY KEY (USER_NAME, TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS IDN_OPENID_USER_RPS ( - USER_NAME VARCHAR(255) NOT NULL, - TENANT_ID INTEGER DEFAULT 0, - RP_URL VARCHAR(255) NOT NULL, - TRUSTED_ALWAYS VARCHAR(128) DEFAULT 'FALSE', - LAST_VISIT DATE NOT NULL, - VISIT_COUNT INTEGER DEFAULT 0, - DEFAULT_PROFILE_NAME VARCHAR(255) DEFAULT 'DEFAULT', - PRIMARY KEY (USER_NAME, TENANT_ID, RP_URL) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS IDN_OPENID_ASSOCIATIONS ( - HANDLE VARCHAR(255) NOT NULL, - ASSOC_TYPE VARCHAR(255) NOT NULL, - EXPIRE_IN TIMESTAMP NOT NULL, - MAC_KEY VARCHAR(255) NOT NULL, - ASSOC_STORE VARCHAR(128) DEFAULT 'SHARED', - TENANT_ID INTEGER DEFAULT -1, - PRIMARY KEY (HANDLE) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS IDN_STS_STORE ( - ID INTEGER AUTO_INCREMENT, - TOKEN_ID VARCHAR(255) NOT NULL, - TOKEN_CONTENT BLOB(1024) NOT NULL, - CREATE_DATE TIMESTAMP NOT NULL, - EXPIRE_DATE TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - STATE INTEGER DEFAULT 0, - PRIMARY KEY (ID) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS IDN_IDENTITY_USER_DATA ( - TENANT_ID INTEGER DEFAULT -1234, - USER_NAME VARCHAR(255) NOT NULL, - DATA_KEY VARCHAR(255) NOT NULL, - DATA_VALUE VARCHAR(255), - PRIMARY KEY (TENANT_ID, USER_NAME, DATA_KEY) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS IDN_IDENTITY_META_DATA ( - USER_NAME VARCHAR(255) NOT NULL, - TENANT_ID INTEGER DEFAULT -1234, - METADATA_TYPE VARCHAR(255) NOT NULL, - METADATA VARCHAR(255) NOT NULL, - VALID VARCHAR(255) NOT NULL, - PRIMARY KEY (TENANT_ID, USER_NAME, METADATA_TYPE,METADATA) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS IDN_THRIFT_SESSION ( - SESSION_ID VARCHAR(255) NOT NULL, - USER_NAME VARCHAR(255) NOT NULL, - CREATED_TIME VARCHAR(255) NOT NULL, - LAST_MODIFIED_TIME VARCHAR(255) NOT NULL, - TENANT_ID INTEGER DEFAULT -1, - PRIMARY KEY (SESSION_ID) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS IDN_AUTH_SESSION_STORE ( - SESSION_ID VARCHAR (100) NOT NULL, - SESSION_TYPE VARCHAR(100) NOT NULL, - OPERATION VARCHAR(10) NOT NULL, - SESSION_OBJECT BLOB, - TIME_CREATED BIGINT, - TENANT_ID INTEGER DEFAULT -1, - PRIMARY KEY (SESSION_ID, SESSION_TYPE, TIME_CREATED, OPERATION) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS SP_APP ( - ID INTEGER NOT NULL AUTO_INCREMENT, - TENANT_ID INTEGER NOT NULL, - APP_NAME VARCHAR (255) NOT NULL , - USER_STORE VARCHAR (255) NOT NULL, - USERNAME VARCHAR (255) NOT NULL , - DESCRIPTION VARCHAR (1024), - ROLE_CLAIM VARCHAR (512), - AUTH_TYPE VARCHAR (255) NOT NULL, - PROVISIONING_USERSTORE_DOMAIN VARCHAR (512), - IS_LOCAL_CLAIM_DIALECT CHAR(1) DEFAULT '1', - IS_SEND_LOCAL_SUBJECT_ID CHAR(1) DEFAULT '0', - IS_SEND_AUTH_LIST_OF_IDPS CHAR(1) DEFAULT '0', - IS_USE_TENANT_DOMAIN_SUBJECT CHAR(1) DEFAULT '1', - IS_USE_USER_DOMAIN_SUBJECT CHAR(1) DEFAULT '1', - ENABLE_AUTHORIZATION CHAR(1) DEFAULT '0', - SUBJECT_CLAIM_URI VARCHAR (512), - IS_SAAS_APP CHAR(1) DEFAULT '0', - IS_DUMB_MODE CHAR(1) DEFAULT '0', - PRIMARY KEY (ID) -)ENGINE INNODB; - -ALTER TABLE SP_APP ADD CONSTRAINT APPLICATION_NAME_CONSTRAINT UNIQUE(APP_NAME, TENANT_ID); - -CREATE TABLE IF NOT EXISTS SP_METADATA ( - ID INTEGER AUTO_INCREMENT, - SP_ID INTEGER, - NAME VARCHAR(255) NOT NULL, - VALUE VARCHAR(255) NOT NULL, - DISPLAY_NAME VARCHAR(255), - TENANT_ID INTEGER DEFAULT -1, - PRIMARY KEY (ID), - CONSTRAINT SP_METADATA_CONSTRAINT UNIQUE (SP_ID, NAME), - FOREIGN KEY (SP_ID) REFERENCES SP_APP(ID) ON DELETE CASCADE -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS SP_INBOUND_AUTH ( - ID INTEGER NOT NULL AUTO_INCREMENT, - TENANT_ID INTEGER NOT NULL, - INBOUND_AUTH_KEY VARCHAR (255), - INBOUND_AUTH_TYPE VARCHAR (255) NOT NULL, - INBOUND_CONFIG_TYPE VARCHAR (255) NOT NULL, - PROP_NAME VARCHAR (255), - PROP_VALUE VARCHAR (1024) , - APP_ID INTEGER NOT NULL, - PRIMARY KEY (ID) -)ENGINE INNODB; - -ALTER TABLE SP_INBOUND_AUTH ADD CONSTRAINT APPLICATION_ID_CONSTRAINT FOREIGN KEY (APP_ID) REFERENCES SP_APP (ID) ON DELETE CASCADE; - -CREATE TABLE IF NOT EXISTS SP_AUTH_STEP ( - ID INTEGER NOT NULL AUTO_INCREMENT, - TENANT_ID INTEGER NOT NULL, - STEP_ORDER INTEGER DEFAULT 1, - APP_ID INTEGER NOT NULL , - IS_SUBJECT_STEP CHAR(1) DEFAULT '0', - IS_ATTRIBUTE_STEP CHAR(1) DEFAULT '0', - PRIMARY KEY (ID) -)ENGINE INNODB; - -ALTER TABLE SP_AUTH_STEP ADD CONSTRAINT APPLICATION_ID_CONSTRAINT_STEP FOREIGN KEY (APP_ID) REFERENCES SP_APP (ID) ON DELETE CASCADE; - -CREATE TABLE IF NOT EXISTS SP_FEDERATED_IDP ( - ID INTEGER NOT NULL, - TENANT_ID INTEGER NOT NULL, - AUTHENTICATOR_ID INTEGER NOT NULL, - PRIMARY KEY (ID, AUTHENTICATOR_ID) -)ENGINE INNODB; - -ALTER TABLE SP_FEDERATED_IDP ADD CONSTRAINT STEP_ID_CONSTRAINT FOREIGN KEY (ID) REFERENCES SP_AUTH_STEP (ID) ON DELETE CASCADE; - -CREATE TABLE IF NOT EXISTS SP_CLAIM_MAPPING ( - ID INTEGER NOT NULL AUTO_INCREMENT, - TENANT_ID INTEGER NOT NULL, - IDP_CLAIM VARCHAR (512) NOT NULL , - SP_CLAIM VARCHAR (512) NOT NULL , - APP_ID INTEGER NOT NULL, - IS_REQUESTED VARCHAR(128) DEFAULT '0', - IS_MANDATORY VARCHAR(128) DEFAULT '0', - DEFAULT_VALUE VARCHAR(255), - PRIMARY KEY (ID) -)ENGINE INNODB; - -ALTER TABLE SP_CLAIM_MAPPING ADD CONSTRAINT CLAIMID_APPID_CONSTRAINT FOREIGN KEY (APP_ID) REFERENCES SP_APP (ID) ON DELETE CASCADE; - -CREATE TABLE IF NOT EXISTS SP_ROLE_MAPPING ( - ID INTEGER NOT NULL AUTO_INCREMENT, - TENANT_ID INTEGER NOT NULL, - IDP_ROLE VARCHAR (255) NOT NULL , - SP_ROLE VARCHAR (255) NOT NULL , - APP_ID INTEGER NOT NULL, - PRIMARY KEY (ID) -)ENGINE INNODB; - -ALTER TABLE SP_ROLE_MAPPING ADD CONSTRAINT ROLEID_APPID_CONSTRAINT FOREIGN KEY (APP_ID) REFERENCES SP_APP (ID) ON DELETE CASCADE; - -CREATE TABLE IF NOT EXISTS SP_REQ_PATH_AUTHENTICATOR ( - ID INTEGER NOT NULL AUTO_INCREMENT, - TENANT_ID INTEGER NOT NULL, - AUTHENTICATOR_NAME VARCHAR (255) NOT NULL , - APP_ID INTEGER NOT NULL, - PRIMARY KEY (ID) -)ENGINE INNODB; - -ALTER TABLE SP_REQ_PATH_AUTHENTICATOR ADD CONSTRAINT REQ_AUTH_APPID_CONSTRAINT FOREIGN KEY (APP_ID) REFERENCES SP_APP (ID) ON DELETE CASCADE; - -CREATE TABLE IF NOT EXISTS SP_PROVISIONING_CONNECTOR ( - ID INTEGER NOT NULL AUTO_INCREMENT, - TENANT_ID INTEGER NOT NULL, - IDP_NAME VARCHAR (255) NOT NULL , - CONNECTOR_NAME VARCHAR (255) NOT NULL , - APP_ID INTEGER NOT NULL, - IS_JIT_ENABLED CHAR(1) NOT NULL DEFAULT '0', - BLOCKING CHAR(1) NOT NULL DEFAULT '0', - RULE_ENABLED CHAR(1) NOT NULL DEFAULT '0', - PRIMARY KEY (ID) -)ENGINE INNODB; - -ALTER TABLE SP_PROVISIONING_CONNECTOR ADD CONSTRAINT PRO_CONNECTOR_APPID_CONSTRAINT FOREIGN KEY (APP_ID) REFERENCES SP_APP (ID) ON DELETE CASCADE; - -CREATE TABLE IF NOT EXISTS IDP ( - ID INTEGER AUTO_INCREMENT, - TENANT_ID INTEGER, - NAME VARCHAR(254) NOT NULL, - IS_ENABLED CHAR(1) NOT NULL DEFAULT '1', - IS_PRIMARY CHAR(1) NOT NULL DEFAULT '0', - HOME_REALM_ID VARCHAR(254), - IMAGE MEDIUMBLOB, - CERTIFICATE BLOB, - ALIAS VARCHAR(254), - INBOUND_PROV_ENABLED CHAR (1) NOT NULL DEFAULT '0', - INBOUND_PROV_USER_STORE_ID VARCHAR(254), - USER_CLAIM_URI VARCHAR(254), - ROLE_CLAIM_URI VARCHAR(254), - DESCRIPTION VARCHAR (1024), - DEFAULT_AUTHENTICATOR_NAME VARCHAR(254), - DEFAULT_PRO_CONNECTOR_NAME VARCHAR(254), - PROVISIONING_ROLE VARCHAR(128), - IS_FEDERATION_HUB CHAR(1) NOT NULL DEFAULT '0', - IS_LOCAL_CLAIM_DIALECT CHAR(1) NOT NULL DEFAULT '0', - DISPLAY_NAME VARCHAR(255), - PRIMARY KEY (ID), - UNIQUE (TENANT_ID, NAME) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS IDP_ROLE ( - ID INTEGER AUTO_INCREMENT, - IDP_ID INTEGER, - TENANT_ID INTEGER, - ROLE VARCHAR(254), - PRIMARY KEY (ID), - UNIQUE (IDP_ID, ROLE), - FOREIGN KEY (IDP_ID) REFERENCES IDP(ID) ON DELETE CASCADE -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS IDP_ROLE_MAPPING ( - ID INTEGER AUTO_INCREMENT, - IDP_ROLE_ID INTEGER, - TENANT_ID INTEGER, - USER_STORE_ID VARCHAR (253), - LOCAL_ROLE VARCHAR(253), - PRIMARY KEY (ID), - UNIQUE (IDP_ROLE_ID, TENANT_ID, USER_STORE_ID, LOCAL_ROLE), - FOREIGN KEY (IDP_ROLE_ID) REFERENCES IDP_ROLE(ID) ON DELETE CASCADE -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS IDP_CLAIM ( - ID INTEGER AUTO_INCREMENT, - IDP_ID INTEGER, - TENANT_ID INTEGER, - CLAIM VARCHAR(254), - PRIMARY KEY (ID), - UNIQUE (IDP_ID, CLAIM), - FOREIGN KEY (IDP_ID) REFERENCES IDP(ID) ON DELETE CASCADE -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS IDP_CLAIM_MAPPING ( - ID INTEGER AUTO_INCREMENT, - IDP_CLAIM_ID INTEGER, - TENANT_ID INTEGER, - LOCAL_CLAIM VARCHAR(253), - DEFAULT_VALUE VARCHAR(255), - IS_REQUESTED VARCHAR(128) DEFAULT '0', - PRIMARY KEY (ID), - UNIQUE (IDP_CLAIM_ID, TENANT_ID, LOCAL_CLAIM), - FOREIGN KEY (IDP_CLAIM_ID) REFERENCES IDP_CLAIM(ID) ON DELETE CASCADE -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS IDP_AUTHENTICATOR ( - ID INTEGER AUTO_INCREMENT, - TENANT_ID INTEGER, - IDP_ID INTEGER, - NAME VARCHAR(255) NOT NULL, - IS_ENABLED CHAR (1) DEFAULT '1', - DISPLAY_NAME VARCHAR(255), - PRIMARY KEY (ID), - UNIQUE (TENANT_ID, IDP_ID, NAME), - FOREIGN KEY (IDP_ID) REFERENCES IDP(ID) ON DELETE CASCADE -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS IDP_METADATA ( - ID INTEGER AUTO_INCREMENT, - IDP_ID INTEGER, - NAME VARCHAR(255) NOT NULL, - VALUE VARCHAR(255) NOT NULL, - DISPLAY_NAME VARCHAR(255), - TENANT_ID INTEGER DEFAULT -1, - PRIMARY KEY (ID), - CONSTRAINT IDP_METADATA_CONSTRAINT UNIQUE (IDP_ID, NAME), - FOREIGN KEY (IDP_ID) REFERENCES IDP(ID) ON DELETE CASCADE -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS IDP_AUTHENTICATOR_PROPERTY ( - ID INTEGER AUTO_INCREMENT, - TENANT_ID INTEGER, - AUTHENTICATOR_ID INTEGER, - PROPERTY_KEY VARCHAR(255) NOT NULL, - PROPERTY_VALUE VARCHAR(2047), - IS_SECRET CHAR (1) DEFAULT '0', - PRIMARY KEY (ID), - UNIQUE (TENANT_ID, AUTHENTICATOR_ID, PROPERTY_KEY), - FOREIGN KEY (AUTHENTICATOR_ID) REFERENCES IDP_AUTHENTICATOR(ID) ON DELETE CASCADE -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS IDP_PROVISIONING_CONFIG ( - ID INTEGER AUTO_INCREMENT, - TENANT_ID INTEGER, - IDP_ID INTEGER, - PROVISIONING_CONNECTOR_TYPE VARCHAR(255) NOT NULL, - IS_ENABLED CHAR (1) DEFAULT '0', - IS_BLOCKING CHAR (1) DEFAULT '0', - IS_RULES_ENABLED CHAR (1) DEFAULT '0', - PRIMARY KEY (ID), - UNIQUE (TENANT_ID, IDP_ID, PROVISIONING_CONNECTOR_TYPE), - FOREIGN KEY (IDP_ID) REFERENCES IDP(ID) ON DELETE CASCADE -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS IDP_PROV_CONFIG_PROPERTY ( - ID INTEGER AUTO_INCREMENT, - TENANT_ID INTEGER, - PROVISIONING_CONFIG_ID INTEGER, - PROPERTY_KEY VARCHAR(255) NOT NULL, - PROPERTY_VALUE VARCHAR(2048), - PROPERTY_BLOB_VALUE BLOB, - PROPERTY_TYPE CHAR(32) NOT NULL, - IS_SECRET CHAR (1) DEFAULT '0', - PRIMARY KEY (ID), - UNIQUE (TENANT_ID, PROVISIONING_CONFIG_ID, PROPERTY_KEY), - FOREIGN KEY (PROVISIONING_CONFIG_ID) REFERENCES IDP_PROVISIONING_CONFIG(ID) ON DELETE CASCADE -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS IDP_PROVISIONING_ENTITY ( - ID INTEGER AUTO_INCREMENT, - PROVISIONING_CONFIG_ID INTEGER, - ENTITY_TYPE VARCHAR(255) NOT NULL, - ENTITY_LOCAL_USERSTORE VARCHAR(255) NOT NULL, - ENTITY_NAME VARCHAR(255) NOT NULL, - ENTITY_VALUE VARCHAR(255), - TENANT_ID INTEGER, - ENTITY_LOCAL_ID VARCHAR(255), - PRIMARY KEY (ID), - UNIQUE (ENTITY_TYPE, TENANT_ID, ENTITY_LOCAL_USERSTORE, ENTITY_NAME, PROVISIONING_CONFIG_ID), - UNIQUE (PROVISIONING_CONFIG_ID, ENTITY_TYPE, ENTITY_VALUE), - FOREIGN KEY (PROVISIONING_CONFIG_ID) REFERENCES IDP_PROVISIONING_CONFIG(ID) ON DELETE CASCADE -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS IDP_LOCAL_CLAIM ( - ID INTEGER AUTO_INCREMENT, - TENANT_ID INTEGER, - IDP_ID INTEGER, - CLAIM_URI VARCHAR(255) NOT NULL, - DEFAULT_VALUE VARCHAR(255), - IS_REQUESTED VARCHAR(128) DEFAULT '0', - PRIMARY KEY (ID), - UNIQUE (TENANT_ID, IDP_ID, CLAIM_URI), - FOREIGN KEY (IDP_ID) REFERENCES IDP(ID) ON DELETE CASCADE -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS IDN_ASSOCIATED_ID ( - ID INTEGER AUTO_INCREMENT, - IDP_USER_ID VARCHAR(255) NOT NULL, - TENANT_ID INTEGER DEFAULT -1234, - IDP_ID INTEGER NOT NULL, - DOMAIN_NAME VARCHAR(255) NOT NULL, - USER_NAME VARCHAR(255) NOT NULL, - PRIMARY KEY (ID), - UNIQUE(IDP_USER_ID, TENANT_ID, IDP_ID), - FOREIGN KEY (IDP_ID) REFERENCES IDP(ID) ON DELETE CASCADE -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS IDN_USER_ACCOUNT_ASSOCIATION ( - ASSOCIATION_KEY VARCHAR(255) NOT NULL, - TENANT_ID INTEGER, - DOMAIN_NAME VARCHAR(255) NOT NULL, - USER_NAME VARCHAR(255) NOT NULL, - PRIMARY KEY (TENANT_ID, DOMAIN_NAME, USER_NAME) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS FIDO_DEVICE_STORE ( - TENANT_ID INTEGER, - DOMAIN_NAME VARCHAR(255) NOT NULL, - USER_NAME VARCHAR(45) NOT NULL, - TIME_REGISTERED TIMESTAMP, - KEY_HANDLE VARCHAR(200) NOT NULL, - DEVICE_DATA VARCHAR(2048) NOT NULL, - PRIMARY KEY (TENANT_ID, DOMAIN_NAME, USER_NAME, KEY_HANDLE) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS WF_REQUEST ( - UUID VARCHAR (45), - CREATED_BY VARCHAR (255), - TENANT_ID INTEGER DEFAULT -1, - OPERATION_TYPE VARCHAR (50), - CREATED_AT TIMESTAMP, - UPDATED_AT TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - STATUS VARCHAR (30), - REQUEST BLOB, - PRIMARY KEY (UUID) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS WF_BPS_PROFILE ( - PROFILE_NAME VARCHAR(45), - HOST_URL_MANAGER VARCHAR(255), - HOST_URL_WORKER VARCHAR(255), - USERNAME VARCHAR(45), - PASSWORD VARCHAR(1023), - CALLBACK_HOST VARCHAR (45), - CALLBACK_USERNAME VARCHAR (45), - CALLBACK_PASSWORD VARCHAR (255), - TENANT_ID INTEGER DEFAULT -1, - PRIMARY KEY (PROFILE_NAME, TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS WF_WORKFLOW( - ID VARCHAR (45), - WF_NAME VARCHAR (45), - DESCRIPTION VARCHAR (255), - TEMPLATE_ID VARCHAR (45), - IMPL_ID VARCHAR (45), - TENANT_ID INTEGER DEFAULT -1, - PRIMARY KEY (ID) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS WF_WORKFLOW_ASSOCIATION( - ID INTEGER NOT NULL AUTO_INCREMENT, - ASSOC_NAME VARCHAR (45), - EVENT_ID VARCHAR(45), - ASSOC_CONDITION VARCHAR (2000), - WORKFLOW_ID VARCHAR (45), - IS_ENABLED CHAR (1) DEFAULT '1', - TENANT_ID INTEGER DEFAULT -1, - PRIMARY KEY(ID), - FOREIGN KEY (WORKFLOW_ID) REFERENCES WF_WORKFLOW(ID)ON DELETE CASCADE -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS WF_WORKFLOW_CONFIG_PARAM( - WORKFLOW_ID VARCHAR (45), - PARAM_NAME VARCHAR (45), - PARAM_VALUE VARCHAR (1000), - PARAM_QNAME VARCHAR (45), - PARAM_HOLDER VARCHAR (45), - TENANT_ID INTEGER DEFAULT -1, - PRIMARY KEY (WORKFLOW_ID, PARAM_NAME, PARAM_QNAME, PARAM_HOLDER), - FOREIGN KEY (WORKFLOW_ID) REFERENCES WF_WORKFLOW(ID)ON DELETE CASCADE -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS WF_REQUEST_ENTITY_RELATIONSHIP( - REQUEST_ID VARCHAR (45), - ENTITY_NAME VARCHAR (255), - ENTITY_TYPE VARCHAR (50), - TENANT_ID INTEGER DEFAULT -1, - PRIMARY KEY(REQUEST_ID, ENTITY_NAME, ENTITY_TYPE, TENANT_ID), - FOREIGN KEY (REQUEST_ID) REFERENCES WF_REQUEST(UUID)ON DELETE CASCADE -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS WF_WORKFLOW_REQUEST_RELATION( - RELATIONSHIP_ID VARCHAR (45), - WORKFLOW_ID VARCHAR (45), - REQUEST_ID VARCHAR (45), - UPDATED_AT TIMESTAMP, - STATUS VARCHAR (30), - TENANT_ID INTEGER DEFAULT -1, - PRIMARY KEY (RELATIONSHIP_ID), - FOREIGN KEY (WORKFLOW_ID) REFERENCES WF_WORKFLOW(ID)ON DELETE CASCADE, - FOREIGN KEY (REQUEST_ID) REFERENCES WF_REQUEST(UUID)ON DELETE CASCADE -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS IDN_RECOVERY_DATA ( - USER_NAME VARCHAR(255) NOT NULL, - USER_DOMAIN VARCHAR(255) NOT NULL, - TENANT_ID INTEGER DEFAULT -1, - CODE VARCHAR(255) NOT NULL, - SCENARIO VARCHAR(255) NOT NULL, - STEP VARCHAR(255) NOT NULL, - TIME_CREATED TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - REMAINING_SETS VARCHAR(2500) DEFAULT NULL, - PRIMARY KEY(USER_NAME, USER_DOMAIN, TENANT_ID, SCENARIO,STEP), - UNIQUE(CODE) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS IDN_PASSWORD_HISTORY_DATA ( - ID INTEGER NOT NULL AUTO_INCREMENT, - USER_NAME VARCHAR(255) NOT NULL, - USER_DOMAIN VARCHAR(127) NOT NULL, - TENANT_ID INTEGER DEFAULT -1, - SALT_VALUE VARCHAR(255), - HASH VARCHAR(255) NOT NULL, - TIME_CREATED TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY(ID), - UNIQUE (USER_NAME,USER_DOMAIN,TENANT_ID,SALT_VALUE,HASH) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS IDN_CLAIM_DIALECT ( - ID INTEGER NOT NULL AUTO_INCREMENT, - DIALECT_URI VARCHAR (255) NOT NULL, - TENANT_ID INTEGER NOT NULL, - PRIMARY KEY (ID), - CONSTRAINT DIALECT_URI_CONSTRAINT UNIQUE (DIALECT_URI, TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS IDN_CLAIM ( - ID INTEGER NOT NULL AUTO_INCREMENT, - DIALECT_ID INTEGER, - CLAIM_URI VARCHAR (255) NOT NULL, - TENANT_ID INTEGER NOT NULL, - PRIMARY KEY (ID), - FOREIGN KEY (DIALECT_ID) REFERENCES IDN_CLAIM_DIALECT(ID) ON DELETE CASCADE, - CONSTRAINT CLAIM_URI_CONSTRAINT UNIQUE (DIALECT_ID, CLAIM_URI, TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS IDN_CLAIM_MAPPED_ATTRIBUTE ( - ID INTEGER NOT NULL AUTO_INCREMENT, - LOCAL_CLAIM_ID INTEGER, - USER_STORE_DOMAIN_NAME VARCHAR (255) NOT NULL, - ATTRIBUTE_NAME VARCHAR (255) NOT NULL, - TENANT_ID INTEGER NOT NULL, - PRIMARY KEY (ID), - FOREIGN KEY (LOCAL_CLAIM_ID) REFERENCES IDN_CLAIM(ID) ON DELETE CASCADE, - CONSTRAINT USER_STORE_DOMAIN_CONSTRAINT UNIQUE (LOCAL_CLAIM_ID, USER_STORE_DOMAIN_NAME, TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS IDN_CLAIM_PROPERTY ( - ID INTEGER NOT NULL AUTO_INCREMENT, - LOCAL_CLAIM_ID INTEGER, - PROPERTY_NAME VARCHAR (255) NOT NULL, - PROPERTY_VALUE VARCHAR (255) NOT NULL, - TENANT_ID INTEGER NOT NULL, - PRIMARY KEY (ID), - FOREIGN KEY (LOCAL_CLAIM_ID) REFERENCES IDN_CLAIM(ID) ON DELETE CASCADE, - CONSTRAINT PROPERTY_NAME_CONSTRAINT UNIQUE (LOCAL_CLAIM_ID, PROPERTY_NAME, TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS IDN_CLAIM_MAPPING ( - ID INTEGER NOT NULL AUTO_INCREMENT, - EXT_CLAIM_ID INTEGER NOT NULL, - MAPPED_LOCAL_CLAIM_ID INTEGER NOT NULL, - TENANT_ID INTEGER NOT NULL, - PRIMARY KEY (ID), - FOREIGN KEY (EXT_CLAIM_ID) REFERENCES IDN_CLAIM(ID) ON DELETE CASCADE, - FOREIGN KEY (MAPPED_LOCAL_CLAIM_ID) REFERENCES IDN_CLAIM(ID) ON DELETE CASCADE, - CONSTRAINT EXT_TO_LOC_MAPPING_CONSTRN UNIQUE (EXT_CLAIM_ID, TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS IDN_SAML2_ASSERTION_STORE ( - ID INTEGER NOT NULL AUTO_INCREMENT, - SAML2_ID VARCHAR(255) , - SAML2_ISSUER VARCHAR(255) , - SAML2_SUBJECT VARCHAR(255) , - SAML2_SESSION_INDEX VARCHAR(255) , - SAML2_AUTHN_CONTEXT_CLASS_REF VARCHAR(255) , - SAML2_ASSERTION VARCHAR(4096) , - PRIMARY KEY (ID) -)ENGINE INNODB; - --- End of IDENTITY Tables-- - --- Start of API-MGT Tables -- -CREATE TABLE IF NOT EXISTS AM_SUBSCRIBER ( - SUBSCRIBER_ID INTEGER AUTO_INCREMENT, - USER_ID VARCHAR(255) NOT NULL, - TENANT_ID INTEGER NOT NULL, - EMAIL_ADDRESS VARCHAR(256) NULL, - DATE_SUBSCRIBED TIMESTAMP NOT NULL, - PRIMARY KEY (SUBSCRIBER_ID), - CREATED_BY VARCHAR(100), - CREATED_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - UPDATED_BY VARCHAR(100), - UPDATED_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - UNIQUE (TENANT_ID,USER_ID) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS AM_APPLICATION ( - APPLICATION_ID INTEGER AUTO_INCREMENT, - NAME VARCHAR(100), - SUBSCRIBER_ID INTEGER, - APPLICATION_TIER VARCHAR(50) DEFAULT 'Unlimited', - CALLBACK_URL VARCHAR(512), - DESCRIPTION VARCHAR(512), - APPLICATION_STATUS VARCHAR(50) DEFAULT 'APPROVED', - GROUP_ID VARCHAR(100), - CREATED_BY VARCHAR(100), - CREATED_TIME TIMESTAMP, - UPDATED_BY VARCHAR(100), - UPDATED_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - UUID VARCHAR(256), - FOREIGN KEY(SUBSCRIBER_ID) REFERENCES AM_SUBSCRIBER(SUBSCRIBER_ID) ON UPDATE CASCADE ON DELETE RESTRICT, - PRIMARY KEY(APPLICATION_ID), - UNIQUE (NAME,SUBSCRIBER_ID), - UNIQUE (UUID) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS AM_API ( - API_ID INTEGER AUTO_INCREMENT, - API_PROVIDER VARCHAR(200), - API_NAME VARCHAR(200), - API_VERSION VARCHAR(30), - CONTEXT VARCHAR(256), - CONTEXT_TEMPLATE VARCHAR(256), - API_TIER VARCHAR(256), - CREATED_BY VARCHAR(100), - CREATED_TIME TIMESTAMP, - UPDATED_BY VARCHAR(100), - UPDATED_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY(API_ID), - UNIQUE (API_PROVIDER,API_NAME,API_VERSION) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS AM_API_URL_MAPPING ( - URL_MAPPING_ID INTEGER AUTO_INCREMENT, - API_ID INTEGER NOT NULL, - HTTP_METHOD VARCHAR(20) NULL, - AUTH_SCHEME VARCHAR(50) NULL, - URL_PATTERN VARCHAR(512) NULL, - THROTTLING_TIER varchar(512) DEFAULT NULL, - MEDIATION_SCRIPT BLOB, - PRIMARY KEY (URL_MAPPING_ID) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS AM_SUBSCRIPTION ( - SUBSCRIPTION_ID INTEGER AUTO_INCREMENT, - TIER_ID VARCHAR(50), - API_ID INTEGER, - LAST_ACCESSED TIMESTAMP NULL, - APPLICATION_ID INTEGER, - SUB_STATUS VARCHAR(50), - SUBS_CREATE_STATE VARCHAR(50) DEFAULT 'SUBSCRIBE', - CREATED_BY VARCHAR(100), - CREATED_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - UPDATED_BY VARCHAR(100), - UPDATED_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - UUID VARCHAR(256), - FOREIGN KEY(APPLICATION_ID) REFERENCES AM_APPLICATION(APPLICATION_ID) ON UPDATE CASCADE ON DELETE RESTRICT, - FOREIGN KEY(API_ID) REFERENCES AM_API(API_ID) ON UPDATE CASCADE ON DELETE RESTRICT, - PRIMARY KEY (SUBSCRIPTION_ID), - UNIQUE (UUID) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS AM_SUBSCRIPTION_KEY_MAPPING ( - SUBSCRIPTION_ID INTEGER, - ACCESS_TOKEN VARCHAR(255), - KEY_TYPE VARCHAR(512) NOT NULL, - FOREIGN KEY(SUBSCRIPTION_ID) REFERENCES AM_SUBSCRIPTION(SUBSCRIPTION_ID) ON UPDATE CASCADE ON DELETE RESTRICT, - PRIMARY KEY(SUBSCRIPTION_ID,ACCESS_TOKEN) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS AM_APPLICATION_KEY_MAPPING ( - APPLICATION_ID INTEGER, - CONSUMER_KEY VARCHAR(255), - KEY_TYPE VARCHAR(512) NOT NULL, - STATE VARCHAR(30) NOT NULL, - CREATE_MODE VARCHAR(30) DEFAULT 'CREATED', - FOREIGN KEY(APPLICATION_ID) REFERENCES AM_APPLICATION(APPLICATION_ID) ON UPDATE CASCADE ON DELETE RESTRICT, - PRIMARY KEY(APPLICATION_ID,KEY_TYPE) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS AM_API_LC_EVENT ( - EVENT_ID INTEGER AUTO_INCREMENT, - API_ID INTEGER NOT NULL, - PREVIOUS_STATE VARCHAR(50), - NEW_STATE VARCHAR(50) NOT NULL, - USER_ID VARCHAR(255) NOT NULL, - TENANT_ID INTEGER NOT NULL, - EVENT_DATE TIMESTAMP NOT NULL, - FOREIGN KEY(API_ID) REFERENCES AM_API(API_ID) ON UPDATE CASCADE ON DELETE RESTRICT, - PRIMARY KEY (EVENT_ID) -)ENGINE INNODB; - -CREATE TABLE AM_APP_KEY_DOMAIN_MAPPING ( - CONSUMER_KEY VARCHAR(255), - AUTHZ_DOMAIN VARCHAR(255) DEFAULT 'ALL', - PRIMARY KEY (CONSUMER_KEY,AUTHZ_DOMAIN) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS AM_API_COMMENTS ( - COMMENT_ID INTEGER AUTO_INCREMENT, - COMMENT_TEXT VARCHAR(512), - COMMENTED_USER VARCHAR(255), - DATE_COMMENTED TIMESTAMP NOT NULL, - API_ID INTEGER NOT NULL, - FOREIGN KEY(API_ID) REFERENCES AM_API(API_ID) ON UPDATE CASCADE ON DELETE RESTRICT, - PRIMARY KEY (COMMENT_ID) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS AM_API_RATINGS ( - RATING_ID INTEGER AUTO_INCREMENT, - API_ID INTEGER, - RATING INTEGER, - SUBSCRIBER_ID INTEGER, - FOREIGN KEY(API_ID) REFERENCES AM_API(API_ID) ON UPDATE CASCADE ON DELETE RESTRICT, - FOREIGN KEY(SUBSCRIBER_ID) REFERENCES AM_SUBSCRIBER(SUBSCRIBER_ID) ON UPDATE CASCADE ON DELETE RESTRICT, - PRIMARY KEY (RATING_ID) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS AM_TIER_PERMISSIONS ( - TIER_PERMISSIONS_ID INTEGER AUTO_INCREMENT, - TIER VARCHAR(50) NOT NULL, - PERMISSIONS_TYPE VARCHAR(50) NOT NULL, - ROLES VARCHAR(512) NOT NULL, - TENANT_ID INTEGER NOT NULL, - PRIMARY KEY(TIER_PERMISSIONS_ID) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS AM_EXTERNAL_STORES ( - APISTORE_ID INTEGER AUTO_INCREMENT, - API_ID INTEGER, - STORE_ID VARCHAR(255) NOT NULL, - STORE_DISPLAY_NAME VARCHAR(255) NOT NULL, - STORE_ENDPOINT VARCHAR(255) NOT NULL, - STORE_TYPE VARCHAR(255) NOT NULL, - FOREIGN KEY(API_ID) REFERENCES AM_API(API_ID) ON UPDATE CASCADE ON DELETE RESTRICT, - PRIMARY KEY (APISTORE_ID) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS AM_WORKFLOWS( - WF_ID INTEGER AUTO_INCREMENT, - WF_REFERENCE VARCHAR(255) NOT NULL, - WF_TYPE VARCHAR(255) NOT NULL, - WF_STATUS VARCHAR(255) NOT NULL, - WF_CREATED_TIME TIMESTAMP, - WF_UPDATED_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP , - WF_STATUS_DESC VARCHAR(1000), - TENANT_ID INTEGER, - TENANT_DOMAIN VARCHAR(255), - WF_EXTERNAL_REFERENCE VARCHAR(255) NOT NULL, - PRIMARY KEY (WF_ID), - UNIQUE (WF_EXTERNAL_REFERENCE) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS AM_APPLICATION_REGISTRATION ( - REG_ID INT AUTO_INCREMENT, - SUBSCRIBER_ID INT, - WF_REF VARCHAR(255) NOT NULL, - APP_ID INT, - TOKEN_TYPE VARCHAR(30), - TOKEN_SCOPE VARCHAR(256) DEFAULT 'default', - INPUTS VARCHAR(1000), - ALLOWED_DOMAINS VARCHAR(256), - VALIDITY_PERIOD BIGINT, - UNIQUE (SUBSCRIBER_ID,APP_ID,TOKEN_TYPE), - FOREIGN KEY(SUBSCRIBER_ID) REFERENCES AM_SUBSCRIBER(SUBSCRIBER_ID) ON UPDATE CASCADE ON DELETE RESTRICT, - FOREIGN KEY(APP_ID) REFERENCES AM_APPLICATION(APPLICATION_ID) ON UPDATE CASCADE ON DELETE RESTRICT, - PRIMARY KEY (REG_ID) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS AM_API_SCOPES ( - API_ID INTEGER NOT NULL, - SCOPE_ID INTEGER NOT NULL, - FOREIGN KEY (API_ID) REFERENCES AM_API (API_ID) ON DELETE CASCADE ON UPDATE CASCADE, - FOREIGN KEY (SCOPE_ID) REFERENCES IDN_OAUTH2_SCOPE (SCOPE_ID) ON DELETE CASCADE ON UPDATE CASCADE -)ENGINE = INNODB; - -CREATE TABLE IF NOT EXISTS AM_API_DEFAULT_VERSION ( - DEFAULT_VERSION_ID INT AUTO_INCREMENT, - API_NAME VARCHAR(256) NOT NULL , - API_PROVIDER VARCHAR(256) NOT NULL , - DEFAULT_API_VERSION VARCHAR(30) , - PUBLISHED_DEFAULT_API_VERSION VARCHAR(30) , - PRIMARY KEY (DEFAULT_VERSION_ID) -)ENGINE = INNODB; - -CREATE INDEX IDX_SUB_APP_ID ON AM_SUBSCRIPTION (APPLICATION_ID, SUBSCRIPTION_ID); - - -CREATE TABLE IF NOT EXISTS AM_ALERT_TYPES ( - ALERT_TYPE_ID INTEGER AUTO_INCREMENT, - ALERT_TYPE_NAME VARCHAR(255) NOT NULL , - STAKE_HOLDER VARCHAR(100) NOT NULL, - PRIMARY KEY (ALERT_TYPE_ID) -)ENGINE = INNODB; - -CREATE TABLE IF NOT EXISTS AM_ALERT_TYPES_VALUES ( - ALERT_TYPE_ID INTEGER, - USER_NAME VARCHAR(255) NOT NULL , - STAKE_HOLDER VARCHAR(100) NOT NULL , - PRIMARY KEY (ALERT_TYPE_ID,USER_NAME,STAKE_HOLDER) -)ENGINE = INNODB; - -CREATE TABLE IF NOT EXISTS AM_ALERT_EMAILLIST ( - EMAIL_LIST_ID INTEGER AUTO_INCREMENT, - USER_NAME VARCHAR(255) NOT NULL , - STAKE_HOLDER VARCHAR(100) NOT NULL , - PRIMARY KEY (EMAIL_LIST_ID,USER_NAME,STAKE_HOLDER) -)ENGINE = INNODB; - -CREATE TABLE IF NOT EXISTS AM_ALERT_EMAILLIST_DETAILS ( - EMAIL_LIST_ID INTEGER, - EMAIL VARCHAR(255), - PRIMARY KEY (EMAIL_LIST_ID,EMAIL) -)ENGINE = INNODB; - -INSERT INTO AM_ALERT_TYPES (ALERT_TYPE_NAME, STAKE_HOLDER) VALUES ('abnormalResponseTime', 'publisher'); -INSERT INTO AM_ALERT_TYPES (ALERT_TYPE_NAME, STAKE_HOLDER) VALUES ('abnormalBackendTime', 'publisher'); -INSERT INTO AM_ALERT_TYPES (ALERT_TYPE_NAME, STAKE_HOLDER) VALUES ('abnormalRequestsPerMin', 'subscriber'); -INSERT INTO AM_ALERT_TYPES (ALERT_TYPE_NAME, STAKE_HOLDER) VALUES ('RequestPatternChanged', 'subscriber'); -INSERT INTO AM_ALERT_TYPES (ALERT_TYPE_NAME, STAKE_HOLDER) VALUES ('UnusualIPAccessAlert', 'subscriber'); -INSERT INTO AM_ALERT_TYPES (ALERT_TYPE_NAME, STAKE_HOLDER) VALUES ('AbnormalRefreshAlert', 'subscriber'); -INSERT INTO AM_ALERT_TYPES (ALERT_TYPE_NAME, STAKE_HOLDER) VALUES ('FrequentTierHittingAlert', 'subscriber'); -INSERT INTO AM_ALERT_TYPES (ALERT_TYPE_NAME, STAKE_HOLDER) VALUES ('AbnormalTierUsage', 'publisher'); -INSERT INTO AM_ALERT_TYPES (ALERT_TYPE_NAME, STAKE_HOLDER) VALUES ('healthAvailabilityPerMin', 'publisher'); - - - --- AM Throttling tables -- - -CREATE TABLE IF NOT EXISTS AM_POLICY_SUBSCRIPTION ( - POLICY_ID INT(11) NOT NULL AUTO_INCREMENT, - NAME VARCHAR(512) NOT NULL, - DISPLAY_NAME VARCHAR(512) NULL DEFAULT NULL, - TENANT_ID INT(11) NOT NULL, - DESCRIPTION VARCHAR(1024) NULL DEFAULT NULL, - QUOTA_TYPE VARCHAR(25) NOT NULL, - QUOTA INT(11) NOT NULL, - QUOTA_UNIT VARCHAR(10) NULL, - UNIT_TIME INT(11) NOT NULL, - TIME_UNIT VARCHAR(25) NOT NULL, - RATE_LIMIT_COUNT INT(11) NULL DEFAULT NULL, - RATE_LIMIT_TIME_UNIT VARCHAR(25) NULL DEFAULT NULL, - IS_DEPLOYED TINYINT(1) NOT NULL DEFAULT 0, - CUSTOM_ATTRIBUTES BLOB DEFAULT NULL, - STOP_ON_QUOTA_REACH BOOLEAN NOT NULL DEFAULT 0, - BILLING_PLAN VARCHAR(20) NOT NULL, - UUID VARCHAR(256), - PRIMARY KEY (POLICY_ID), - UNIQUE INDEX AM_POLICY_SUBSCRIPTION_NAME_TENANT (NAME, TENANT_ID), - UNIQUE (UUID) -)ENGINE = InnoDB; - -CREATE TABLE IF NOT EXISTS AM_POLICY_APPLICATION ( - POLICY_ID INT(11) NOT NULL AUTO_INCREMENT, - NAME VARCHAR(512) NOT NULL, - DISPLAY_NAME VARCHAR(512) NULL DEFAULT NULL, - TENANT_ID INT(11) NOT NULL, - DESCRIPTION VARCHAR(1024) NULL DEFAULT NULL, - QUOTA_TYPE VARCHAR(25) NOT NULL, - QUOTA INT(11) NOT NULL, - QUOTA_UNIT VARCHAR(10) NULL DEFAULT NULL, - UNIT_TIME INT(11) NOT NULL, - TIME_UNIT VARCHAR(25) NOT NULL, - IS_DEPLOYED TINYINT(1) NOT NULL DEFAULT 0, - CUSTOM_ATTRIBUTES BLOB DEFAULT NULL, - UUID VARCHAR(256), - PRIMARY KEY (POLICY_ID), - UNIQUE INDEX APP_NAME_TENANT (NAME, TENANT_ID), - UNIQUE (UUID) -)ENGINE = InnoDB; - -CREATE TABLE IF NOT EXISTS AM_POLICY_HARD_THROTTLING ( - POLICY_ID INT(11) NOT NULL AUTO_INCREMENT, - NAME VARCHAR(512) NOT NULL, - TENANT_ID INT(11) NOT NULL, - DESCRIPTION VARCHAR(1024) NULL DEFAULT NULL, - QUOTA_TYPE VARCHAR(25) NOT NULL, - QUOTA INT(11) NOT NULL, - QUOTA_UNIT VARCHAR(10) NULL DEFAULT NULL, - UNIT_TIME INT(11) NOT NULL, - TIME_UNIT VARCHAR(25) NOT NULL, - IS_DEPLOYED TINYINT(1) NOT NULL DEFAULT 0, - PRIMARY KEY (POLICY_ID), - UNIQUE INDEX POLICY_HARD_NAME_TENANT (NAME, TENANT_ID) -)ENGINE = InnoDB; - - -CREATE TABLE IF NOT EXISTS AM_API_THROTTLE_POLICY ( - POLICY_ID INT(11) NOT NULL AUTO_INCREMENT, - NAME VARCHAR(512) NOT NULL, - DISPLAY_NAME VARCHAR(512) NULL DEFAULT NULL, - TENANT_ID INT(11) NOT NULL, - DESCRIPTION VARCHAR (1024), - DEFAULT_QUOTA_TYPE VARCHAR(25) NOT NULL, - DEFAULT_QUOTA INTEGER NOT NULL, - DEFAULT_QUOTA_UNIT VARCHAR(10) NULL, - DEFAULT_UNIT_TIME INTEGER NOT NULL, - DEFAULT_TIME_UNIT VARCHAR(25) NOT NULL, - APPLICABLE_LEVEL VARCHAR(25) NOT NULL, - IS_DEPLOYED TINYINT(1) NOT NULL DEFAULT 0, - UUID VARCHAR(256), - PRIMARY KEY (POLICY_ID), - UNIQUE INDEX API_NAME_TENANT (NAME, TENANT_ID), - UNIQUE (UUID) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS AM_CONDITION_GROUP ( - CONDITION_GROUP_ID INTEGER NOT NULL AUTO_INCREMENT, - POLICY_ID INTEGER NOT NULL, - QUOTA_TYPE VARCHAR(25), - QUOTA INTEGER NOT NULL, - QUOTA_UNIT VARCHAR(10) NULL DEFAULT NULL, - UNIT_TIME INTEGER NOT NULL, - TIME_UNIT VARCHAR(25) NOT NULL, - DESCRIPTION VARCHAR (1024) NULL DEFAULT NULL, - PRIMARY KEY (CONDITION_GROUP_ID), - FOREIGN KEY (POLICY_ID) REFERENCES AM_API_THROTTLE_POLICY(POLICY_ID) ON DELETE CASCADE ON UPDATE CASCADE -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS AM_QUERY_PARAMETER_CONDITION ( - QUERY_PARAMETER_ID INTEGER NOT NULL AUTO_INCREMENT, - CONDITION_GROUP_ID INTEGER NOT NULL, - PARAMETER_NAME VARCHAR(255) DEFAULT NULL, - PARAMETER_VALUE VARCHAR(255) DEFAULT NULL, - IS_PARAM_MAPPING BOOLEAN DEFAULT 1, - PRIMARY KEY (QUERY_PARAMETER_ID), - FOREIGN KEY (CONDITION_GROUP_ID) REFERENCES AM_CONDITION_GROUP(CONDITION_GROUP_ID) ON DELETE CASCADE ON UPDATE CASCADE -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS AM_HEADER_FIELD_CONDITION ( - HEADER_FIELD_ID INTEGER NOT NULL AUTO_INCREMENT, - CONDITION_GROUP_ID INTEGER NOT NULL, - HEADER_FIELD_NAME VARCHAR(255) DEFAULT NULL, - HEADER_FIELD_VALUE VARCHAR(255) DEFAULT NULL, - IS_HEADER_FIELD_MAPPING BOOLEAN DEFAULT 1, - PRIMARY KEY (HEADER_FIELD_ID), - FOREIGN KEY (CONDITION_GROUP_ID) REFERENCES AM_CONDITION_GROUP(CONDITION_GROUP_ID) ON DELETE CASCADE ON UPDATE CASCADE -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS AM_JWT_CLAIM_CONDITION ( - JWT_CLAIM_ID INTEGER NOT NULL AUTO_INCREMENT, - CONDITION_GROUP_ID INTEGER NOT NULL, - CLAIM_URI VARCHAR(512) DEFAULT NULL, - CLAIM_ATTRIB VARCHAR(1024) DEFAULT NULL, - IS_CLAIM_MAPPING BOOLEAN DEFAULT 1, - PRIMARY KEY (JWT_CLAIM_ID), - FOREIGN KEY (CONDITION_GROUP_ID) REFERENCES AM_CONDITION_GROUP(CONDITION_GROUP_ID) ON DELETE CASCADE ON UPDATE CASCADE -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS AM_IP_CONDITION ( - AM_IP_CONDITION_ID INT NOT NULL AUTO_INCREMENT, - STARTING_IP VARCHAR(45) NULL, - ENDING_IP VARCHAR(45) NULL, - SPECIFIC_IP VARCHAR(45) NULL, - WITHIN_IP_RANGE BOOLEAN DEFAULT 1, - CONDITION_GROUP_ID INT NULL, - PRIMARY KEY (AM_IP_CONDITION_ID), - INDEX fk_AM_IP_CONDITION_1_idx (CONDITION_GROUP_ID ASC), CONSTRAINT fk_AM_IP_CONDITION_1 FOREIGN KEY (CONDITION_GROUP_ID) -REFERENCES AM_CONDITION_GROUP (CONDITION_GROUP_ID) ON DELETE CASCADE ON UPDATE CASCADE) - ENGINE = InnoDB; - - -CREATE TABLE IF NOT EXISTS AM_POLICY_GLOBAL ( - POLICY_ID INT(11) NOT NULL AUTO_INCREMENT, - NAME VARCHAR(512) NOT NULL, - KEY_TEMPLATE VARCHAR(512) NOT NULL, - TENANT_ID INT(11) NOT NULL, - DESCRIPTION VARCHAR(1024) NULL DEFAULT NULL, - SIDDHI_QUERY BLOB DEFAULT NULL, - IS_DEPLOYED TINYINT(1) NOT NULL DEFAULT 0, - UUID VARCHAR(256), - PRIMARY KEY (POLICY_ID), - UNIQUE (UUID) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS AM_THROTTLE_TIER_PERMISSIONS ( - THROTTLE_TIER_PERMISSIONS_ID INT NOT NULL AUTO_INCREMENT, - TIER VARCHAR(50) NULL, - PERMISSIONS_TYPE VARCHAR(50) NULL, - ROLES VARCHAR(512) NULL, - TENANT_ID INT(11) NULL, - PRIMARY KEY (THROTTLE_TIER_PERMISSIONS_ID)) - ENGINE = InnoDB; - -CREATE TABLE `AM_BLOCK_CONDITIONS` ( - `CONDITION_ID` int(11) NOT NULL AUTO_INCREMENT, - `TYPE` varchar(45) DEFAULT NULL, - `VALUE` varchar(512) DEFAULT NULL, - `ENABLED` varchar(45) DEFAULT NULL, - `DOMAIN` varchar(45) DEFAULT NULL, - `UUID` VARCHAR(256), - PRIMARY KEY (`CONDITION_ID`), - UNIQUE (`UUID`) -) ENGINE=InnoDB; - --- End of API-MGT Tables -- - --- Performance indexes start-- - -create index IDX_ITS_LMT on IDN_THRIFT_SESSION (LAST_MODIFIED_TIME); -create index IDX_IOAT_AT on IDN_OAUTH2_ACCESS_TOKEN (ACCESS_TOKEN); -create index IDX_IOAT_UT on IDN_OAUTH2_ACCESS_TOKEN (USER_TYPE); -create index IDX_AAI_CTX on AM_API (CONTEXT); -create index IDX_AAKM_CK on AM_APPLICATION_KEY_MAPPING (CONSUMER_KEY); -create index IDX_AAUM_AI on AM_API_URL_MAPPING (API_ID); -create index IDX_AAUM_TT on AM_API_URL_MAPPING (THROTTLING_TIER); -create index IDX_AATP_DQT on AM_API_THROTTLE_POLICY (DEFAULT_QUOTA_TYPE); -create index IDX_ACG_QT on AM_CONDITION_GROUP (QUOTA_TYPE); -create index IDX_APS_QT on AM_POLICY_SUBSCRIPTION (QUOTA_TYPE); -create index IDX_AS_AITIAI on AM_SUBSCRIPTION (API_ID,TIER_ID,APPLICATION_ID); -create index IDX_APA_QT on AM_POLICY_APPLICATION (QUOTA_TYPE); -create index IDX_AA_AT_CB on AM_APPLICATION (APPLICATION_TIER,CREATED_BY); - --- Performance indexes end-- diff --git a/base/mysql/scripts/mysql-configdb.sql b/base/mysql/scripts/mysql-configdb.sql deleted file mode 100644 index 12913f3a..00000000 --- a/base/mysql/scripts/mysql-configdb.sql +++ /dev/null @@ -1,467 +0,0 @@ -create database configdb; -use configdb; - -CREATE TABLE IF NOT EXISTS REG_CLUSTER_LOCK ( - REG_LOCK_NAME VARCHAR (20), - REG_LOCK_STATUS VARCHAR (20), - REG_LOCKED_TIME TIMESTAMP, - REG_TENANT_ID INTEGER DEFAULT 0, - PRIMARY KEY (REG_LOCK_NAME) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS REG_LOG ( - REG_LOG_ID INTEGER AUTO_INCREMENT, - REG_PATH VARCHAR (750), - REG_USER_ID VARCHAR (31) NOT NULL, - REG_LOGGED_TIME TIMESTAMP NOT NULL, - REG_ACTION INTEGER NOT NULL, - REG_ACTION_DATA VARCHAR (500), - REG_TENANT_ID INTEGER DEFAULT 0, - PRIMARY KEY (REG_LOG_ID, REG_TENANT_ID) -)ENGINE INNODB; - -CREATE INDEX REG_LOG_IND_BY_REGLOG USING HASH ON REG_LOG(REG_LOGGED_TIME, REG_TENANT_ID); - --- The REG_PATH_VALUE should be less than 767 bytes, and hence was fixed at 750. --- See CARBON-5917. - -CREATE TABLE IF NOT EXISTS REG_PATH( - REG_PATH_ID INTEGER NOT NULL AUTO_INCREMENT, - REG_PATH_VALUE VARCHAR(750) NOT NULL, - REG_PATH_PARENT_ID INTEGER, - REG_TENANT_ID INTEGER DEFAULT 0, - CONSTRAINT PK_REG_PATH PRIMARY KEY(REG_PATH_ID, REG_TENANT_ID) -)ENGINE INNODB; - -CREATE INDEX REG_PATH_IND_BY_PATH_VALUE USING HASH ON REG_PATH(REG_PATH_VALUE, REG_TENANT_ID); -CREATE INDEX REG_PATH_IND_BY_PATH_PARENT_ID USING HASH ON REG_PATH(REG_PATH_PARENT_ID, REG_TENANT_ID); - -CREATE TABLE IF NOT EXISTS REG_CONTENT ( - REG_CONTENT_ID INTEGER NOT NULL AUTO_INCREMENT, - REG_CONTENT_DATA LONGBLOB, - REG_TENANT_ID INTEGER DEFAULT 0, - CONSTRAINT PK_REG_CONTENT PRIMARY KEY(REG_CONTENT_ID, REG_TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS REG_CONTENT_HISTORY ( - REG_CONTENT_ID INTEGER NOT NULL, - REG_CONTENT_DATA LONGBLOB, - REG_DELETED SMALLINT, - REG_TENANT_ID INTEGER DEFAULT 0, - CONSTRAINT PK_REG_CONTENT_HISTORY PRIMARY KEY(REG_CONTENT_ID, REG_TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS REG_RESOURCE ( - REG_PATH_ID INTEGER NOT NULL, - REG_NAME VARCHAR(256), - REG_VERSION INTEGER NOT NULL AUTO_INCREMENT, - REG_MEDIA_TYPE VARCHAR(500), - REG_CREATOR VARCHAR(31) NOT NULL, - REG_CREATED_TIME TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - REG_LAST_UPDATOR VARCHAR(31), - REG_LAST_UPDATED_TIME TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - REG_DESCRIPTION VARCHAR(1000), - REG_CONTENT_ID INTEGER, - REG_TENANT_ID INTEGER DEFAULT 0, - REG_UUID VARCHAR(100) NOT NULL, - CONSTRAINT PK_REG_RESOURCE PRIMARY KEY(REG_VERSION, REG_TENANT_ID) -)ENGINE INNODB; - -ALTER TABLE REG_RESOURCE ADD CONSTRAINT REG_RESOURCE_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID); -ALTER TABLE REG_RESOURCE ADD CONSTRAINT REG_RESOURCE_FK_BY_CONTENT_ID FOREIGN KEY (REG_CONTENT_ID, REG_TENANT_ID) REFERENCES REG_CONTENT (REG_CONTENT_ID, REG_TENANT_ID); -CREATE INDEX REG_RESOURCE_IND_BY_NAME USING HASH ON REG_RESOURCE(REG_NAME, REG_TENANT_ID); -CREATE INDEX REG_RESOURCE_IND_BY_PATH_ID_NAME USING HASH ON REG_RESOURCE(REG_PATH_ID, REG_NAME, REG_TENANT_ID); -CREATE INDEX REG_RESOURCE_IND_BY_UUID USING HASH ON REG_RESOURCE(REG_UUID); -CREATE INDEX REG_RESOURCE_IND_BY_TENAN USING HASH ON REG_RESOURCE(REG_TENANT_ID, REG_UUID); -CREATE INDEX REG_RESOURCE_IND_BY_TYPE USING HASH ON REG_RESOURCE(REG_TENANT_ID, REG_MEDIA_TYPE); - -CREATE TABLE IF NOT EXISTS REG_RESOURCE_HISTORY ( - REG_PATH_ID INTEGER NOT NULL, - REG_NAME VARCHAR(256), - REG_VERSION INTEGER NOT NULL, - REG_MEDIA_TYPE VARCHAR(500), - REG_CREATOR VARCHAR(31) NOT NULL, - REG_CREATED_TIME TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - REG_LAST_UPDATOR VARCHAR(31), - REG_LAST_UPDATED_TIME TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - REG_DESCRIPTION VARCHAR(1000), - REG_CONTENT_ID INTEGER, - REG_DELETED SMALLINT, - REG_TENANT_ID INTEGER DEFAULT 0, - REG_UUID VARCHAR(100) NOT NULL, - CONSTRAINT PK_REG_RESOURCE_HISTORY PRIMARY KEY(REG_VERSION, REG_TENANT_ID) -)ENGINE INNODB; - -ALTER TABLE REG_RESOURCE_HISTORY ADD CONSTRAINT REG_RESOURCE_HIST_FK_BY_PATHID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID); -ALTER TABLE REG_RESOURCE_HISTORY ADD CONSTRAINT REG_RESOURCE_HIST_FK_BY_CONTENT_ID FOREIGN KEY (REG_CONTENT_ID, REG_TENANT_ID) REFERENCES REG_CONTENT_HISTORY (REG_CONTENT_ID, REG_TENANT_ID); -CREATE INDEX REG_RESOURCE_HISTORY_IND_BY_NAME USING HASH ON REG_RESOURCE_HISTORY(REG_NAME, REG_TENANT_ID); -CREATE INDEX REG_RESOURCE_HISTORY_IND_BY_PATH_ID_NAME USING HASH ON REG_RESOURCE(REG_PATH_ID, REG_NAME, REG_TENANT_ID); - -CREATE TABLE IF NOT EXISTS REG_COMMENT ( - REG_ID INTEGER NOT NULL AUTO_INCREMENT, - REG_COMMENT_TEXT VARCHAR(500) NOT NULL, - REG_USER_ID VARCHAR(31) NOT NULL, - REG_COMMENTED_TIME TIMESTAMP NOT NULL, - REG_TENANT_ID INTEGER DEFAULT 0, - CONSTRAINT PK_REG_COMMENT PRIMARY KEY(REG_ID, REG_TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS REG_RESOURCE_COMMENT ( - REG_COMMENT_ID INTEGER NOT NULL, - REG_VERSION INTEGER, - REG_PATH_ID INTEGER, - REG_RESOURCE_NAME VARCHAR(256), - REG_TENANT_ID INTEGER DEFAULT 0 -)ENGINE INNODB; - -ALTER TABLE REG_RESOURCE_COMMENT ADD CONSTRAINT REG_RESOURCE_COMMENT_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID); -ALTER TABLE REG_RESOURCE_COMMENT ADD CONSTRAINT REG_RESOURCE_COMMENT_FK_BY_COMMENT_ID FOREIGN KEY (REG_COMMENT_ID, REG_TENANT_ID) REFERENCES REG_COMMENT (REG_ID, REG_TENANT_ID); -CREATE INDEX REG_RESOURCE_COMMENT_IND_BY_PATH_ID_AND_RESOURCE_NAME USING HASH ON REG_RESOURCE_COMMENT(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID); -CREATE INDEX REG_RESOURCE_COMMENT_IND_BY_VERSION USING HASH ON REG_RESOURCE_COMMENT(REG_VERSION, REG_TENANT_ID); - -CREATE TABLE IF NOT EXISTS REG_RATING ( - REG_ID INTEGER NOT NULL AUTO_INCREMENT, - REG_RATING INTEGER NOT NULL, - REG_USER_ID VARCHAR(31) NOT NULL, - REG_RATED_TIME TIMESTAMP NOT NULL, - REG_TENANT_ID INTEGER DEFAULT 0, - CONSTRAINT PK_REG_RATING PRIMARY KEY(REG_ID, REG_TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS REG_RESOURCE_RATING ( - REG_RATING_ID INTEGER NOT NULL, - REG_VERSION INTEGER, - REG_PATH_ID INTEGER, - REG_RESOURCE_NAME VARCHAR(256), - REG_TENANT_ID INTEGER DEFAULT 0 -)ENGINE INNODB; - -ALTER TABLE REG_RESOURCE_RATING ADD CONSTRAINT REG_RESOURCE_RATING_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID); -ALTER TABLE REG_RESOURCE_RATING ADD CONSTRAINT REG_RESOURCE_RATING_FK_BY_RATING_ID FOREIGN KEY (REG_RATING_ID, REG_TENANT_ID) REFERENCES REG_RATING (REG_ID, REG_TENANT_ID); -CREATE INDEX REG_RESOURCE_RATING_IND_BY_PATH_ID_AND_RESOURCE_NAME USING HASH ON REG_RESOURCE_RATING(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID); -CREATE INDEX REG_RESOURCE_RATING_IND_BY_VERSION USING HASH ON REG_RESOURCE_RATING(REG_VERSION, REG_TENANT_ID); - - -CREATE TABLE IF NOT EXISTS REG_TAG ( - REG_ID INTEGER NOT NULL AUTO_INCREMENT, - REG_TAG_NAME VARCHAR(500) NOT NULL, - REG_USER_ID VARCHAR(31) NOT NULL, - REG_TAGGED_TIME TIMESTAMP NOT NULL, - REG_TENANT_ID INTEGER DEFAULT 0, - CONSTRAINT PK_REG_TAG PRIMARY KEY(REG_ID, REG_TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS REG_RESOURCE_TAG ( - REG_TAG_ID INTEGER NOT NULL, - REG_VERSION INTEGER, - REG_PATH_ID INTEGER, - REG_RESOURCE_NAME VARCHAR(256), - REG_TENANT_ID INTEGER DEFAULT 0 -)ENGINE INNODB; - -ALTER TABLE REG_RESOURCE_TAG ADD CONSTRAINT REG_RESOURCE_TAG_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID); -ALTER TABLE REG_RESOURCE_TAG ADD CONSTRAINT REG_RESOURCE_TAG_FK_BY_TAG_ID FOREIGN KEY (REG_TAG_ID, REG_TENANT_ID) REFERENCES REG_TAG (REG_ID, REG_TENANT_ID); -CREATE INDEX REG_RESOURCE_TAG_IND_BY_PATH_ID_AND_RESOURCE_NAME USING HASH ON REG_RESOURCE_TAG(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID); -CREATE INDEX REG_RESOURCE_TAG_IND_BY_VERSION USING HASH ON REG_RESOURCE_TAG(REG_VERSION, REG_TENANT_ID); - -CREATE TABLE IF NOT EXISTS REG_PROPERTY ( - REG_ID INTEGER NOT NULL AUTO_INCREMENT, - REG_NAME VARCHAR(100) NOT NULL, - REG_VALUE VARCHAR(1000), - REG_TENANT_ID INTEGER DEFAULT 0, - CONSTRAINT PK_REG_PROPERTY PRIMARY KEY(REG_ID, REG_TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS REG_RESOURCE_PROPERTY ( - REG_PROPERTY_ID INTEGER NOT NULL, - REG_VERSION INTEGER, - REG_PATH_ID INTEGER, - REG_RESOURCE_NAME VARCHAR(256), - REG_TENANT_ID INTEGER DEFAULT 0 -)ENGINE INNODB; - -ALTER TABLE REG_RESOURCE_PROPERTY ADD CONSTRAINT REG_RESOURCE_PROPERTY_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID); -ALTER TABLE REG_RESOURCE_PROPERTY ADD CONSTRAINT REG_RESOURCE_PROPERTY_FK_BY_TAG_ID FOREIGN KEY (REG_PROPERTY_ID, REG_TENANT_ID) REFERENCES REG_PROPERTY (REG_ID, REG_TENANT_ID); -CREATE INDEX REG_RESOURCE_PROPERTY_IND_BY_PATH_ID_AND_RESOURCE_NAME USING HASH ON REG_RESOURCE_PROPERTY(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID); -CREATE INDEX REG_RESOURCE_PROPERTY_IND_BY_VERSION USING HASH ON REG_RESOURCE_PROPERTY(REG_VERSION, REG_TENANT_ID); - --- CREATE TABLE IF NOT EXISTS REG_ASSOCIATIONS ( --- SRC_PATH_ID INTEGER, --- SRC_RESOURCE_NAME VARCHAR(256), --- SRC_VERSION INTEGER, --- TGT_PATH_ID INTEGER, --- TGT_RESOURCE_NAME VARCHAR(256), --- TGT_VERSION INTEGER --- )ENGINE INNODB; --- --- ALTER TABLE REG_ASSOCIATIONS ADD CONSTRAINT REG_ASSOCIATIONS_FK_BY_SRC_PATH_ID FOREIGN KEY (SRC_PATH_ID) REFERENCES REG_PATH (PATH_ID); --- ALTER TABLE REG_ASSOCIATIONS ADD CONSTRAINT REG_ASSOCIATIONS_FK_BY_TGT_PATH_ID FOREIGN KEY (TGT_PATH_ID) REFERENCES REG_PATH (PATH_ID); --- CREATE INDEX REG_ASSOCIATIONS_IND_BY_SRC_VERSION ON REG_ASSOCIATIONS(SRC_VERSION); --- CREATE INDEX REG_ASSOCIATIONS_IND_BY_TGT_VERSION ON REG_ASSOCIATIONS(TGT_VERSION); --- CREATE INDEX REG_ASSOCIATIONS_IND_BY_SRC_RESOURCE_NAME ON REG_ASSOCIATIONS(SRC_RESOURCE_NAME); --- CREATE INDEX REG_ASSOCIATIONS_IND_BY_TGT_RESOURCE_NAME ON REG_ASSOCIATIONS(TGT_RESOURCE_NAME); - - - -CREATE TABLE IF NOT EXISTS REG_ASSOCIATION ( - REG_ASSOCIATION_ID INTEGER AUTO_INCREMENT, - REG_SOURCEPATH VARCHAR (750) NOT NULL, - REG_TARGETPATH VARCHAR (750) NOT NULL, - REG_ASSOCIATION_TYPE VARCHAR (2000) NOT NULL, - REG_TENANT_ID INTEGER DEFAULT 0, - PRIMARY KEY (REG_ASSOCIATION_ID, REG_TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS REG_SNAPSHOT ( - REG_SNAPSHOT_ID INTEGER NOT NULL AUTO_INCREMENT, - REG_PATH_ID INTEGER NOT NULL, - REG_RESOURCE_NAME VARCHAR(255), - REG_RESOURCE_VIDS LONGBLOB NOT NULL, - REG_TENANT_ID INTEGER DEFAULT 0, - CONSTRAINT PK_REG_SNAPSHOT PRIMARY KEY(REG_SNAPSHOT_ID, REG_TENANT_ID) -)ENGINE INNODB; - -CREATE INDEX REG_SNAPSHOT_IND_BY_PATH_ID_AND_RESOURCE_NAME USING HASH ON REG_SNAPSHOT(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID); - -ALTER TABLE REG_SNAPSHOT ADD CONSTRAINT REG_SNAPSHOT_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID); - - --- ################################ --- USER MANAGER TABLES --- ################################ - -CREATE TABLE UM_TENANT ( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_DOMAIN_NAME VARCHAR(255) NOT NULL, - UM_EMAIL VARCHAR(255), - UM_ACTIVE BOOLEAN DEFAULT FALSE, - UM_CREATED_DATE TIMESTAMP NOT NULL, - UM_USER_CONFIG LONGBLOB, - PRIMARY KEY (UM_ID), - UNIQUE(UM_DOMAIN_NAME) -)ENGINE INNODB; - -CREATE TABLE UM_DOMAIN( - UM_DOMAIN_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_DOMAIN_NAME VARCHAR(255), - UM_TENANT_ID INTEGER DEFAULT 0, - PRIMARY KEY (UM_DOMAIN_ID, UM_TENANT_ID) -)ENGINE INNODB; - -CREATE UNIQUE INDEX INDEX_UM_TENANT_UM_DOMAIN_NAME - ON UM_TENANT (UM_DOMAIN_NAME); - -CREATE TABLE UM_USER ( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_USER_NAME VARCHAR(255) NOT NULL, - UM_USER_PASSWORD VARCHAR(255) NOT NULL, - UM_SALT_VALUE VARCHAR(31), - UM_REQUIRE_CHANGE BOOLEAN DEFAULT FALSE, - UM_CHANGED_TIME TIMESTAMP NOT NULL, - UM_TENANT_ID INTEGER DEFAULT 0, - PRIMARY KEY (UM_ID, UM_TENANT_ID), - UNIQUE(UM_USER_NAME, UM_TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE UM_SYSTEM_USER ( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_USER_NAME VARCHAR(255) NOT NULL, - UM_USER_PASSWORD VARCHAR(255) NOT NULL, - UM_SALT_VALUE VARCHAR(31), - UM_REQUIRE_CHANGE BOOLEAN DEFAULT FALSE, - UM_CHANGED_TIME TIMESTAMP NOT NULL, - UM_TENANT_ID INTEGER DEFAULT 0, - PRIMARY KEY (UM_ID, UM_TENANT_ID), - UNIQUE(UM_USER_NAME, UM_TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE UM_ROLE ( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_ROLE_NAME VARCHAR(255) NOT NULL, - UM_TENANT_ID INTEGER DEFAULT 0, - UM_SHARED_ROLE BOOLEAN DEFAULT FALSE, - PRIMARY KEY (UM_ID, UM_TENANT_ID), - UNIQUE(UM_ROLE_NAME, UM_TENANT_ID) -)ENGINE INNODB; - - -CREATE TABLE UM_MODULE( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_MODULE_NAME VARCHAR(100), - UNIQUE(UM_MODULE_NAME), - PRIMARY KEY(UM_ID) -)ENGINE INNODB; - -CREATE TABLE UM_MODULE_ACTIONS( - UM_ACTION VARCHAR(255) NOT NULL, - UM_MODULE_ID INTEGER NOT NULL, - PRIMARY KEY(UM_ACTION, UM_MODULE_ID), - FOREIGN KEY (UM_MODULE_ID) REFERENCES UM_MODULE(UM_ID) ON DELETE CASCADE -)ENGINE INNODB; - -CREATE TABLE UM_PERMISSION ( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_RESOURCE_ID VARCHAR(255) NOT NULL, - UM_ACTION VARCHAR(255) NOT NULL, - UM_TENANT_ID INTEGER DEFAULT 0, - UM_MODULE_ID INTEGER DEFAULT 0, - PRIMARY KEY (UM_ID, UM_TENANT_ID) -)ENGINE INNODB; - -CREATE INDEX INDEX_UM_PERMISSION_UM_RESOURCE_ID_UM_ACTION ON UM_PERMISSION (UM_RESOURCE_ID, UM_ACTION, UM_TENANT_ID); - -CREATE TABLE UM_ROLE_PERMISSION ( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_PERMISSION_ID INTEGER NOT NULL, - UM_ROLE_NAME VARCHAR(255) NOT NULL, - UM_IS_ALLOWED SMALLINT NOT NULL, - UM_TENANT_ID INTEGER DEFAULT 0, - UM_DOMAIN_ID INTEGER, - UNIQUE (UM_PERMISSION_ID, UM_ROLE_NAME, UM_TENANT_ID, UM_DOMAIN_ID), - FOREIGN KEY (UM_PERMISSION_ID, UM_TENANT_ID) REFERENCES UM_PERMISSION(UM_ID, UM_TENANT_ID) ON DELETE CASCADE, - FOREIGN KEY (UM_DOMAIN_ID, UM_TENANT_ID) REFERENCES UM_DOMAIN(UM_DOMAIN_ID, UM_TENANT_ID) ON DELETE CASCADE, - PRIMARY KEY (UM_ID, UM_TENANT_ID) -)ENGINE INNODB; - --- REMOVED UNIQUE (UM_PERMISSION_ID, UM_ROLE_ID) -CREATE TABLE UM_USER_PERMISSION ( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_PERMISSION_ID INTEGER NOT NULL, - UM_USER_NAME VARCHAR(255) NOT NULL, - UM_IS_ALLOWED SMALLINT NOT NULL, - UM_TENANT_ID INTEGER DEFAULT 0, - FOREIGN KEY (UM_PERMISSION_ID, UM_TENANT_ID) REFERENCES UM_PERMISSION(UM_ID, UM_TENANT_ID) ON DELETE CASCADE, - PRIMARY KEY (UM_ID, UM_TENANT_ID) -)ENGINE INNODB; - --- REMOVED UNIQUE (UM_PERMISSION_ID, UM_USER_ID) -CREATE TABLE UM_USER_ROLE ( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_ROLE_ID INTEGER NOT NULL, - UM_USER_ID INTEGER NOT NULL, - UM_TENANT_ID INTEGER DEFAULT 0, - UNIQUE (UM_USER_ID, UM_ROLE_ID, UM_TENANT_ID), - FOREIGN KEY (UM_ROLE_ID, UM_TENANT_ID) REFERENCES UM_ROLE(UM_ID, UM_TENANT_ID), - FOREIGN KEY (UM_USER_ID, UM_TENANT_ID) REFERENCES UM_USER(UM_ID, UM_TENANT_ID), - PRIMARY KEY (UM_ID, UM_TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE UM_SHARED_USER_ROLE( - UM_ROLE_ID INTEGER NOT NULL, - UM_USER_ID INTEGER NOT NULL, - UM_USER_TENANT_ID INTEGER NOT NULL, - UM_ROLE_TENANT_ID INTEGER NOT NULL, - UNIQUE(UM_USER_ID,UM_ROLE_ID,UM_USER_TENANT_ID, UM_ROLE_TENANT_ID), - FOREIGN KEY(UM_ROLE_ID,UM_ROLE_TENANT_ID) REFERENCES UM_ROLE(UM_ID,UM_TENANT_ID) ON DELETE CASCADE, - FOREIGN KEY(UM_USER_ID,UM_USER_TENANT_ID) REFERENCES UM_USER(UM_ID,UM_TENANT_ID) ON DELETE CASCADE -)ENGINE INNODB; - -CREATE TABLE UM_ACCOUNT_MAPPING( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_USER_NAME VARCHAR(255) NOT NULL, - UM_TENANT_ID INTEGER NOT NULL, - UM_USER_STORE_DOMAIN VARCHAR(100), - UM_ACC_LINK_ID INTEGER NOT NULL, - UNIQUE(UM_USER_NAME, UM_TENANT_ID, UM_USER_STORE_DOMAIN, UM_ACC_LINK_ID), - FOREIGN KEY (UM_TENANT_ID) REFERENCES UM_TENANT(UM_ID) ON DELETE CASCADE, - PRIMARY KEY (UM_ID) -)ENGINE INNODB; - - -CREATE TABLE UM_USER_ATTRIBUTE ( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_ATTR_NAME VARCHAR(255) NOT NULL, - UM_ATTR_VALUE VARCHAR(1024), - UM_PROFILE_ID VARCHAR(255), - UM_USER_ID INTEGER, - UM_TENANT_ID INTEGER DEFAULT 0, - FOREIGN KEY (UM_USER_ID, UM_TENANT_ID) REFERENCES UM_USER(UM_ID, UM_TENANT_ID), - PRIMARY KEY (UM_ID, UM_TENANT_ID) -)ENGINE INNODB; - -CREATE INDEX UM_USER_ID_INDEX ON UM_USER_ATTRIBUTE(UM_USER_ID); - -CREATE TABLE UM_DIALECT( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_DIALECT_URI VARCHAR(255) NOT NULL, - UM_TENANT_ID INTEGER DEFAULT 0, - UNIQUE(UM_DIALECT_URI, UM_TENANT_ID), - PRIMARY KEY (UM_ID, UM_TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE UM_CLAIM( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_DIALECT_ID INTEGER NOT NULL, - UM_CLAIM_URI VARCHAR(255) NOT NULL, - UM_DISPLAY_TAG VARCHAR(255), - UM_DESCRIPTION VARCHAR(255), - UM_MAPPED_ATTRIBUTE_DOMAIN VARCHAR(255), - UM_MAPPED_ATTRIBUTE VARCHAR(255), - UM_REG_EX VARCHAR(255), - UM_SUPPORTED SMALLINT, - UM_REQUIRED SMALLINT, - UM_DISPLAY_ORDER INTEGER, - UM_CHECKED_ATTRIBUTE SMALLINT, - UM_READ_ONLY SMALLINT, - UM_TENANT_ID INTEGER DEFAULT 0, - UNIQUE(UM_DIALECT_ID, UM_CLAIM_URI, UM_TENANT_ID,UM_MAPPED_ATTRIBUTE_DOMAIN), - FOREIGN KEY(UM_DIALECT_ID, UM_TENANT_ID) REFERENCES UM_DIALECT(UM_ID, UM_TENANT_ID), - PRIMARY KEY (UM_ID, UM_TENANT_ID) -)ENGINE INNODB; - - -CREATE TABLE UM_PROFILE_CONFIG( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_DIALECT_ID INTEGER NOT NULL, - UM_PROFILE_NAME VARCHAR(255), - UM_TENANT_ID INTEGER DEFAULT 0, - FOREIGN KEY(UM_DIALECT_ID, UM_TENANT_ID) REFERENCES UM_DIALECT(UM_ID, UM_TENANT_ID), - PRIMARY KEY (UM_ID, UM_TENANT_ID) -)ENGINE INNODB; - - -CREATE TABLE UM_HYBRID_ROLE( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_ROLE_NAME VARCHAR(255), - UM_TENANT_ID INTEGER DEFAULT 0, - PRIMARY KEY (UM_ID, UM_TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE UM_HYBRID_USER_ROLE( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_USER_NAME VARCHAR(255), - UM_ROLE_ID INTEGER NOT NULL, - UM_TENANT_ID INTEGER DEFAULT 0, - UM_DOMAIN_ID INTEGER, - UNIQUE (UM_USER_NAME, UM_ROLE_ID, UM_TENANT_ID, UM_DOMAIN_ID), - FOREIGN KEY (UM_ROLE_ID, UM_TENANT_ID) REFERENCES UM_HYBRID_ROLE(UM_ID, UM_TENANT_ID) ON DELETE CASCADE, - FOREIGN KEY (UM_DOMAIN_ID, UM_TENANT_ID) REFERENCES UM_DOMAIN(UM_DOMAIN_ID, UM_TENANT_ID) ON DELETE CASCADE, - PRIMARY KEY (UM_ID, UM_TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE UM_SYSTEM_ROLE( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_ROLE_NAME VARCHAR(255), - UM_TENANT_ID INTEGER DEFAULT 0, - PRIMARY KEY (UM_ID, UM_TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE UM_SYSTEM_USER_ROLE( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_USER_NAME VARCHAR(255), - UM_ROLE_ID INTEGER NOT NULL, - UM_TENANT_ID INTEGER DEFAULT 0, - UNIQUE (UM_USER_NAME, UM_ROLE_ID, UM_TENANT_ID), - FOREIGN KEY (UM_ROLE_ID, UM_TENANT_ID) REFERENCES UM_SYSTEM_ROLE(UM_ID, UM_TENANT_ID), - PRIMARY KEY (UM_ID, UM_TENANT_ID) -)ENGINE INNODB; - - -CREATE TABLE UM_HYBRID_REMEMBER_ME( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_USER_NAME VARCHAR(255) NOT NULL, - UM_COOKIE_VALUE VARCHAR(1024), - UM_CREATED_TIME TIMESTAMP, - UM_TENANT_ID INTEGER DEFAULT 0, - PRIMARY KEY (UM_ID, UM_TENANT_ID) -)ENGINE INNODB; diff --git a/base/mysql/scripts/mysql-govregdb.sql b/base/mysql/scripts/mysql-govregdb.sql deleted file mode 100644 index 5eb010d7..00000000 --- a/base/mysql/scripts/mysql-govregdb.sql +++ /dev/null @@ -1,467 +0,0 @@ -create database govregdb; -use govregdb; - -CREATE TABLE IF NOT EXISTS REG_CLUSTER_LOCK ( - REG_LOCK_NAME VARCHAR (20), - REG_LOCK_STATUS VARCHAR (20), - REG_LOCKED_TIME TIMESTAMP, - REG_TENANT_ID INTEGER DEFAULT 0, - PRIMARY KEY (REG_LOCK_NAME) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS REG_LOG ( - REG_LOG_ID INTEGER AUTO_INCREMENT, - REG_PATH VARCHAR (750), - REG_USER_ID VARCHAR (31) NOT NULL, - REG_LOGGED_TIME TIMESTAMP NOT NULL, - REG_ACTION INTEGER NOT NULL, - REG_ACTION_DATA VARCHAR (500), - REG_TENANT_ID INTEGER DEFAULT 0, - PRIMARY KEY (REG_LOG_ID, REG_TENANT_ID) -)ENGINE INNODB; - -CREATE INDEX REG_LOG_IND_BY_REGLOG USING HASH ON REG_LOG(REG_LOGGED_TIME, REG_TENANT_ID); - --- The REG_PATH_VALUE should be less than 767 bytes, and hence was fixed at 750. --- See CARBON-5917. - -CREATE TABLE IF NOT EXISTS REG_PATH( - REG_PATH_ID INTEGER NOT NULL AUTO_INCREMENT, - REG_PATH_VALUE VARCHAR(750) NOT NULL, - REG_PATH_PARENT_ID INTEGER, - REG_TENANT_ID INTEGER DEFAULT 0, - CONSTRAINT PK_REG_PATH PRIMARY KEY(REG_PATH_ID, REG_TENANT_ID) -)ENGINE INNODB; - -CREATE INDEX REG_PATH_IND_BY_PATH_VALUE USING HASH ON REG_PATH(REG_PATH_VALUE, REG_TENANT_ID); -CREATE INDEX REG_PATH_IND_BY_PATH_PARENT_ID USING HASH ON REG_PATH(REG_PATH_PARENT_ID, REG_TENANT_ID); - -CREATE TABLE IF NOT EXISTS REG_CONTENT ( - REG_CONTENT_ID INTEGER NOT NULL AUTO_INCREMENT, - REG_CONTENT_DATA LONGBLOB, - REG_TENANT_ID INTEGER DEFAULT 0, - CONSTRAINT PK_REG_CONTENT PRIMARY KEY(REG_CONTENT_ID, REG_TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS REG_CONTENT_HISTORY ( - REG_CONTENT_ID INTEGER NOT NULL, - REG_CONTENT_DATA LONGBLOB, - REG_DELETED SMALLINT, - REG_TENANT_ID INTEGER DEFAULT 0, - CONSTRAINT PK_REG_CONTENT_HISTORY PRIMARY KEY(REG_CONTENT_ID, REG_TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS REG_RESOURCE ( - REG_PATH_ID INTEGER NOT NULL, - REG_NAME VARCHAR(256), - REG_VERSION INTEGER NOT NULL AUTO_INCREMENT, - REG_MEDIA_TYPE VARCHAR(500), - REG_CREATOR VARCHAR(31) NOT NULL, - REG_CREATED_TIME TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - REG_LAST_UPDATOR VARCHAR(31), - REG_LAST_UPDATED_TIME TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - REG_DESCRIPTION VARCHAR(1000), - REG_CONTENT_ID INTEGER, - REG_TENANT_ID INTEGER DEFAULT 0, - REG_UUID VARCHAR(100) NOT NULL, - CONSTRAINT PK_REG_RESOURCE PRIMARY KEY(REG_VERSION, REG_TENANT_ID) -)ENGINE INNODB; - -ALTER TABLE REG_RESOURCE ADD CONSTRAINT REG_RESOURCE_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID); -ALTER TABLE REG_RESOURCE ADD CONSTRAINT REG_RESOURCE_FK_BY_CONTENT_ID FOREIGN KEY (REG_CONTENT_ID, REG_TENANT_ID) REFERENCES REG_CONTENT (REG_CONTENT_ID, REG_TENANT_ID); -CREATE INDEX REG_RESOURCE_IND_BY_NAME USING HASH ON REG_RESOURCE(REG_NAME, REG_TENANT_ID); -CREATE INDEX REG_RESOURCE_IND_BY_PATH_ID_NAME USING HASH ON REG_RESOURCE(REG_PATH_ID, REG_NAME, REG_TENANT_ID); -CREATE INDEX REG_RESOURCE_IND_BY_UUID USING HASH ON REG_RESOURCE(REG_UUID); -CREATE INDEX REG_RESOURCE_IND_BY_TENAN USING HASH ON REG_RESOURCE(REG_TENANT_ID, REG_UUID); -CREATE INDEX REG_RESOURCE_IND_BY_TYPE USING HASH ON REG_RESOURCE(REG_TENANT_ID, REG_MEDIA_TYPE); - -CREATE TABLE IF NOT EXISTS REG_RESOURCE_HISTORY ( - REG_PATH_ID INTEGER NOT NULL, - REG_NAME VARCHAR(256), - REG_VERSION INTEGER NOT NULL, - REG_MEDIA_TYPE VARCHAR(500), - REG_CREATOR VARCHAR(31) NOT NULL, - REG_CREATED_TIME TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - REG_LAST_UPDATOR VARCHAR(31), - REG_LAST_UPDATED_TIME TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - REG_DESCRIPTION VARCHAR(1000), - REG_CONTENT_ID INTEGER, - REG_DELETED SMALLINT, - REG_TENANT_ID INTEGER DEFAULT 0, - REG_UUID VARCHAR(100) NOT NULL, - CONSTRAINT PK_REG_RESOURCE_HISTORY PRIMARY KEY(REG_VERSION, REG_TENANT_ID) -)ENGINE INNODB; - -ALTER TABLE REG_RESOURCE_HISTORY ADD CONSTRAINT REG_RESOURCE_HIST_FK_BY_PATHID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID); -ALTER TABLE REG_RESOURCE_HISTORY ADD CONSTRAINT REG_RESOURCE_HIST_FK_BY_CONTENT_ID FOREIGN KEY (REG_CONTENT_ID, REG_TENANT_ID) REFERENCES REG_CONTENT_HISTORY (REG_CONTENT_ID, REG_TENANT_ID); -CREATE INDEX REG_RESOURCE_HISTORY_IND_BY_NAME USING HASH ON REG_RESOURCE_HISTORY(REG_NAME, REG_TENANT_ID); -CREATE INDEX REG_RESOURCE_HISTORY_IND_BY_PATH_ID_NAME USING HASH ON REG_RESOURCE(REG_PATH_ID, REG_NAME, REG_TENANT_ID); - -CREATE TABLE IF NOT EXISTS REG_COMMENT ( - REG_ID INTEGER NOT NULL AUTO_INCREMENT, - REG_COMMENT_TEXT VARCHAR(500) NOT NULL, - REG_USER_ID VARCHAR(31) NOT NULL, - REG_COMMENTED_TIME TIMESTAMP NOT NULL, - REG_TENANT_ID INTEGER DEFAULT 0, - CONSTRAINT PK_REG_COMMENT PRIMARY KEY(REG_ID, REG_TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS REG_RESOURCE_COMMENT ( - REG_COMMENT_ID INTEGER NOT NULL, - REG_VERSION INTEGER, - REG_PATH_ID INTEGER, - REG_RESOURCE_NAME VARCHAR(256), - REG_TENANT_ID INTEGER DEFAULT 0 -)ENGINE INNODB; - -ALTER TABLE REG_RESOURCE_COMMENT ADD CONSTRAINT REG_RESOURCE_COMMENT_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID); -ALTER TABLE REG_RESOURCE_COMMENT ADD CONSTRAINT REG_RESOURCE_COMMENT_FK_BY_COMMENT_ID FOREIGN KEY (REG_COMMENT_ID, REG_TENANT_ID) REFERENCES REG_COMMENT (REG_ID, REG_TENANT_ID); -CREATE INDEX REG_RESOURCE_COMMENT_IND_BY_PATH_ID_AND_RESOURCE_NAME USING HASH ON REG_RESOURCE_COMMENT(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID); -CREATE INDEX REG_RESOURCE_COMMENT_IND_BY_VERSION USING HASH ON REG_RESOURCE_COMMENT(REG_VERSION, REG_TENANT_ID); - -CREATE TABLE IF NOT EXISTS REG_RATING ( - REG_ID INTEGER NOT NULL AUTO_INCREMENT, - REG_RATING INTEGER NOT NULL, - REG_USER_ID VARCHAR(31) NOT NULL, - REG_RATED_TIME TIMESTAMP NOT NULL, - REG_TENANT_ID INTEGER DEFAULT 0, - CONSTRAINT PK_REG_RATING PRIMARY KEY(REG_ID, REG_TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS REG_RESOURCE_RATING ( - REG_RATING_ID INTEGER NOT NULL, - REG_VERSION INTEGER, - REG_PATH_ID INTEGER, - REG_RESOURCE_NAME VARCHAR(256), - REG_TENANT_ID INTEGER DEFAULT 0 -)ENGINE INNODB; - -ALTER TABLE REG_RESOURCE_RATING ADD CONSTRAINT REG_RESOURCE_RATING_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID); -ALTER TABLE REG_RESOURCE_RATING ADD CONSTRAINT REG_RESOURCE_RATING_FK_BY_RATING_ID FOREIGN KEY (REG_RATING_ID, REG_TENANT_ID) REFERENCES REG_RATING (REG_ID, REG_TENANT_ID); -CREATE INDEX REG_RESOURCE_RATING_IND_BY_PATH_ID_AND_RESOURCE_NAME USING HASH ON REG_RESOURCE_RATING(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID); -CREATE INDEX REG_RESOURCE_RATING_IND_BY_VERSION USING HASH ON REG_RESOURCE_RATING(REG_VERSION, REG_TENANT_ID); - - -CREATE TABLE IF NOT EXISTS REG_TAG ( - REG_ID INTEGER NOT NULL AUTO_INCREMENT, - REG_TAG_NAME VARCHAR(500) NOT NULL, - REG_USER_ID VARCHAR(31) NOT NULL, - REG_TAGGED_TIME TIMESTAMP NOT NULL, - REG_TENANT_ID INTEGER DEFAULT 0, - CONSTRAINT PK_REG_TAG PRIMARY KEY(REG_ID, REG_TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS REG_RESOURCE_TAG ( - REG_TAG_ID INTEGER NOT NULL, - REG_VERSION INTEGER, - REG_PATH_ID INTEGER, - REG_RESOURCE_NAME VARCHAR(256), - REG_TENANT_ID INTEGER DEFAULT 0 -)ENGINE INNODB; - -ALTER TABLE REG_RESOURCE_TAG ADD CONSTRAINT REG_RESOURCE_TAG_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID); -ALTER TABLE REG_RESOURCE_TAG ADD CONSTRAINT REG_RESOURCE_TAG_FK_BY_TAG_ID FOREIGN KEY (REG_TAG_ID, REG_TENANT_ID) REFERENCES REG_TAG (REG_ID, REG_TENANT_ID); -CREATE INDEX REG_RESOURCE_TAG_IND_BY_PATH_ID_AND_RESOURCE_NAME USING HASH ON REG_RESOURCE_TAG(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID); -CREATE INDEX REG_RESOURCE_TAG_IND_BY_VERSION USING HASH ON REG_RESOURCE_TAG(REG_VERSION, REG_TENANT_ID); - -CREATE TABLE IF NOT EXISTS REG_PROPERTY ( - REG_ID INTEGER NOT NULL AUTO_INCREMENT, - REG_NAME VARCHAR(100) NOT NULL, - REG_VALUE VARCHAR(1000), - REG_TENANT_ID INTEGER DEFAULT 0, - CONSTRAINT PK_REG_PROPERTY PRIMARY KEY(REG_ID, REG_TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS REG_RESOURCE_PROPERTY ( - REG_PROPERTY_ID INTEGER NOT NULL, - REG_VERSION INTEGER, - REG_PATH_ID INTEGER, - REG_RESOURCE_NAME VARCHAR(256), - REG_TENANT_ID INTEGER DEFAULT 0 -)ENGINE INNODB; - -ALTER TABLE REG_RESOURCE_PROPERTY ADD CONSTRAINT REG_RESOURCE_PROPERTY_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID); -ALTER TABLE REG_RESOURCE_PROPERTY ADD CONSTRAINT REG_RESOURCE_PROPERTY_FK_BY_TAG_ID FOREIGN KEY (REG_PROPERTY_ID, REG_TENANT_ID) REFERENCES REG_PROPERTY (REG_ID, REG_TENANT_ID); -CREATE INDEX REG_RESOURCE_PROPERTY_IND_BY_PATH_ID_AND_RESOURCE_NAME USING HASH ON REG_RESOURCE_PROPERTY(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID); -CREATE INDEX REG_RESOURCE_PROPERTY_IND_BY_VERSION USING HASH ON REG_RESOURCE_PROPERTY(REG_VERSION, REG_TENANT_ID); - --- CREATE TABLE IF NOT EXISTS REG_ASSOCIATIONS ( --- SRC_PATH_ID INTEGER, --- SRC_RESOURCE_NAME VARCHAR(256), --- SRC_VERSION INTEGER, --- TGT_PATH_ID INTEGER, --- TGT_RESOURCE_NAME VARCHAR(256), --- TGT_VERSION INTEGER --- )ENGINE INNODB; --- --- ALTER TABLE REG_ASSOCIATIONS ADD CONSTRAINT REG_ASSOCIATIONS_FK_BY_SRC_PATH_ID FOREIGN KEY (SRC_PATH_ID) REFERENCES REG_PATH (PATH_ID); --- ALTER TABLE REG_ASSOCIATIONS ADD CONSTRAINT REG_ASSOCIATIONS_FK_BY_TGT_PATH_ID FOREIGN KEY (TGT_PATH_ID) REFERENCES REG_PATH (PATH_ID); --- CREATE INDEX REG_ASSOCIATIONS_IND_BY_SRC_VERSION ON REG_ASSOCIATIONS(SRC_VERSION); --- CREATE INDEX REG_ASSOCIATIONS_IND_BY_TGT_VERSION ON REG_ASSOCIATIONS(TGT_VERSION); --- CREATE INDEX REG_ASSOCIATIONS_IND_BY_SRC_RESOURCE_NAME ON REG_ASSOCIATIONS(SRC_RESOURCE_NAME); --- CREATE INDEX REG_ASSOCIATIONS_IND_BY_TGT_RESOURCE_NAME ON REG_ASSOCIATIONS(TGT_RESOURCE_NAME); - - - -CREATE TABLE IF NOT EXISTS REG_ASSOCIATION ( - REG_ASSOCIATION_ID INTEGER AUTO_INCREMENT, - REG_SOURCEPATH VARCHAR (750) NOT NULL, - REG_TARGETPATH VARCHAR (750) NOT NULL, - REG_ASSOCIATION_TYPE VARCHAR (2000) NOT NULL, - REG_TENANT_ID INTEGER DEFAULT 0, - PRIMARY KEY (REG_ASSOCIATION_ID, REG_TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS REG_SNAPSHOT ( - REG_SNAPSHOT_ID INTEGER NOT NULL AUTO_INCREMENT, - REG_PATH_ID INTEGER NOT NULL, - REG_RESOURCE_NAME VARCHAR(255), - REG_RESOURCE_VIDS LONGBLOB NOT NULL, - REG_TENANT_ID INTEGER DEFAULT 0, - CONSTRAINT PK_REG_SNAPSHOT PRIMARY KEY(REG_SNAPSHOT_ID, REG_TENANT_ID) -)ENGINE INNODB; - -CREATE INDEX REG_SNAPSHOT_IND_BY_PATH_ID_AND_RESOURCE_NAME USING HASH ON REG_SNAPSHOT(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID); - -ALTER TABLE REG_SNAPSHOT ADD CONSTRAINT REG_SNAPSHOT_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID); - - --- ################################ --- USER MANAGER TABLES --- ################################ - -CREATE TABLE UM_TENANT ( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_DOMAIN_NAME VARCHAR(255) NOT NULL, - UM_EMAIL VARCHAR(255), - UM_ACTIVE BOOLEAN DEFAULT FALSE, - UM_CREATED_DATE TIMESTAMP NOT NULL, - UM_USER_CONFIG LONGBLOB, - PRIMARY KEY (UM_ID), - UNIQUE(UM_DOMAIN_NAME) -)ENGINE INNODB; - -CREATE TABLE UM_DOMAIN( - UM_DOMAIN_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_DOMAIN_NAME VARCHAR(255), - UM_TENANT_ID INTEGER DEFAULT 0, - PRIMARY KEY (UM_DOMAIN_ID, UM_TENANT_ID) -)ENGINE INNODB; - -CREATE UNIQUE INDEX INDEX_UM_TENANT_UM_DOMAIN_NAME - ON UM_TENANT (UM_DOMAIN_NAME); - -CREATE TABLE UM_USER ( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_USER_NAME VARCHAR(255) NOT NULL, - UM_USER_PASSWORD VARCHAR(255) NOT NULL, - UM_SALT_VALUE VARCHAR(31), - UM_REQUIRE_CHANGE BOOLEAN DEFAULT FALSE, - UM_CHANGED_TIME TIMESTAMP NOT NULL, - UM_TENANT_ID INTEGER DEFAULT 0, - PRIMARY KEY (UM_ID, UM_TENANT_ID), - UNIQUE(UM_USER_NAME, UM_TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE UM_SYSTEM_USER ( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_USER_NAME VARCHAR(255) NOT NULL, - UM_USER_PASSWORD VARCHAR(255) NOT NULL, - UM_SALT_VALUE VARCHAR(31), - UM_REQUIRE_CHANGE BOOLEAN DEFAULT FALSE, - UM_CHANGED_TIME TIMESTAMP NOT NULL, - UM_TENANT_ID INTEGER DEFAULT 0, - PRIMARY KEY (UM_ID, UM_TENANT_ID), - UNIQUE(UM_USER_NAME, UM_TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE UM_ROLE ( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_ROLE_NAME VARCHAR(255) NOT NULL, - UM_TENANT_ID INTEGER DEFAULT 0, - UM_SHARED_ROLE BOOLEAN DEFAULT FALSE, - PRIMARY KEY (UM_ID, UM_TENANT_ID), - UNIQUE(UM_ROLE_NAME, UM_TENANT_ID) -)ENGINE INNODB; - - -CREATE TABLE UM_MODULE( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_MODULE_NAME VARCHAR(100), - UNIQUE(UM_MODULE_NAME), - PRIMARY KEY(UM_ID) -)ENGINE INNODB; - -CREATE TABLE UM_MODULE_ACTIONS( - UM_ACTION VARCHAR(255) NOT NULL, - UM_MODULE_ID INTEGER NOT NULL, - PRIMARY KEY(UM_ACTION, UM_MODULE_ID), - FOREIGN KEY (UM_MODULE_ID) REFERENCES UM_MODULE(UM_ID) ON DELETE CASCADE -)ENGINE INNODB; - -CREATE TABLE UM_PERMISSION ( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_RESOURCE_ID VARCHAR(255) NOT NULL, - UM_ACTION VARCHAR(255) NOT NULL, - UM_TENANT_ID INTEGER DEFAULT 0, - UM_MODULE_ID INTEGER DEFAULT 0, - PRIMARY KEY (UM_ID, UM_TENANT_ID) -)ENGINE INNODB; - -CREATE INDEX INDEX_UM_PERMISSION_UM_RESOURCE_ID_UM_ACTION ON UM_PERMISSION (UM_RESOURCE_ID, UM_ACTION, UM_TENANT_ID); - -CREATE TABLE UM_ROLE_PERMISSION ( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_PERMISSION_ID INTEGER NOT NULL, - UM_ROLE_NAME VARCHAR(255) NOT NULL, - UM_IS_ALLOWED SMALLINT NOT NULL, - UM_TENANT_ID INTEGER DEFAULT 0, - UM_DOMAIN_ID INTEGER, - UNIQUE (UM_PERMISSION_ID, UM_ROLE_NAME, UM_TENANT_ID, UM_DOMAIN_ID), - FOREIGN KEY (UM_PERMISSION_ID, UM_TENANT_ID) REFERENCES UM_PERMISSION(UM_ID, UM_TENANT_ID) ON DELETE CASCADE, - FOREIGN KEY (UM_DOMAIN_ID, UM_TENANT_ID) REFERENCES UM_DOMAIN(UM_DOMAIN_ID, UM_TENANT_ID) ON DELETE CASCADE, - PRIMARY KEY (UM_ID, UM_TENANT_ID) -)ENGINE INNODB; - --- REMOVED UNIQUE (UM_PERMISSION_ID, UM_ROLE_ID) -CREATE TABLE UM_USER_PERMISSION ( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_PERMISSION_ID INTEGER NOT NULL, - UM_USER_NAME VARCHAR(255) NOT NULL, - UM_IS_ALLOWED SMALLINT NOT NULL, - UM_TENANT_ID INTEGER DEFAULT 0, - FOREIGN KEY (UM_PERMISSION_ID, UM_TENANT_ID) REFERENCES UM_PERMISSION(UM_ID, UM_TENANT_ID) ON DELETE CASCADE, - PRIMARY KEY (UM_ID, UM_TENANT_ID) -)ENGINE INNODB; - --- REMOVED UNIQUE (UM_PERMISSION_ID, UM_USER_ID) -CREATE TABLE UM_USER_ROLE ( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_ROLE_ID INTEGER NOT NULL, - UM_USER_ID INTEGER NOT NULL, - UM_TENANT_ID INTEGER DEFAULT 0, - UNIQUE (UM_USER_ID, UM_ROLE_ID, UM_TENANT_ID), - FOREIGN KEY (UM_ROLE_ID, UM_TENANT_ID) REFERENCES UM_ROLE(UM_ID, UM_TENANT_ID), - FOREIGN KEY (UM_USER_ID, UM_TENANT_ID) REFERENCES UM_USER(UM_ID, UM_TENANT_ID), - PRIMARY KEY (UM_ID, UM_TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE UM_SHARED_USER_ROLE( - UM_ROLE_ID INTEGER NOT NULL, - UM_USER_ID INTEGER NOT NULL, - UM_USER_TENANT_ID INTEGER NOT NULL, - UM_ROLE_TENANT_ID INTEGER NOT NULL, - UNIQUE(UM_USER_ID,UM_ROLE_ID,UM_USER_TENANT_ID, UM_ROLE_TENANT_ID), - FOREIGN KEY(UM_ROLE_ID,UM_ROLE_TENANT_ID) REFERENCES UM_ROLE(UM_ID,UM_TENANT_ID) ON DELETE CASCADE, - FOREIGN KEY(UM_USER_ID,UM_USER_TENANT_ID) REFERENCES UM_USER(UM_ID,UM_TENANT_ID) ON DELETE CASCADE -)ENGINE INNODB; - -CREATE TABLE UM_ACCOUNT_MAPPING( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_USER_NAME VARCHAR(255) NOT NULL, - UM_TENANT_ID INTEGER NOT NULL, - UM_USER_STORE_DOMAIN VARCHAR(100), - UM_ACC_LINK_ID INTEGER NOT NULL, - UNIQUE(UM_USER_NAME, UM_TENANT_ID, UM_USER_STORE_DOMAIN, UM_ACC_LINK_ID), - FOREIGN KEY (UM_TENANT_ID) REFERENCES UM_TENANT(UM_ID) ON DELETE CASCADE, - PRIMARY KEY (UM_ID) -)ENGINE INNODB; - - -CREATE TABLE UM_USER_ATTRIBUTE ( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_ATTR_NAME VARCHAR(255) NOT NULL, - UM_ATTR_VALUE VARCHAR(1024), - UM_PROFILE_ID VARCHAR(255), - UM_USER_ID INTEGER, - UM_TENANT_ID INTEGER DEFAULT 0, - FOREIGN KEY (UM_USER_ID, UM_TENANT_ID) REFERENCES UM_USER(UM_ID, UM_TENANT_ID), - PRIMARY KEY (UM_ID, UM_TENANT_ID) -)ENGINE INNODB; - -CREATE INDEX UM_USER_ID_INDEX ON UM_USER_ATTRIBUTE(UM_USER_ID); - -CREATE TABLE UM_DIALECT( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_DIALECT_URI VARCHAR(255) NOT NULL, - UM_TENANT_ID INTEGER DEFAULT 0, - UNIQUE(UM_DIALECT_URI, UM_TENANT_ID), - PRIMARY KEY (UM_ID, UM_TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE UM_CLAIM( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_DIALECT_ID INTEGER NOT NULL, - UM_CLAIM_URI VARCHAR(255) NOT NULL, - UM_DISPLAY_TAG VARCHAR(255), - UM_DESCRIPTION VARCHAR(255), - UM_MAPPED_ATTRIBUTE_DOMAIN VARCHAR(255), - UM_MAPPED_ATTRIBUTE VARCHAR(255), - UM_REG_EX VARCHAR(255), - UM_SUPPORTED SMALLINT, - UM_REQUIRED SMALLINT, - UM_DISPLAY_ORDER INTEGER, - UM_CHECKED_ATTRIBUTE SMALLINT, - UM_READ_ONLY SMALLINT, - UM_TENANT_ID INTEGER DEFAULT 0, - UNIQUE(UM_DIALECT_ID, UM_CLAIM_URI, UM_TENANT_ID,UM_MAPPED_ATTRIBUTE_DOMAIN), - FOREIGN KEY(UM_DIALECT_ID, UM_TENANT_ID) REFERENCES UM_DIALECT(UM_ID, UM_TENANT_ID), - PRIMARY KEY (UM_ID, UM_TENANT_ID) -)ENGINE INNODB; - - -CREATE TABLE UM_PROFILE_CONFIG( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_DIALECT_ID INTEGER NOT NULL, - UM_PROFILE_NAME VARCHAR(255), - UM_TENANT_ID INTEGER DEFAULT 0, - FOREIGN KEY(UM_DIALECT_ID, UM_TENANT_ID) REFERENCES UM_DIALECT(UM_ID, UM_TENANT_ID), - PRIMARY KEY (UM_ID, UM_TENANT_ID) -)ENGINE INNODB; - - -CREATE TABLE UM_HYBRID_ROLE( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_ROLE_NAME VARCHAR(255), - UM_TENANT_ID INTEGER DEFAULT 0, - PRIMARY KEY (UM_ID, UM_TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE UM_HYBRID_USER_ROLE( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_USER_NAME VARCHAR(255), - UM_ROLE_ID INTEGER NOT NULL, - UM_TENANT_ID INTEGER DEFAULT 0, - UM_DOMAIN_ID INTEGER, - UNIQUE (UM_USER_NAME, UM_ROLE_ID, UM_TENANT_ID, UM_DOMAIN_ID), - FOREIGN KEY (UM_ROLE_ID, UM_TENANT_ID) REFERENCES UM_HYBRID_ROLE(UM_ID, UM_TENANT_ID) ON DELETE CASCADE, - FOREIGN KEY (UM_DOMAIN_ID, UM_TENANT_ID) REFERENCES UM_DOMAIN(UM_DOMAIN_ID, UM_TENANT_ID) ON DELETE CASCADE, - PRIMARY KEY (UM_ID, UM_TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE UM_SYSTEM_ROLE( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_ROLE_NAME VARCHAR(255), - UM_TENANT_ID INTEGER DEFAULT 0, - PRIMARY KEY (UM_ID, UM_TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE UM_SYSTEM_USER_ROLE( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_USER_NAME VARCHAR(255), - UM_ROLE_ID INTEGER NOT NULL, - UM_TENANT_ID INTEGER DEFAULT 0, - UNIQUE (UM_USER_NAME, UM_ROLE_ID, UM_TENANT_ID), - FOREIGN KEY (UM_ROLE_ID, UM_TENANT_ID) REFERENCES UM_SYSTEM_ROLE(UM_ID, UM_TENANT_ID), - PRIMARY KEY (UM_ID, UM_TENANT_ID) -)ENGINE INNODB; - - -CREATE TABLE UM_HYBRID_REMEMBER_ME( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_USER_NAME VARCHAR(255) NOT NULL, - UM_COOKIE_VALUE VARCHAR(1024), - UM_CREATED_TIME TIMESTAMP, - UM_TENANT_ID INTEGER DEFAULT 0, - PRIMARY KEY (UM_ID, UM_TENANT_ID) -)ENGINE INNODB; diff --git a/base/mysql/scripts/mysql-mbstoredb.sql b/base/mysql/scripts/mysql-mbstoredb.sql deleted file mode 100644 index 6fd0d22f..00000000 --- a/base/mysql/scripts/mysql-mbstoredb.sql +++ /dev/null @@ -1,140 +0,0 @@ --- WSO2 Message Broker MySQL Database schema -- - -create database mbstoredb; -use mbstoredb; - --- Start of Message Store Tables -- - -CREATE TABLE IF NOT EXISTS MB_QUEUE_MAPPING ( - QUEUE_ID INTEGER AUTO_INCREMENT, - QUEUE_NAME VARCHAR(512) NOT NULL, - PRIMARY KEY (QUEUE_ID, QUEUE_NAME) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - -CREATE TABLE IF NOT EXISTS MB_METADATA ( - MESSAGE_ID BIGINT, - QUEUE_ID INTEGER, - DLC_QUEUE_ID INTEGER NOT NULL, - MESSAGE_METADATA VARBINARY(65500) NOT NULL, - PRIMARY KEY (MESSAGE_ID, QUEUE_ID), - FOREIGN KEY (QUEUE_ID) REFERENCES MB_QUEUE_MAPPING (QUEUE_ID) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - -CREATE INDEX MB_METADATA_QUEUE_ID_INDEX ON MB_METADATA (QUEUE_ID) USING HASH; - -CREATE TABLE IF NOT EXISTS MB_CONTENT ( - MESSAGE_ID BIGINT, - CONTENT_OFFSET INTEGER, - MESSAGE_CONTENT VARBINARY(65500) NOT NULL, - PRIMARY KEY (MESSAGE_ID,CONTENT_OFFSET), - FOREIGN KEY (MESSAGE_ID) REFERENCES MB_METADATA (MESSAGE_ID) - ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - -CREATE TABLE IF NOT EXISTS MB_EXPIRATION_DATA ( - MESSAGE_ID BIGINT UNIQUE, - EXPIRATION_TIME BIGINT, - MESSAGE_DESTINATION VARCHAR(512) NOT NULL, - FOREIGN KEY (MESSAGE_ID) REFERENCES MB_METADATA (MESSAGE_ID) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - -CREATE TABLE IF NOT EXISTS MB_RETAINED_METADATA ( - TOPIC_ID INT, - TOPIC_NAME VARCHAR(512) NOT NULL, - MESSAGE_ID BIGINT NOT NULL, - MESSAGE_METADATA VARBINARY(65000) NOT NULL, - PRIMARY KEY (TOPIC_ID) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- End of Message Store Tables -- - --- Start of Andes Context Store Tables -- - -CREATE TABLE IF NOT EXISTS MB_DURABLE_SUBSCRIPTION ( - SUBSCRIPTION_ID VARCHAR(512) NOT NULL, - DESTINATION_IDENTIFIER VARCHAR(512) NOT NULL, - SUBSCRIPTION_DATA VARCHAR(2048) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - -CREATE TABLE IF NOT EXISTS MB_NODE ( - NODE_ID VARCHAR(512) NOT NULL, - NODE_DATA VARCHAR(2048) NOT NULL, - PRIMARY KEY(NODE_ID) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - -CREATE TABLE IF NOT EXISTS MB_EXCHANGE ( - EXCHANGE_NAME VARCHAR(512) NOT NULL, - EXCHANGE_DATA VARCHAR(2048) NOT NULL, - PRIMARY KEY(EXCHANGE_NAME) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - -CREATE TABLE IF NOT EXISTS MB_QUEUE ( - QUEUE_NAME VARCHAR(512) NOT NULL, - QUEUE_DATA VARCHAR(2048) NOT NULL, - PRIMARY KEY(QUEUE_NAME) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - -CREATE TABLE IF NOT EXISTS MB_BINDING ( - EXCHANGE_NAME VARCHAR(512) NOT NULL, - QUEUE_NAME VARCHAR(512) NOT NULL, - BINDING_DETAILS VARCHAR(2048) NOT NULL, - FOREIGN KEY (EXCHANGE_NAME) REFERENCES MB_EXCHANGE (EXCHANGE_NAME), - FOREIGN KEY (QUEUE_NAME) REFERENCES MB_QUEUE (QUEUE_NAME) - ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - -CREATE TABLE IF NOT EXISTS MB_QUEUE_COUNTER ( - QUEUE_NAME VARCHAR(512) NOT NULL, - MESSAGE_COUNT BIGINT, - PRIMARY KEY (QUEUE_NAME) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - -CREATE TABLE IF NOT EXISTS MB_SLOT ( - SLOT_ID bigint(11) NOT NULL AUTO_INCREMENT, - START_MESSAGE_ID bigint(20) NOT NULL, - END_MESSAGE_ID bigint(20) NOT NULL, - STORAGE_QUEUE_NAME varchar(512) NOT NULL, - SLOT_STATE tinyint(4) NOT NULL DEFAULT '1', - ASSIGNED_NODE_ID varchar(512) DEFAULT NULL, - ASSIGNED_QUEUE_NAME varchar(512) DEFAULT NULL, - PRIMARY KEY (SLOT_ID) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- Default value '1' for SLOT_STATE stands for CREATED state of slot - -CREATE INDEX MB_SLOT_MESSAGE_ID_INDEX ON MB_SLOT (START_MESSAGE_ID, END_MESSAGE_ID) USING HASH; - -CREATE INDEX MB_SLOT_QUEUE_INDEX ON MB_SLOT (STORAGE_QUEUE_NAME) USING HASH; - -CREATE TABLE IF NOT EXISTS MB_SLOT_MESSAGE_ID ( - QUEUE_NAME varchar(512) NOT NULL, - MESSAGE_ID bigint(20) NOT NULL, - PRIMARY KEY (QUEUE_NAME,MESSAGE_ID) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - -CREATE TABLE IF NOT EXISTS MB_NODE_TO_LAST_PUBLISHED_ID ( - NODE_ID varchar(512) NOT NULL, - MESSAGE_ID bigint(20) NOT NULL, - PRIMARY KEY (NODE_ID) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - -CREATE TABLE IF NOT EXISTS MB_QUEUE_TO_LAST_ASSIGNED_ID ( - QUEUE_NAME varchar(512) NOT NULL, - MESSAGE_ID bigint(20) NOT NULL, - PRIMARY KEY (QUEUE_NAME) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - -CREATE TABLE IF NOT EXISTS MB_MSG_STORE_STATUS ( - NODE_ID VARCHAR(512) NOT NULL, - TIME_STAMP BIGINT, - PRIMARY KEY (NODE_ID, TIME_STAMP) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - -CREATE TABLE IF NOT EXISTS MB_RETAINED_CONTENT ( - MESSAGE_ID BIGINT, - CONTENT_OFFSET INT, - MESSAGE_CONTENT VARBINARY(65500) NOT NULL, - PRIMARY KEY (MESSAGE_ID,CONTENT_OFFSET) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; - --- End of Andes Context Store Tables -- diff --git a/base/mysql/scripts/mysql-statdbs.sql b/base/mysql/scripts/mysql-statdbs.sql deleted file mode 100644 index 56e6ed72..00000000 --- a/base/mysql/scripts/mysql-statdbs.sql +++ /dev/null @@ -1,4 +0,0 @@ -create database statdb; -create database analyticseventstoredb; -create database analyticprocesseddatastoredb; -set global max_connections = 200; \ No newline at end of file diff --git a/base/mysql/scripts/mysql-userdb.sql b/base/mysql/scripts/mysql-userdb.sql deleted file mode 100644 index 2355184b..00000000 --- a/base/mysql/scripts/mysql-userdb.sql +++ /dev/null @@ -1,467 +0,0 @@ -create database userdb; -use userdb; - -CREATE TABLE IF NOT EXISTS REG_CLUSTER_LOCK ( - REG_LOCK_NAME VARCHAR (20), - REG_LOCK_STATUS VARCHAR (20), - REG_LOCKED_TIME TIMESTAMP, - REG_TENANT_ID INTEGER DEFAULT 0, - PRIMARY KEY (REG_LOCK_NAME) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS REG_LOG ( - REG_LOG_ID INTEGER AUTO_INCREMENT, - REG_PATH VARCHAR (750), - REG_USER_ID VARCHAR (31) NOT NULL, - REG_LOGGED_TIME TIMESTAMP NOT NULL, - REG_ACTION INTEGER NOT NULL, - REG_ACTION_DATA VARCHAR (500), - REG_TENANT_ID INTEGER DEFAULT 0, - PRIMARY KEY (REG_LOG_ID, REG_TENANT_ID) -)ENGINE INNODB; - -CREATE INDEX REG_LOG_IND_BY_REGLOG USING HASH ON REG_LOG(REG_LOGGED_TIME, REG_TENANT_ID); - --- The REG_PATH_VALUE should be less than 767 bytes, and hence was fixed at 750. --- See CARBON-5917. - -CREATE TABLE IF NOT EXISTS REG_PATH( - REG_PATH_ID INTEGER NOT NULL AUTO_INCREMENT, - REG_PATH_VALUE VARCHAR(750) NOT NULL, - REG_PATH_PARENT_ID INTEGER, - REG_TENANT_ID INTEGER DEFAULT 0, - CONSTRAINT PK_REG_PATH PRIMARY KEY(REG_PATH_ID, REG_TENANT_ID) -)ENGINE INNODB; - -CREATE INDEX REG_PATH_IND_BY_PATH_VALUE USING HASH ON REG_PATH(REG_PATH_VALUE, REG_TENANT_ID); -CREATE INDEX REG_PATH_IND_BY_PATH_PARENT_ID USING HASH ON REG_PATH(REG_PATH_PARENT_ID, REG_TENANT_ID); - -CREATE TABLE IF NOT EXISTS REG_CONTENT ( - REG_CONTENT_ID INTEGER NOT NULL AUTO_INCREMENT, - REG_CONTENT_DATA LONGBLOB, - REG_TENANT_ID INTEGER DEFAULT 0, - CONSTRAINT PK_REG_CONTENT PRIMARY KEY(REG_CONTENT_ID, REG_TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS REG_CONTENT_HISTORY ( - REG_CONTENT_ID INTEGER NOT NULL, - REG_CONTENT_DATA LONGBLOB, - REG_DELETED SMALLINT, - REG_TENANT_ID INTEGER DEFAULT 0, - CONSTRAINT PK_REG_CONTENT_HISTORY PRIMARY KEY(REG_CONTENT_ID, REG_TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS REG_RESOURCE ( - REG_PATH_ID INTEGER NOT NULL, - REG_NAME VARCHAR(256), - REG_VERSION INTEGER NOT NULL AUTO_INCREMENT, - REG_MEDIA_TYPE VARCHAR(500), - REG_CREATOR VARCHAR(31) NOT NULL, - REG_CREATED_TIME TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - REG_LAST_UPDATOR VARCHAR(31), - REG_LAST_UPDATED_TIME TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - REG_DESCRIPTION VARCHAR(1000), - REG_CONTENT_ID INTEGER, - REG_TENANT_ID INTEGER DEFAULT 0, - REG_UUID VARCHAR(100) NOT NULL, - CONSTRAINT PK_REG_RESOURCE PRIMARY KEY(REG_VERSION, REG_TENANT_ID) -)ENGINE INNODB; - -ALTER TABLE REG_RESOURCE ADD CONSTRAINT REG_RESOURCE_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID); -ALTER TABLE REG_RESOURCE ADD CONSTRAINT REG_RESOURCE_FK_BY_CONTENT_ID FOREIGN KEY (REG_CONTENT_ID, REG_TENANT_ID) REFERENCES REG_CONTENT (REG_CONTENT_ID, REG_TENANT_ID); -CREATE INDEX REG_RESOURCE_IND_BY_NAME USING HASH ON REG_RESOURCE(REG_NAME, REG_TENANT_ID); -CREATE INDEX REG_RESOURCE_IND_BY_PATH_ID_NAME USING HASH ON REG_RESOURCE(REG_PATH_ID, REG_NAME, REG_TENANT_ID); -CREATE INDEX REG_RESOURCE_IND_BY_UUID USING HASH ON REG_RESOURCE(REG_UUID); -CREATE INDEX REG_RESOURCE_IND_BY_TENAN USING HASH ON REG_RESOURCE(REG_TENANT_ID, REG_UUID); -CREATE INDEX REG_RESOURCE_IND_BY_TYPE USING HASH ON REG_RESOURCE(REG_TENANT_ID, REG_MEDIA_TYPE); - -CREATE TABLE IF NOT EXISTS REG_RESOURCE_HISTORY ( - REG_PATH_ID INTEGER NOT NULL, - REG_NAME VARCHAR(256), - REG_VERSION INTEGER NOT NULL, - REG_MEDIA_TYPE VARCHAR(500), - REG_CREATOR VARCHAR(31) NOT NULL, - REG_CREATED_TIME TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - REG_LAST_UPDATOR VARCHAR(31), - REG_LAST_UPDATED_TIME TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - REG_DESCRIPTION VARCHAR(1000), - REG_CONTENT_ID INTEGER, - REG_DELETED SMALLINT, - REG_TENANT_ID INTEGER DEFAULT 0, - REG_UUID VARCHAR(100) NOT NULL, - CONSTRAINT PK_REG_RESOURCE_HISTORY PRIMARY KEY(REG_VERSION, REG_TENANT_ID) -)ENGINE INNODB; - -ALTER TABLE REG_RESOURCE_HISTORY ADD CONSTRAINT REG_RESOURCE_HIST_FK_BY_PATHID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID); -ALTER TABLE REG_RESOURCE_HISTORY ADD CONSTRAINT REG_RESOURCE_HIST_FK_BY_CONTENT_ID FOREIGN KEY (REG_CONTENT_ID, REG_TENANT_ID) REFERENCES REG_CONTENT_HISTORY (REG_CONTENT_ID, REG_TENANT_ID); -CREATE INDEX REG_RESOURCE_HISTORY_IND_BY_NAME USING HASH ON REG_RESOURCE_HISTORY(REG_NAME, REG_TENANT_ID); -CREATE INDEX REG_RESOURCE_HISTORY_IND_BY_PATH_ID_NAME USING HASH ON REG_RESOURCE(REG_PATH_ID, REG_NAME, REG_TENANT_ID); - -CREATE TABLE IF NOT EXISTS REG_COMMENT ( - REG_ID INTEGER NOT NULL AUTO_INCREMENT, - REG_COMMENT_TEXT VARCHAR(500) NOT NULL, - REG_USER_ID VARCHAR(31) NOT NULL, - REG_COMMENTED_TIME TIMESTAMP NOT NULL, - REG_TENANT_ID INTEGER DEFAULT 0, - CONSTRAINT PK_REG_COMMENT PRIMARY KEY(REG_ID, REG_TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS REG_RESOURCE_COMMENT ( - REG_COMMENT_ID INTEGER NOT NULL, - REG_VERSION INTEGER, - REG_PATH_ID INTEGER, - REG_RESOURCE_NAME VARCHAR(256), - REG_TENANT_ID INTEGER DEFAULT 0 -)ENGINE INNODB; - -ALTER TABLE REG_RESOURCE_COMMENT ADD CONSTRAINT REG_RESOURCE_COMMENT_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID); -ALTER TABLE REG_RESOURCE_COMMENT ADD CONSTRAINT REG_RESOURCE_COMMENT_FK_BY_COMMENT_ID FOREIGN KEY (REG_COMMENT_ID, REG_TENANT_ID) REFERENCES REG_COMMENT (REG_ID, REG_TENANT_ID); -CREATE INDEX REG_RESOURCE_COMMENT_IND_BY_PATH_ID_AND_RESOURCE_NAME USING HASH ON REG_RESOURCE_COMMENT(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID); -CREATE INDEX REG_RESOURCE_COMMENT_IND_BY_VERSION USING HASH ON REG_RESOURCE_COMMENT(REG_VERSION, REG_TENANT_ID); - -CREATE TABLE IF NOT EXISTS REG_RATING ( - REG_ID INTEGER NOT NULL AUTO_INCREMENT, - REG_RATING INTEGER NOT NULL, - REG_USER_ID VARCHAR(31) NOT NULL, - REG_RATED_TIME TIMESTAMP NOT NULL, - REG_TENANT_ID INTEGER DEFAULT 0, - CONSTRAINT PK_REG_RATING PRIMARY KEY(REG_ID, REG_TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS REG_RESOURCE_RATING ( - REG_RATING_ID INTEGER NOT NULL, - REG_VERSION INTEGER, - REG_PATH_ID INTEGER, - REG_RESOURCE_NAME VARCHAR(256), - REG_TENANT_ID INTEGER DEFAULT 0 -)ENGINE INNODB; - -ALTER TABLE REG_RESOURCE_RATING ADD CONSTRAINT REG_RESOURCE_RATING_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID); -ALTER TABLE REG_RESOURCE_RATING ADD CONSTRAINT REG_RESOURCE_RATING_FK_BY_RATING_ID FOREIGN KEY (REG_RATING_ID, REG_TENANT_ID) REFERENCES REG_RATING (REG_ID, REG_TENANT_ID); -CREATE INDEX REG_RESOURCE_RATING_IND_BY_PATH_ID_AND_RESOURCE_NAME USING HASH ON REG_RESOURCE_RATING(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID); -CREATE INDEX REG_RESOURCE_RATING_IND_BY_VERSION USING HASH ON REG_RESOURCE_RATING(REG_VERSION, REG_TENANT_ID); - - -CREATE TABLE IF NOT EXISTS REG_TAG ( - REG_ID INTEGER NOT NULL AUTO_INCREMENT, - REG_TAG_NAME VARCHAR(500) NOT NULL, - REG_USER_ID VARCHAR(31) NOT NULL, - REG_TAGGED_TIME TIMESTAMP NOT NULL, - REG_TENANT_ID INTEGER DEFAULT 0, - CONSTRAINT PK_REG_TAG PRIMARY KEY(REG_ID, REG_TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS REG_RESOURCE_TAG ( - REG_TAG_ID INTEGER NOT NULL, - REG_VERSION INTEGER, - REG_PATH_ID INTEGER, - REG_RESOURCE_NAME VARCHAR(256), - REG_TENANT_ID INTEGER DEFAULT 0 -)ENGINE INNODB; - -ALTER TABLE REG_RESOURCE_TAG ADD CONSTRAINT REG_RESOURCE_TAG_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID); -ALTER TABLE REG_RESOURCE_TAG ADD CONSTRAINT REG_RESOURCE_TAG_FK_BY_TAG_ID FOREIGN KEY (REG_TAG_ID, REG_TENANT_ID) REFERENCES REG_TAG (REG_ID, REG_TENANT_ID); -CREATE INDEX REG_RESOURCE_TAG_IND_BY_PATH_ID_AND_RESOURCE_NAME USING HASH ON REG_RESOURCE_TAG(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID); -CREATE INDEX REG_RESOURCE_TAG_IND_BY_VERSION USING HASH ON REG_RESOURCE_TAG(REG_VERSION, REG_TENANT_ID); - -CREATE TABLE IF NOT EXISTS REG_PROPERTY ( - REG_ID INTEGER NOT NULL AUTO_INCREMENT, - REG_NAME VARCHAR(100) NOT NULL, - REG_VALUE VARCHAR(1000), - REG_TENANT_ID INTEGER DEFAULT 0, - CONSTRAINT PK_REG_PROPERTY PRIMARY KEY(REG_ID, REG_TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS REG_RESOURCE_PROPERTY ( - REG_PROPERTY_ID INTEGER NOT NULL, - REG_VERSION INTEGER, - REG_PATH_ID INTEGER, - REG_RESOURCE_NAME VARCHAR(256), - REG_TENANT_ID INTEGER DEFAULT 0 -)ENGINE INNODB; - -ALTER TABLE REG_RESOURCE_PROPERTY ADD CONSTRAINT REG_RESOURCE_PROPERTY_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID); -ALTER TABLE REG_RESOURCE_PROPERTY ADD CONSTRAINT REG_RESOURCE_PROPERTY_FK_BY_TAG_ID FOREIGN KEY (REG_PROPERTY_ID, REG_TENANT_ID) REFERENCES REG_PROPERTY (REG_ID, REG_TENANT_ID); -CREATE INDEX REG_RESOURCE_PROPERTY_IND_BY_PATH_ID_AND_RESOURCE_NAME USING HASH ON REG_RESOURCE_PROPERTY(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID); -CREATE INDEX REG_RESOURCE_PROPERTY_IND_BY_VERSION USING HASH ON REG_RESOURCE_PROPERTY(REG_VERSION, REG_TENANT_ID); - --- CREATE TABLE IF NOT EXISTS REG_ASSOCIATIONS ( --- SRC_PATH_ID INTEGER, --- SRC_RESOURCE_NAME VARCHAR(256), --- SRC_VERSION INTEGER, --- TGT_PATH_ID INTEGER, --- TGT_RESOURCE_NAME VARCHAR(256), --- TGT_VERSION INTEGER --- )ENGINE INNODB; --- --- ALTER TABLE REG_ASSOCIATIONS ADD CONSTRAINT REG_ASSOCIATIONS_FK_BY_SRC_PATH_ID FOREIGN KEY (SRC_PATH_ID) REFERENCES REG_PATH (PATH_ID); --- ALTER TABLE REG_ASSOCIATIONS ADD CONSTRAINT REG_ASSOCIATIONS_FK_BY_TGT_PATH_ID FOREIGN KEY (TGT_PATH_ID) REFERENCES REG_PATH (PATH_ID); --- CREATE INDEX REG_ASSOCIATIONS_IND_BY_SRC_VERSION ON REG_ASSOCIATIONS(SRC_VERSION); --- CREATE INDEX REG_ASSOCIATIONS_IND_BY_TGT_VERSION ON REG_ASSOCIATIONS(TGT_VERSION); --- CREATE INDEX REG_ASSOCIATIONS_IND_BY_SRC_RESOURCE_NAME ON REG_ASSOCIATIONS(SRC_RESOURCE_NAME); --- CREATE INDEX REG_ASSOCIATIONS_IND_BY_TGT_RESOURCE_NAME ON REG_ASSOCIATIONS(TGT_RESOURCE_NAME); - - - -CREATE TABLE IF NOT EXISTS REG_ASSOCIATION ( - REG_ASSOCIATION_ID INTEGER AUTO_INCREMENT, - REG_SOURCEPATH VARCHAR (750) NOT NULL, - REG_TARGETPATH VARCHAR (750) NOT NULL, - REG_ASSOCIATION_TYPE VARCHAR (2000) NOT NULL, - REG_TENANT_ID INTEGER DEFAULT 0, - PRIMARY KEY (REG_ASSOCIATION_ID, REG_TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE IF NOT EXISTS REG_SNAPSHOT ( - REG_SNAPSHOT_ID INTEGER NOT NULL AUTO_INCREMENT, - REG_PATH_ID INTEGER NOT NULL, - REG_RESOURCE_NAME VARCHAR(255), - REG_RESOURCE_VIDS LONGBLOB NOT NULL, - REG_TENANT_ID INTEGER DEFAULT 0, - CONSTRAINT PK_REG_SNAPSHOT PRIMARY KEY(REG_SNAPSHOT_ID, REG_TENANT_ID) -)ENGINE INNODB; - -CREATE INDEX REG_SNAPSHOT_IND_BY_PATH_ID_AND_RESOURCE_NAME USING HASH ON REG_SNAPSHOT(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID); - -ALTER TABLE REG_SNAPSHOT ADD CONSTRAINT REG_SNAPSHOT_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID); - - --- ################################ --- USER MANAGER TABLES --- ################################ - -CREATE TABLE UM_TENANT ( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_DOMAIN_NAME VARCHAR(255) NOT NULL, - UM_EMAIL VARCHAR(255), - UM_ACTIVE BOOLEAN DEFAULT FALSE, - UM_CREATED_DATE TIMESTAMP NOT NULL, - UM_USER_CONFIG LONGBLOB, - PRIMARY KEY (UM_ID), - UNIQUE(UM_DOMAIN_NAME) -)ENGINE INNODB; - -CREATE TABLE UM_DOMAIN( - UM_DOMAIN_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_DOMAIN_NAME VARCHAR(255), - UM_TENANT_ID INTEGER DEFAULT 0, - PRIMARY KEY (UM_DOMAIN_ID, UM_TENANT_ID) -)ENGINE INNODB; - -CREATE UNIQUE INDEX INDEX_UM_TENANT_UM_DOMAIN_NAME - ON UM_TENANT (UM_DOMAIN_NAME); - -CREATE TABLE UM_USER ( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_USER_NAME VARCHAR(255) NOT NULL, - UM_USER_PASSWORD VARCHAR(255) NOT NULL, - UM_SALT_VALUE VARCHAR(31), - UM_REQUIRE_CHANGE BOOLEAN DEFAULT FALSE, - UM_CHANGED_TIME TIMESTAMP NOT NULL, - UM_TENANT_ID INTEGER DEFAULT 0, - PRIMARY KEY (UM_ID, UM_TENANT_ID), - UNIQUE(UM_USER_NAME, UM_TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE UM_SYSTEM_USER ( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_USER_NAME VARCHAR(255) NOT NULL, - UM_USER_PASSWORD VARCHAR(255) NOT NULL, - UM_SALT_VALUE VARCHAR(31), - UM_REQUIRE_CHANGE BOOLEAN DEFAULT FALSE, - UM_CHANGED_TIME TIMESTAMP NOT NULL, - UM_TENANT_ID INTEGER DEFAULT 0, - PRIMARY KEY (UM_ID, UM_TENANT_ID), - UNIQUE(UM_USER_NAME, UM_TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE UM_ROLE ( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_ROLE_NAME VARCHAR(255) NOT NULL, - UM_TENANT_ID INTEGER DEFAULT 0, - UM_SHARED_ROLE BOOLEAN DEFAULT FALSE, - PRIMARY KEY (UM_ID, UM_TENANT_ID), - UNIQUE(UM_ROLE_NAME, UM_TENANT_ID) -)ENGINE INNODB; - - -CREATE TABLE UM_MODULE( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_MODULE_NAME VARCHAR(100), - UNIQUE(UM_MODULE_NAME), - PRIMARY KEY(UM_ID) -)ENGINE INNODB; - -CREATE TABLE UM_MODULE_ACTIONS( - UM_ACTION VARCHAR(255) NOT NULL, - UM_MODULE_ID INTEGER NOT NULL, - PRIMARY KEY(UM_ACTION, UM_MODULE_ID), - FOREIGN KEY (UM_MODULE_ID) REFERENCES UM_MODULE(UM_ID) ON DELETE CASCADE -)ENGINE INNODB; - -CREATE TABLE UM_PERMISSION ( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_RESOURCE_ID VARCHAR(255) NOT NULL, - UM_ACTION VARCHAR(255) NOT NULL, - UM_TENANT_ID INTEGER DEFAULT 0, - UM_MODULE_ID INTEGER DEFAULT 0, - PRIMARY KEY (UM_ID, UM_TENANT_ID) -)ENGINE INNODB; - -CREATE INDEX INDEX_UM_PERMISSION_UM_RESOURCE_ID_UM_ACTION ON UM_PERMISSION (UM_RESOURCE_ID, UM_ACTION, UM_TENANT_ID); - -CREATE TABLE UM_ROLE_PERMISSION ( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_PERMISSION_ID INTEGER NOT NULL, - UM_ROLE_NAME VARCHAR(255) NOT NULL, - UM_IS_ALLOWED SMALLINT NOT NULL, - UM_TENANT_ID INTEGER DEFAULT 0, - UM_DOMAIN_ID INTEGER, - UNIQUE (UM_PERMISSION_ID, UM_ROLE_NAME, UM_TENANT_ID, UM_DOMAIN_ID), - FOREIGN KEY (UM_PERMISSION_ID, UM_TENANT_ID) REFERENCES UM_PERMISSION(UM_ID, UM_TENANT_ID) ON DELETE CASCADE, - FOREIGN KEY (UM_DOMAIN_ID, UM_TENANT_ID) REFERENCES UM_DOMAIN(UM_DOMAIN_ID, UM_TENANT_ID) ON DELETE CASCADE, - PRIMARY KEY (UM_ID, UM_TENANT_ID) -)ENGINE INNODB; - --- REMOVED UNIQUE (UM_PERMISSION_ID, UM_ROLE_ID) -CREATE TABLE UM_USER_PERMISSION ( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_PERMISSION_ID INTEGER NOT NULL, - UM_USER_NAME VARCHAR(255) NOT NULL, - UM_IS_ALLOWED SMALLINT NOT NULL, - UM_TENANT_ID INTEGER DEFAULT 0, - FOREIGN KEY (UM_PERMISSION_ID, UM_TENANT_ID) REFERENCES UM_PERMISSION(UM_ID, UM_TENANT_ID) ON DELETE CASCADE, - PRIMARY KEY (UM_ID, UM_TENANT_ID) -)ENGINE INNODB; - --- REMOVED UNIQUE (UM_PERMISSION_ID, UM_USER_ID) -CREATE TABLE UM_USER_ROLE ( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_ROLE_ID INTEGER NOT NULL, - UM_USER_ID INTEGER NOT NULL, - UM_TENANT_ID INTEGER DEFAULT 0, - UNIQUE (UM_USER_ID, UM_ROLE_ID, UM_TENANT_ID), - FOREIGN KEY (UM_ROLE_ID, UM_TENANT_ID) REFERENCES UM_ROLE(UM_ID, UM_TENANT_ID), - FOREIGN KEY (UM_USER_ID, UM_TENANT_ID) REFERENCES UM_USER(UM_ID, UM_TENANT_ID), - PRIMARY KEY (UM_ID, UM_TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE UM_SHARED_USER_ROLE( - UM_ROLE_ID INTEGER NOT NULL, - UM_USER_ID INTEGER NOT NULL, - UM_USER_TENANT_ID INTEGER NOT NULL, - UM_ROLE_TENANT_ID INTEGER NOT NULL, - UNIQUE(UM_USER_ID,UM_ROLE_ID,UM_USER_TENANT_ID, UM_ROLE_TENANT_ID), - FOREIGN KEY(UM_ROLE_ID,UM_ROLE_TENANT_ID) REFERENCES UM_ROLE(UM_ID,UM_TENANT_ID) ON DELETE CASCADE, - FOREIGN KEY(UM_USER_ID,UM_USER_TENANT_ID) REFERENCES UM_USER(UM_ID,UM_TENANT_ID) ON DELETE CASCADE -)ENGINE INNODB; - -CREATE TABLE UM_ACCOUNT_MAPPING( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_USER_NAME VARCHAR(255) NOT NULL, - UM_TENANT_ID INTEGER NOT NULL, - UM_USER_STORE_DOMAIN VARCHAR(100), - UM_ACC_LINK_ID INTEGER NOT NULL, - UNIQUE(UM_USER_NAME, UM_TENANT_ID, UM_USER_STORE_DOMAIN, UM_ACC_LINK_ID), - FOREIGN KEY (UM_TENANT_ID) REFERENCES UM_TENANT(UM_ID) ON DELETE CASCADE, - PRIMARY KEY (UM_ID) -)ENGINE INNODB; - - -CREATE TABLE UM_USER_ATTRIBUTE ( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_ATTR_NAME VARCHAR(255) NOT NULL, - UM_ATTR_VALUE VARCHAR(1024), - UM_PROFILE_ID VARCHAR(255), - UM_USER_ID INTEGER, - UM_TENANT_ID INTEGER DEFAULT 0, - FOREIGN KEY (UM_USER_ID, UM_TENANT_ID) REFERENCES UM_USER(UM_ID, UM_TENANT_ID), - PRIMARY KEY (UM_ID, UM_TENANT_ID) -)ENGINE INNODB; - -CREATE INDEX UM_USER_ID_INDEX ON UM_USER_ATTRIBUTE(UM_USER_ID); - -CREATE TABLE UM_DIALECT( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_DIALECT_URI VARCHAR(255) NOT NULL, - UM_TENANT_ID INTEGER DEFAULT 0, - UNIQUE(UM_DIALECT_URI, UM_TENANT_ID), - PRIMARY KEY (UM_ID, UM_TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE UM_CLAIM( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_DIALECT_ID INTEGER NOT NULL, - UM_CLAIM_URI VARCHAR(255) NOT NULL, - UM_DISPLAY_TAG VARCHAR(255), - UM_DESCRIPTION VARCHAR(255), - UM_MAPPED_ATTRIBUTE_DOMAIN VARCHAR(255), - UM_MAPPED_ATTRIBUTE VARCHAR(255), - UM_REG_EX VARCHAR(255), - UM_SUPPORTED SMALLINT, - UM_REQUIRED SMALLINT, - UM_DISPLAY_ORDER INTEGER, - UM_CHECKED_ATTRIBUTE SMALLINT, - UM_READ_ONLY SMALLINT, - UM_TENANT_ID INTEGER DEFAULT 0, - UNIQUE(UM_DIALECT_ID, UM_CLAIM_URI, UM_TENANT_ID,UM_MAPPED_ATTRIBUTE_DOMAIN), - FOREIGN KEY(UM_DIALECT_ID, UM_TENANT_ID) REFERENCES UM_DIALECT(UM_ID, UM_TENANT_ID), - PRIMARY KEY (UM_ID, UM_TENANT_ID) -)ENGINE INNODB; - - -CREATE TABLE UM_PROFILE_CONFIG( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_DIALECT_ID INTEGER NOT NULL, - UM_PROFILE_NAME VARCHAR(255), - UM_TENANT_ID INTEGER DEFAULT 0, - FOREIGN KEY(UM_DIALECT_ID, UM_TENANT_ID) REFERENCES UM_DIALECT(UM_ID, UM_TENANT_ID), - PRIMARY KEY (UM_ID, UM_TENANT_ID) -)ENGINE INNODB; - - -CREATE TABLE UM_HYBRID_ROLE( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_ROLE_NAME VARCHAR(255), - UM_TENANT_ID INTEGER DEFAULT 0, - PRIMARY KEY (UM_ID, UM_TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE UM_HYBRID_USER_ROLE( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_USER_NAME VARCHAR(255), - UM_ROLE_ID INTEGER NOT NULL, - UM_TENANT_ID INTEGER DEFAULT 0, - UM_DOMAIN_ID INTEGER, - UNIQUE (UM_USER_NAME, UM_ROLE_ID, UM_TENANT_ID, UM_DOMAIN_ID), - FOREIGN KEY (UM_ROLE_ID, UM_TENANT_ID) REFERENCES UM_HYBRID_ROLE(UM_ID, UM_TENANT_ID) ON DELETE CASCADE, - FOREIGN KEY (UM_DOMAIN_ID, UM_TENANT_ID) REFERENCES UM_DOMAIN(UM_DOMAIN_ID, UM_TENANT_ID) ON DELETE CASCADE, - PRIMARY KEY (UM_ID, UM_TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE UM_SYSTEM_ROLE( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_ROLE_NAME VARCHAR(255), - UM_TENANT_ID INTEGER DEFAULT 0, - PRIMARY KEY (UM_ID, UM_TENANT_ID) -)ENGINE INNODB; - -CREATE TABLE UM_SYSTEM_USER_ROLE( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_USER_NAME VARCHAR(255), - UM_ROLE_ID INTEGER NOT NULL, - UM_TENANT_ID INTEGER DEFAULT 0, - UNIQUE (UM_USER_NAME, UM_ROLE_ID, UM_TENANT_ID), - FOREIGN KEY (UM_ROLE_ID, UM_TENANT_ID) REFERENCES UM_SYSTEM_ROLE(UM_ID, UM_TENANT_ID), - PRIMARY KEY (UM_ID, UM_TENANT_ID) -)ENGINE INNODB; - - -CREATE TABLE UM_HYBRID_REMEMBER_ME( - UM_ID INTEGER NOT NULL AUTO_INCREMENT, - UM_USER_NAME VARCHAR(255) NOT NULL, - UM_COOKIE_VALUE VARCHAR(1024), - UM_CREATED_TIME TIMESTAMP, - UM_TENANT_ID INTEGER DEFAULT 0, - PRIMARY KEY (UM_ID, UM_TENANT_ID) -)ENGINE INNODB; diff --git a/pattern-1/README.md b/pattern-1/README.md index c8d0dee3..bf046642 100644 --- a/pattern-1/README.md +++ b/pattern-1/README.md @@ -1,3 +1,220 @@ -# Pattern-1 Deployment +# Kubernetes Resources for deployment of WSO2 API Manager with WSO2 API Manager Analytics -![alt tag](https://github.com/wso2/kubernetes-apim/blob/2.1.0/pattern-1/pattern-1.png) +Core Kubernetes resources for WSO2 API Manager deployment pattern 1. This consists of a scalable deployment of WSO2 API Manager +with WSO2 API Manager Analytics support. + +![WSO2 API Manager deployment with WSO2 API Manager Analytics support](pattern-1.png) + +## Prerequisites + +* In order to use WSO2 Kubernetes resources, you need an active WSO2 subscription. If you do not possess an active WSO2 +subscription already, you can sign up for a WSO2 Free Trial Subscription from [here](https://wso2.com/free-trial-subscription).

+ +* Install [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) and [Kubernetes client](https://kubernetes.io/docs/tasks/tools/install-kubectl/) +in order to run the steps provided in the following quick start guide.

+ +* An already setup [Kubernetes cluster](https://kubernetes.io/docs/setup/pick-right-solution/)

+ +* A pre-configured Network File System (NFS) to be used as the persistent volume for artifact sharing and persistence. +In the NFS server instance, create a Linux system user account named `wso2carbon` with user id `802` and a system group named `wso2` with group id `802`. +Add the `wso2carbon` user to the group `wso2`. + +``` +groupadd --system -g 802 wso2 +useradd --system -g 802 -u 802 wso2carbon +``` + +## Quick Start Guide + +>In the context of this document, `KUBERNETES_HOME` will refer to a local copy of the [`wso2/kubernetes-apim`](https://github.com/wso2/kubernetes-apim/) +Git repository.
+ +##### 1. Clone the Kubernetes Resources for WSO2 API Manager Git repository. + +``` +git clone https://github.com/wso2/kubernetes-apim.git +``` + +##### 2. Create a namespace named `wso2` and a service account named `wso2svc-account`, within the namespace `wso2`. + +``` +kubectl create namespace wso2 +kubectl create serviceaccount wso2svc-account -n wso2 +``` + +Then, switch the context to new `wso2` namespace from `default` namespace. + +``` +kubectl config set-context $(kubectl config current-context) --namespace=wso2 +``` + +##### 3. Create a Kubernetes Secret for pulling the required Docker images from [`WSO2 Docker Registry`](https://docker.wso2.com). + +Create a Kubernetes Secret named `wso2creds` in the cluster to authenticate with the WSO2 Docker Registry, to pull the required images. + +``` +kubectl create secret docker-registry wso2creds --docker-server=docker.wso2.com --docker-username= --docker-password= --docker-email= +``` + +`WSO2_USERNAME`: Your WSO2 username
+`WSO2_PASSWORD`: Your WSO2 password + +Please see [Kubernetes official documentation](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/#create-a-secret-in-the-cluster-that-holds-your-authorization-token) +for further details. + +##### 4. Setup product database(s). + +Setup the external product databases. Please refer to WSO2 API Manager's [official documentation](https://docs.wso2.com/display/AM220/Installing+and+Configuring+the+Databases) +on creating the required databases for the deployment. + +Provide appropriate connection URLs, corresponding to the created external databases and the relevant driver class names for the data sources defined in +the following files: + +* `/pattern-1/confs/apim/datasources/master-datasources.xml` +* `/pattern-1/confs/apim-analytics/datasources/analytics-datasources.xml` +* `/pattern-1/confs/apim-analytics/datasources/master-datasources.xml` +* `/pattern-1/confs/apim-analytics/datasources/stats-datasources.xml` + +Please refer WSO2's [official documentation](https://docs.wso2.com/display/ADMIN44x/Configuring+master-datasources.xml) on configuring data sources. + +**Note**: + +* For **evaluation purposes**, you can use Kubernetes resources provided in the directory
+`/pattern-1/extras/rdbms/mysql` for deploying the product databases, using MySQL in Kubernetes. However, this approach of product database deployment is +**not recommended** for a production setup. + +* For using these Kubernetes resources, + + first create a Kubernetes ConfigMap for passing database script(s) to the deployment. + + ``` + kubectl create configmap mysql-dbscripts --from-file=/pattern-1/extras/confs/mysql/dbscripts/ + ``` + + Here, a Network File System (NFS) is needed to be used for persisting MySQL DB data. + + Create and export a directory within the NFS server instance. + + Provide read-write-execute permissions to other users for the created folder. + + Update the Kubernetes Persistent Volume resource with the corresponding NFS server IP (`NFS_SERVER_IP`) and exported, + NFS server directory path (`NFS_LOCATION_PATH`) in `/pattern-1/extras/rdbms/volumes/persistent-volumes.yaml`. + + Deploy the persistent volume resource and volume claim as follows: + + ``` + kubectl create -f /pattern-1/extras/rdbms/mysql/mysql-persistent-volume-claim.yaml + kubectl create -f /pattern-1/extras/rdbms/volumes/persistent-volumes.yaml + ``` + + Then, create a Kubernetes service (accessible only within the Kubernetes cluster), followed by the MySQL Kubernetes deployment, as follows: + + ``` + kubectl create -f /pattern-1/extras/rdbms/mysql/mysql-service.yaml + kubectl create -f /pattern-1/extras/rdbms/mysql/mysql-deployment.yaml + ``` + +##### 5. Create a Kubernetes role and a role binding necessary for the Kubernetes API requests made from Kubernetes membership scheme. + +``` +kubectl create --username=admin --password= -f /rbac/rbac.yaml +``` + +`K8S_CLUSTER_ADMIN_PASSWORD`: Kubernetes cluster admin password + +##### 6. Setup a Network File System (NFS) to be used for persistent storage. + +Create and export unique directories within the NFS server instance for each Kubernetes Persistent Volume resource defined in the +`/pattern-1/volumes/persistent-volumes.yaml` file. + +Grant ownership to `wso2carbon` user and `wso2` group, for each of the previously created directories. + +``` +sudo chown -R wso2carbon:wso2 +``` + +Grant read-write-execute permissions to the `wso2carbon` user, for each of the previously created directories. + +``` +chmod -R 700 +``` + +Update each Kubernetes Persistent Volume resource with the corresponding NFS server IP (`NFS_SERVER_IP`) and exported, NFS server directory path (`NFS_LOCATION_PATH`). + +Then, deploy the persistent volume resource and volume claim as follows: + +``` +kubectl create -f /pattern-1/apim/wso2apim-volume-claim.yaml +kubectl create -f /pattern-1/apim-analytics/wso2apim-analytics-volume-claims.yaml +kubectl create -f /pattern-1/volumes/persistent-volumes.yaml +``` + +##### 7. Create Kubernetes ConfigMaps for passing WSO2 product configurations into the Kubernetes cluster. + +``` +kubectl create configmap apim-conf --from-file=/pattern-1/confs/apim/ +kubectl create configmap apim-conf-datasources --from-file=/pattern-1/confs/apim/datasources/ + +kubectl create configmap apim-analytics-conf --from-file=/pattern-1/confs/apim-analytics/ +kubectl create configmap apim-analytics-conf-datasources --from-file=/pattern-1/confs/apim-analytics/datasources/ +``` + +##### 8. Create Kubernetes Services and Deployments for WSO2 API Manager and Analytics. + +``` +kubectl create -f /pattern-1/apim-analytics/wso2apim-analytics-deployment.yaml +kubectl create -f /pattern-1/apim-analytics/wso2apim-analytics-service.yaml +kubectl create -f /pattern-1/apim/wso2apim-deployment.yaml +kubectl create -f /pattern-1/apim/wso2apim-service.yaml +``` + +##### 9. Deploy Kubernetes Ingress resource. + +The WSO2 API Manager Kubernetes Ingress resource uses the NGINX Ingress Controller. + +In order to enable the NGINX Ingress controller in the desired cloud or on-premise environment, +please refer the official documentation, [NGINX Ingress Controller Installation Guide](https://kubernetes.github.io/ingress-nginx/deploy/). + +Finally, deploy the WSO2 API Manager Kubernetes Ingress resources as follows: + +``` +kubectl create -f /pattern-1/ingresses/wso2apim-analytics-ingress.yaml +kubectl create -f /pattern-1/ingresses/wso2apim-ingress.yaml +``` + +##### 10. Access Management Consoles. + +Default deployment will expose `wso2apim`, `wso2apim-gateway` and `wso2apim-analytics` hosts. + +To access the console in the environment, + +1. Obtain the external IP (`EXTERNAL-IP`) of the Ingress resources by listing down the Kubernetes Ingresses (using `kubectl get ing`). + +e.g. + +``` +NAME HOSTS ADDRESS PORTS AGE +wso2apim-with-analytics-apim-analytics-ingress wso2apim-analytics 80, 443 6m +wso2apim-with-analytics-apim-ingress wso2apim,wso2apim-gateway 80, 443 7m +``` + +2. Add the above host as an entry in /etc/hosts file as follows: + +``` + wso2apim-analytics + wso2apim + wso2apim-gateway +``` + +3. Try navigating to `https://wso2apim/carbon` and `https://wso2apim-analytics/carbon` from your favorite browser. + +##### 11. Scale up using `kubectl scale`. + +Default deployment runs a single replica (or pod) of WSO2 API Manager. To scale this deployment into any `` number of +container replicas, upon your requirement, simply run following Kubernetes client command on the terminal. + +``` +kubectl scale --replicas= -f /pattern-1/apim/wso2apim-deployment.yaml +``` + +For example, If `` is 2, you are here scaling up this deployment from 1 to 2 container replicas. diff --git a/pattern-1/apim-analytics/wso2apim-analytics-deployment.yaml b/pattern-1/apim-analytics/wso2apim-analytics-deployment.yaml new file mode 100644 index 00000000..6bff037a --- /dev/null +++ b/pattern-1/apim-analytics/wso2apim-analytics-deployment.yaml @@ -0,0 +1,139 @@ +# Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +# +# Licensed 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. + +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: wso2apim-with-analytics-apim-analytics-deployment +spec: + replicas: 1 + minReadySeconds: 30 + strategy: + rollingUpdate: + maxSurge: 1 + maxUnavailable: 0 + type: RollingUpdate + template: + metadata: + labels: + deployment: wso2apim-with-analytics-apim-analytics + spec: + containers: + - name: wso2apim-with-analytics-apim-analytics + image: docker.wso2.com/wso2am-analytics:2.2.0 + resources: + limits: + memory: "4Gi" + requests: + memory: "4Gi" + livenessProbe: + exec: + command: + - /bin/bash + - -c + - nc -z localhost 7712 + initialDelaySeconds: 250 + periodSeconds: 10 + readinessProbe: + exec: + command: + - /bin/bash + - -c + - nc -z localhost 7712 + initialDelaySeconds: 250 + periodSeconds: 10 + imagePullPolicy: Always + ports: + - + containerPort: 9764 + protocol: "TCP" + - + containerPort: 9444 + protocol: "TCP" + - + containerPort: 7612 + protocol: "TCP" + - + containerPort: 7712 + protocol: "TCP" + - + containerPort: 11225 + protocol: "TCP" + - + containerPort: 10006 + protocol: "TCP" + - + containerPort: 11001 + protocol: "TCP" + - + containerPort: 11002 + protocol: "TCP" + - + containerPort: 11003 + protocol: "TCP" + - + containerPort: 11501 + protocol: "TCP" + - + containerPort: 8083 + protocol: "TCP" + - + containerPort: 4041 + protocol: "TCP" + - + containerPort: 10007 + protocol: TCP + - + containerPort: 12501 + protocol: TCP + - + containerPort: 13001 + protocol: TCP + - + containerPort: 13501 + protocol: TCP + - + containerPort: 14501 + protocol: TCP + - + containerPort: 7078 + protocol: TCP + - + containerPort: 6067 + protocol: TCP + volumeMounts: + - name: apim-analytics-conf + mountPath: /home/wso2carbon/kubernetes-volumes/am-analytics/conf + - name: apim-analytics-conf-datasources + mountPath: /home/wso2carbon/kubernetes-volumes/am-analytics/conf-datasources + - name: analytics-persistent-disk + mountPath: /home/wso2carbon/wso2am-analytics-2.2.0/repository/conf/analytics + - name: data-persistent-disk + mountPath: /home/wso2carbon/wso2am-analytics-2.2.0/repository/data + serviceAccountName: "wso2svc-account" + imagePullSecrets: + - name: wso2creds + volumes: + - name: apim-analytics-conf + configMap: + name: apim-analytics-conf + - name: apim-analytics-conf-datasources + configMap: + name: apim-analytics-conf-datasources + - name: analytics-persistent-disk + persistentVolumeClaim: + claimName: wso2apim-with-analytics-apim-analytics-volume-claim + - name: data-persistent-disk + persistentVolumeClaim: + claimName: wso2apim-with-analytics-apim-analytics-data-volume-claim diff --git a/pattern-1/artifacts/apim-analytics/wso2apim-analytics-1-service.yaml b/pattern-1/apim-analytics/wso2apim-analytics-service.yaml similarity index 72% rename from pattern-1/artifacts/apim-analytics/wso2apim-analytics-1-service.yaml rename to pattern-1/apim-analytics/wso2apim-analytics-service.yaml index a8f79f80..40dd23af 100644 --- a/pattern-1/artifacts/apim-analytics/wso2apim-analytics-1-service.yaml +++ b/pattern-1/apim-analytics/wso2apim-analytics-service.yaml @@ -15,13 +15,12 @@ apiVersion: v1 kind: Service metadata: - name: wso2apim-analytics-1 - labels: - node: wso2apim-analytics-1 - pattern: wso2apim-pattern-1 + name: wso2apim-with-analytics-apim-analytics-service spec: + # label keys and values that must match in order to receive traffic for this service + selector: + deployment: wso2apim-with-analytics-apim-analytics ports: - # ports that this service should serve on - name: 'thrift' port: 7612 @@ -31,84 +30,78 @@ spec: port: 7712 protocol: TCP - - name: 'spark-1' + name: 'spark-port-1' port: 11225 protocol: TCP - - name: 'spark-2' + name: 'spark-port-2' port: 10006 protocol: TCP - - name: 'spark-3' + name: 'spark-port-3' port: 11001 protocol: TCP - - name: 'spark-44' + name: 'spark-port-4' protocol: TCP port: 8082 - - name: 'spark-5' + name: 'spark-port-5' protocol: TCP port: 4041 - - name: 'spark6' + name: 'spark-port-6' protocol: TCP port: 12001 - - name: 'spark7' + name: 'spark-port-7' protocol: TCP port: 12002 - - name: 'spark8' + name: 'spark-port-8' protocol: TCP port: 12003 - - name: 'spark9' + name: 'spark-port-9' protocol: TCP port: 12004 - - name: 'spark10' + name: 'spark-port-10' protocol: TCP port: 12005 - - name: 'analytics1' + name: 'analytics-port-1' protocol: TCP port: 10007 - - name: 'analytics2' + name: 'analytics-port-2' protocol: TCP port: 11002 - - name: 'analytics3' + name: 'analytics-port-3' protocol: TCP port: 12501 - - name: 'analytics5' + name: 'analytics-port-4' protocol: TCP port: 13001 - - name: 'analytics6' + name: 'analytics-port-5' protocol: TCP port: 13501 - - name: 'analytics7' + name: 'analytics-port-6' protocol: TCP port: 14501 - - name: 'analytics8' + name: 'analytics-port-7' protocol: TCP port: 7078 - - name: 'analytics9' + name: 'analytics-port-8' protocol: TCP port: 6067 - - name: 'analytics10' + name: 'analytics-port-9' protocol: TCP port: 11003 - - # label keys and values that must match in order to receive traffic for this service - selector: - node: wso2apim-analytics-1 - pattern: wso2apim-pattern-1 - clusterIP: None diff --git a/pattern-1/apim-analytics/wso2apim-analytics-volume-claims.yaml b/pattern-1/apim-analytics/wso2apim-analytics-volume-claims.yaml new file mode 100644 index 00000000..7b1430ca --- /dev/null +++ b/pattern-1/apim-analytics/wso2apim-analytics-volume-claims.yaml @@ -0,0 +1,45 @@ +# Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +# +# Licensed 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. + +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: wso2apim-with-analytics-apim-analytics-data-volume-claim +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 20Gi + storageClassName: "" + selector: + matchLabels: + purpose: apim-analytics-data + +--- + +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: wso2apim-with-analytics-apim-analytics-volume-claim +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi + storageClassName: "" + selector: + matchLabels: + purpose: apim-analytics diff --git a/pattern-1/apim/wso2apim-deployment.yaml b/pattern-1/apim/wso2apim-deployment.yaml new file mode 100644 index 00000000..20eaacd1 --- /dev/null +++ b/pattern-1/apim/wso2apim-deployment.yaml @@ -0,0 +1,99 @@ +# Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +# +# Licensed 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. + +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: wso2apim-with-analytics-apim +spec: + replicas: 1 + minReadySeconds: 30 + strategy: + rollingUpdate: + maxSurge: 1 + maxUnavailable: 0 + type: RollingUpdate + template: + metadata: + labels: + deployment: wso2apim-with-analytics-apim + spec: + containers: + - name: wso2apim-with-analytics-apim-worker + image: docker.wso2.com/wso2am:2.2.0 + livenessProbe: + exec: + command: + - /bin/bash + - -c + - nc -z localhost 9443 + initialDelaySeconds: 150 + periodSeconds: 10 + readinessProbe: + exec: + command: + - /bin/bash + - -c + - nc -z localhost 9443 + initialDelaySeconds: 150 + periodSeconds: 10 + imagePullPolicy: Always + ports: + - + containerPort: 8280 + protocol: "TCP" + - + containerPort: 8243 + protocol: "TCP" + - + containerPort: 9763 + protocol: "TCP" + - + containerPort: 9443 + protocol: "TCP" + - + containerPort: 5672 + protocol: "TCP" + - + containerPort: 9711 + protocol: "TCP" + - + containerPort: 9611 + protocol: "TCP" + - + containerPort: 7711 + protocol: "TCP" + - + containerPort: 7611 + protocol: "TCP" + volumeMounts: + - name: apim-storage-volume + mountPath: /home/wso2carbon/wso2am-2.2.0/repository/deployment/server + - name: apim-conf + mountPath: /home/wso2carbon/kubernetes-volumes/am/conf + - name: apim-conf-datasources + mountPath: /home/wso2carbon/kubernetes-volumes/am/conf/datasources + serviceAccountName: "wso2svc-account" + imagePullSecrets: + - name: wso2creds + volumes: + - name: apim-storage-volume + persistentVolumeClaim: + claimName: wso2apim-with-analytics-apim-deployment-volume-claim + - name: apim-conf + configMap: + name: apim-conf + - name: apim-conf-datasources + configMap: + name: apim-conf-datasources \ No newline at end of file diff --git a/pattern-1/artifacts/apim/wso2apim-service.yaml b/pattern-1/apim/wso2apim-service.yaml similarity index 78% rename from pattern-1/artifacts/apim/wso2apim-service.yaml rename to pattern-1/apim/wso2apim-service.yaml index c047aec8..9c3ba9b2 100644 --- a/pattern-1/artifacts/apim/wso2apim-service.yaml +++ b/pattern-1/apim/wso2apim-service.yaml @@ -15,31 +15,26 @@ apiVersion: v1 kind: Service metadata: - name: wso2apim - labels: - app: wso2apim - pattern: wso2apim-pattern-1 + name: wso2apim-with-analytics-apim-service spec: + # label keys and values that must match in order to receive traffic for this service + selector: + deployment: wso2apim-with-analytics-apim ports: # ports that this service should serve on - - name: 'pass-through-http' + name: pass-through-http protocol: TCP port: 8280 - - name: 'pass-through-https' + name: pass-through-https protocol: TCP port: 8243 - - name: 'servlet-http' + name: servlet-http protocol: TCP port: 9763 - - name: 'servlet-https' + name: servlet-https protocol: TCP port: 9443 - # label keys and values that must match in order to receive traffic for this service - selector: - app: wso2apim - pattern: wso2apim-pattern-1 - sessionAffinity: ClientIP diff --git a/pattern-2/artifacts/apim-gateway/wso2apim-mgt-volume-claim.yaml b/pattern-1/apim/wso2apim-volume-claim.yaml similarity index 83% rename from pattern-2/artifacts/apim-gateway/wso2apim-mgt-volume-claim.yaml rename to pattern-1/apim/wso2apim-volume-claim.yaml index 4c696f49..549b2524 100644 --- a/pattern-2/artifacts/apim-gateway/wso2apim-mgt-volume-claim.yaml +++ b/pattern-1/apim/wso2apim-volume-claim.yaml @@ -15,13 +15,14 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: apim-mgt-volume-claim - labels: - app: apim-gateway - pattern: wso2apim-pattern-2 + name: wso2apim-with-analytics-apim-deployment-volume-claim spec: accessModes: - ReadWriteMany resources: requests: storage: 1Gi + storageClassName: "" + selector: + matchLabels: + purpose: apim-shared-deployment diff --git a/pattern-1/artifacts/apim-analytics/wso2apim-analytics-1-deployment.yaml b/pattern-1/artifacts/apim-analytics/wso2apim-analytics-1-deployment.yaml deleted file mode 100644 index 2af533a2..00000000 --- a/pattern-1/artifacts/apim-analytics/wso2apim-analytics-1-deployment.yaml +++ /dev/null @@ -1,153 +0,0 @@ -# Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -# -# Licensed 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. - -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: wso2apim-analytics-1 - labels: - app: wso2apim-analytics - node: wso2apim-analytics-1 - pattern: wso2apim-pattern-1 -spec: - strategy: - type: Recreate - template: - metadata: - labels: - app: wso2apim-analytics - node: wso2apim-analytics-1 - pattern: wso2apim-pattern-1 - spec: - hostname: wso2apim-analytics-1 - containers: - - image: docker.wso2.com/wso2am-analytics-kubernetes:2.1.0 - name: wso2apim-analytics - imagePullPolicy: IfNotPresent - resources: - limits: - memory: "4Gi" - requests: - memory: "4Gi" - ports: - - - containerPort: 9764 - protocol: "TCP" - - - containerPort: 9444 - protocol: "TCP" - - - containerPort: 7612 - protocol: "TCP" - - - containerPort: 7712 - protocol: "TCP" - - - containerPort: 11225 - protocol: "TCP" - - - containerPort: 10006 - protocol: "TCP" - - - containerPort: 11001 - protocol: "TCP" - - - containerPort: 11002 - protocol: "TCP" - - - containerPort: 11003 - protocol: "TCP" - - - containerPort: 11501 - protocol: "TCP" - - - containerPort: 8083 - protocol: "TCP" - - - containerPort: 4041 - protocol: "TCP" - - - containerPort: 10007 - protocol: TCP - - - containerPort: 12501 - protocol: TCP - - - containerPort: 13001 - protocol: TCP - - - containerPort: 13501 - protocol: TCP - - - containerPort: 14501 - protocol: TCP - - - containerPort: 7078 - protocol: TCP - - - containerPort: 6067 - protocol: TCP - livenessProbe: - tcpSocket: - port: 7712 - initialDelaySeconds: 300 - periodSeconds: 20 - volumeMounts: - - name: apim-analytics-storage-volume - mountPath: "/home/wso2user/wso2am-analytics-2.1.0/repository/data/" - - name: apim-analytics-1-bin - mountPath: "/home/wso2user/wso2am-analytics-2.1.0-conf/bin/" - - name: apim-analytics-1-conf - mountPath: "/home/wso2user/wso2am-analytics-2.1.0-conf/conf/" - - name: apim-analytics-1-spark - mountPath: "/home/wso2user/wso2am-analytics-2.1.0-conf/conf-analytics-spark/" - - name: apim-analytics-1-axis2 - mountPath: "/home/wso2user/wso2am-analytics-2.1.0-conf/conf-axis2/" - - name: apim-analytics-1-datasources - mountPath: "/home/wso2user/wso2am-analytics-2.1.0-conf/conf-datasources/" - - name: apim-analytics-1-tomcat - mountPath: "/home/wso2user/wso2am-analytics-2.1.0-conf/conf-tomcat/" - - name: apim-analytics-1-conf-analytics - mountPath: "/home/wso2user/wso2am-analytics-2.1.0-conf/conf-analytics/" - - name: apim-analytics-1-conf-analytics-volume - mountPath: "/home/wso2user/wso2am-analytics-2.1.0/repository/conf/analytics/" - volumes: - - name: apim-analytics-storage-volume - persistentVolumeClaim: - claimName: apim-analytics-volume-claim-1 - - name: apim-analytics-1-conf-analytics-volume - persistentVolumeClaim: - claimName: apim-analytics-conf-volume-claim-1 - - name: apim-analytics-1-bin - configMap: - name: apim-analytics-1-bin - - name: apim-analytics-1-conf - configMap: - name: apim-analytics-1-conf - - name: apim-analytics-1-spark - configMap: - name: apim-analytics-1-spark - - name: apim-analytics-1-axis2 - configMap: - name: apim-analytics-1-axis2 - - name: apim-analytics-1-datasources - configMap: - name: apim-analytics-1-datasources - - name: apim-analytics-1-tomcat - configMap: - name: apim-analytics-1-tomcat - - name: apim-analytics-1-conf-analytics - configMap: - name: apim-analytics-1-conf-analytics - serviceAccountName: "wso2svcacct" diff --git a/pattern-1/artifacts/apim-analytics/wso2apim-analytics-2-deployment.yaml b/pattern-1/artifacts/apim-analytics/wso2apim-analytics-2-deployment.yaml deleted file mode 100644 index a094aa86..00000000 --- a/pattern-1/artifacts/apim-analytics/wso2apim-analytics-2-deployment.yaml +++ /dev/null @@ -1,149 +0,0 @@ -# Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -# -# Licensed 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. - -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: wso2apim-analytics-2 - labels: - app: wso2apim-analytics - node: wso2apim-analytics-2 - pattern: wso2apim-pattern-1 -spec: - strategy: - type: Recreate - template: - metadata: - labels: - app: wso2apim-analytics - node: wso2apim-analytics-2 - pattern: wso2apim-pattern-1 - spec: - hostname: wso2apim-analytics-2 - containers: - - image: docker.wso2.com/wso2am-analytics-kubernetes:2.1.0 - name: wso2apim-analytics - imagePullPolicy: IfNotPresent - resources: - limits: - memory: "4Gi" - requests: - memory: "4Gi" - ports: - - - containerPort: 9764 - protocol: "TCP" - - - containerPort: 9444 - protocol: "TCP" - - - containerPort: 7612 - protocol: "TCP" - - - containerPort: 7712 - protocol: "TCP" - - - containerPort: 11225 - protocol: "TCP" - - - containerPort: 10006 - protocol: "TCP" - - - containerPort: 11001 - protocol: "TCP" - - - containerPort: 11501 - protocol: "TCP" - - - containerPort: 8083 - protocol: "TCP" - - - containerPort: 4041 - protocol: "TCP" - - - containerPort: 10007 - protocol: TCP - - - containerPort: 12501 - protocol: TCP - - - containerPort: 13001 - protocol: TCP - - - containerPort: 13501 - protocol: TCP - - - containerPort: 14501 - protocol: TCP - - - containerPort: 7078 - protocol: TCP - - - containerPort: 6067 - protocol: TCP - livenessProbe: - tcpSocket: - port: 7712 - initialDelaySeconds: 300 - periodSeconds: 20 - volumeMounts: - - name: apim-analytics2-storage-volume - mountPath: "/home/wso2user/wso2am-analytics-2.1.0/repository/data/" - - name: apim-analytics-2-bin - mountPath: "/home/wso2user/wso2am-analytics-2.1.0-conf/bin/" - - name: apim-analytics-2-conf - mountPath: "/home/wso2user/wso2am-analytics-2.1.0-conf/conf/" - - name: apim-analytics-2-spark - mountPath: "/home/wso2user/wso2am-analytics-2.1.0-conf/conf-analytics-spark/" - - name: apim-analytics-2-axis2 - mountPath: "/home/wso2user/wso2am-analytics-2.1.0-conf/conf-axis2/" - - name: apim-analytics-2-datasources - mountPath: "/home/wso2user/wso2am-analytics-2.1.0-conf/conf-datasources/" - - name: apim-analytics-2-tomcat - mountPath: "/home/wso2user/wso2am-analytics-2.1.0-conf/conf-tomcat/" - - name: apim-analytics-2-conf-analytics - mountPath: "/home/wso2user/wso2am-analytics-2.1.0-conf/conf-analytics/" - - name: apim-analytics-2-conf-analytics-volume - mountPath: "/home/wso2user/wso2am-analytics-2.1.0/repository/conf/analytics/" - volumes: - - name: apim-analytics2-storage-volume - persistentVolumeClaim: - claimName: apim-analytics-volume-claim-2 - - name: apim-analytics-2-conf-analytics-volume - persistentVolumeClaim: - claimName: apim-analytics-conf-volume-claim-2 - - name: apim-analytics-2-bin - configMap: - name: apim-analytics-2-bin - - name: apim-analytics-2-conf - configMap: - name: apim-analytics-2-conf - - name: apim-analytics-2-spark - configMap: - name: apim-analytics-2-spark - - name: apim-analytics-2-axis2 - configMap: - name: apim-analytics-2-axis2 - - name: apim-analytics-2-datasources - configMap: - name: apim-analytics-2-datasources - - name: apim-analytics-2-tomcat - configMap: - name: apim-analytics-2-tomcat - - name: apim-analytics-2-conf-analytics - configMap: - name: apim-analytics-2-conf-analytics - serviceAccountName: "wso2svcacct" - securityContext: - supplementalGroups: [0] diff --git a/pattern-1/artifacts/apim-analytics/wso2apim-analytics-service.yaml b/pattern-1/artifacts/apim-analytics/wso2apim-analytics-service.yaml deleted file mode 100644 index 6cee7a03..00000000 --- a/pattern-1/artifacts/apim-analytics/wso2apim-analytics-service.yaml +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -# -# Licensed 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. - -apiVersion: v1 -kind: Service -metadata: - name: wso2apim-analytics - labels: - app: wso2apim-analytics - pattern: wso2apim-pattern-1 -spec: - ports: - # ports that this service should serve on - - - name: 'servlet-http' - protocol: TCP - port: 9764 - - - name: 'servlet-https' - protocol: TCP - port: 9444 - - - name: 'spark-1' - protocol: TCP - port: 8082 - - - name: 'spark-2' - protocol: TCP - port: 4041 - - - name: 'spark-3' - protocol: TCP - port: 11501 - # label keys and values that must match in order to receive traffic for this service - selector: - app: wso2apim-analytics - pattern: wso2apim-pattern-1 - sessionAffinity: ClientIP \ No newline at end of file diff --git a/pattern-1/artifacts/apim-analytics/wso2apim-analytics-volume-claim.yaml b/pattern-1/artifacts/apim-analytics/wso2apim-analytics-volume-claim.yaml deleted file mode 100644 index 4759164d..00000000 --- a/pattern-1/artifacts/apim-analytics/wso2apim-analytics-volume-claim.yaml +++ /dev/null @@ -1,91 +0,0 @@ -# Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -# -# Licensed 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. - -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: apim-analytics-volume-claim-1 - labels: - app: apim-analytics - pattern: wso2apim-pattern-1 -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - # This storage size should be change according to the TPS of the server and the record count. - storage: 20Gi - selector: - matchLabels: - type: local - pattern: wso2apim-pattern-1 - purpose: apim-analytics-data-1 ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: apim-analytics-volume-claim-2 - labels: - app: apim-analytics - pattern: wso2apim-pattern-1 -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - # This storage size should be change according to the TPS of the server and the record count. - storage: 20Gi - selector: - matchLabels: - type: local - pattern: wso2apim-pattern-1 - purpose: apim-analytics-data-2 ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: apim-analytics-conf-volume-claim-1 - labels: - app: apim-analytics - pattern: wso2apim-pattern-1 -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 1Gi - selector: - matchLabels: - type: local - pattern: wso2apim-pattern-1 - purpose: apim-analytics-conf-analytics-1 ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: apim-analytics-conf-volume-claim-2 - labels: - app: apim-analytics - pattern: wso2apim-pattern-1 -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 1Gi - selector: - matchLabels: - type: local - pattern: wso2apim-pattern-1 - purpose: apim-analytics-conf-analytics-2 diff --git a/pattern-1/artifacts/apim/wso2apim-manager-worker-deployment.yaml b/pattern-1/artifacts/apim/wso2apim-manager-worker-deployment.yaml deleted file mode 100644 index 4b9980f5..00000000 --- a/pattern-1/artifacts/apim/wso2apim-manager-worker-deployment.yaml +++ /dev/null @@ -1,107 +0,0 @@ -# Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -# -# Licensed 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. - -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: wso2apim-manager-worker - labels: - app: wso2apim - node-m: manager-worker - pattern: wso2apim-pattern-1 -spec: - strategy: - type: Recreate - template: - metadata: - labels: - app: wso2apim - node-m: manager-worker - pattern: wso2apim-pattern-1 - spec: - containers: - - - image: docker.wso2.com/wso2am-kubernetes:2.1.0 - name: wso2apim - imagePullPolicy: IfNotPresent - ports: - - - containerPort: 8243 - protocol: "TCP" - - - containerPort: 9763 - protocol: "TCP" - - - containerPort: 9443 - protocol: "TCP" - - - containerPort: 5672 - protocol: "TCP" - - - containerPort: 9711 - protocol: "TCP" - - - containerPort: 9611 - protocol: "TCP" - - - containerPort: 7711 - protocol: "TCP" - - - containerPort: 7611 - protocol: "TCP" - - volumeMounts: - - - name: apim-mgt-storage-volume - mountPath: "/home/wso2user/wso2am-2.1.0/repository/deployment/server" - - name: apim-manager-worker-bin - mountPath: "/home/wso2user/wso2am-2.1.0-conf/bin/" - - name: apim-manager-worker-conf - mountPath: "/home/wso2user/wso2am-2.1.0-conf/conf/" - - name: apim-manager-worker-identity - mountPath: "/home/wso2user/wso2am-2.1.0-conf/conf-identity/" - - name: apim-manager-worker-axis2 - mountPath: "/home/wso2user/wso2am-2.1.0-conf/conf-axis2/" - - name: apim-manager-worker-datasources - mountPath: "/home/wso2user/wso2am-2.1.0-conf/conf-datasources/" - - name: apim-manager-worker-tomcat - mountPath: "/home/wso2user/wso2am-2.1.0-conf/conf-tomcat/" - livenessProbe: - tcpSocket: - port: 9443 - initialDelaySeconds: 300 - periodSeconds: 20 - serviceAccountName: "wso2svcacct" - volumes: - - name: apim-mgt-storage-volume - persistentVolumeClaim: - claimName: apim-mgt-volume-claim - - name: apim-manager-worker-bin - configMap: - name: apim-manager-worker-bin - - name: apim-manager-worker-conf - configMap: - name: apim-manager-worker-conf - - name: apim-manager-worker-identity - configMap: - name: apim-manager-worker-identity - - name: apim-manager-worker-axis2 - configMap: - name: apim-manager-worker-axis2 - - name: apim-manager-worker-datasources - configMap: - name: apim-manager-worker-datasources - - name: apim-manager-worker-tomcat - configMap: - name: apim-manager-worker-tomcat diff --git a/pattern-1/artifacts/apim/wso2apim-manager-worker-service.yaml b/pattern-1/artifacts/apim/wso2apim-manager-worker-service.yaml deleted file mode 100644 index 72b6fe6f..00000000 --- a/pattern-1/artifacts/apim/wso2apim-manager-worker-service.yaml +++ /dev/null @@ -1,57 +0,0 @@ -# Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -# -# Licensed 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. - -apiVersion: v1 -kind: Service -metadata: - name: wso2apim-manager-worker - labels: - node-m: manager-worker - pattern: wso2apim-pattern-1 -spec: - ports: - # ports that this service should serve on - - - name: "http" - protocol: TCP - port: 9763 - - - name: "https" - protocol: TCP - port: 9443 - - - name: "jms-tcp" - protocol: TCP - port: 5672 - - - name: "binary-secure" - protocol: TCP - port: 9711 - - - name: "binary" - protocol: TCP - port: 9611 - - - name: "thrift-secure" - protocol: TCP - port: 7711 - - - name: "thrift" - protocol: TCP - port: 7611 - # label keys and values that must match in order to receive traffic for this service - selector: - node-m: manager-worker - pattern: wso2apim-pattern-1 - clusterIP: None diff --git a/pattern-1/artifacts/apim/wso2apim-worker-deployment.yaml b/pattern-1/artifacts/apim/wso2apim-worker-deployment.yaml deleted file mode 100644 index 609e3615..00000000 --- a/pattern-1/artifacts/apim/wso2apim-worker-deployment.yaml +++ /dev/null @@ -1,108 +0,0 @@ -# Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -# -# Licensed 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. - -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: wso2apim-worker - labels: - app: wso2apim - node-w: worker - pattern: wso2apim-pattern-1 -spec: - strategy: - type: Recreate - template: - metadata: - labels: - app: wso2apim - node-w: worker - pattern: wso2apim-pattern-1 - spec: - containers: - - image: docker.wso2.com/wso2am-kubernetes:2.1.0 - name: wso2apim - imagePullPolicy: IfNotPresent - ports: - - - containerPort: 8280 - protocol: "TCP" - - - containerPort: 8243 - protocol: "TCP" - - - containerPort: 9763 - protocol: "TCP" - - - containerPort: 9443 - protocol: "TCP" - - - containerPort: 5672 - protocol: "TCP" - - - containerPort: 9711 - protocol: "TCP" - - - containerPort: 9611 - protocol: "TCP" - - - containerPort: 7711 - protocol: "TCP" - - - containerPort: 7611 - protocol: "TCP" - - volumeMounts: - - name: apim-mgt-storage-volume - mountPath: "/home/wso2user/wso2am-2.1.0/repository/deployment/server" - - name: apim-worker-bin - mountPath: "/home/wso2user/wso2am-2.1.0-conf/bin/" - - name: apim-worker-conf - mountPath: "/home/wso2user/wso2am-2.1.0-conf/conf/" - - name: apim-worker-identity - mountPath: "/home/wso2user/wso2am-2.1.0-conf/conf-identity/" - - name: apim-worker-axis2 - mountPath: "/home/wso2user/wso2am-2.1.0-conf/conf-axis2/" - - name: apim-worker-datasources - mountPath: "/home/wso2user/wso2am-2.1.0-conf/conf-datasources/" - - name: apim-worker-tomcat - mountPath: "/home/wso2user/wso2am-2.1.0-conf/conf-tomcat/" - livenessProbe: - tcpSocket: - port: 9443 - initialDelaySeconds: 300 - periodSeconds: 20 - serviceAccountName: "wso2svcacct" - volumes: - - name: apim-mgt-storage-volume - persistentVolumeClaim: - claimName: apim-mgt-volume-claim - - name: apim-worker-bin - configMap: - name: apim-worker-bin - - name: apim-worker-conf - configMap: - name: apim-worker-conf - - name: apim-worker-identity - configMap: - name: apim-worker-identity - - name: apim-worker-axis2 - configMap: - name: apim-worker-axis2 - - name: apim-worker-datasources - configMap: - name: apim-worker-datasources - - name: apim-worker-tomcat - configMap: - name: apim-worker-tomcat \ No newline at end of file diff --git a/pattern-1/artifacts/deploy-kubernetes.sh b/pattern-1/artifacts/deploy-kubernetes.sh deleted file mode 100755 index 38a21cf7..00000000 --- a/pattern-1/artifacts/deploy-kubernetes.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/bin/bash - -# ------------------------------------------------------------------------ -# Copyright 2017 WSO2, Inc. (http://wso2.com) -# -# Licensed 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 -# ------------------------------------------------------------------------ - -# set namespace -kubectl config set-context $(kubectl config current-context) --namespace=wso2 - -# volumes -kubectl create -f volumes/persistent-volumes.yaml - -# Configuration Maps -kubectl create configmap apim-analytics-1-bin --from-file=../confs/apim-analytics-1/bin/ -kubectl create configmap apim-analytics-1-conf --from-file=../confs/apim-analytics-1/repository/conf/ -kubectl create configmap apim-analytics-1-spark --from-file=../confs/apim-analytics-1/repository/conf/analytics/spark/ -kubectl create configmap apim-analytics-1-axis2 --from-file=../confs/apim-analytics-1/repository/conf/axis2/ -kubectl create configmap apim-analytics-1-datasources --from-file=../confs/apim-analytics-1/repository/conf/datasources/ -kubectl create configmap apim-analytics-1-tomcat --from-file=../confs/apim-analytics-1/repository/conf/tomcat/ -kubectl create configmap apim-analytics-1-conf-analytics --from-file=../confs/apim-analytics-1/repository/conf/analytics/ - -kubectl create configmap apim-analytics-2-bin --from-file=../confs/apim-analytics-2/bin/ -kubectl create configmap apim-analytics-2-conf --from-file=../confs/apim-analytics-2/repository/conf/ -kubectl create configmap apim-analytics-2-spark --from-file=../confs/apim-analytics-2/repository/conf/analytics/spark/ -kubectl create configmap apim-analytics-2-axis2 --from-file=../confs/apim-analytics-2/repository/conf/axis2/ -kubectl create configmap apim-analytics-2-datasources --from-file=../confs/apim-analytics-2/repository/conf/datasources/ -kubectl create configmap apim-analytics-2-tomcat --from-file=../confs/apim-analytics-2/repository/conf/tomcat/ -kubectl create configmap apim-analytics-2-conf-analytics --from-file=../confs/apim-analytics-2/repository/conf/analytics/ - -kubectl create configmap apim-manager-worker-bin --from-file=../confs/apim-manager-worker/bin/ -kubectl create configmap apim-manager-worker-conf --from-file=../confs/apim-manager-worker/repository/conf/ -kubectl create configmap apim-manager-worker-identity --from-file=../confs/apim-manager-worker/repository/conf/identity/ -kubectl create configmap apim-manager-worker-axis2 --from-file=../confs/apim-manager-worker/repository/conf/axis2/ -kubectl create configmap apim-manager-worker-datasources --from-file=../confs/apim-manager-worker/repository/conf/datasources/ -kubectl create configmap apim-manager-worker-tomcat --from-file=../confs/apim-manager-worker/repository/conf/tomcat/ - -kubectl create configmap apim-worker-bin --from-file=../confs/apim-worker/bin/ -kubectl create configmap apim-worker-conf --from-file=../confs/apim-worker/repository/conf/ -kubectl create configmap apim-worker-identity --from-file=../confs/apim-worker/repository/conf/identity/ -kubectl create configmap apim-worker-axis2 --from-file=../confs/apim-worker/repository/conf/axis2/ -kubectl create configmap apim-worker-datasources --from-file=../confs/apim-worker/repository/conf/datasources/ -kubectl create configmap apim-worker-tomcat --from-file=../confs/apim-worker/repository/conf/tomcat/ - -# databases -echo 'deploying databases ...' -kubectl create -f rdbms/rdbms-persistent-volume-claim.yaml -kubectl create -f rdbms/rdbms-service.yaml -kubectl create -f rdbms/rdbms-deployment.yaml - -echo 'deploying services and volume claims ...' -kubectl create -f apim-analytics/wso2apim-analytics-service.yaml -kubectl create -f apim-analytics/wso2apim-analytics-1-service.yaml -kubectl create -f apim-analytics/wso2apim-analytics-2-service.yaml -kubectl create -f apim/wso2apim-service.yaml -kubectl create -f apim/wso2apim-manager-worker-service.yaml -kubectl create -f apim/wso2apim-worker-service.yaml -kubectl create -f apim/wso2apim-mgt-volume-claim.yaml -kubectl create -f apim-analytics/wso2apim-analytics-volume-claim.yaml - -sleep 30s -# analytics -echo 'deploying apim analytics ...' -kubectl create -f apim-analytics/wso2apim-analytics-1-deployment.yaml -sleep 10s -kubectl create -f apim-analytics/wso2apim-analytics-2-deployment.yaml - -sleep 1m -# apim -echo 'deploying apim manager-worker ...' -kubectl create -f apim/wso2apim-manager-worker-deployment.yaml -sleep 1m -echo 'deploying apim worker ...' -kubectl create -f apim/wso2apim-worker-deployment.yaml - -echo 'deploying wso2apim and wso2apim-analytics ingresses ...' -kubectl create -f ingresses/nginx-default-http-backend.yaml -kubectl create -f ingresses/nginx-ingress-controller.yaml -kubectl create -f ingresses/wso2apim-analytics-ingress.yaml -kubectl create -f ingresses/wso2apim-ingress.yaml diff --git a/pattern-1/artifacts/deploy-openshift.sh b/pattern-1/artifacts/deploy-openshift.sh deleted file mode 100755 index 55048298..00000000 --- a/pattern-1/artifacts/deploy-openshift.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/bin/bash - -# ------------------------------------------------------------------------ -# Copyright 2017 WSO2, Inc. (http://wso2.com) -# -# Licensed 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 -# ------------------------------------------------------------------------ - -oc project wso2 - -# volumes -oc create -f volumes/persistent-volumes.yaml - -# Configuration Maps -oc create configmap apim-analytics-1-bin --from-file=../confs/apim-analytics-1/bin/ -oc create configmap apim-analytics-1-conf --from-file=../confs/apim-analytics-1/repository/conf/ -oc create configmap apim-analytics-1-spark --from-file=../confs/apim-analytics-1/repository/conf/analytics/spark/ -oc create configmap apim-analytics-1-axis2 --from-file=../confs/apim-analytics-1/repository/conf/axis2/ -oc create configmap apim-analytics-1-datasources --from-file=../confs/apim-analytics-1/repository/conf/datasources/ -oc create configmap apim-analytics-1-tomcat --from-file=../confs/apim-analytics-1/repository/conf/tomcat/ -oc create configmap apim-analytics-1-conf-analytics --from-file=../confs/apim-analytics-1/repository/conf/analytics/ - -oc create configmap apim-analytics-2-bin --from-file=../confs/apim-analytics-2/bin/ -oc create configmap apim-analytics-2-conf --from-file=../confs/apim-analytics-2/repository/conf/ -oc create configmap apim-analytics-2-spark --from-file=../confs/apim-analytics-2/repository/conf/analytics/spark/ -oc create configmap apim-analytics-2-axis2 --from-file=../confs/apim-analytics-2/repository/conf/axis2/ -oc create configmap apim-analytics-2-datasources --from-file=../confs/apim-analytics-2/repository/conf/datasources/ -oc create configmap apim-analytics-2-tomcat --from-file=../confs/apim-analytics-2/repository/conf/tomcat/ -oc create configmap apim-analytics-2-conf-analytics --from-file=../confs/apim-analytics-2/repository/conf/analytics/ - -oc create configmap apim-manager-worker-bin --from-file=../confs/apim-manager-worker/bin/ -oc create configmap apim-manager-worker-conf --from-file=../confs/apim-manager-worker/repository/conf/ -oc create configmap apim-manager-worker-identity --from-file=../confs/apim-manager-worker/repository/conf/identity/ -oc create configmap apim-manager-worker-axis2 --from-file=../confs/apim-manager-worker/repository/conf/axis2/ -oc create configmap apim-manager-worker-datasources --from-file=../confs/apim-manager-worker/repository/conf/datasources/ -oc create configmap apim-manager-worker-tomcat --from-file=../confs/apim-manager-worker/repository/conf/tomcat/ - -oc create configmap apim-worker-bin --from-file=../confs/apim-worker/bin/ -oc create configmap apim-worker-conf --from-file=../confs/apim-worker/repository/conf/ -oc create configmap apim-worker-identity --from-file=../confs/apim-worker/repository/conf/identity/ -oc create configmap apim-worker-axis2 --from-file=../confs/apim-worker/repository/conf/axis2/ -oc create configmap apim-worker-datasources --from-file=../confs/apim-worker/repository/conf/datasources/ -oc create configmap apim-worker-tomcat --from-file=../confs/apim-worker/repository/conf/tomcat/ - -# databases -echo 'deploying databases ...' -oc create -f rdbms/rdbms-persistent-volume-claim.yaml -oc create -f rdbms/rdbms-service.yaml -oc create -f rdbms/rdbms-deployment.yaml - -echo 'deploying services and volume claims ...' -oc create -f apim-analytics/wso2apim-analytics-service.yaml -oc create -f apim-analytics/wso2apim-analytics-1-service.yaml -oc create -f apim-analytics/wso2apim-analytics-2-service.yaml -oc create -f apim/wso2apim-service.yaml -oc create -f apim/wso2apim-manager-worker-service.yaml -oc create -f apim/wso2apim-worker-service.yaml -oc create -f apim/wso2apim-mgt-volume-claim.yaml -oc create -f apim-analytics/wso2apim-analytics-volume-claim.yaml - -sleep 30s -# analytics -echo 'deploying apim analytics ...' -oc create -f apim-analytics/wso2apim-analytics-1-deployment.yaml -sleep 10s -oc create -f apim-analytics/wso2apim-analytics-2-deployment.yaml - -sleep 1m -# apim -echo 'deploying apim manager-worker ...' -oc create -f apim/wso2apim-manager-worker-deployment.yaml -sleep 1m -echo 'deploying apim worker ...' -oc create -f apim/wso2apim-worker-deployment.yaml - -echo 'deploying wso2apim and wso2apim-analytics routes ...' -oc create -f routes/wso2apim-route.yaml -oc create -f routes/wso2apim-gw-route.yaml -oc create -f routes/wso2apim-analytics-route.yaml diff --git a/pattern-1/artifacts/ingresses/nginx-default-http-backend.yaml b/pattern-1/artifacts/ingresses/nginx-default-http-backend.yaml deleted file mode 100644 index 290ba1f2..00000000 --- a/pattern-1/artifacts/ingresses/nginx-default-http-backend.yaml +++ /dev/null @@ -1,70 +0,0 @@ -# Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -# -# Licensed 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. - -# Source reference: -# https://github.com/kubernetes/ingress/tree/nginx-0.9.0-beta.11/ - -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: nginx-default-http-backend - labels: - k8s-app: nginx-default-http-backend - pattern: wso2apim-pattern-1 - namespace: kube-system -spec: - replicas: 1 - template: - metadata: - labels: - k8s-app: nginx-default-http-backend - spec: - terminationGracePeriodSeconds: 60 - containers: - - name: nginx-default-http-backend - # Any image is permissable as long as: - # 1. It serves a 404 page at / - # 2. It serves 200 on a /healthz endpoint - image: gcr.io/google_containers/defaultbackend:1.0 - livenessProbe: - httpGet: - path: /healthz - port: 8080 - scheme: HTTP - initialDelaySeconds: 30 - timeoutSeconds: 5 - ports: - - containerPort: 8080 - resources: - limits: - cpu: 10m - memory: 20Mi - requests: - cpu: 10m - memory: 20Mi -# serviceAccountName: "wso2svcacct" ---- -apiVersion: v1 -kind: Service -metadata: - name: nginx-default-http-backend - namespace: kube-system - labels: - k8s-app: nginx-default-http-backend -spec: - ports: - - port: 80 - targetPort: 8080 - selector: - k8s-app: nginx-default-http-backend \ No newline at end of file diff --git a/pattern-1/artifacts/ingresses/nginx-ingress-controller.yaml b/pattern-1/artifacts/ingresses/nginx-ingress-controller.yaml deleted file mode 100644 index 1f65b4c9..00000000 --- a/pattern-1/artifacts/ingresses/nginx-ingress-controller.yaml +++ /dev/null @@ -1,71 +0,0 @@ -# Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -# -# Licensed 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. - -# Source reference: -# https://github.com/kubernetes/ingress/tree/nginx-0.9.0-beta.11/ - -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: nginx-ingress-controller - labels: - k8s-app: nginx-ingress-controller - pattern: wso2apim-pattern-1 - namespace: kube-system -spec: - replicas: 1 - template: - metadata: - labels: - k8s-app: nginx-ingress-controller - spec: - # hostNetwork makes it possible to use ipv6 and to preserve the source IP correctly regardless of docker configuration - # however, it is not a hard dependency of the nginx-ingress-controller itself and it may cause issues if port 10254 already is taken on the host - # that said, since hostPort is broken on CNI (https://github.com/kubernetes/kubernetes/issues/31307) we have to use hostNetwork where CNI is used - # like with kubeadm - # hostNetwork: true - terminationGracePeriodSeconds: 60 - containers: - - image: gcr.io/google_containers/nginx-ingress-controller:0.9.0-beta.11 - name: nginx-ingress-controller - readinessProbe: - httpGet: - path: /healthz - port: 10254 - scheme: HTTP - livenessProbe: - httpGet: - path: /healthz - port: 10254 - scheme: HTTP - initialDelaySeconds: 10 - timeoutSeconds: 1 - ports: - - containerPort: 80 - hostPort: 80 - - containerPort: 443 - hostPort: 443 - env: - - name: POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - - name: POD_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - args: - - /nginx-ingress-controller - - --default-backend-service=$(POD_NAMESPACE)/nginx-default-http-backend -# serviceAccountName: "wso2svcacct" \ No newline at end of file diff --git a/pattern-1/artifacts/routes/wso2apim-analytics-route.yaml b/pattern-1/artifacts/routes/wso2apim-analytics-route.yaml deleted file mode 100644 index 757fb8a9..00000000 --- a/pattern-1/artifacts/routes/wso2apim-analytics-route.yaml +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -# -# Licensed 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. - -apiVersion: v1 -kind: Route -metadata: - name: wso2apim-analytics-route - labels: - pattern: wso2apim-pattern-1 -spec: - host: wso2apim-analytics - port: - targetPort: servlet-https - to: - kind: Service - name: wso2apim-analytics - tls: - termination: passthrough \ No newline at end of file diff --git a/pattern-1/artifacts/routes/wso2apim-gw-route.yaml b/pattern-1/artifacts/routes/wso2apim-gw-route.yaml deleted file mode 100644 index 5ff9cd38..00000000 --- a/pattern-1/artifacts/routes/wso2apim-gw-route.yaml +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -# -# Licensed 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. - -apiVersion: v1 -kind: Route -metadata: - name: wso2apim-gw-route - labels: - pattern: wso2apim-pattern-1 -spec: - host: wso2apim-gw - port: - targetPort: pass-through-https - to: - kind: Service - name: wso2apim - tls: - termination: passthrough \ No newline at end of file diff --git a/pattern-1/artifacts/routes/wso2apim-route.yaml b/pattern-1/artifacts/routes/wso2apim-route.yaml deleted file mode 100644 index 6c106a61..00000000 --- a/pattern-1/artifacts/routes/wso2apim-route.yaml +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -# -# Licensed 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. - -apiVersion: v1 -kind: Route -metadata: - name: wso2apim-route - labels: - pattern: wso2apim-pattern-1 -spec: - host: wso2apim - port: - targetPort: servlet-https - to: - kind: Service - name: wso2apim - tls: - termination: passthrough \ No newline at end of file diff --git a/pattern-1/artifacts/undeploy-kubernetes.sh b/pattern-1/artifacts/undeploy-kubernetes.sh deleted file mode 100755 index 07bc63d2..00000000 --- a/pattern-1/artifacts/undeploy-kubernetes.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash - -# ------------------------------------------------------------------------ -# Copyright 2017 WSO2, Inc. (http://wso2.com) -# -# Licensed 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 -# ------------------------------------------------------------------------ - -kubectl delete deployments,services,PersistentVolume,PersistentVolumeClaim,Ingress -l pattern=wso2apim-pattern-1 -n wso2 - -kubectl delete deployment nginx-default-http-backend -n kube-system -kubectl delete deployment nginx-ingress-controller -n kube-system -kubectl delete service nginx-default-http-backend -n kube-system - -kubectl delete configmaps apim-analytics-1-bin -kubectl delete configmaps apim-analytics-1-conf -kubectl delete configmaps apim-analytics-1-spark -kubectl delete configmaps apim-analytics-1-axis2 -kubectl delete configmaps apim-analytics-1-datasources -kubectl delete configmaps apim-analytics-1-tomcat -kubectl delete configmaps apim-analytics-1-conf-analytics - -kubectl delete configmaps apim-analytics-2-bin -kubectl delete configmaps apim-analytics-2-conf -kubectl delete configmaps apim-analytics-2-spark -kubectl delete configmaps apim-analytics-2-axis2 -kubectl delete configmaps apim-analytics-2-datasources -kubectl delete configmaps apim-analytics-2-tomcat -kubectl delete configmaps apim-analytics-2-conf-analytics - -kubectl delete configmaps apim-manager-worker-bin -kubectl delete configmaps apim-manager-worker-conf -kubectl delete configmaps apim-manager-worker-identity -kubectl delete configmaps apim-manager-worker-axis2 -kubectl delete configmaps apim-manager-worker-datasources -kubectl delete configmaps apim-manager-worker-tomcat - -kubectl delete configmaps apim-worker-bin -kubectl delete configmaps apim-worker-conf -kubectl delete configmaps apim-worker-identity -kubectl delete configmaps apim-worker-axis2 -kubectl delete configmaps apim-worker-datasources -kubectl delete configmaps apim-worker-tomcat diff --git a/pattern-1/artifacts/undeploy-openshift.sh b/pattern-1/artifacts/undeploy-openshift.sh deleted file mode 100755 index 8c720a4d..00000000 --- a/pattern-1/artifacts/undeploy-openshift.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash - -# ------------------------------------------------------------------------ -# Copyright 2017 WSO2, Inc. (http://wso2.com) -# -# Licensed 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 -# ------------------------------------------------------------------------ - -oc delete deployments,services,PersistentVolume,PersistentVolumeClaim,Routes -l pattern=wso2apim-pattern-1 -n wso2 - -oc delete configmaps apim-analytics-1-bin -oc delete configmaps apim-analytics-1-conf -oc delete configmaps apim-analytics-1-spark -oc delete configmaps apim-analytics-1-axis2 -oc delete configmaps apim-analytics-1-datasources -oc delete configmaps apim-analytics-1-tomcat -oc delete configmaps apim-analytics-1-conf-analytics - -oc delete configmaps apim-analytics-2-bin -oc delete configmaps apim-analytics-2-conf -oc delete configmaps apim-analytics-2-spark -oc delete configmaps apim-analytics-2-axis2 -oc delete configmaps apim-analytics-2-datasources -oc delete configmaps apim-analytics-2-tomcat -oc delete configmaps apim-analytics-2-conf-analytics - -oc delete configmaps apim-manager-worker-bin -oc delete configmaps apim-manager-worker-conf -oc delete configmaps apim-manager-worker-identity -oc delete configmaps apim-manager-worker-axis2 -oc delete configmaps apim-manager-worker-datasources -oc delete configmaps apim-manager-worker-tomcat - -oc delete configmaps apim-worker-bin -oc delete configmaps apim-worker-conf -oc delete configmaps apim-worker-identity -oc delete configmaps apim-worker-axis2 -oc delete configmaps apim-worker-datasources -oc delete configmaps apim-worker-tomcat diff --git a/pattern-1/artifacts/volumes/persistent-volumes.yaml b/pattern-1/artifacts/volumes/persistent-volumes.yaml deleted file mode 100644 index 362220ea..00000000 --- a/pattern-1/artifacts/volumes/persistent-volumes.yaml +++ /dev/null @@ -1,129 +0,0 @@ -# Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -# -# Licensed 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. - - -apiVersion: v1 -kind: PersistentVolume -metadata: - name: local-pv-2 - labels: - type: local - pattern: wso2apim-pattern-1 -spec: - capacity: - storage: 20Gi - accessModes: - - ReadWriteOnce - persistentVolumeReclaimPolicy: Delete - hostPath: - path: /tmp/data/pattern-1-pv-2 ---- -apiVersion: v1 -kind: PersistentVolume -metadata: - name: local-pv-4 - labels: - type: local - pattern: wso2apim-pattern-1 -spec: - capacity: - storage: 2Gi - accessModes: - - ReadWriteOnce - persistentVolumeReclaimPolicy: Delete - nfs: - # FIXME: use the right IP - #Example Path in NFS server: /exports/pattern-1/apim - server: - path: "" ---- -apiVersion: v1 -kind: PersistentVolume -metadata: - name: local-pv-1 - labels: - type: local - pattern: wso2apim-pattern-1 - purpose: apim-analytics-conf-analytics-1 -spec: - capacity: - storage: 1Gi - accessModes: - - ReadWriteOnce - persistentVolumeReclaimPolicy: Recycle - nfs: - # FIXME: use the right IP - #Example Path in NFS server: /exports/pattern-1/anlytics2 - server: - path: "" ---- -apiVersion: v1 -kind: PersistentVolume -metadata: - name: local-pv-3 - labels: - type: local - pattern: wso2apim-pattern-1 - purpose: apim-analytics-conf-analytics-2 -spec: - capacity: - storage: 1Gi - accessModes: - - ReadWriteOnce - persistentVolumeReclaimPolicy: Recycle - nfs: - # FIXME: use the right IP - #Example Path in NFS server: /exports/pattern-1/anlytics2 - server: - path: "" ---- -apiVersion: v1 -kind: PersistentVolume -metadata: - name: local-pv-5 - labels: - type: local - pattern: wso2apim-pattern-1 - purpose: apim-analytics-data-1 -spec: - capacity: - storage: 20Gi - accessModes: - - ReadWriteOnce - persistentVolumeReclaimPolicy: Recycle - nfs: - # FIXME: use the right IP - #Example Path in NFS server: /exports/pattern-1/anlytics2 - server: - path: "" ---- -apiVersion: v1 -kind: PersistentVolume -metadata: - name: local-pv-6 - labels: - type: local - pattern: wso2apim-pattern-1 - purpose: apim-analytics-data-2 -spec: - capacity: - storage: 20Gi - accessModes: - - ReadWriteOnce - persistentVolumeReclaimPolicy: Recycle - nfs: - # FIXME: use the right IP - #Example Path in NFS server: /exports/pattern-1/anlytics2 - server: - path: "" \ No newline at end of file diff --git a/pattern-1/confs/apim-analytics-1/bin/wso2server.sh b/pattern-1/confs/apim-analytics-1/bin/wso2server.sh deleted file mode 100755 index 05af2f81..00000000 --- a/pattern-1/confs/apim-analytics-1/bin/wso2server.sh +++ /dev/null @@ -1,327 +0,0 @@ -#!/bin/sh -# ---------------------------------------------------------------------------- -# Copyright 2005-2012 WSO2, Inc. http://www.wso2.org -# -# Licensed 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. - -# ---------------------------------------------------------------------------- -# Main Script for the WSO2 Carbon Server -# -# Environment Variable Prequisites -# -# CARBON_HOME Home of WSO2 Carbon installation. If not set I will try -# to figure it out. -# -# JAVA_HOME Must point at your Java Development Kit installation. -# -# JAVA_OPTS (Optional) Java runtime options used when the commands -# is executed. -# -# NOTE: Borrowed generously from Apache Tomcat startup scripts. -# ----------------------------------------------------------------------------- - -# OS specific support. $var _must_ be set to either true or false. -#ulimit -n 100000 - -# NOTE: This is an edited wso2server.sh script to facilitate spark environment variables for WSO2DAS - -cygwin=false; -darwin=false; -os400=false; -mingw=false; -case "`uname`" in -CYGWIN*) cygwin=true;; -MINGW*) mingw=true;; -OS400*) os400=true;; -Darwin*) darwin=true - if [ -z "$JAVA_VERSION" ] ; then - JAVA_VERSION="CurrentJDK" - else - echo "Using Java version: $JAVA_VERSION" - fi - if [ -z "$JAVA_HOME" ] ; then - JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/${JAVA_VERSION}/Home - fi - ;; -esac - -# resolve links - $0 may be a softlink -PRG="$0" - -while [ -h "$PRG" ]; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '.*/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`/"$link" - fi -done - -# Get standard environment variables -PRGDIR=`dirname "$PRG"` - -# Only set CARBON_HOME if not already set -[ -z "$CARBON_HOME" ] && CARBON_HOME=`cd "$PRGDIR/.." ; pwd` - -# Set AXIS2_HOME. Needed for One Click JAR Download -AXIS2_HOME=$CARBON_HOME - -# For Cygwin, ensure paths are in UNIX format before anything is touched -if $cygwin; then - [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` - [ -n "$CARBON_HOME" ] && CARBON_HOME=`cygpath --unix "$CARBON_HOME"` - [ -n "$AXIS2_HOME" ] && CARBON_HOME=`cygpath --unix "$CARBON_HOME"` -fi - -# For OS400 -if $os400; then - # Set job priority to standard for interactive (interactive - 6) by using - # the interactive priority - 6, the helper threads that respond to requests - # will be running at the same priority as interactive jobs. - COMMAND='chgjob job('$JOBNAME') runpty(6)' - system $COMMAND - - # Enable multi threading - QIBM_MULTI_THREADED=Y - export QIBM_MULTI_THREADED -fi - -# For Migwn, ensure paths are in UNIX format before anything is touched -if $mingw ; then - [ -n "$CARBON_HOME" ] && - CARBON_HOME="`(cd "$CARBON_HOME"; pwd)`" - [ -n "$JAVA_HOME" ] && - JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" - [ -n "$AXIS2_HOME" ] && - CARBON_HOME="`(cd "$CARBON_HOME"; pwd)`" - # TODO classpath? -fi - -if [ -z "$JAVACMD" ] ; then - if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - else - JAVACMD=java - fi -fi - -if [ ! -x "$JAVACMD" ] ; then - echo "Error: JAVA_HOME is not defined correctly." - echo " CARBON cannot execute $JAVACMD" - exit 1 -fi - -# if JAVA_HOME is not set we're not happy -if [ -z "$JAVA_HOME" ]; then - echo "You must set the JAVA_HOME variable before running CARBON." - exit 1 -fi - -if [ -e "$CARBON_HOME/wso2carbon.pid" ]; then - PID=`cat "$CARBON_HOME"/wso2carbon.pid` -fi - -# ----- Process the input command ---------------------------------------------- -args="" -NODE_PARAMS="" -for c in $* -do - if [ "$c" = "-receiverNode" ]; then - NODE_PARAMS="-DdisableAnalyticsEngine=true -DdisableAnalyticsExecution=true -DdisableIndexing=true -DdisableDataPurging=false -DdisableAnalyticsSparkCtx=true -DdisableAnalyticsStats=true" - echo "Starting Data Analytics Server node as a Receiver Node" - elif [ "$c" = "-indexerNode" ]; then - NODE_PARAMS="-DdisableAnalyticsExecution=true -DdisableAnalyticsEngine=true -DdisableEventSink=true -DdisableAnalyticsSparkCtx=true -DdisableAnalyticsStats=true -DdisableDataPurging=true" - echo "Starting Data Analytics Server node as an Indexer Node" - elif [ "$c" = "-analyzerNode" ]; then - NODE_PARAMS="-DdisableIndexing=true -DdisableEventSink=true -DdisableDataPurging=true -DenableAnalyticsStats=true" - echo "Starting Data Analytics Server node as an Analyzer Node" - elif [ "$c" = "-dashboardNode" ]; then - NODE_PARAMS="-DdisableIndexing=true -DdisableEventSink=true -DdisableDataPurging=true -DenableAnalyticsStats=true -DdisableAnalyticsExecution=true -DdisableAnalyticsEngine=true -DdisableAnalyticsSparkCtx=true " - echo "Starting Data Analytics Server node as an Analyzer Node" - elif [ "$c" = "--debug" ] || [ "$c" = "-debug" ] || [ "$c" = "debug" ]; then - CMD="--debug" - continue - elif [ "$CMD" = "--debug" ]; then - if [ -z "$PORT" ]; then - PORT=$c - fi - elif [ "$c" = "--stop" ] || [ "$c" = "-stop" ] || [ "$c" = "stop" ]; then - CMD="stop" - elif [ "$c" = "--start" ] || [ "$c" = "-start" ] || [ "$c" = "start" ]; then - CMD="start" - elif [ "$c" = "--version" ] || [ "$c" = "-version" ] || [ "$c" = "version" ]; then - CMD="version" - elif [ "$c" = "--restart" ] || [ "$c" = "-restart" ] || [ "$c" = "restart" ]; then - CMD="restart" - elif [ "$c" = "--test" ] || [ "$c" = "-test" ] || [ "$c" = "test" ]; then - CMD="test" - else - args="$args $c" - fi -done - -if [ "$CMD" = "--debug" ]; then - if [ "$PORT" = "" ]; then - echo " Please specify the debug port after the --debug option" - exit 1 - fi - if [ -n "$JAVA_OPTS" ]; then - echo "Warning !!!. User specified JAVA_OPTS will be ignored, once you give the --debug option." - fi - CMD="RUN" - JAVA_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=$PORT" - echo "Please start the remote debugging client to continue..." -elif [ "$CMD" = "start" ]; then - if [ -e "$CARBON_HOME/wso2carbon.pid" ]; then - if ps -p $PID > /dev/null ; then - echo "Process is already running" - exit 0 - fi - fi - export CARBON_HOME=$CARBON_HOME -# using nohup sh to avoid erros in solaris OS.TODO - nohup sh $CARBON_HOME/bin/wso2server.sh $args $NODE_PARAMS > /dev/null 2>&1 & - exit 0 -elif [ "$CMD" = "stop" ]; then - export CARBON_HOME=$CARBON_HOME - kill -term `cat $CARBON_HOME/wso2carbon.pid` - exit 0 -elif [ "$CMD" = "restart" ]; then - export CARBON_HOME=$CARBON_HOME - kill -term `cat $CARBON_HOME/wso2carbon.pid` - process_status=0 - pid=`cat $CARBON_HOME/wso2carbon.pid` - while [ "$process_status" -eq "0" ] - do - sleep 1; - ps -p$pid 2>&1 > /dev/null - process_status=$? - done - -# using nohup sh to avoid erros in solaris OS.TODO - nohup sh $CARBON_HOME/bin/wso2server.sh $args $NODE_PARAMS > /dev/null 2>&1 & - exit 0 -elif [ "$CMD" = "test" ]; then - JAVACMD="exec "$JAVACMD"" -elif [ "$CMD" = "version" ]; then - cat $CARBON_HOME/bin/version.txt - cat $CARBON_HOME/bin/wso2carbon-version.txt - exit 0 -fi - -# ---------- Handle the SSL Issue with proper JDK version -------------------- -jdk_17=`$JAVA_HOME/bin/java -version 2>&1 | grep "1.[7|8]"` -if [ "$jdk_17" = "" ]; then - echo " Starting WSO2 Carbon (in unsupported JDK)" - echo " [ERROR] CARBON is supported only on JDK 1.7 and 1.8" -fi - -CARBON_XBOOTCLASSPATH="" -for f in "$CARBON_HOME"/lib/xboot/*.jar -do - if [ "$f" != "$CARBON_HOME/lib/xboot/*.jar" ];then - CARBON_XBOOTCLASSPATH="$CARBON_XBOOTCLASSPATH":$f - fi -done - -JAVA_ENDORSED_DIRS="$CARBON_HOME/lib/endorsed":"$JAVA_HOME/jre/lib/endorsed":"$JAVA_HOME/lib/endorsed" - -CARBON_CLASSPATH="" -if [ -e "$JAVA_HOME/lib/tools.jar" ]; then - CARBON_CLASSPATH="$JAVA_HOME/lib/tools.jar" -fi -for f in "$CARBON_HOME"/bin/*.jar -do - if [ "$f" != "$CARBON_HOME/bin/*.jar" ];then - CARBON_CLASSPATH="$CARBON_CLASSPATH":$f - fi -done -for t in "$CARBON_HOME"/lib/commons-lang*.jar -do - CARBON_CLASSPATH="$CARBON_CLASSPATH":$t -done -# For Cygwin, switch paths to Windows format before running java -if $cygwin; then - JAVA_HOME=`cygpath --absolute --windows "$JAVA_HOME"` - CARBON_HOME=`cygpath --absolute --windows "$CARBON_HOME"` - AXIS2_HOME=`cygpath --absolute --windows "$CARBON_HOME"` - CLASSPATH=`cygpath --path --windows "$CLASSPATH"` - JAVA_ENDORSED_DIRS=`cygpath --path --windows "$JAVA_ENDORSED_DIRS"` - CARBON_CLASSPATH=`cygpath --path --windows "$CARBON_CLASSPATH"` - CARBON_XBOOTCLASSPATH=`cygpath --path --windows "$CARBON_XBOOTCLASSPATH"` -fi - -# ----- Execute The Requested Command ----------------------------------------- - -echo JAVA_HOME environment variable is set to $JAVA_HOME -echo CARBON_HOME environment variable is set to $CARBON_HOME - -cd "$CARBON_HOME" - -TMP_DIR=$CARBON_HOME/tmp -if [ -d "$TMP_DIR" ]; then -rm -rf "$TMP_DIR" -fi - -START_EXIT_STATUS=121 -status=$START_EXIT_STATUS - -#load spark environment variables -. $CARBON_HOME/bin/load-spark-env-vars.sh - -#To monitor a Carbon server in remote JMX mode on linux host machines, set the below system property. -# -Djava.rmi.server.hostname="your.IP.goes.here" - -while [ "$status" = "$START_EXIT_STATUS" ] -do - $JAVACMD \ - -Xbootclasspath/a:"$CARBON_XBOOTCLASSPATH" \ - -Xms256m -Xmx1024m -XX:MaxPermSize=256m \ - -XX:+HeapDumpOnOutOfMemoryError \ - -XX:HeapDumpPath="$CARBON_HOME/repository/logs/heap-dump.hprof" \ - $JAVA_OPTS \ - -Dcom.sun.management.jmxremote \ - -classpath "$CARBON_CLASSPATH" \ - -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" \ - -Djava.io.tmpdir="$CARBON_HOME/tmp" \ - -Dcatalina.base="$CARBON_HOME/lib/tomcat" \ - -Dwso2.server.standalone=true \ - -Dcarbon.registry.root=/ \ - -Djava.command="$JAVACMD" \ - -Dcarbon.home="$CARBON_HOME" \ - -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \ - -Dcarbon.config.dir.path="$CARBON_HOME/repository/conf" \ - -Djava.util.logging.config.file="$CARBON_HOME/repository/conf/etc/logging-bridge.properties" \ - -Dcomponents.repo="$CARBON_HOME/repository/components/plugins" \ - -Dconf.location="$CARBON_HOME/repository/conf"\ - -Dcom.atomikos.icatch.file="$CARBON_HOME/lib/transactions.properties" \ - -Dcom.atomikos.icatch.hide_init_file_path=true \ - -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false \ - -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true \ - -Dcom.sun.jndi.ldap.connect.pool.authentication=simple \ - -Dcom.sun.jndi.ldap.connect.pool.timeout=3000 \ - -Dorg.terracotta.quartz.skipUpdateCheck=true \ - -Djava.security.egd=file:/dev/./urandom \ - -Dfile.encoding=UTF8 \ - -Djava.net.preferIPv4Stack=true \ - -Dcom.ibm.cacheLocalHost=true \ - $NODE_PARAMS \ - org.wso2.carbon.bootstrap.Bootstrap $* - status=$? -done diff --git a/pattern-1/confs/apim-analytics-1/repository/conf/analytics/analytics-config.xml b/pattern-1/confs/apim-analytics-1/repository/conf/analytics/analytics-config.xml deleted file mode 100644 index 8fac9dc3..00000000 --- a/pattern-1/confs/apim-analytics-1/repository/conf/analytics/analytics-config.xml +++ /dev/null @@ -1,110 +0,0 @@ - - - - - EVENT_STORE - - - org.wso2.carbon.analytics.datasource.rdbms.RDBMSAnalyticsRecordStore - - WSO2_ANALYTICS_EVENT_STORE_DB - read_write_optimized - - - - org.wso2.carbon.analytics.datasource.rdbms.RDBMSAnalyticsRecordStore - - WSO2_ANALYTICS_EVENT_STORE_DB - write_optimized - - - - org.wso2.carbon.analytics.datasource.rdbms.RDBMSAnalyticsRecordStore - - WSO2_ANALYTICS_PROCESSED_DATA_STORE_DB - read_write_optimized - - - - - org.apache.lucene.analysis.standard.StandardAnalyzer - - - - - - DEFAULT - - - - - - - 1 - - 6 - - 20971520 - - 1500 - - 1 - - 1024 - - 209715200 - - - - true - 0 0 12 * * ? - - - -
ORG_WSO2_APIMGT_STATISTICS_WORKFLOW
- ORG_WSO2_APIMGT_STATISTICS_PERMINUTEREQUEST
- ORG_WSO2_APIMGT_STATISTICS_PERHOURREQUEST
- ORG_WSO2_APIMGT_STATISTICS_PERDAYREQUEST
- ORG_WSO2_APIMGT_STATISTICS_PERMINUTERESPONSE
- ORG_WSO2_APIMGT_STATISTICS_PERHOURRESPONSE
- ORG_WSO2_APIMGT_STATISTICS_PERDAYRESPONSE
- ORG_WSO2_APIMGT_STATISTICS_PERMINUTEEXECUTIONTIMES
- ORG_WSO2_APIMGT_STATISTICS_PERHOUREXECUTIONTIMES
- ORG_WSO2_APIMGT_STATISTICS_PERDAYEXECUTIONTIMES
- ORG_WSO2_APIMGT_STATISTICS_THROTTLE
- ORG_WSO2_APIMGT_STATISTICS_FAULT
- LOGANALYZER
- ORG_WSO2_CARBON_IDENTITY_OAUTH_TOKEN_ISSUANCE
- - -
- - 2 -
-
diff --git a/pattern-1/confs/apim-analytics-1/repository/conf/analytics/my-node-id.dat b/pattern-1/confs/apim-analytics-1/repository/conf/analytics/my-node-id.dat deleted file mode 100644 index 495b13d1..00000000 --- a/pattern-1/confs/apim-analytics-1/repository/conf/analytics/my-node-id.dat +++ /dev/null @@ -1 +0,0 @@ -wso2am-analytics-1 diff --git a/pattern-1/confs/apim-analytics-1/repository/conf/analytics/spark/spark-defaults.conf b/pattern-1/confs/apim-analytics-1/repository/conf/analytics/spark/spark-defaults.conf deleted file mode 100755 index 92fbc882..00000000 --- a/pattern-1/confs/apim-analytics-1/repository/conf/analytics/spark/spark-defaults.conf +++ /dev/null @@ -1,122 +0,0 @@ -# ------------------------------------------------------ -# CARBON RELATED SPARK PROPERTIES -# ------------------------------------------------------ -# Carbon specific properties when running Spark in the Carbon environment. -# Should start with the prefix "carbon." - -# carbon.spark.master config has 3 states -# 1. (default) local mode - spark starts in the local mode (NOTE: carbon.spark.master.count property -# will not be considered here) -# ex: "carbon.spark.master local" or "carbon.spark.master local[2]" -# 2. client mode - DAS acts as a client for an external Spark cluster (NOTE: carbon.spark.master.count property -# will not be considered here) -# ex: "carbon.spark.master spark://:" -# 3. cluster mode - DAS creates its own Spark cluster usign Carbon Clustering -# ex: "carbon.spark.master local" AND "carbon.spark.master.count " - -carbon.spark.master local -carbon.spark.master.count 2 - -#This configuration is used to limit the number of results returned from spark query execution -#To return all the results, set this to -1 -carbon.spark.results.limit 1000 - -# Below configuratoin can be used to point to a symbolic link to WSO2 DAS HOME -# carbon.das.symbolic.link /home/ubuntu/das/das_symlink/ - -# Below configuration can be used with the spark fair scheduler, when fair schedule pools are used. the -# defualt pool name for carbon is 'carbon-pool' -# carbon.scheduler.pool carbon-pool - - - -# ------------------------------------------------------ -# SPARK PROPERTIES -# ------------------------------------------------------ -# Default system properties included when running spark. -# This is useful for setting default environmental settings. -# Check http://spark.apache.org/docs/latest/configuration.html for further information - -# Application (Spark Driver) Properties -# ------------------------------------------------------ -spark.app.name CarbonAnalytics -# Spark Driver will be running inside the carbon JVM. Hence the below properties are obsolete -# spark.driver.cores 1 -# spark.driver.memory 512m - -# Runtime Environment -# ------------------------------------------------------ - -# Spark UI -spark.ui.port 4040 -spark.history.ui.port 18080 - -# Compression and Serialization -spark.serializer org.apache.spark.serializer.KryoSerializer -spark.kryoserializer.buffer 256k -spark.kryoserializer.buffer.max 256m - -# Execution Behavior - -# Networking -spark.blockManager.port 12000 -spark.broadcast.port 12500 -spark.driver.port 13000 -spark.executor.port 13500 -spark.fileserver.port 14000 -spark.replClassServer.port 14500 -spark.akka.timeout 1000s - -# Scheduling -spark.scheduler.mode FAIR -# this property can be set to specify where hte fairscheduler.xml file is. the carbon specific -# fairscheduler.xml is in the /repository/conf/analytics/spark directory -# spark.scheduler.allocation.file /repository/conf/analytics/spark/fairscheduler.xml - -# Dynamic Allocation - -# Security - -# Encryption - -# Standalone Cluster Configs -spark.deploy.recoveryMode CUSTOM -spark.deploy.recoveryMode.factory org.wso2.carbon.analytics.spark.core.deploy.AnalyticsRecoveryModeFactory - -# Master -spark.master.port 7077 -spark.master.rest.port 6066 -spark.master.webui.port 8081 - -# Worker -spark.worker.cores 1 -spark.worker.memory 1g -spark.worker.dir work -spark.worker.port 11000 -spark.worker.webui.port 11500 - -# Executors -# spark.executor.cores 1 ; Default: Takes all the available cores in the worker -spark.executor.memory 1g -spark.executor.logs.rolling.strategy size -spark.executor.logs.rolling.maxSize 10000000 -spark.executor.logs.rolling.maxRetainedFiles 10 - -# spark.cores.max ; Default: Int.MAX_VALUE; The maximum amount of CPU cores to request for the application from across -# the cluster (not from each machine) - - -# Spark Logging -# ------------------------------------------------------ -# To allow event logging for spark you need to uncomment -# the line spark.eventlog.log true and set the directory in which the -# logs will be stored. - -# spark.eventLog.enabled true -# spark.eventLog.dir - -# YARN related configs -# ------------------------------------------------------ -# spark.yarn.jar - - diff --git a/pattern-1/confs/apim-analytics-1/repository/conf/axis2/axis2.xml b/pattern-1/confs/apim-analytics-1/repository/conf/axis2/axis2.xml deleted file mode 100644 index bea4911e..00000000 --- a/pattern-1/confs/apim-analytics-1/repository/conf/axis2/axis2.xml +++ /dev/null @@ -1,728 +0,0 @@ - - - - - - - - - - - - - true - true - optional - true - work/mtom - 4000 - - ${childfirstCL} - - - true - - - true - - - - false - - inmemory - - - - - - - services - - - axis2services - - - axis2modules - - - WSO2 API Manager Analytics Server-2.1.0 - - - WSO2 API Manager Analytics Server-2.1.0 - - - - - - - false - - - - - - false - - - true - - - - ./repository/deployment/server/synapse-configs - - - - . - - - . - - - WSO2 Carbon Server - - - - - - - ${jaxwsparam} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 9763 - - - - - - - - - - - - 9443 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - HTTP/1.1 - chunked - - true - - - HTTP/1.1 - chunked - - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - kubernetes - org.wso2.carbon.membership.scheme.kubernetes.KubernetesMembershipScheme - wso2apim-analytics-1,wso2apim-analytics-2 - wso2 - - - - - wso2.am.analytics.domain - - - - - - 45564 - - 100 - - 60 - - - - - - 127.0.0.1 - - - - - - 4000 - - - - - - - - - - - - - - - - - - 127.0.0.1 - 4000 - - - - - - - - - diff --git a/pattern-1/confs/apim-analytics-1/repository/conf/axis2/axis2_client.xml b/pattern-1/confs/apim-analytics-1/repository/conf/axis2/axis2_client.xml deleted file mode 100644 index a8b584d0..00000000 --- a/pattern-1/confs/apim-analytics-1/repository/conf/axis2/axis2_client.xml +++ /dev/null @@ -1,300 +0,0 @@ - - - - - - - true - false - false - - - 500 - - 15000 - - - false - - - - true - - - - - - false - - - admin - axis2 - - - - - - - - - - - - - - - - - - - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 6071 - - - - - - - - - - - - - - - - - - - - - - HTTP/1.1 - chunked - 60000 - 60000 - - - HTTP/1.1 - chunked - 60000 - 60000 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pattern-1/confs/apim-analytics-1/repository/conf/axis2/tenant-axis2.xml b/pattern-1/confs/apim-analytics-1/repository/conf/axis2/tenant-axis2.xml deleted file mode 100644 index c6fe9d23..00000000 --- a/pattern-1/confs/apim-analytics-1/repository/conf/axis2/tenant-axis2.xml +++ /dev/null @@ -1,285 +0,0 @@ - - - - - - - - - true - true - optional - - - true - - - false - - - - true - - - - - - false - - - false - - - axis2services - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pattern-1/confs/apim-analytics-1/repository/conf/carbon.xml b/pattern-1/confs/apim-analytics-1/repository/conf/carbon.xml deleted file mode 100755 index d86e8678..00000000 --- a/pattern-1/confs/apim-analytics-1/repository/conf/carbon.xml +++ /dev/null @@ -1,695 +0,0 @@ - - - - - - - - WSO2 API Manager Analytics Server - - - AM-Analytics - - - 2.1.0 - - - wso2apim-analytics - - - wso2apim-analytics - - - local:/${carbon.context}/services/ - - - - - - - DataAnalyticsServer - ComplexEventProcessor - - - - - - - org.wso2.carbon - - - / - - - - - - - - - 15 - - - - - - - - - 1 - - - - - 9999 - - 11111 - - - - - - 10389 - - 8000 - - - - - - 10500 - - - - - - - - - org.wso2.carbon.tomcat.jndi.CarbonJavaURLContextFactory - - - - - - - - - java - - - - - - - - - - false - - - false - - - 600 - - - - false - - - - - - - - 153722867280912 - - - - - - - - - 15 - - - - - - ${carbon.home}/repository/deployment/server/ - - - 15 - - - ${carbon.home}/repository/conf/axis2/axis2.xml - - - 30000 - - - ${carbon.home}/repository/deployment/client/ - - ${carbon.home}/repository/conf/axis2/axis2_client.xml - - true - - - - - - - - - - admin - Default Administrator Role - - - user - Default User Role - - - - - - - - - - - - ${carbon.home}/repository/resources/security/wso2carbon.jks - - JKS - - wso2carbon - - wso2carbon - - wso2carbon - - - - - - ${carbon.home}/repository/resources/security/client-truststore.jks - - JKS - - wso2carbon - - - - - - - - - - - - - - - - - - - UserManager - - - false - - - - - - true - allow - - - - - - - - - - - false - - (.*)(/images|/css|/js|/docs)(.*) - - - - - - - true - - - - - ${carbon.home}/tmp/work - - - - - - true - - - 10 - - - 30 - - - - - - 100 - - - - keystore - certificate - * - - org.wso2.carbon.ui.transports.fileupload.AnyFileUploadExecutor - - - - - jarZip - - org.wso2.carbon.ui.transports.fileupload.JarZipUploadExecutor - - - - dbs - - org.wso2.carbon.ui.transports.fileupload.DBSFileUploadExecutor - - - - tools - - org.wso2.carbon.ui.transports.fileupload.ToolsFileUploadExecutor - - - - toolsAny - - org.wso2.carbon.ui.transports.fileupload.ToolsAnyFileUploadExecutor - - - - - - - - - - info - org.wso2.carbon.core.transports.util.InfoProcessor - - - wsdl - org.wso2.carbon.core.transports.util.Wsdl11Processor - - - wsdl2 - org.wso2.carbon.core.transports.util.Wsdl20Processor - - - xsd - org.wso2.carbon.core.transports.util.XsdProcessor - - - - - - false - false - true - svn - http://svnrepo.example.com/repos/ - username - password - true - - - - - - - - - - - - - - - ${require.carbon.servlet} - - - - - true - - - - - - - default repository - http://product-dist.wso2.com/p2/carbon/releases/wilkes/ - - - - - - - - true - - - - - - true - - diff --git a/pattern-1/confs/apim-analytics-1/repository/conf/datasources/stats-datasources.xml b/pattern-1/confs/apim-analytics-1/repository/conf/datasources/stats-datasources.xml deleted file mode 100755 index b25bf493..00000000 --- a/pattern-1/confs/apim-analytics-1/repository/conf/datasources/stats-datasources.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader - - - - - WSO2AM_STATS_DB - The datasource used for setting statistics to API Manager - - jdbc/WSO2AM_STATS_DB - - - - jdbc:mysql://apim-rdbms:3306/statdb?autoReconnect=true&relaxAutoCommit=true - root - root - com.mysql.jdbc.Driver - 50 - 60000 - true - SELECT 1 - 30000 - false - - - - - - - diff --git a/pattern-1/confs/apim-analytics-1/repository/conf/event-processor.xml b/pattern-1/confs/apim-analytics-1/repository/conf/event-processor.xml deleted file mode 100644 index 0073a4cf..00000000 --- a/pattern-1/confs/apim-analytics-1/repository/conf/event-processor.xml +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - - - - - - 10000 - - wso2apim-analytics-1 - 11224 - 20000 - 20000 - - 5242880 - - UTF-8 - 1024 - 30000 - - 1000000 - - 10 - - 1000000 - - 10 - - - wso2apim-analytics-1 - 10005 - 15000 - 10000 - - - wso2apim-analytics-1 - 11000 - - 5242880 - - UTF-8 - 1024 - 30000 - - - 15 - 10 - - cep_persistence - - - - - - - - - - - 0.0.0.0 - 8904 - - - 0.0.0.0 - 11000 - - - - - - - localhost - 8904 - - - localhost - 8905 - - - - 20000 - - 5000 - - 10000 - - - - - - 15000 - 15100 - - - 20000 - - 8192 - - 8192 - - 5242880 - - UTF-8 - - 10000 - - 20000 - - - - 1024 - - 5242880 - - UTF-8 - - 20000 - - - - 60000 - 60000 - - - org.wso2.cep.storm.dependencies.jar - - - - 20000 - - - - - diff --git a/pattern-1/confs/apim-analytics-1/repository/conf/tomcat/catalina-server.xml b/pattern-1/confs/apim-analytics-1/repository/conf/tomcat/catalina-server.xml deleted file mode 100755 index 742f4a31..00000000 --- a/pattern-1/confs/apim-analytics-1/repository/conf/tomcat/catalina-server.xml +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pattern-1/confs/apim-analytics-2/bin/wso2server.sh b/pattern-1/confs/apim-analytics-2/bin/wso2server.sh deleted file mode 100755 index 05af2f81..00000000 --- a/pattern-1/confs/apim-analytics-2/bin/wso2server.sh +++ /dev/null @@ -1,327 +0,0 @@ -#!/bin/sh -# ---------------------------------------------------------------------------- -# Copyright 2005-2012 WSO2, Inc. http://www.wso2.org -# -# Licensed 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. - -# ---------------------------------------------------------------------------- -# Main Script for the WSO2 Carbon Server -# -# Environment Variable Prequisites -# -# CARBON_HOME Home of WSO2 Carbon installation. If not set I will try -# to figure it out. -# -# JAVA_HOME Must point at your Java Development Kit installation. -# -# JAVA_OPTS (Optional) Java runtime options used when the commands -# is executed. -# -# NOTE: Borrowed generously from Apache Tomcat startup scripts. -# ----------------------------------------------------------------------------- - -# OS specific support. $var _must_ be set to either true or false. -#ulimit -n 100000 - -# NOTE: This is an edited wso2server.sh script to facilitate spark environment variables for WSO2DAS - -cygwin=false; -darwin=false; -os400=false; -mingw=false; -case "`uname`" in -CYGWIN*) cygwin=true;; -MINGW*) mingw=true;; -OS400*) os400=true;; -Darwin*) darwin=true - if [ -z "$JAVA_VERSION" ] ; then - JAVA_VERSION="CurrentJDK" - else - echo "Using Java version: $JAVA_VERSION" - fi - if [ -z "$JAVA_HOME" ] ; then - JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/${JAVA_VERSION}/Home - fi - ;; -esac - -# resolve links - $0 may be a softlink -PRG="$0" - -while [ -h "$PRG" ]; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '.*/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`/"$link" - fi -done - -# Get standard environment variables -PRGDIR=`dirname "$PRG"` - -# Only set CARBON_HOME if not already set -[ -z "$CARBON_HOME" ] && CARBON_HOME=`cd "$PRGDIR/.." ; pwd` - -# Set AXIS2_HOME. Needed for One Click JAR Download -AXIS2_HOME=$CARBON_HOME - -# For Cygwin, ensure paths are in UNIX format before anything is touched -if $cygwin; then - [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` - [ -n "$CARBON_HOME" ] && CARBON_HOME=`cygpath --unix "$CARBON_HOME"` - [ -n "$AXIS2_HOME" ] && CARBON_HOME=`cygpath --unix "$CARBON_HOME"` -fi - -# For OS400 -if $os400; then - # Set job priority to standard for interactive (interactive - 6) by using - # the interactive priority - 6, the helper threads that respond to requests - # will be running at the same priority as interactive jobs. - COMMAND='chgjob job('$JOBNAME') runpty(6)' - system $COMMAND - - # Enable multi threading - QIBM_MULTI_THREADED=Y - export QIBM_MULTI_THREADED -fi - -# For Migwn, ensure paths are in UNIX format before anything is touched -if $mingw ; then - [ -n "$CARBON_HOME" ] && - CARBON_HOME="`(cd "$CARBON_HOME"; pwd)`" - [ -n "$JAVA_HOME" ] && - JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" - [ -n "$AXIS2_HOME" ] && - CARBON_HOME="`(cd "$CARBON_HOME"; pwd)`" - # TODO classpath? -fi - -if [ -z "$JAVACMD" ] ; then - if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - else - JAVACMD=java - fi -fi - -if [ ! -x "$JAVACMD" ] ; then - echo "Error: JAVA_HOME is not defined correctly." - echo " CARBON cannot execute $JAVACMD" - exit 1 -fi - -# if JAVA_HOME is not set we're not happy -if [ -z "$JAVA_HOME" ]; then - echo "You must set the JAVA_HOME variable before running CARBON." - exit 1 -fi - -if [ -e "$CARBON_HOME/wso2carbon.pid" ]; then - PID=`cat "$CARBON_HOME"/wso2carbon.pid` -fi - -# ----- Process the input command ---------------------------------------------- -args="" -NODE_PARAMS="" -for c in $* -do - if [ "$c" = "-receiverNode" ]; then - NODE_PARAMS="-DdisableAnalyticsEngine=true -DdisableAnalyticsExecution=true -DdisableIndexing=true -DdisableDataPurging=false -DdisableAnalyticsSparkCtx=true -DdisableAnalyticsStats=true" - echo "Starting Data Analytics Server node as a Receiver Node" - elif [ "$c" = "-indexerNode" ]; then - NODE_PARAMS="-DdisableAnalyticsExecution=true -DdisableAnalyticsEngine=true -DdisableEventSink=true -DdisableAnalyticsSparkCtx=true -DdisableAnalyticsStats=true -DdisableDataPurging=true" - echo "Starting Data Analytics Server node as an Indexer Node" - elif [ "$c" = "-analyzerNode" ]; then - NODE_PARAMS="-DdisableIndexing=true -DdisableEventSink=true -DdisableDataPurging=true -DenableAnalyticsStats=true" - echo "Starting Data Analytics Server node as an Analyzer Node" - elif [ "$c" = "-dashboardNode" ]; then - NODE_PARAMS="-DdisableIndexing=true -DdisableEventSink=true -DdisableDataPurging=true -DenableAnalyticsStats=true -DdisableAnalyticsExecution=true -DdisableAnalyticsEngine=true -DdisableAnalyticsSparkCtx=true " - echo "Starting Data Analytics Server node as an Analyzer Node" - elif [ "$c" = "--debug" ] || [ "$c" = "-debug" ] || [ "$c" = "debug" ]; then - CMD="--debug" - continue - elif [ "$CMD" = "--debug" ]; then - if [ -z "$PORT" ]; then - PORT=$c - fi - elif [ "$c" = "--stop" ] || [ "$c" = "-stop" ] || [ "$c" = "stop" ]; then - CMD="stop" - elif [ "$c" = "--start" ] || [ "$c" = "-start" ] || [ "$c" = "start" ]; then - CMD="start" - elif [ "$c" = "--version" ] || [ "$c" = "-version" ] || [ "$c" = "version" ]; then - CMD="version" - elif [ "$c" = "--restart" ] || [ "$c" = "-restart" ] || [ "$c" = "restart" ]; then - CMD="restart" - elif [ "$c" = "--test" ] || [ "$c" = "-test" ] || [ "$c" = "test" ]; then - CMD="test" - else - args="$args $c" - fi -done - -if [ "$CMD" = "--debug" ]; then - if [ "$PORT" = "" ]; then - echo " Please specify the debug port after the --debug option" - exit 1 - fi - if [ -n "$JAVA_OPTS" ]; then - echo "Warning !!!. User specified JAVA_OPTS will be ignored, once you give the --debug option." - fi - CMD="RUN" - JAVA_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=$PORT" - echo "Please start the remote debugging client to continue..." -elif [ "$CMD" = "start" ]; then - if [ -e "$CARBON_HOME/wso2carbon.pid" ]; then - if ps -p $PID > /dev/null ; then - echo "Process is already running" - exit 0 - fi - fi - export CARBON_HOME=$CARBON_HOME -# using nohup sh to avoid erros in solaris OS.TODO - nohup sh $CARBON_HOME/bin/wso2server.sh $args $NODE_PARAMS > /dev/null 2>&1 & - exit 0 -elif [ "$CMD" = "stop" ]; then - export CARBON_HOME=$CARBON_HOME - kill -term `cat $CARBON_HOME/wso2carbon.pid` - exit 0 -elif [ "$CMD" = "restart" ]; then - export CARBON_HOME=$CARBON_HOME - kill -term `cat $CARBON_HOME/wso2carbon.pid` - process_status=0 - pid=`cat $CARBON_HOME/wso2carbon.pid` - while [ "$process_status" -eq "0" ] - do - sleep 1; - ps -p$pid 2>&1 > /dev/null - process_status=$? - done - -# using nohup sh to avoid erros in solaris OS.TODO - nohup sh $CARBON_HOME/bin/wso2server.sh $args $NODE_PARAMS > /dev/null 2>&1 & - exit 0 -elif [ "$CMD" = "test" ]; then - JAVACMD="exec "$JAVACMD"" -elif [ "$CMD" = "version" ]; then - cat $CARBON_HOME/bin/version.txt - cat $CARBON_HOME/bin/wso2carbon-version.txt - exit 0 -fi - -# ---------- Handle the SSL Issue with proper JDK version -------------------- -jdk_17=`$JAVA_HOME/bin/java -version 2>&1 | grep "1.[7|8]"` -if [ "$jdk_17" = "" ]; then - echo " Starting WSO2 Carbon (in unsupported JDK)" - echo " [ERROR] CARBON is supported only on JDK 1.7 and 1.8" -fi - -CARBON_XBOOTCLASSPATH="" -for f in "$CARBON_HOME"/lib/xboot/*.jar -do - if [ "$f" != "$CARBON_HOME/lib/xboot/*.jar" ];then - CARBON_XBOOTCLASSPATH="$CARBON_XBOOTCLASSPATH":$f - fi -done - -JAVA_ENDORSED_DIRS="$CARBON_HOME/lib/endorsed":"$JAVA_HOME/jre/lib/endorsed":"$JAVA_HOME/lib/endorsed" - -CARBON_CLASSPATH="" -if [ -e "$JAVA_HOME/lib/tools.jar" ]; then - CARBON_CLASSPATH="$JAVA_HOME/lib/tools.jar" -fi -for f in "$CARBON_HOME"/bin/*.jar -do - if [ "$f" != "$CARBON_HOME/bin/*.jar" ];then - CARBON_CLASSPATH="$CARBON_CLASSPATH":$f - fi -done -for t in "$CARBON_HOME"/lib/commons-lang*.jar -do - CARBON_CLASSPATH="$CARBON_CLASSPATH":$t -done -# For Cygwin, switch paths to Windows format before running java -if $cygwin; then - JAVA_HOME=`cygpath --absolute --windows "$JAVA_HOME"` - CARBON_HOME=`cygpath --absolute --windows "$CARBON_HOME"` - AXIS2_HOME=`cygpath --absolute --windows "$CARBON_HOME"` - CLASSPATH=`cygpath --path --windows "$CLASSPATH"` - JAVA_ENDORSED_DIRS=`cygpath --path --windows "$JAVA_ENDORSED_DIRS"` - CARBON_CLASSPATH=`cygpath --path --windows "$CARBON_CLASSPATH"` - CARBON_XBOOTCLASSPATH=`cygpath --path --windows "$CARBON_XBOOTCLASSPATH"` -fi - -# ----- Execute The Requested Command ----------------------------------------- - -echo JAVA_HOME environment variable is set to $JAVA_HOME -echo CARBON_HOME environment variable is set to $CARBON_HOME - -cd "$CARBON_HOME" - -TMP_DIR=$CARBON_HOME/tmp -if [ -d "$TMP_DIR" ]; then -rm -rf "$TMP_DIR" -fi - -START_EXIT_STATUS=121 -status=$START_EXIT_STATUS - -#load spark environment variables -. $CARBON_HOME/bin/load-spark-env-vars.sh - -#To monitor a Carbon server in remote JMX mode on linux host machines, set the below system property. -# -Djava.rmi.server.hostname="your.IP.goes.here" - -while [ "$status" = "$START_EXIT_STATUS" ] -do - $JAVACMD \ - -Xbootclasspath/a:"$CARBON_XBOOTCLASSPATH" \ - -Xms256m -Xmx1024m -XX:MaxPermSize=256m \ - -XX:+HeapDumpOnOutOfMemoryError \ - -XX:HeapDumpPath="$CARBON_HOME/repository/logs/heap-dump.hprof" \ - $JAVA_OPTS \ - -Dcom.sun.management.jmxremote \ - -classpath "$CARBON_CLASSPATH" \ - -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" \ - -Djava.io.tmpdir="$CARBON_HOME/tmp" \ - -Dcatalina.base="$CARBON_HOME/lib/tomcat" \ - -Dwso2.server.standalone=true \ - -Dcarbon.registry.root=/ \ - -Djava.command="$JAVACMD" \ - -Dcarbon.home="$CARBON_HOME" \ - -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \ - -Dcarbon.config.dir.path="$CARBON_HOME/repository/conf" \ - -Djava.util.logging.config.file="$CARBON_HOME/repository/conf/etc/logging-bridge.properties" \ - -Dcomponents.repo="$CARBON_HOME/repository/components/plugins" \ - -Dconf.location="$CARBON_HOME/repository/conf"\ - -Dcom.atomikos.icatch.file="$CARBON_HOME/lib/transactions.properties" \ - -Dcom.atomikos.icatch.hide_init_file_path=true \ - -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false \ - -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true \ - -Dcom.sun.jndi.ldap.connect.pool.authentication=simple \ - -Dcom.sun.jndi.ldap.connect.pool.timeout=3000 \ - -Dorg.terracotta.quartz.skipUpdateCheck=true \ - -Djava.security.egd=file:/dev/./urandom \ - -Dfile.encoding=UTF8 \ - -Djava.net.preferIPv4Stack=true \ - -Dcom.ibm.cacheLocalHost=true \ - $NODE_PARAMS \ - org.wso2.carbon.bootstrap.Bootstrap $* - status=$? -done diff --git a/pattern-1/confs/apim-analytics-2/repository/conf/analytics/analytics-config.xml b/pattern-1/confs/apim-analytics-2/repository/conf/analytics/analytics-config.xml deleted file mode 100644 index 8fac9dc3..00000000 --- a/pattern-1/confs/apim-analytics-2/repository/conf/analytics/analytics-config.xml +++ /dev/null @@ -1,110 +0,0 @@ - - - - - EVENT_STORE - - - org.wso2.carbon.analytics.datasource.rdbms.RDBMSAnalyticsRecordStore - - WSO2_ANALYTICS_EVENT_STORE_DB - read_write_optimized - - - - org.wso2.carbon.analytics.datasource.rdbms.RDBMSAnalyticsRecordStore - - WSO2_ANALYTICS_EVENT_STORE_DB - write_optimized - - - - org.wso2.carbon.analytics.datasource.rdbms.RDBMSAnalyticsRecordStore - - WSO2_ANALYTICS_PROCESSED_DATA_STORE_DB - read_write_optimized - - - - - org.apache.lucene.analysis.standard.StandardAnalyzer - - - - - - DEFAULT - - - - - - - 1 - - 6 - - 20971520 - - 1500 - - 1 - - 1024 - - 209715200 - - - - true - 0 0 12 * * ? - - - -
ORG_WSO2_APIMGT_STATISTICS_WORKFLOW
- ORG_WSO2_APIMGT_STATISTICS_PERMINUTEREQUEST
- ORG_WSO2_APIMGT_STATISTICS_PERHOURREQUEST
- ORG_WSO2_APIMGT_STATISTICS_PERDAYREQUEST
- ORG_WSO2_APIMGT_STATISTICS_PERMINUTERESPONSE
- ORG_WSO2_APIMGT_STATISTICS_PERHOURRESPONSE
- ORG_WSO2_APIMGT_STATISTICS_PERDAYRESPONSE
- ORG_WSO2_APIMGT_STATISTICS_PERMINUTEEXECUTIONTIMES
- ORG_WSO2_APIMGT_STATISTICS_PERHOUREXECUTIONTIMES
- ORG_WSO2_APIMGT_STATISTICS_PERDAYEXECUTIONTIMES
- ORG_WSO2_APIMGT_STATISTICS_THROTTLE
- ORG_WSO2_APIMGT_STATISTICS_FAULT
- LOGANALYZER
- ORG_WSO2_CARBON_IDENTITY_OAUTH_TOKEN_ISSUANCE
- - -
- - 2 -
-
diff --git a/pattern-1/confs/apim-analytics-2/repository/conf/analytics/my-node-id.dat b/pattern-1/confs/apim-analytics-2/repository/conf/analytics/my-node-id.dat deleted file mode 100644 index 1303b174..00000000 --- a/pattern-1/confs/apim-analytics-2/repository/conf/analytics/my-node-id.dat +++ /dev/null @@ -1 +0,0 @@ -wso2am-analytics-2 diff --git a/pattern-1/confs/apim-analytics-2/repository/conf/analytics/spark/spark-defaults.conf b/pattern-1/confs/apim-analytics-2/repository/conf/analytics/spark/spark-defaults.conf deleted file mode 100755 index 92fbc882..00000000 --- a/pattern-1/confs/apim-analytics-2/repository/conf/analytics/spark/spark-defaults.conf +++ /dev/null @@ -1,122 +0,0 @@ -# ------------------------------------------------------ -# CARBON RELATED SPARK PROPERTIES -# ------------------------------------------------------ -# Carbon specific properties when running Spark in the Carbon environment. -# Should start with the prefix "carbon." - -# carbon.spark.master config has 3 states -# 1. (default) local mode - spark starts in the local mode (NOTE: carbon.spark.master.count property -# will not be considered here) -# ex: "carbon.spark.master local" or "carbon.spark.master local[2]" -# 2. client mode - DAS acts as a client for an external Spark cluster (NOTE: carbon.spark.master.count property -# will not be considered here) -# ex: "carbon.spark.master spark://:" -# 3. cluster mode - DAS creates its own Spark cluster usign Carbon Clustering -# ex: "carbon.spark.master local" AND "carbon.spark.master.count " - -carbon.spark.master local -carbon.spark.master.count 2 - -#This configuration is used to limit the number of results returned from spark query execution -#To return all the results, set this to -1 -carbon.spark.results.limit 1000 - -# Below configuratoin can be used to point to a symbolic link to WSO2 DAS HOME -# carbon.das.symbolic.link /home/ubuntu/das/das_symlink/ - -# Below configuration can be used with the spark fair scheduler, when fair schedule pools are used. the -# defualt pool name for carbon is 'carbon-pool' -# carbon.scheduler.pool carbon-pool - - - -# ------------------------------------------------------ -# SPARK PROPERTIES -# ------------------------------------------------------ -# Default system properties included when running spark. -# This is useful for setting default environmental settings. -# Check http://spark.apache.org/docs/latest/configuration.html for further information - -# Application (Spark Driver) Properties -# ------------------------------------------------------ -spark.app.name CarbonAnalytics -# Spark Driver will be running inside the carbon JVM. Hence the below properties are obsolete -# spark.driver.cores 1 -# spark.driver.memory 512m - -# Runtime Environment -# ------------------------------------------------------ - -# Spark UI -spark.ui.port 4040 -spark.history.ui.port 18080 - -# Compression and Serialization -spark.serializer org.apache.spark.serializer.KryoSerializer -spark.kryoserializer.buffer 256k -spark.kryoserializer.buffer.max 256m - -# Execution Behavior - -# Networking -spark.blockManager.port 12000 -spark.broadcast.port 12500 -spark.driver.port 13000 -spark.executor.port 13500 -spark.fileserver.port 14000 -spark.replClassServer.port 14500 -spark.akka.timeout 1000s - -# Scheduling -spark.scheduler.mode FAIR -# this property can be set to specify where hte fairscheduler.xml file is. the carbon specific -# fairscheduler.xml is in the /repository/conf/analytics/spark directory -# spark.scheduler.allocation.file /repository/conf/analytics/spark/fairscheduler.xml - -# Dynamic Allocation - -# Security - -# Encryption - -# Standalone Cluster Configs -spark.deploy.recoveryMode CUSTOM -spark.deploy.recoveryMode.factory org.wso2.carbon.analytics.spark.core.deploy.AnalyticsRecoveryModeFactory - -# Master -spark.master.port 7077 -spark.master.rest.port 6066 -spark.master.webui.port 8081 - -# Worker -spark.worker.cores 1 -spark.worker.memory 1g -spark.worker.dir work -spark.worker.port 11000 -spark.worker.webui.port 11500 - -# Executors -# spark.executor.cores 1 ; Default: Takes all the available cores in the worker -spark.executor.memory 1g -spark.executor.logs.rolling.strategy size -spark.executor.logs.rolling.maxSize 10000000 -spark.executor.logs.rolling.maxRetainedFiles 10 - -# spark.cores.max ; Default: Int.MAX_VALUE; The maximum amount of CPU cores to request for the application from across -# the cluster (not from each machine) - - -# Spark Logging -# ------------------------------------------------------ -# To allow event logging for spark you need to uncomment -# the line spark.eventlog.log true and set the directory in which the -# logs will be stored. - -# spark.eventLog.enabled true -# spark.eventLog.dir - -# YARN related configs -# ------------------------------------------------------ -# spark.yarn.jar - - diff --git a/pattern-1/confs/apim-analytics-2/repository/conf/axis2/axis2.xml b/pattern-1/confs/apim-analytics-2/repository/conf/axis2/axis2.xml deleted file mode 100644 index bea4911e..00000000 --- a/pattern-1/confs/apim-analytics-2/repository/conf/axis2/axis2.xml +++ /dev/null @@ -1,728 +0,0 @@ - - - - - - - - - - - - - true - true - optional - true - work/mtom - 4000 - - ${childfirstCL} - - - true - - - true - - - - false - - inmemory - - - - - - - services - - - axis2services - - - axis2modules - - - WSO2 API Manager Analytics Server-2.1.0 - - - WSO2 API Manager Analytics Server-2.1.0 - - - - - - - false - - - - - - false - - - true - - - - ./repository/deployment/server/synapse-configs - - - - . - - - . - - - WSO2 Carbon Server - - - - - - - ${jaxwsparam} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 9763 - - - - - - - - - - - - 9443 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - HTTP/1.1 - chunked - - true - - - HTTP/1.1 - chunked - - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - kubernetes - org.wso2.carbon.membership.scheme.kubernetes.KubernetesMembershipScheme - wso2apim-analytics-1,wso2apim-analytics-2 - wso2 - - - - - wso2.am.analytics.domain - - - - - - 45564 - - 100 - - 60 - - - - - - 127.0.0.1 - - - - - - 4000 - - - - - - - - - - - - - - - - - - 127.0.0.1 - 4000 - - - - - - - - - diff --git a/pattern-1/confs/apim-analytics-2/repository/conf/axis2/axis2_client.xml b/pattern-1/confs/apim-analytics-2/repository/conf/axis2/axis2_client.xml deleted file mode 100644 index a8b584d0..00000000 --- a/pattern-1/confs/apim-analytics-2/repository/conf/axis2/axis2_client.xml +++ /dev/null @@ -1,300 +0,0 @@ - - - - - - - true - false - false - - - 500 - - 15000 - - - false - - - - true - - - - - - false - - - admin - axis2 - - - - - - - - - - - - - - - - - - - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 6071 - - - - - - - - - - - - - - - - - - - - - - HTTP/1.1 - chunked - 60000 - 60000 - - - HTTP/1.1 - chunked - 60000 - 60000 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pattern-1/confs/apim-analytics-2/repository/conf/axis2/tenant-axis2.xml b/pattern-1/confs/apim-analytics-2/repository/conf/axis2/tenant-axis2.xml deleted file mode 100644 index c6fe9d23..00000000 --- a/pattern-1/confs/apim-analytics-2/repository/conf/axis2/tenant-axis2.xml +++ /dev/null @@ -1,285 +0,0 @@ - - - - - - - - - true - true - optional - - - true - - - false - - - - true - - - - - - false - - - false - - - axis2services - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pattern-1/confs/apim-analytics-2/repository/conf/datasources/analytics-datasources.xml b/pattern-1/confs/apim-analytics-2/repository/conf/datasources/analytics-datasources.xml deleted file mode 100755 index 8da98798..00000000 --- a/pattern-1/confs/apim-analytics-2/repository/conf/datasources/analytics-datasources.xml +++ /dev/null @@ -1,109 +0,0 @@ - - - - org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader - - - - - - - - WSO2_ANALYTICS_EVENT_STORE_DB - The datasource used for analytics record store - - - jdbc:mysql://apim-rdbms:3306/analyticseventstoredb?autoReconnect=true&relaxAutoCommit=true - root - root - com.mysql.jdbc.Driver - 50 - 60000 - true - SELECT 1 - 30000 - false - READ_COMMITTED - - - - - - WSO2_ANALYTICS_PROCESSED_DATA_STORE_DB - The datasource used for analytics record store - - - jdbc:mysql://apim-rdbms:3306/analyticprocesseddatastoredb?autoReconnect=true&relaxAutoCommit=true - root - root - com.mysql.jdbc.Driver - 50 - 60000 - true - SELECT 1 - 30000 - false - READ_COMMITTED - - - - - - - - - - - - - diff --git a/pattern-1/confs/apim-analytics-2/repository/conf/datasources/master-datasources.xml b/pattern-1/confs/apim-analytics-2/repository/conf/datasources/master-datasources.xml deleted file mode 100755 index eebb492a..00000000 --- a/pattern-1/confs/apim-analytics-2/repository/conf/datasources/master-datasources.xml +++ /dev/null @@ -1,109 +0,0 @@ - - - - org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader - - - - - - WSO2_CARBON_DB - The datasource used for registry and user manager - - jdbc/WSO2CarbonDB - - - - jdbc:h2:repository/database/WSO2CARBON_DB;DB_CLOSE_ON_EXIT=FALSE - wso2carbon - wso2carbon - org.h2.Driver - 50 - 60000 - true - SELECT 1 - 30000 - - - - - - WSO2UM_DB - The datasource used by user manager - - jdbc/WSO2UM_DB - - - - jdbc:mysql://apim-rdbms:3306/userdb?autoReconnect=true - root - root - com.mysql.jdbc.Driver - 50 - 60000 - true - SELECT 1 - 30000 - - - - - - WSO2REG_DB - The datasource used by the registry - - jdbc/WSO2REG_DB - - - - jdbc:mysql://apim-rdbms:3306/govregdb?autoReconnect=true - root - root - com.mysql.jdbc.Driver - 50 - 60000 - true - SELECT 1 - 30000 - - - - - - - - - - diff --git a/pattern-1/confs/apim-analytics-2/repository/conf/datasources/stats-datasources.xml b/pattern-1/confs/apim-analytics-2/repository/conf/datasources/stats-datasources.xml deleted file mode 100755 index b25bf493..00000000 --- a/pattern-1/confs/apim-analytics-2/repository/conf/datasources/stats-datasources.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader - - - - - WSO2AM_STATS_DB - The datasource used for setting statistics to API Manager - - jdbc/WSO2AM_STATS_DB - - - - jdbc:mysql://apim-rdbms:3306/statdb?autoReconnect=true&relaxAutoCommit=true - root - root - com.mysql.jdbc.Driver - 50 - 60000 - true - SELECT 1 - 30000 - false - - - - - - - diff --git a/pattern-1/confs/apim-analytics-2/repository/conf/event-processor.xml b/pattern-1/confs/apim-analytics-2/repository/conf/event-processor.xml deleted file mode 100644 index 25ea40ef..00000000 --- a/pattern-1/confs/apim-analytics-2/repository/conf/event-processor.xml +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - - - - - - 10000 - - wso2apim-analytics-2 - 11224 - 20000 - 20000 - - 5242880 - - UTF-8 - 1024 - 30000 - - 1000000 - - 10 - - 1000000 - - 10 - - - wso2apim-analytics-2 - 10005 - 15000 - 10000 - - - wso2apim-analytics-2 - 11000 - - 5242880 - - UTF-8 - 1024 - 30000 - - - 15 - 10 - - cep_persistence - - - - - - - - - - - 0.0.0.0 - 8904 - - - 0.0.0.0 - 11000 - - - - - - - localhost - 8904 - - - localhost - 8905 - - - - 20000 - - 5000 - - 10000 - - - - - - 15000 - 15100 - - - 20000 - - 8192 - - 8192 - - 5242880 - - UTF-8 - - 10000 - - 20000 - - - - 1024 - - 5242880 - - UTF-8 - - 20000 - - - - 60000 - 60000 - - - org.wso2.cep.storm.dependencies.jar - - - - 20000 - - - - - diff --git a/pattern-1/confs/apim-analytics-2/repository/conf/registry.xml b/pattern-1/confs/apim-analytics-2/repository/conf/registry.xml deleted file mode 100644 index a223a80a..00000000 --- a/pattern-1/confs/apim-analytics-2/repository/conf/registry.xml +++ /dev/null @@ -1,149 +0,0 @@ - - - - - - - - wso2registry - false - true - / - - - jdbc/WSO2CarbonDB - - - - jdbc/WSO2REG_DB - - - gov - root@jdbc:mysql://apim_rdbms:3306/regdb - govregistry - false - true - / - - - gov - /_system/governance - - - gov - /_system/analytics_config - - - - - - - - - - - - 35 - 3 - - 50 - - 50 - - /_system/local/repository/components/org.wso2.carbon.registry/indexing/lastaccesstime - - - - - - - - - - - - - - - - - - - - - - false - - - - true - true - true - true - - diff --git a/pattern-1/confs/apim-analytics-2/repository/conf/tomcat/catalina-server.xml b/pattern-1/confs/apim-analytics-2/repository/conf/tomcat/catalina-server.xml deleted file mode 100755 index 742f4a31..00000000 --- a/pattern-1/confs/apim-analytics-2/repository/conf/tomcat/catalina-server.xml +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pattern-2/confs/apim-analytics-1/repository/conf/carbon.xml b/pattern-1/confs/apim-analytics/carbon.xml old mode 100755 new mode 100644 similarity index 99% rename from pattern-2/confs/apim-analytics-1/repository/conf/carbon.xml rename to pattern-1/confs/apim-analytics/carbon.xml index d86e8678..815352d9 --- a/pattern-2/confs/apim-analytics-1/repository/conf/carbon.xml +++ b/pattern-1/confs/apim-analytics/carbon.xml @@ -36,7 +36,7 @@ - 2.1.0 + 2.1.1.SNAPSHOT - - - - - - - - - true - - true - - - false - - false - - - false - - work/mtom - - 4000 - - - false - - - inmemory - - - - - services - - - axis2services - - - axis2modules - - - WSO2 AM 2.1.0 - WSO2 AM 2.1.0 - - - - false - - - - - - - false - - - true - - - 30000 - - - repository/deployment/server/synapse-configs - - . - - . - - localhost - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 8280 - true - - - org.wso2.carbon.mediation.transport.handlers.PassThroughNHttpGetProcessor - - - - - - - - - - - - 8243 - true - - - org.wso2.carbon.mediation.transport.handlers.PassThroughNHttpGetProcessor - - - repository/resources/security/wso2carbon.jks - JKS - wso2carbon - wso2carbon - - - - - repository/resources/security/client-truststore.jks - JKS - wso2carbon - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - - - - - - - - - - - - - - - - - true - - - repository/resources/security/wso2carbon.jks - JKS - wso2carbon - wso2carbon - - - - - repository/resources/security/client-truststore.jks - JKS - wso2carbon - - - AllowAll - - - - - - - - - - - - - - - - - - - - - - - - - outflowDispatchSeq - outflowFaultSeq - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - kubernetes - org.wso2.carbon.membership.scheme.kubernetes.KubernetesMembershipScheme - wso2apim-manager-worker,wso2apim-worker - wso2 - - - - - wso2.am.domain - - - - - - 45564 - - 100 - - 60 - - - - - - api-manager - - - - - - 4000 - - - - - - - - - - - - - - - api-manager - 4000 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pattern-1/confs/apim-manager-worker/repository/conf/jndi.properties b/pattern-1/confs/apim-manager-worker/repository/conf/jndi.properties deleted file mode 100755 index 21befd18..00000000 --- a/pattern-1/confs/apim-manager-worker/repository/conf/jndi.properties +++ /dev/null @@ -1,29 +0,0 @@ -# -# Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -# -# Licensed 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. -# - -# register some connection factories -# connectionfactory.[jndiname] = [ConnectionURL] -connectionfactory.TopicConnectionFactory = amqp://admin:admin@clientid/carbon?brokerlist='tcp://localhost:5672' - -connectionfactory.QueueConnectionFactory = amqp://admin:admin@clientID/test?brokerlist='tcp://localhost:5672' - -# register some queues in JNDI using the form -# queue.[jndiName] = [physicalName] -#queue.MyQueue = example.MyQueue - -# register some topics in JNDI using the form -# topic.[jndiName] = [physicalName] -topic.throttleData = throttleData diff --git a/pattern-1/confs/apim-manager-worker/repository/conf/log4j.properties b/pattern-1/confs/apim-manager-worker/repository/conf/log4j.properties deleted file mode 100755 index 6fdf2c2c..00000000 --- a/pattern-1/confs/apim-manager-worker/repository/conf/log4j.properties +++ /dev/null @@ -1,220 +0,0 @@ -# -# Copyright (c) 2005-2015, WSO2 Inc. (http://wso2.com) All Rights Reserved. -# -# Licensed 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. -# - -## -# This is the log4j configuration file used by WSO2 AM -# ===================================================== -# -# IMPORTANT : Please do not remove or change the names of any of the Appenders defined here. -# The layout pattern & log file can be changed using the WSO2 AM Management Console, and those -# settings will override the settings in this file. -## - - -# the root category is ERROR (applies for all 3rd party JARs etc) and will be logged to the -# LOG_APPENDER and the CONSOLE_APPENDER - -log4j.rootLogger=ERROR, CARBON_CONSOLE, CARBON_LOGFILE, CARBON_MEMORY, CARBON_SYS_LOG, ERROR_LOGFILE - -log4j.logger.AUDIT_LOG=INFO, AUDIT_LOGFILE - -log4j.category.org.apache.synapse=INFO -log4j.category.org.apache.synapse.transport=INFO -log4j.category.org.apache.axis2=INFO -log4j.category.org.apache.axis2.transport=INFO -log4j.logger.com.atomikos=INFO,ATOMIKOS -log4j.logger.org.quartz=WARN -log4j.logger.org.wso2=INFO -log4j.logger.org.wso2.carbon=INFO -#log4j.category.org.apache.synapse.transport.nhttp.util=DEBUG -#log4j.category.org.apache.http.impl.nio.reactor=DEBUG -#log4j.logger.org.wso2.carbon.utils.deployment.ComponentBuilder=DEBUG -#log4j.logger.org.wso2.carbon.utils.deployment.OSGiBundleDeployer=DEBUG -log4j.logger.org.apache.catalina=WARN -log4j.logger.org.apache.coyote=WARN -log4j.logger.org.apache.axis2.enterprise=FATAL -log4j.logger.de.hunsicker.jalopy.io=FATAL - -# uncomment the following logs to see HTTP headers and messages -#log4j.logger.org.apache.synapse.transport.http.headers=DEBUG -#log4j.logger.org.apache.synapse.transport.http.wire=DEBUG - -# qpid related logs for the message broker -log4j.logger.qpid=WARN -log4j.logger.org.apache.qpid=WARN -log4j.logger.org.apache.qpid.server.Main=INFO -log4j.logger.qpid.message=WARN -log4j.logger.qpid.message.broker.listening=INFO -log4j.logger.org.wso2.carbon.databridge.agent.thrift.AsyncDataPublisher=WARN - -# The console appender is used to display general information at console -log4j.appender.CARBON_CONSOLE=org.wso2.carbon.utils.logging.appenders.CarbonConsoleAppender -log4j.appender.CARBON_CONSOLE.layout=org.apache.log4j.PatternLayout -log4j.appender.CARBON_CONSOLE.layout.ConversionPattern=[%d{ISO8601}] %5p - %c{1} %m%n - -# Configure the service logger at INFO level. Writes only run-time/mediation-time audit messages -log4j.category.SERVICE_LOGGER=INFO, SERVICE_APPENDER -log4j.additivity.SERVICE_LOGGER=false -log4j.appender.SERVICE_APPENDER=org.apache.log4j.RollingFileAppender -log4j.appender.SERVICE_APPENDER.File=${carbon.home}/repository/logs/${instance.log}/wso2-apigw-service${instance.log}.log -log4j.appender.SERVICE_APPENDER.MaxFileSize=1000KB -log4j.appender.SERVICE_APPENDER.MaxBackupIndex=10 -log4j.appender.SERVICE_APPENDER.layout=org.apache.log4j.PatternLayout -log4j.appender.SERVICE_APPENDER.layout.ConversionPattern=%d{ISO8601} [%X{ip}-%X{host}] [%t] %5p %c{1} %m%n - -# The trace logger dumps enough information @INFO level, but maybe pushed upto TRACE. -# Writes only run-time/mediation time tracing/debug messages for messages passing through trace -# enabled sequences, mediators and services. Enabling tracing on these has a performance impact -log4j.category.TRACE_LOGGER=INFO, TRACE_APPENDER, TRACE_MEMORYAPPENDER -log4j.additivity.TRACE_LOGGER=false -log4j.appender.TRACE_APPENDER=org.apache.log4j.DailyRollingFileAppender -log4j.appender.TRACE_APPENDER.File=${carbon.home}/repository/logs/${instance.log}/wso2-apigw-trace${instance.log}.log -log4j.appender.TRACE_APPENDER.Append=true -log4j.appender.TRACE_APPENDER.layout=org.apache.log4j.PatternLayout -log4j.appender.TRACE_APPENDER.layout.ConversionPattern=%d{HH:mm:ss,SSS} [%X{ip}-%X{host}] [%t] %5p %c{1} %m%n - -# The memory appender for trace logger -log4j.appender.TRACE_MEMORYAPPENDER=org.wso2.carbon.utils.logging.appenders.MemoryAppender -log4j.appender.TRACE_MEMORYAPPENDER.bufferSize=2000 -log4j.appender.TRACE_MEMORYAPPENDER.layout=org.apache.log4j.PatternLayout -log4j.appender.TRACE_MEMORYAPPENDER.layout.ConversionPattern=%d{HH:mm:ss,SSS} [%X{ip}-%X{host}] [%t] %5p %m%n - -# CARBON_LOGFILE is set to be a DailyRollingFileAppender using a PatternLayout. -log4j.appender.CARBON_LOGFILE=org.wso2.carbon.utils.logging.appenders.CarbonDailyRollingFileAppender -# Log file will be overridden by the configuration setting in the DB -# This path should be relative to WSO2 Carbon Home -log4j.appender.CARBON_LOGFILE.File=${carbon.home}/repository/logs/${instance.log}/wso2carbon${instance.log}.log -log4j.appender.CARBON_LOGFILE.Append=true -log4j.appender.CARBON_LOGFILE.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout -# ConversionPattern will be overridden by the configuration setting in the DB -log4j.appender.CARBON_LOGFILE.layout.ConversionPattern=TID: [%T] [%S] [%d] %P%5p {%c} - %x %m {%c}%n -log4j.appender.CARBON_LOGFILE.layout.TenantPattern=%U%@%D [%T] [%S] -log4j.appender.CARBON_LOGFILE.threshold=DEBUG - -# The standard error log where all the warnings, errors and fatal errors will be logged -log4j.appender.ERROR_LOGFILE=org.apache.log4j.FileAppender -log4j.appender.ERROR_LOGFILE.File=${carbon.home}/repository/logs/${instance.log}/wso2-apigw-errors.log -log4j.appender.ERROR_LOGFILE.layout=org.apache.log4j.PatternLayout -log4j.appender.ERROR_LOGFILE.layout.ConversionPattern=%d{ISO8601} [%X{ip}-%X{host}] [%t] %5p %c{1} %m%n -log4j.appender.ERROR_LOGFILE.threshold=WARN - -# The memory appender for logging -log4j.appender.CARBON_MEMORY=org.wso2.carbon.logging.service.appender.CarbonMemoryAppender -log4j.appender.CARBON_MEMORY.bufferSize=2000 -log4j.appender.CARBON_MEMORY.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout -# ConversionPattern will be overridden by the configuration setting in the DB -log4j.appender.CARBON_MEMORY.layout.ConversionPattern=TID: [%T] [%S] [%d] %P%5p {%c} - %x %m {%c}%n -log4j.appender.CARBON_MEMORY.layout.TenantPattern=%U%@%D [%T] [%S] -log4j.appender.CARBON_MEMORY.columnList=%T,%S,%A,%d,%c,%p,%m,%H,%I,%Stacktrace -log4j.appender.CARBON_MEMORY.threshold=DEBUG - -# LOGEVENT is set to be a LogEventAppender using a PatternLayout to send logs to LOGEVENT -log4j.appender.LOGEVENT=org.wso2.carbon.logging.appender.LogEventAppender -log4j.appender.LOGEVENT.url=tcp://localhost:7611 -log4j.appender.LOGEVENT.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout -log4j.appender.LOGEVENT.columnList=%T,%S,%A,%d,%c,%p,%m,%I,%Stacktrace -log4j.appender.LOGEVENT.userName=admin -log4j.appender.LOGEVENT.password=admin -log4j.appender.LOGEVENT.processingLimit=1000 -log4j.appender.LOGEVENT.maxTolerableConsecutiveFailure=20 - - -log4j.appender.CARBON_SYS_LOG = org.apache.log4j.net.SyslogAppender -log4j.appender.CARBON_SYS_LOG.layout=org.apache.log4j.PatternLayout -log4j.appender.CARBON_SYS_LOG.layout.ConversionPattern=[%d] %5p - %x %m {%c}%n -log4j.appender.CARBON_SYS_LOG.SyslogHost=localhost -log4j.appender.CARBON_SYS_LOG.Facility=USER -log4j.appender.CARBON_SYS_LOG.threshold=DEBUG - -# LOGEVENT is set to be a LogEventAppender using a PatternLayout to send logs to LOGEVENT -log4j.appender.LOGEVENT=org.wso2.carbon.logging.appender.LogEventAppender -log4j.appender.LOGEVENT.url=tcp://localhost:7611 -log4j.appender.LOGEVENT.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout -log4j.appender.LOGEVENT.columnList=%T,%S,%A,%d,%c,%p,%m,%H,%I,%Stacktrace -log4j.appender.LOGEVENT.userName=admin -log4j.appender.LOGEVENT.password=admin - -log4j.logger.org.apache.directory.shared.ldap=WARN, CARBON_CONSOLE -log4j.logger.org.apache.directory.server.ldap.handlers=WARN, CARBON_CONSOLE -log4j.logger.org.apache.directory.shared.ldap.entry.DefaultServerAttribute=FATAL, CARBON_CONSOLE -log4j.logger.org.apache.directory.shared.ldap.ldif.LdifReader=ERROR, CARBON_CONSOLE -log4j.logger.org.apache.directory.server.ldap.LdapProtocolHandler=ERROR, CARBON_CONSOLE - -## Trace Logger configuration which will append to a XMPP chatroom or JID ## -#log4j.appender.XMPP_APPENDER=org.wso2.carbon.utils.logging.IMAppender -#log4j.appender.XMPP_APPENDER.host=jabber.org -#log4j.appender.XMPP_APPENDER.username=wso2esb -#log4j.appender.XMPP_APPENDER.password=wso2esb -#log4j.appender.XMPP_APPENDER.recipient=ruwan@jabber.org -#log4j.appender.XMPP_APPENDER.layout=org.apache.log4j.PatternLayout -#log4j.appender.XMPP_APPENDER.layout.ConversionPattern=[%X{host}] [%t] %-5p [%d{HH:mm:ss,SSS}] %C{1} - %m%n - -# Appender config to AUDIT_LOGFILE -log4j.appender.AUDIT_LOGFILE=org.apache.log4j.DailyRollingFileAppender -log4j.appender.AUDIT_LOGFILE.File=${carbon.home}/repository/logs/audit.log -log4j.appender.AUDIT_LOGFILE.Append=true -log4j.appender.AUDIT_LOGFILE.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout -log4j.appender.AUDIT_LOGFILE.layout.ConversionPattern=[%d] %P%5p - %x %m %n -log4j.appender.AUDIT_LOGFILE.layout.TenantPattern=%U%@%D [%T] [%S] -log4j.appender.AUDIT_LOGFILE.threshold=INFO -log4j.additivity.AUDIT_LOG=false - -# Appender config to send Atomikos transaction logs to new log file tm.out. -log4j.appender.ATOMIKOS = org.apache.log4j.RollingFileAppender -log4j.appender.ATOMIKOS.File = repository/logs/tm.out -log4j.appender.ATOMIKOS.Append = true -log4j.appender.ATOMIKOS.layout = org.apache.log4j.PatternLayout -log4j.appender.ATOMIKOS.layout.ConversionPattern=%p %t %c - %m%n -log4j.additivity.com.atomikos=false - -# DAS_AGENT is set to be a Custom Log Appender. -log4j.appender.DAS_AGENT=org.wso2.carbon.analytics.shared.data.agents.log4j.appender.LogEventAppender -# DAS_AGENT uses PatternLayout. -log4j.appender.DAS_AGENT.layout=org.wso2.carbon.analytics.shared.data.agents.log4j.util.TenantAwarePatternLayout -log4j.appender.DAS_AGENT.columnList=%D,%S,%A,%d,%c,%p,%m,%H,%I,%Stacktrace -log4j.appender.DAS_AGENT.userName=admin -log4j.appender.DAS_AGENT.password=admin -log4j.appender.DAS_AGENT.url=tcp://wso2apim-analytics-1:7612|tcp://wso2apim-analytics-2:7612 -log4j.appender.DAS_AGENT.maxTolerableConsecutiveFailure=5 -log4j.appender.DAS_AGENT.streamDef=loganalyzer:1.0.0 -log4j.logger.trace.messages=TRACE,CARBON_TRACE_LOGFILE - -# Appender config to CARBON_TRACE_LOGFILE -log4j.appender.CARBON_TRACE_LOGFILE=org.apache.log4j.DailyRollingFileAppender -log4j.appender.CARBON_TRACE_LOGFILE.File=${carbon.home}/repository/logs/${instance.log}/wso2carbon-trace-messages${instance.log}.log -log4j.appender.CARBON_TRACE_LOGFILE.Append=true -log4j.appender.CARBON_TRACE_LOGFILE.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout -log4j.appender.CARBON_TRACE_LOGFILE.layout.ConversionPattern=[%d] %P%5p {%c} - %x %m %n -log4j.appender.CARBON_TRACE_LOGFILE.layout.TenantPattern=%U%@%D [%T] [%S] -log4j.appender.CARBON_TRACE_LOGFILE.threshold=TRACE -log4j.additivity.trace.messages=false - - -# The event trace logger dumps enough information @INFO level, but maybe pushed upto TRACE. -# Writes only run-time/event processing time tracing/debug messages for event passing through trace -# enabled transport adapters event formatters, builders and processors. Enabling event tracing on these has a performance impact -log4j.category.EVENT_TRACE_LOGGER=INFO, EVENT_TRACE_APPENDER, EVENT_TRACE_MEMORYAPPENDER -log4j.additivity.EVENT_TRACE_LOGGER=false -log4j.appender.EVENT_TRACE_APPENDER=org.apache.log4j.DailyRollingFileAppender -log4j.appender.EVENT_TRACE_APPENDER.File=${carbon.home}/repository/logs/${instance.log}/wso2-cep-trace${instance.log}.log -log4j.appender.EVENT_TRACE_APPENDER.Append=true -log4j.appender.EVENT_TRACE_APPENDER.layout=org.apache.log4j.PatternLayout -log4j.appender.EVENT_TRACE_APPENDER.layout.ConversionPattern=%d{HH:mm:ss,SSS} [%X{ip}-%X{host}] [%t] %5p %c{1} %m%n -# The memory appender for trace logger -log4j.appender.EVENT_TRACE_MEMORYAPPENDER=org.wso2.carbon.utils.logging.appenders.MemoryAppender -log4j.appender.EVENT_TRACE_MEMORYAPPENDER.bufferSize=2000 -log4j.appender.EVENT_TRACE_MEMORYAPPENDER.layout=org.apache.log4j.PatternLayout -log4j.appender.EVENT_TRACE_MEMORYAPPENDER.layout.ConversionPattern=%d{HH:mm:ss,SSS} [%X{ip}-%X{host}] [%t] %5p %m%n diff --git a/pattern-1/confs/apim-manager-worker/repository/conf/tomcat/catalina-server.xml b/pattern-1/confs/apim-manager-worker/repository/conf/tomcat/catalina-server.xml deleted file mode 100755 index 742f4a31..00000000 --- a/pattern-1/confs/apim-manager-worker/repository/conf/tomcat/catalina-server.xml +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pattern-1/confs/apim-worker/bin/wso2server.sh b/pattern-1/confs/apim-worker/bin/wso2server.sh deleted file mode 100755 index 7c32a079..00000000 --- a/pattern-1/confs/apim-worker/bin/wso2server.sh +++ /dev/null @@ -1,320 +0,0 @@ -#!/bin/sh -# ---------------------------------------------------------------------------- -# Copyright 2005-2012 WSO2, Inc. http://www.wso2.org -# -# Licensed 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. - -# ---------------------------------------------------------------------------- -# Main Script for the WSO2 Carbon Server -# -# Environment Variable Prequisites -# -# CARBON_HOME Home of WSO2 Carbon installation. If not set I will try -# to figure it out. -# -# JAVA_HOME Must point at your Java Development Kit installation. -# -# JAVA_OPTS (Optional) Java runtime options used when the commands -# is executed. -# -# NOTE: Borrowed generously from Apache Tomcat startup scripts. -# ----------------------------------------------------------------------------- - -# OS specific support. $var _must_ be set to either true or false. -#ulimit -n 100000 - -cygwin=false; -darwin=false; -os400=false; -mingw=false; -case "`uname`" in -CYGWIN*) cygwin=true;; -MINGW*) mingw=true;; -OS400*) os400=true;; -Darwin*) darwin=true - if [ -z "$JAVA_VERSION" ] ; then - JAVA_VERSION="CurrentJDK" - else - echo "Using Java version: $JAVA_VERSION" - fi - if [ -z "$JAVA_HOME" ] ; then - JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/${JAVA_VERSION}/Home - fi - ;; -esac - -# resolve links - $0 may be a softlink -PRG="$0" - -while [ -h "$PRG" ]; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '.*/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`/"$link" - fi -done - -# Get standard environment variables -PRGDIR=`dirname "$PRG"` - -# Only set CARBON_HOME if not already set -[ -z "$CARBON_HOME" ] && CARBON_HOME=`cd "$PRGDIR/.." ; pwd` - -# Set AXIS2_HOME. Needed for One Click JAR Download -AXIS2_HOME="$CARBON_HOME" - -# For Cygwin, ensure paths are in UNIX format before anything is touched -if $cygwin; then - [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` - [ -n "$CARBON_HOME" ] && CARBON_HOME=`cygpath --unix "$CARBON_HOME"` - [ -n "$AXIS2_HOME" ] && CARBON_HOME=`cygpath --unix "$CARBON_HOME"` -fi - -# For OS400 -if $os400; then - # Set job priority to standard for interactive (interactive - 6) by using - # the interactive priority - 6, the helper threads that respond to requests - # will be running at the same priority as interactive jobs. - COMMAND='chgjob job('$JOBNAME') runpty(6)' - system $COMMAND - - # Enable multi threading - QIBM_MULTI_THREADED=Y - export QIBM_MULTI_THREADED -fi - -# For Migwn, ensure paths are in UNIX format before anything is touched -if $mingw ; then - [ -n "$CARBON_HOME" ] && - CARBON_HOME="`(cd "$CARBON_HOME"; pwd)`" - [ -n "$JAVA_HOME" ] && - JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" - [ -n "$AXIS2_HOME" ] && - CARBON_HOME="`(cd "$CARBON_HOME"; pwd)`" - # TODO classpath? -fi - -if [ -z "$JAVACMD" ] ; then - if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - else - JAVACMD=java - fi -fi - -if [ ! -x "$JAVACMD" ] ; then - echo "Error: JAVA_HOME is not defined correctly." - echo " CARBON cannot execute $JAVACMD" - exit 1 -fi - -# if JAVA_HOME is not set we're not happy -if [ -z "$JAVA_HOME" ]; then - echo "You must set the JAVA_HOME variable before running CARBON." - exit 1 -fi - -if [ -e "$CARBON_HOME/wso2carbon.pid" ]; then - PID=`cat "$CARBON_HOME"/wso2carbon.pid` -fi - -# ----- Process the input command ---------------------------------------------- -args="" -for c in $* -do - if [ "$c" = "--debug" ] || [ "$c" = "-debug" ] || [ "$c" = "debug" ]; then - CMD="--debug" - continue - elif [ "$CMD" = "--debug" ]; then - if [ -z "$PORT" ]; then - PORT=$c - fi - elif [ "$c" = "--stop" ] || [ "$c" = "-stop" ] || [ "$c" = "stop" ]; then - CMD="stop" - elif [ "$c" = "--start" ] || [ "$c" = "-start" ] || [ "$c" = "start" ]; then - CMD="start" - elif [ "$c" = "--version" ] || [ "$c" = "-version" ] || [ "$c" = "version" ]; then - CMD="version" - elif [ "$c" = "--restart" ] || [ "$c" = "-restart" ] || [ "$c" = "restart" ]; then - CMD="restart" - elif [ "$c" = "--test" ] || [ "$c" = "-test" ] || [ "$c" = "test" ]; then - CMD="test" - else - args="$args $c" - fi -done - -if [ "$CMD" = "--debug" ]; then - if [ "$PORT" = "" ]; then - echo " Please specify the debug port after the --debug option" - exit 1 - fi - if [ -n "$JAVA_OPTS" ]; then - echo "Warning !!!. User specified JAVA_OPTS will be ignored, once you give the --debug option." - fi - CMD="RUN" - JAVA_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=$PORT" - echo "Please start the remote debugging client to continue..." -elif [ "$CMD" = "start" ]; then - if [ -e "$CARBON_HOME/wso2carbon.pid" ]; then - if ps -p $PID > /dev/null ; then - echo "Process is already running" - exit 0 - fi - fi - export CARBON_HOME="$CARBON_HOME" -# using nohup sh to avoid erros in solaris OS.TODO - nohup sh "$CARBON_HOME"/bin/wso2server.sh $args > /dev/null 2>&1 & - exit 0 -elif [ "$CMD" = "stop" ]; then - export CARBON_HOME="$CARBON_HOME" - kill -term `cat "$CARBON_HOME"/wso2carbon.pid` - exit 0 -elif [ "$CMD" = "restart" ]; then - export CARBON_HOME="$CARBON_HOME" - kill -term `cat "$CARBON_HOME"/wso2carbon.pid` - process_status=0 - pid=`cat "$CARBON_HOME"/wso2carbon.pid` - while [ "$process_status" -eq "0" ] - do - sleep 1; - ps -p$pid 2>&1 > /dev/null - process_status=$? - done - -# using nohup sh to avoid erros in solaris OS.TODO - nohup sh "$CARBON_HOME"/bin/wso2server.sh $args > /dev/null 2>&1 & - exit 0 -elif [ "$CMD" = "test" ]; then - JAVACMD="exec "$JAVACMD"" -elif [ "$CMD" = "version" ]; then - cat "$CARBON_HOME"/bin/version.txt - cat "$CARBON_HOME"/bin/wso2carbon-version.txt - exit 0 -fi - -# ---------- Handle the SSL Issue with proper JDK version -------------------- -jdk_17=`$JAVA_HOME/bin/java -version 2>&1 | grep "1.[7|8]"` -if [ "$jdk_17" = "" ]; then - echo " Starting WSO2 Carbon (in unsupported JDK)" - echo " [ERROR] CARBON is supported only on JDK 1.7 and 1.8" -fi - -CARBON_XBOOTCLASSPATH="" -for f in "$CARBON_HOME"/lib/xboot/*.jar -do - if [ "$f" != "$CARBON_HOME/lib/xboot/*.jar" ];then - CARBON_XBOOTCLASSPATH="$CARBON_XBOOTCLASSPATH":$f - fi -done - -JAVA_ENDORSED_DIRS="$CARBON_HOME/lib/endorsed":"$JAVA_HOME/jre/lib/endorsed":"$JAVA_HOME/lib/endorsed" - -CARBON_CLASSPATH="" -if [ -e "$JAVA_HOME/lib/tools.jar" ]; then - CARBON_CLASSPATH="$JAVA_HOME/lib/tools.jar" -fi -for f in "$CARBON_HOME"/bin/*.jar -do - if [ "$f" != "$CARBON_HOME/bin/*.jar" ];then - CARBON_CLASSPATH="$CARBON_CLASSPATH":$f - fi -done -for t in "$CARBON_HOME"/lib/commons-lang*.jar -do - CARBON_CLASSPATH="$CARBON_CLASSPATH":$t -done -# For Cygwin, switch paths to Windows format before running java -if $cygwin; then - JAVA_HOME=`cygpath --absolute --windows "$JAVA_HOME"` - CARBON_HOME=`cygpath --absolute --windows "$CARBON_HOME"` - AXIS2_HOME=`cygpath --absolute --windows "$CARBON_HOME"` - CLASSPATH=`cygpath --path --windows "$CLASSPATH"` - JAVA_ENDORSED_DIRS=`cygpath --path --windows "$JAVA_ENDORSED_DIRS"` - CARBON_CLASSPATH=`cygpath --path --windows "$CARBON_CLASSPATH"` - CARBON_XBOOTCLASSPATH=`cygpath --path --windows "$CARBON_XBOOTCLASSPATH"` -fi - -# ----- Execute The Requested Command ----------------------------------------- - -echo JAVA_HOME environment variable is set to $JAVA_HOME -echo CARBON_HOME environment variable is set to "$CARBON_HOME" - -cd "$CARBON_HOME" - -TMP_DIR="$CARBON_HOME"/tmp -if [ -d "$TMP_DIR" ]; then -rm -rf "$TMP_DIR" -fi - -START_EXIT_STATUS=121 -status=$START_EXIT_STATUS - -if [ -z "$JVM_MEM_OPTS" ]; then - java_version=$("$JAVACMD" -version 2>&1 | awk -F '"' '/version/ {print $2}') - JVM_MEM_OPTS="-Xms256m -Xmx1024m" - if [ "$java_version" \< "1.8" ]; then - JVM_MEM_OPTS="$JVM_MEM_OPTS -XX:MaxPermSize=256m" - fi -fi -echo "Using Java memory options: $JVM_MEM_OPTS" - -#To monitor a Carbon server in remote JMX mode on linux host machines, set the below system property. -# -Djava.rmi.server.hostname="your.IP.goes.here" - -while [ "$status" = "$START_EXIT_STATUS" ] -do - $JAVACMD \ - -Xbootclasspath/a:"$CARBON_XBOOTCLASSPATH" \ - $JVM_MEM_OPTS \ - -XX:+HeapDumpOnOutOfMemoryError \ - -XX:HeapDumpPath="$CARBON_HOME/repository/logs/heap-dump.hprof" \ - $JAVA_OPTS \ - -Dcom.sun.management.jmxremote \ - -classpath "$CARBON_CLASSPATH" \ - -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" \ - -Djava.io.tmpdir="$CARBON_HOME/tmp" \ - -Dcatalina.base="$CARBON_HOME/lib/tomcat" \ - -Dwso2.server.standalone=true \ - -Dcarbon.registry.root=/ \ - -Djava.command="$JAVACMD" \ - -Dcarbon.home="$CARBON_HOME" \ - -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \ - -Dcarbon.config.dir.path="$CARBON_HOME/repository/conf" \ - -Djava.util.logging.config.file="$CARBON_HOME/repository/conf/etc/logging-bridge.properties" \ - -Dcomponents.repo="$CARBON_HOME/repository/components/plugins" \ - -Dconf.location="$CARBON_HOME/repository/conf"\ - -Dcom.atomikos.icatch.file="$CARBON_HOME/lib/transactions.properties" \ - -Dcom.atomikos.icatch.hide_init_file_path=true \ - -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false \ - -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true \ - -Dcom.sun.jndi.ldap.connect.pool.authentication=simple \ - -Dcom.sun.jndi.ldap.connect.pool.timeout=3000 \ - -Dorg.terracotta.quartz.skipUpdateCheck=true \ - -Djava.security.egd=file:/dev/./urandom \ - -Dfile.encoding=UTF8 \ - -Djava.net.preferIPv4Stack=true \ - -Dcom.ibm.cacheLocalHost=true \ - -Dorg.opensaml.httpclient.https.disableHostnameVerification=true \ - -Dorg.wso2.ignoreHostnameVerification=true \ - -DworkerNode=false \ - org.wso2.carbon.bootstrap.Bootstrap $* - status=$? -done diff --git a/pattern-1/confs/apim-worker/repository/conf/api-manager.xml b/pattern-1/confs/apim-worker/repository/conf/api-manager.xml deleted file mode 100755 index adb5d0b9..00000000 --- a/pattern-1/confs/apim-worker/repository/conf/api-manager.xml +++ /dev/null @@ -1,678 +0,0 @@ - - - jdbc/WSO2AM_DB - - - Synapse - - - false - - - - - https://wso2apim.wso2.svc:${mgt.transport.https.port}${carbon.context}services/ - - ${admin.username} - - ${admin.password} - - false - - - - - - - - X-JWT-Assertion - - - - - - - - - - - - org.wso2.carbon.apimgt.keymgt.token.JWTGenerator - - - - - - - - - - - - - - - - - - - Production and Sandbox - This is a hybrid gateway that handles both production and sandbox token traffic. - - https://localhost:9443${carbon.context}services/ - - ${admin.username} - - ${admin.password} - - http://wso2apim-gw,https://wso2apim-gw - - - - - - - true - - true - - false - - false - - - - - - - - - - - - true - - - tcp://wso2apim-analytics-1:7612|tcp://wso2apim-analytics-2:7612 - ssl://wso2apim-analytics-1:7712|ssl://wso2apim-analytics-2:7712 - - admin - - admin - - - org.wso2.carbon.apimgt.usage.client.impl.APIUsageStatisticsRdbmsClientImpl - - - https://wso2apim-analytics:9444 - admin - admin - - - false - - - org.wso2.carbon.apimgt.usage.publisher.APIMgtUsageDataBridgeDataPublisher - - - false - - - - org.wso2.apimgt.statistics.request - 1.1.0 - - - org.wso2.apimgt.statistics.response - 1.1.0 - - - org.wso2.apimgt.statistics.fault - 1.0.0 - - - org.wso2.apimgt.statistics.throttle - 1.0.0 - - - org.wso2.apimgt.statistics.workflow - 1.0.0 - - - org.wso2.apimgt.statistics.execution.time - 1.0.0 - - - org.wso2.analytics.apim.alertStakeholderInfo - 1.0.0 - - - - - - - - - https://wso2apim.wso2.svc:${mgt.transport.https.port}${carbon.context}services/ - - - ${admin.username} - - ${admin.password} - - - WSClient - 10000 - - - false - localhost - - - - - org.wso2.carbon.apimgt.keymgt.handlers.DefaultKeyValidationHandler - - - - - - - - - - am_application_scope - - - - /oauth2/token - - https://localhost:${https.nio.port}/revoke - - false - - - - - - true - - - - - - - true - false - https://wso2apim/store - - - https://wso2apim-worker.wso2.svc:${mgt.transport.https.port}${carbon.context}services/ - - ${admin.username} - - - ${admin.password} - - false - - false - - - - - true - - - true - - - - - - - false - https://wso2apim/publisher - - - - - - - - - - - - - false - - - - - /resource - admin - 1.0.0 - none - none - Any - - - - - - - - - - - true - - - * - - - GET,PUT,POST,DELETE,PATCH,OPTIONS - - - authorization,Access-Control-Allow-Origin,Content-Type,SOAPAction - - - - false - - - - - - - - - - /api/am/publisher/{version}/swagger.json - GET,HEAD - - - /api/am/store/{version}/swagger.json - GET,HEAD - - - /api/am/admin/{version}/swagger.json - GET,HEAD - - - /api/am/store/{version}/apis - GET,HEAD - - - /api/am/store/{version}/apis/{apiId} - GET,HEAD - - - /api/am/store/{version}/apis/{apiId}/swagger - GET,HEAD - - - /api/am/store/{version}/apis/{apiId}/documents - GET,HEAD - - - /api/am/store/{version}/apis/{apiId}/documents/{documentId} - GET,HEAD - - - /api/am/store/{version}/apis/{apiId}/documents/{documentId}/content - GET,HEAD - - - /api/am/store/{version}/apis/{apiId}/thumbnail - GET,HEAD - - - /api/am/store/{version}/tags - GET,HEAD - - - /api/am/store/{version}/tiers/{tierLevel} - GET,HEAD - - - /api/am/store/{version}/tiers/{tierLevel}/{tierName} - GET,HEAD - - - - - /api/am/store/{version}/apis - GET - - - /api/am/store/{version}/apis/generate-sdk - POST - - - /api/am/store/{version}/apis/{apiId}/documents - GET - - - /api/am/store/{version}/applications - GET - - - /api/am/store/{version}/applications/generate-keys - POST - - - /api/am/store/{version}/subscriptions - GET,POST - - - /api/am/store/{version}/tags - GET - - - /api/am/store/{version}/tiers/{tierLevel} - GET - - - /api/am/store/{version}/tiers/{tierLevel}/{tierName} - GET - - - /api/am/publisher/{version}/apis - GET,POST - - - /api/am/publisher/{version}/apis/{apiId} - GET,DELETE,PUT - - - /api/am/publisher/{version}/apis/{apiId}/swagger - GET,PUT - - - /api/am/publisher/{version}/apis/{apiId}/thumbnail - GET,POST - - - /api/am/publisher/{version}/apis/{apiId}/change-lifecycle - POST - - - /api/am/publisher/{version}/apis/{apiId}/copy-api - POST - - - /api/am/publisher/{version}/applications/{applicationId} - GET - - - /api/am/publisher/{version}/apis/{apiId}/documents - GET,POST - - - /api/am/publisher/{version}/apis/{apiId}/documents/{documentId}/content - GET,POST - - - /api/am/publisher/{version}/apis/{apiId}/documents/{documentId} - GET,PUT,DELETE - - - /api/am/publisher/{version}/environments - GET - - - /api/am/publisher/{version}/subscriptions - GET - - - /api/am/publisher/{version}/subscriptions/block-subscription - POST - - - /api/am/publisher/{version}/subscriptions/{subscriptionId} - GET - - - /api/am/publisher/{version}/subscriptions/unblock-subscription - POST - - - /api/am/publisher/{version}/tiers/{tierLevel} - GET,POST - - - /api/am/publisher/{version}/tiers/{tierLevel}/{tierName} - GET,PUT,DELETE - - - /api/am/publisher/{version}/tiers/update-permission - POST - - - - - true - - true - Binary - {tcp://${carbon.local.ip}:${receiver.url.port}}, {tcp://wso2apim-manager-worker:9611} - {ssl://${carbon.local.ip}:${auth.url.port}}, {ssl://wso2apim-manager-worker:9711} - ${admin.username} - ${admin.password} - - 1000 - 200 - - - 200 - 1000 - 200 - - - - https://localhost:${mgt.transport.https.port}${carbon.context}services/ - ${admin.username} - ${admin.password} - - - true - - - - true - tcp://${carbon.local.ip}:${jms.port} - ${admin.username} - ${admin.password} - throttleData - - - TopicConnectionFactory - topic - org.wso2.andes.jndi.PropertiesFileInitialContextFactory - - amqp://admin:admin@clientID/carbon?failover='roundrobin'%26cyclecount='2'%26brokerlist='tcp://127.0.0.1:5672?retries='5'%26connectdelay='50';tcp://wso2apim-manager-worker:5672?retries='5'%26connectdelay='50'' - - - 20 - 100 - 1000 - 10 - - - - org.wso2.andes.jndi.PropertiesFileInitialContextFactory - repository/conf/jndi.properties - topic - throttleData - allow - TopicConnectionFactory - - - true - false - false - false - - - false - https://localhost:9445/bpmn - ${admin.username} - ${admin.password} - https://localhost:${mgt.transport.https.port}/api/am/publisher/v0.10/workflows/update-workflow-status - https://localhost:${https.nio.port}/token - https://localhost:${mgt.transport.https.port}/client-registration/v0.10/register - ${admin.username} - ${admin.password} - - - - - org.wso2 - org.wso2.client. - org.wso2.client.model. - org.wso2.client.api. - - java,android - - - - diff --git a/pattern-1/confs/apim-worker/repository/conf/jndi.properties b/pattern-1/confs/apim-worker/repository/conf/jndi.properties deleted file mode 100755 index 21befd18..00000000 --- a/pattern-1/confs/apim-worker/repository/conf/jndi.properties +++ /dev/null @@ -1,29 +0,0 @@ -# -# Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -# -# Licensed 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. -# - -# register some connection factories -# connectionfactory.[jndiname] = [ConnectionURL] -connectionfactory.TopicConnectionFactory = amqp://admin:admin@clientid/carbon?brokerlist='tcp://localhost:5672' - -connectionfactory.QueueConnectionFactory = amqp://admin:admin@clientID/test?brokerlist='tcp://localhost:5672' - -# register some queues in JNDI using the form -# queue.[jndiName] = [physicalName] -#queue.MyQueue = example.MyQueue - -# register some topics in JNDI using the form -# topic.[jndiName] = [physicalName] -topic.throttleData = throttleData diff --git a/pattern-1/confs/apim-worker/repository/conf/log4j.properties b/pattern-1/confs/apim-worker/repository/conf/log4j.properties deleted file mode 100755 index 6fdf2c2c..00000000 --- a/pattern-1/confs/apim-worker/repository/conf/log4j.properties +++ /dev/null @@ -1,220 +0,0 @@ -# -# Copyright (c) 2005-2015, WSO2 Inc. (http://wso2.com) All Rights Reserved. -# -# Licensed 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. -# - -## -# This is the log4j configuration file used by WSO2 AM -# ===================================================== -# -# IMPORTANT : Please do not remove or change the names of any of the Appenders defined here. -# The layout pattern & log file can be changed using the WSO2 AM Management Console, and those -# settings will override the settings in this file. -## - - -# the root category is ERROR (applies for all 3rd party JARs etc) and will be logged to the -# LOG_APPENDER and the CONSOLE_APPENDER - -log4j.rootLogger=ERROR, CARBON_CONSOLE, CARBON_LOGFILE, CARBON_MEMORY, CARBON_SYS_LOG, ERROR_LOGFILE - -log4j.logger.AUDIT_LOG=INFO, AUDIT_LOGFILE - -log4j.category.org.apache.synapse=INFO -log4j.category.org.apache.synapse.transport=INFO -log4j.category.org.apache.axis2=INFO -log4j.category.org.apache.axis2.transport=INFO -log4j.logger.com.atomikos=INFO,ATOMIKOS -log4j.logger.org.quartz=WARN -log4j.logger.org.wso2=INFO -log4j.logger.org.wso2.carbon=INFO -#log4j.category.org.apache.synapse.transport.nhttp.util=DEBUG -#log4j.category.org.apache.http.impl.nio.reactor=DEBUG -#log4j.logger.org.wso2.carbon.utils.deployment.ComponentBuilder=DEBUG -#log4j.logger.org.wso2.carbon.utils.deployment.OSGiBundleDeployer=DEBUG -log4j.logger.org.apache.catalina=WARN -log4j.logger.org.apache.coyote=WARN -log4j.logger.org.apache.axis2.enterprise=FATAL -log4j.logger.de.hunsicker.jalopy.io=FATAL - -# uncomment the following logs to see HTTP headers and messages -#log4j.logger.org.apache.synapse.transport.http.headers=DEBUG -#log4j.logger.org.apache.synapse.transport.http.wire=DEBUG - -# qpid related logs for the message broker -log4j.logger.qpid=WARN -log4j.logger.org.apache.qpid=WARN -log4j.logger.org.apache.qpid.server.Main=INFO -log4j.logger.qpid.message=WARN -log4j.logger.qpid.message.broker.listening=INFO -log4j.logger.org.wso2.carbon.databridge.agent.thrift.AsyncDataPublisher=WARN - -# The console appender is used to display general information at console -log4j.appender.CARBON_CONSOLE=org.wso2.carbon.utils.logging.appenders.CarbonConsoleAppender -log4j.appender.CARBON_CONSOLE.layout=org.apache.log4j.PatternLayout -log4j.appender.CARBON_CONSOLE.layout.ConversionPattern=[%d{ISO8601}] %5p - %c{1} %m%n - -# Configure the service logger at INFO level. Writes only run-time/mediation-time audit messages -log4j.category.SERVICE_LOGGER=INFO, SERVICE_APPENDER -log4j.additivity.SERVICE_LOGGER=false -log4j.appender.SERVICE_APPENDER=org.apache.log4j.RollingFileAppender -log4j.appender.SERVICE_APPENDER.File=${carbon.home}/repository/logs/${instance.log}/wso2-apigw-service${instance.log}.log -log4j.appender.SERVICE_APPENDER.MaxFileSize=1000KB -log4j.appender.SERVICE_APPENDER.MaxBackupIndex=10 -log4j.appender.SERVICE_APPENDER.layout=org.apache.log4j.PatternLayout -log4j.appender.SERVICE_APPENDER.layout.ConversionPattern=%d{ISO8601} [%X{ip}-%X{host}] [%t] %5p %c{1} %m%n - -# The trace logger dumps enough information @INFO level, but maybe pushed upto TRACE. -# Writes only run-time/mediation time tracing/debug messages for messages passing through trace -# enabled sequences, mediators and services. Enabling tracing on these has a performance impact -log4j.category.TRACE_LOGGER=INFO, TRACE_APPENDER, TRACE_MEMORYAPPENDER -log4j.additivity.TRACE_LOGGER=false -log4j.appender.TRACE_APPENDER=org.apache.log4j.DailyRollingFileAppender -log4j.appender.TRACE_APPENDER.File=${carbon.home}/repository/logs/${instance.log}/wso2-apigw-trace${instance.log}.log -log4j.appender.TRACE_APPENDER.Append=true -log4j.appender.TRACE_APPENDER.layout=org.apache.log4j.PatternLayout -log4j.appender.TRACE_APPENDER.layout.ConversionPattern=%d{HH:mm:ss,SSS} [%X{ip}-%X{host}] [%t] %5p %c{1} %m%n - -# The memory appender for trace logger -log4j.appender.TRACE_MEMORYAPPENDER=org.wso2.carbon.utils.logging.appenders.MemoryAppender -log4j.appender.TRACE_MEMORYAPPENDER.bufferSize=2000 -log4j.appender.TRACE_MEMORYAPPENDER.layout=org.apache.log4j.PatternLayout -log4j.appender.TRACE_MEMORYAPPENDER.layout.ConversionPattern=%d{HH:mm:ss,SSS} [%X{ip}-%X{host}] [%t] %5p %m%n - -# CARBON_LOGFILE is set to be a DailyRollingFileAppender using a PatternLayout. -log4j.appender.CARBON_LOGFILE=org.wso2.carbon.utils.logging.appenders.CarbonDailyRollingFileAppender -# Log file will be overridden by the configuration setting in the DB -# This path should be relative to WSO2 Carbon Home -log4j.appender.CARBON_LOGFILE.File=${carbon.home}/repository/logs/${instance.log}/wso2carbon${instance.log}.log -log4j.appender.CARBON_LOGFILE.Append=true -log4j.appender.CARBON_LOGFILE.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout -# ConversionPattern will be overridden by the configuration setting in the DB -log4j.appender.CARBON_LOGFILE.layout.ConversionPattern=TID: [%T] [%S] [%d] %P%5p {%c} - %x %m {%c}%n -log4j.appender.CARBON_LOGFILE.layout.TenantPattern=%U%@%D [%T] [%S] -log4j.appender.CARBON_LOGFILE.threshold=DEBUG - -# The standard error log where all the warnings, errors and fatal errors will be logged -log4j.appender.ERROR_LOGFILE=org.apache.log4j.FileAppender -log4j.appender.ERROR_LOGFILE.File=${carbon.home}/repository/logs/${instance.log}/wso2-apigw-errors.log -log4j.appender.ERROR_LOGFILE.layout=org.apache.log4j.PatternLayout -log4j.appender.ERROR_LOGFILE.layout.ConversionPattern=%d{ISO8601} [%X{ip}-%X{host}] [%t] %5p %c{1} %m%n -log4j.appender.ERROR_LOGFILE.threshold=WARN - -# The memory appender for logging -log4j.appender.CARBON_MEMORY=org.wso2.carbon.logging.service.appender.CarbonMemoryAppender -log4j.appender.CARBON_MEMORY.bufferSize=2000 -log4j.appender.CARBON_MEMORY.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout -# ConversionPattern will be overridden by the configuration setting in the DB -log4j.appender.CARBON_MEMORY.layout.ConversionPattern=TID: [%T] [%S] [%d] %P%5p {%c} - %x %m {%c}%n -log4j.appender.CARBON_MEMORY.layout.TenantPattern=%U%@%D [%T] [%S] -log4j.appender.CARBON_MEMORY.columnList=%T,%S,%A,%d,%c,%p,%m,%H,%I,%Stacktrace -log4j.appender.CARBON_MEMORY.threshold=DEBUG - -# LOGEVENT is set to be a LogEventAppender using a PatternLayout to send logs to LOGEVENT -log4j.appender.LOGEVENT=org.wso2.carbon.logging.appender.LogEventAppender -log4j.appender.LOGEVENT.url=tcp://localhost:7611 -log4j.appender.LOGEVENT.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout -log4j.appender.LOGEVENT.columnList=%T,%S,%A,%d,%c,%p,%m,%I,%Stacktrace -log4j.appender.LOGEVENT.userName=admin -log4j.appender.LOGEVENT.password=admin -log4j.appender.LOGEVENT.processingLimit=1000 -log4j.appender.LOGEVENT.maxTolerableConsecutiveFailure=20 - - -log4j.appender.CARBON_SYS_LOG = org.apache.log4j.net.SyslogAppender -log4j.appender.CARBON_SYS_LOG.layout=org.apache.log4j.PatternLayout -log4j.appender.CARBON_SYS_LOG.layout.ConversionPattern=[%d] %5p - %x %m {%c}%n -log4j.appender.CARBON_SYS_LOG.SyslogHost=localhost -log4j.appender.CARBON_SYS_LOG.Facility=USER -log4j.appender.CARBON_SYS_LOG.threshold=DEBUG - -# LOGEVENT is set to be a LogEventAppender using a PatternLayout to send logs to LOGEVENT -log4j.appender.LOGEVENT=org.wso2.carbon.logging.appender.LogEventAppender -log4j.appender.LOGEVENT.url=tcp://localhost:7611 -log4j.appender.LOGEVENT.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout -log4j.appender.LOGEVENT.columnList=%T,%S,%A,%d,%c,%p,%m,%H,%I,%Stacktrace -log4j.appender.LOGEVENT.userName=admin -log4j.appender.LOGEVENT.password=admin - -log4j.logger.org.apache.directory.shared.ldap=WARN, CARBON_CONSOLE -log4j.logger.org.apache.directory.server.ldap.handlers=WARN, CARBON_CONSOLE -log4j.logger.org.apache.directory.shared.ldap.entry.DefaultServerAttribute=FATAL, CARBON_CONSOLE -log4j.logger.org.apache.directory.shared.ldap.ldif.LdifReader=ERROR, CARBON_CONSOLE -log4j.logger.org.apache.directory.server.ldap.LdapProtocolHandler=ERROR, CARBON_CONSOLE - -## Trace Logger configuration which will append to a XMPP chatroom or JID ## -#log4j.appender.XMPP_APPENDER=org.wso2.carbon.utils.logging.IMAppender -#log4j.appender.XMPP_APPENDER.host=jabber.org -#log4j.appender.XMPP_APPENDER.username=wso2esb -#log4j.appender.XMPP_APPENDER.password=wso2esb -#log4j.appender.XMPP_APPENDER.recipient=ruwan@jabber.org -#log4j.appender.XMPP_APPENDER.layout=org.apache.log4j.PatternLayout -#log4j.appender.XMPP_APPENDER.layout.ConversionPattern=[%X{host}] [%t] %-5p [%d{HH:mm:ss,SSS}] %C{1} - %m%n - -# Appender config to AUDIT_LOGFILE -log4j.appender.AUDIT_LOGFILE=org.apache.log4j.DailyRollingFileAppender -log4j.appender.AUDIT_LOGFILE.File=${carbon.home}/repository/logs/audit.log -log4j.appender.AUDIT_LOGFILE.Append=true -log4j.appender.AUDIT_LOGFILE.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout -log4j.appender.AUDIT_LOGFILE.layout.ConversionPattern=[%d] %P%5p - %x %m %n -log4j.appender.AUDIT_LOGFILE.layout.TenantPattern=%U%@%D [%T] [%S] -log4j.appender.AUDIT_LOGFILE.threshold=INFO -log4j.additivity.AUDIT_LOG=false - -# Appender config to send Atomikos transaction logs to new log file tm.out. -log4j.appender.ATOMIKOS = org.apache.log4j.RollingFileAppender -log4j.appender.ATOMIKOS.File = repository/logs/tm.out -log4j.appender.ATOMIKOS.Append = true -log4j.appender.ATOMIKOS.layout = org.apache.log4j.PatternLayout -log4j.appender.ATOMIKOS.layout.ConversionPattern=%p %t %c - %m%n -log4j.additivity.com.atomikos=false - -# DAS_AGENT is set to be a Custom Log Appender. -log4j.appender.DAS_AGENT=org.wso2.carbon.analytics.shared.data.agents.log4j.appender.LogEventAppender -# DAS_AGENT uses PatternLayout. -log4j.appender.DAS_AGENT.layout=org.wso2.carbon.analytics.shared.data.agents.log4j.util.TenantAwarePatternLayout -log4j.appender.DAS_AGENT.columnList=%D,%S,%A,%d,%c,%p,%m,%H,%I,%Stacktrace -log4j.appender.DAS_AGENT.userName=admin -log4j.appender.DAS_AGENT.password=admin -log4j.appender.DAS_AGENT.url=tcp://wso2apim-analytics-1:7612|tcp://wso2apim-analytics-2:7612 -log4j.appender.DAS_AGENT.maxTolerableConsecutiveFailure=5 -log4j.appender.DAS_AGENT.streamDef=loganalyzer:1.0.0 -log4j.logger.trace.messages=TRACE,CARBON_TRACE_LOGFILE - -# Appender config to CARBON_TRACE_LOGFILE -log4j.appender.CARBON_TRACE_LOGFILE=org.apache.log4j.DailyRollingFileAppender -log4j.appender.CARBON_TRACE_LOGFILE.File=${carbon.home}/repository/logs/${instance.log}/wso2carbon-trace-messages${instance.log}.log -log4j.appender.CARBON_TRACE_LOGFILE.Append=true -log4j.appender.CARBON_TRACE_LOGFILE.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout -log4j.appender.CARBON_TRACE_LOGFILE.layout.ConversionPattern=[%d] %P%5p {%c} - %x %m %n -log4j.appender.CARBON_TRACE_LOGFILE.layout.TenantPattern=%U%@%D [%T] [%S] -log4j.appender.CARBON_TRACE_LOGFILE.threshold=TRACE -log4j.additivity.trace.messages=false - - -# The event trace logger dumps enough information @INFO level, but maybe pushed upto TRACE. -# Writes only run-time/event processing time tracing/debug messages for event passing through trace -# enabled transport adapters event formatters, builders and processors. Enabling event tracing on these has a performance impact -log4j.category.EVENT_TRACE_LOGGER=INFO, EVENT_TRACE_APPENDER, EVENT_TRACE_MEMORYAPPENDER -log4j.additivity.EVENT_TRACE_LOGGER=false -log4j.appender.EVENT_TRACE_APPENDER=org.apache.log4j.DailyRollingFileAppender -log4j.appender.EVENT_TRACE_APPENDER.File=${carbon.home}/repository/logs/${instance.log}/wso2-cep-trace${instance.log}.log -log4j.appender.EVENT_TRACE_APPENDER.Append=true -log4j.appender.EVENT_TRACE_APPENDER.layout=org.apache.log4j.PatternLayout -log4j.appender.EVENT_TRACE_APPENDER.layout.ConversionPattern=%d{HH:mm:ss,SSS} [%X{ip}-%X{host}] [%t] %5p %c{1} %m%n -# The memory appender for trace logger -log4j.appender.EVENT_TRACE_MEMORYAPPENDER=org.wso2.carbon.utils.logging.appenders.MemoryAppender -log4j.appender.EVENT_TRACE_MEMORYAPPENDER.bufferSize=2000 -log4j.appender.EVENT_TRACE_MEMORYAPPENDER.layout=org.apache.log4j.PatternLayout -log4j.appender.EVENT_TRACE_MEMORYAPPENDER.layout.ConversionPattern=%d{HH:mm:ss,SSS} [%X{ip}-%X{host}] [%t] %5p %m%n diff --git a/pattern-1/confs/apim-worker/repository/conf/tomcat/catalina-server.xml b/pattern-1/confs/apim-worker/repository/conf/tomcat/catalina-server.xml deleted file mode 100755 index 742f4a31..00000000 --- a/pattern-1/confs/apim-worker/repository/conf/tomcat/catalina-server.xml +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pattern-2/confs/apim-is-as-km/repository/conf/api-manager.xml b/pattern-1/confs/apim/api-manager.xml similarity index 89% rename from pattern-2/confs/apim-is-as-km/repository/conf/api-manager.xml rename to pattern-1/confs/apim/api-manager.xml index 69440f5d..1f151948 100644 --- a/pattern-2/confs/apim-is-as-km/repository/conf/api-manager.xml +++ b/pattern-1/confs/apim/api-manager.xml @@ -5,7 +5,7 @@ jdbc/WSO2AM_DB - None + Synapse @@ -56,8 +56,6 @@ Token generation the implementation is provided in URLSafeJWTGenerator --> - - - https://wso2apim-manager-worker.wso2.svc:9443/services/ + https://localhost:${mgt.transport.https.port}${carbon.context}services/ ${admin.username} ${admin.password} - http://wso2apim-gw,https://wso2apim-gw + http://${carbon.local.ip}:${http.nio.port},https://${carbon.local.ip}:${https.nio.port} @@ -108,6 +106,15 @@ false + + true + + true @@ -124,7 +131,7 @@ --> - false + true - {tcp://localhost:7612} - + tcp://wso2apim-with-analytics-apim-analytics-service:7612 + ssl://wso2apim-with-analytics-apim-analytics-service:7712 ${admin.username} @@ -147,7 +154,7 @@ org.wso2.carbon.apimgt.usage.client.impl.APIUsageStatisticsRdbmsClientImpl - https://localhost:9444 + https://wso2apim-analytics:9444 ${admin.username} ${admin.password} @@ -190,7 +197,7 @@ org.wso2.analytics.apim.alertStakeholderInfo - 1.0.0 + 1.0.1 @@ -220,7 +227,7 @@ 10000 - false + true localhost @@ -249,6 +256,8 @@ + + am_application_scope - https://${GATEWAY_SERVER_HOST}:{port}/revoke + https://localhost:${https.nio.port}/revoke @@ -280,6 +289,7 @@ + false true @@ -325,6 +335,8 @@ + + true - - - - false - - - - - /resource - admin - 1.0.0 - none - none - Any - - - - - - - @@ -571,13 +543,15 @@ true - - true + Binary tcp://${carbon.local.ip}:${receiver.url.port} ssl://${carbon.local.ip}:${auth.url.port} ${admin.username} ${admin.password} + + + true 1000 200 @@ -589,6 +563,7 @@ + true https://localhost:${mgt.transport.https.port}${carbon.context}services/ ${admin.username} ${admin.password} @@ -600,32 +575,16 @@ true - tcp://${carbon.local.ip}:${jms.port} - ${admin.username} - ${admin.password} throttleData TopicConnectionFactory topic org.wso2.andes.jndi.PropertiesFileInitialContextFactory - amqp://${jms.username}:${jms.password}@clientid/carbon?brokerlist='${jms.url}' + amqp://${admin.username}:${admin.password}@clientid/carbon?brokerlist='tcp://${carbon.local.ip}:${jms.port}' - - 20 - 100 - 1000 - 10 - - - org.wso2.andes.jndi.PropertiesFileInitialContextFactory - repository/conf/jndi.properties - topic - throttleData - allow - TopicConnectionFactory - + + Supported Languages/Frameworks : android, java, scala, csharp, dart, flash, groovy, javascript, jmeter, + nodejs, perl, php, python, ruby, swift, clojure, asyncScala, csharpDotNet2--> java,android diff --git a/pattern-1/confs/apim-manager-worker/repository/conf/carbon.xml b/pattern-1/confs/apim/carbon.xml old mode 100755 new mode 100644 similarity index 97% rename from pattern-1/confs/apim-manager-worker/repository/conf/carbon.xml rename to pattern-1/confs/apim/carbon.xml index 1c04ceee..1d6259f7 --- a/pattern-1/confs/apim-manager-worker/repository/conf/carbon.xml +++ b/pattern-1/confs/apim/carbon.xml @@ -1,6 +1,6 @@ - 2.1.0 + 2.2.0 + + claim_mgt_menu + identity_mgt_emailtemplate_menu + identity_security_questions_menu + - - + + + + wso2registry + false + true + / + + + jdbc/WSO2CarbonDB + + + + jdbc/WSO2REG_DB + + + gov + wso2carbon@jdbc:mysql://wso2apim-with-analytics-rdbms-service:3306/WSO2AM_COMMON_DB + govregistry + false + true + / + + + gov + /_system/governance + + + gov + /_system/config + + + + + + + .* + + + + + + + + .* + + + + + + + + true + + /trunk/schemas/ + + + /trunk/wsdls/ + + + /trunk/policies/ + + + + application/wsdl+xml + + + + + + + application/wsdl+xml + application/xsd+xml + 50 + true + + 3 + + /trunk/schemas/ + + + /trunk/wsdls/ + + + application/vnd.wso2.governance-archive + + + + + + + + 1.0.0-SNAPSHOT + true + + dev + qa + live + + + application/vnd.wso2-service+xml + + + + + + + + application/vnd.wso2-service+xml + + + + + + + + application/vnd.wso2-api+xml + + + + + + + + /_system/governance/event/topics/registry/notifications/.* + + + + + + + + + Created + Tested + Deployed + + + application/vnd.wso2-smart-link + + + + + + + + /trunk/policies/ + + + application/policy+xml + + + + + + + + true + + /trunk/schemas/ + + + application/x-xsd+xml + + + + + + + + application/vnd.wso2-hyperlink + + + + + + + application/vnd.wso2.endpoint + + /trunk/endpoints/ + + + + + + + + application/vnd.wso2-uri+xml + + + + + + + + .* + + + + + + + .* + + + + + + + workflow-config + + + + + + + + + + + + + + + + + + + + + + + true + + 35 + 3 + + 40 + + 40 + + /_system/local/repository/components/org.wso2.carbon.registry/indexing/lastaccesstime + + + + + + + + + + + + + + + + + + + + + + + false + + + + true + true + true + true + + /trunk/services/ + + + + + false + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pattern-1/confs/apim-analytics-1/repository/conf/user-mgt.xml b/pattern-1/confs/apim/user-mgt.xml old mode 100755 new mode 100644 similarity index 93% rename from pattern-1/confs/apim-analytics-1/repository/conf/user-mgt.xml rename to pattern-1/confs/apim/user-mgt.xml index de5e9db7..7c0fa72e --- a/pattern-1/confs/apim-analytics-1/repository/conf/user-mgt.xml +++ b/pattern-1/confs/apim/user-mgt.xml @@ -1,3 +1,4 @@ + - - true + true admin admin admin - everyone + everyone + true + true jdbc/WSO2UM_DB - - @@ -84,9 +84,9 @@ (objectClass=groupOfNames) member false - [a-zA-Z0-9._-|//]{3,30}$ + [a-zA-Z0-9._\-|//]{3,30}$ ^[\S]{5,30}$ - [a-zA-Z0-9._-|//]{3,30}$ + [a-zA-Z0-9._\-|//]{3,30}$ false PLAIN_TEXT , @@ -99,8 +99,7 @@ true - - - - /permission true @@ -218,7 +216,6 @@ - - - - - - - - - - - - - true - true - optional - true - work/mtom - 4000 - - ${childfirstCL} - - - true - - - true - - - - false - - inmemory - - - - - - - services - - - axis2services - - - axis2modules - - - WSO2 API Manager Analytics Server-2.1.0 - - - WSO2 API Manager Analytics Server-2.1.0 - - - - - - - false - - - - - - false - - - true - - - - ./repository/deployment/server/synapse-configs - - - - . - - - . - - - WSO2 Carbon Server - - - - - - - ${jaxwsparam} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 9763 - - - - - - - - - - - - 9443 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - HTTP/1.1 - chunked - - true - - - HTTP/1.1 - chunked - - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - kubernetes - org.wso2.carbon.membership.scheme.kubernetes.KubernetesMembershipScheme - wso2apim-analytics-1,wso2apim-analytics-2 - wso2 - - - - - wso2.am.analytics.domain - - - - - - 45564 - - 100 - - 60 - - - - - - 127.0.0.1 - - - - - - 4000 - - - - - - - - - - - - - - - - - - 127.0.0.1 - 4000 - - - - - - - - - diff --git a/pattern-2/confs/apim-analytics-1/repository/conf/axis2/axis2_client.xml b/pattern-2/confs/apim-analytics-1/repository/conf/axis2/axis2_client.xml deleted file mode 100644 index a8b584d0..00000000 --- a/pattern-2/confs/apim-analytics-1/repository/conf/axis2/axis2_client.xml +++ /dev/null @@ -1,300 +0,0 @@ - - - - - - - true - false - false - - - 500 - - 15000 - - - false - - - - true - - - - - - false - - - admin - axis2 - - - - - - - - - - - - - - - - - - - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 6071 - - - - - - - - - - - - - - - - - - - - - - HTTP/1.1 - chunked - 60000 - 60000 - - - HTTP/1.1 - chunked - 60000 - 60000 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pattern-2/confs/apim-analytics-1/repository/conf/axis2/tenant-axis2.xml b/pattern-2/confs/apim-analytics-1/repository/conf/axis2/tenant-axis2.xml deleted file mode 100644 index c6fe9d23..00000000 --- a/pattern-2/confs/apim-analytics-1/repository/conf/axis2/tenant-axis2.xml +++ /dev/null @@ -1,285 +0,0 @@ - - - - - - - - - true - true - optional - - - true - - - false - - - - true - - - - - - false - - - false - - - axis2services - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pattern-2/confs/apim-analytics-1/repository/conf/datasources/stats-datasources.xml b/pattern-2/confs/apim-analytics-1/repository/conf/datasources/stats-datasources.xml deleted file mode 100755 index b25bf493..00000000 --- a/pattern-2/confs/apim-analytics-1/repository/conf/datasources/stats-datasources.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader - - - - - WSO2AM_STATS_DB - The datasource used for setting statistics to API Manager - - jdbc/WSO2AM_STATS_DB - - - - jdbc:mysql://apim-rdbms:3306/statdb?autoReconnect=true&relaxAutoCommit=true - root - root - com.mysql.jdbc.Driver - 50 - 60000 - true - SELECT 1 - 30000 - false - - - - - - - diff --git a/pattern-2/confs/apim-analytics-1/repository/conf/event-processor.xml b/pattern-2/confs/apim-analytics-1/repository/conf/event-processor.xml deleted file mode 100644 index 0073a4cf..00000000 --- a/pattern-2/confs/apim-analytics-1/repository/conf/event-processor.xml +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - - - - - - 10000 - - wso2apim-analytics-1 - 11224 - 20000 - 20000 - - 5242880 - - UTF-8 - 1024 - 30000 - - 1000000 - - 10 - - 1000000 - - 10 - - - wso2apim-analytics-1 - 10005 - 15000 - 10000 - - - wso2apim-analytics-1 - 11000 - - 5242880 - - UTF-8 - 1024 - 30000 - - - 15 - 10 - - cep_persistence - - - - - - - - - - - 0.0.0.0 - 8904 - - - 0.0.0.0 - 11000 - - - - - - - localhost - 8904 - - - localhost - 8905 - - - - 20000 - - 5000 - - 10000 - - - - - - 15000 - 15100 - - - 20000 - - 8192 - - 8192 - - 5242880 - - UTF-8 - - 10000 - - 20000 - - - - 1024 - - 5242880 - - UTF-8 - - 20000 - - - - 60000 - 60000 - - - org.wso2.cep.storm.dependencies.jar - - - - 20000 - - - - - diff --git a/pattern-2/confs/apim-analytics-1/repository/conf/tomcat/catalina-server.xml b/pattern-2/confs/apim-analytics-1/repository/conf/tomcat/catalina-server.xml deleted file mode 100755 index 742f4a31..00000000 --- a/pattern-2/confs/apim-analytics-1/repository/conf/tomcat/catalina-server.xml +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pattern-2/confs/apim-analytics-1/repository/conf/user-mgt.xml b/pattern-2/confs/apim-analytics-1/repository/conf/user-mgt.xml deleted file mode 100755 index de5e9db7..00000000 --- a/pattern-2/confs/apim-analytics-1/repository/conf/user-mgt.xml +++ /dev/null @@ -1,259 +0,0 @@ - - - - - - true - admin - - admin - admin - - everyone - true - jdbc/WSO2UM_DB - - - - - org.wso2.carbon.user.core.tenant.JDBCTenantManager - false - true - true - ^[\S]{3,30}$ - ^[\S]{3,30}$ - Username pattern policy violated - ^[\S]{5,30}$ - ^[\S]{5,30}$ - Password length should be within 5 to 30 characters - ^[\S]{3,30}$ - ^[\S]{3,30}$ - true - false - true - SHA-256 - true - , - 100 - 100 - true - false - - - - - - - - - - - - - /permission - true - false - - - - - diff --git a/pattern-2/confs/apim-analytics-2/bin/wso2server.sh b/pattern-2/confs/apim-analytics-2/bin/wso2server.sh deleted file mode 100755 index 05af2f81..00000000 --- a/pattern-2/confs/apim-analytics-2/bin/wso2server.sh +++ /dev/null @@ -1,327 +0,0 @@ -#!/bin/sh -# ---------------------------------------------------------------------------- -# Copyright 2005-2012 WSO2, Inc. http://www.wso2.org -# -# Licensed 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. - -# ---------------------------------------------------------------------------- -# Main Script for the WSO2 Carbon Server -# -# Environment Variable Prequisites -# -# CARBON_HOME Home of WSO2 Carbon installation. If not set I will try -# to figure it out. -# -# JAVA_HOME Must point at your Java Development Kit installation. -# -# JAVA_OPTS (Optional) Java runtime options used when the commands -# is executed. -# -# NOTE: Borrowed generously from Apache Tomcat startup scripts. -# ----------------------------------------------------------------------------- - -# OS specific support. $var _must_ be set to either true or false. -#ulimit -n 100000 - -# NOTE: This is an edited wso2server.sh script to facilitate spark environment variables for WSO2DAS - -cygwin=false; -darwin=false; -os400=false; -mingw=false; -case "`uname`" in -CYGWIN*) cygwin=true;; -MINGW*) mingw=true;; -OS400*) os400=true;; -Darwin*) darwin=true - if [ -z "$JAVA_VERSION" ] ; then - JAVA_VERSION="CurrentJDK" - else - echo "Using Java version: $JAVA_VERSION" - fi - if [ -z "$JAVA_HOME" ] ; then - JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/${JAVA_VERSION}/Home - fi - ;; -esac - -# resolve links - $0 may be a softlink -PRG="$0" - -while [ -h "$PRG" ]; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '.*/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`/"$link" - fi -done - -# Get standard environment variables -PRGDIR=`dirname "$PRG"` - -# Only set CARBON_HOME if not already set -[ -z "$CARBON_HOME" ] && CARBON_HOME=`cd "$PRGDIR/.." ; pwd` - -# Set AXIS2_HOME. Needed for One Click JAR Download -AXIS2_HOME=$CARBON_HOME - -# For Cygwin, ensure paths are in UNIX format before anything is touched -if $cygwin; then - [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` - [ -n "$CARBON_HOME" ] && CARBON_HOME=`cygpath --unix "$CARBON_HOME"` - [ -n "$AXIS2_HOME" ] && CARBON_HOME=`cygpath --unix "$CARBON_HOME"` -fi - -# For OS400 -if $os400; then - # Set job priority to standard for interactive (interactive - 6) by using - # the interactive priority - 6, the helper threads that respond to requests - # will be running at the same priority as interactive jobs. - COMMAND='chgjob job('$JOBNAME') runpty(6)' - system $COMMAND - - # Enable multi threading - QIBM_MULTI_THREADED=Y - export QIBM_MULTI_THREADED -fi - -# For Migwn, ensure paths are in UNIX format before anything is touched -if $mingw ; then - [ -n "$CARBON_HOME" ] && - CARBON_HOME="`(cd "$CARBON_HOME"; pwd)`" - [ -n "$JAVA_HOME" ] && - JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" - [ -n "$AXIS2_HOME" ] && - CARBON_HOME="`(cd "$CARBON_HOME"; pwd)`" - # TODO classpath? -fi - -if [ -z "$JAVACMD" ] ; then - if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - else - JAVACMD=java - fi -fi - -if [ ! -x "$JAVACMD" ] ; then - echo "Error: JAVA_HOME is not defined correctly." - echo " CARBON cannot execute $JAVACMD" - exit 1 -fi - -# if JAVA_HOME is not set we're not happy -if [ -z "$JAVA_HOME" ]; then - echo "You must set the JAVA_HOME variable before running CARBON." - exit 1 -fi - -if [ -e "$CARBON_HOME/wso2carbon.pid" ]; then - PID=`cat "$CARBON_HOME"/wso2carbon.pid` -fi - -# ----- Process the input command ---------------------------------------------- -args="" -NODE_PARAMS="" -for c in $* -do - if [ "$c" = "-receiverNode" ]; then - NODE_PARAMS="-DdisableAnalyticsEngine=true -DdisableAnalyticsExecution=true -DdisableIndexing=true -DdisableDataPurging=false -DdisableAnalyticsSparkCtx=true -DdisableAnalyticsStats=true" - echo "Starting Data Analytics Server node as a Receiver Node" - elif [ "$c" = "-indexerNode" ]; then - NODE_PARAMS="-DdisableAnalyticsExecution=true -DdisableAnalyticsEngine=true -DdisableEventSink=true -DdisableAnalyticsSparkCtx=true -DdisableAnalyticsStats=true -DdisableDataPurging=true" - echo "Starting Data Analytics Server node as an Indexer Node" - elif [ "$c" = "-analyzerNode" ]; then - NODE_PARAMS="-DdisableIndexing=true -DdisableEventSink=true -DdisableDataPurging=true -DenableAnalyticsStats=true" - echo "Starting Data Analytics Server node as an Analyzer Node" - elif [ "$c" = "-dashboardNode" ]; then - NODE_PARAMS="-DdisableIndexing=true -DdisableEventSink=true -DdisableDataPurging=true -DenableAnalyticsStats=true -DdisableAnalyticsExecution=true -DdisableAnalyticsEngine=true -DdisableAnalyticsSparkCtx=true " - echo "Starting Data Analytics Server node as an Analyzer Node" - elif [ "$c" = "--debug" ] || [ "$c" = "-debug" ] || [ "$c" = "debug" ]; then - CMD="--debug" - continue - elif [ "$CMD" = "--debug" ]; then - if [ -z "$PORT" ]; then - PORT=$c - fi - elif [ "$c" = "--stop" ] || [ "$c" = "-stop" ] || [ "$c" = "stop" ]; then - CMD="stop" - elif [ "$c" = "--start" ] || [ "$c" = "-start" ] || [ "$c" = "start" ]; then - CMD="start" - elif [ "$c" = "--version" ] || [ "$c" = "-version" ] || [ "$c" = "version" ]; then - CMD="version" - elif [ "$c" = "--restart" ] || [ "$c" = "-restart" ] || [ "$c" = "restart" ]; then - CMD="restart" - elif [ "$c" = "--test" ] || [ "$c" = "-test" ] || [ "$c" = "test" ]; then - CMD="test" - else - args="$args $c" - fi -done - -if [ "$CMD" = "--debug" ]; then - if [ "$PORT" = "" ]; then - echo " Please specify the debug port after the --debug option" - exit 1 - fi - if [ -n "$JAVA_OPTS" ]; then - echo "Warning !!!. User specified JAVA_OPTS will be ignored, once you give the --debug option." - fi - CMD="RUN" - JAVA_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=$PORT" - echo "Please start the remote debugging client to continue..." -elif [ "$CMD" = "start" ]; then - if [ -e "$CARBON_HOME/wso2carbon.pid" ]; then - if ps -p $PID > /dev/null ; then - echo "Process is already running" - exit 0 - fi - fi - export CARBON_HOME=$CARBON_HOME -# using nohup sh to avoid erros in solaris OS.TODO - nohup sh $CARBON_HOME/bin/wso2server.sh $args $NODE_PARAMS > /dev/null 2>&1 & - exit 0 -elif [ "$CMD" = "stop" ]; then - export CARBON_HOME=$CARBON_HOME - kill -term `cat $CARBON_HOME/wso2carbon.pid` - exit 0 -elif [ "$CMD" = "restart" ]; then - export CARBON_HOME=$CARBON_HOME - kill -term `cat $CARBON_HOME/wso2carbon.pid` - process_status=0 - pid=`cat $CARBON_HOME/wso2carbon.pid` - while [ "$process_status" -eq "0" ] - do - sleep 1; - ps -p$pid 2>&1 > /dev/null - process_status=$? - done - -# using nohup sh to avoid erros in solaris OS.TODO - nohup sh $CARBON_HOME/bin/wso2server.sh $args $NODE_PARAMS > /dev/null 2>&1 & - exit 0 -elif [ "$CMD" = "test" ]; then - JAVACMD="exec "$JAVACMD"" -elif [ "$CMD" = "version" ]; then - cat $CARBON_HOME/bin/version.txt - cat $CARBON_HOME/bin/wso2carbon-version.txt - exit 0 -fi - -# ---------- Handle the SSL Issue with proper JDK version -------------------- -jdk_17=`$JAVA_HOME/bin/java -version 2>&1 | grep "1.[7|8]"` -if [ "$jdk_17" = "" ]; then - echo " Starting WSO2 Carbon (in unsupported JDK)" - echo " [ERROR] CARBON is supported only on JDK 1.7 and 1.8" -fi - -CARBON_XBOOTCLASSPATH="" -for f in "$CARBON_HOME"/lib/xboot/*.jar -do - if [ "$f" != "$CARBON_HOME/lib/xboot/*.jar" ];then - CARBON_XBOOTCLASSPATH="$CARBON_XBOOTCLASSPATH":$f - fi -done - -JAVA_ENDORSED_DIRS="$CARBON_HOME/lib/endorsed":"$JAVA_HOME/jre/lib/endorsed":"$JAVA_HOME/lib/endorsed" - -CARBON_CLASSPATH="" -if [ -e "$JAVA_HOME/lib/tools.jar" ]; then - CARBON_CLASSPATH="$JAVA_HOME/lib/tools.jar" -fi -for f in "$CARBON_HOME"/bin/*.jar -do - if [ "$f" != "$CARBON_HOME/bin/*.jar" ];then - CARBON_CLASSPATH="$CARBON_CLASSPATH":$f - fi -done -for t in "$CARBON_HOME"/lib/commons-lang*.jar -do - CARBON_CLASSPATH="$CARBON_CLASSPATH":$t -done -# For Cygwin, switch paths to Windows format before running java -if $cygwin; then - JAVA_HOME=`cygpath --absolute --windows "$JAVA_HOME"` - CARBON_HOME=`cygpath --absolute --windows "$CARBON_HOME"` - AXIS2_HOME=`cygpath --absolute --windows "$CARBON_HOME"` - CLASSPATH=`cygpath --path --windows "$CLASSPATH"` - JAVA_ENDORSED_DIRS=`cygpath --path --windows "$JAVA_ENDORSED_DIRS"` - CARBON_CLASSPATH=`cygpath --path --windows "$CARBON_CLASSPATH"` - CARBON_XBOOTCLASSPATH=`cygpath --path --windows "$CARBON_XBOOTCLASSPATH"` -fi - -# ----- Execute The Requested Command ----------------------------------------- - -echo JAVA_HOME environment variable is set to $JAVA_HOME -echo CARBON_HOME environment variable is set to $CARBON_HOME - -cd "$CARBON_HOME" - -TMP_DIR=$CARBON_HOME/tmp -if [ -d "$TMP_DIR" ]; then -rm -rf "$TMP_DIR" -fi - -START_EXIT_STATUS=121 -status=$START_EXIT_STATUS - -#load spark environment variables -. $CARBON_HOME/bin/load-spark-env-vars.sh - -#To monitor a Carbon server in remote JMX mode on linux host machines, set the below system property. -# -Djava.rmi.server.hostname="your.IP.goes.here" - -while [ "$status" = "$START_EXIT_STATUS" ] -do - $JAVACMD \ - -Xbootclasspath/a:"$CARBON_XBOOTCLASSPATH" \ - -Xms256m -Xmx1024m -XX:MaxPermSize=256m \ - -XX:+HeapDumpOnOutOfMemoryError \ - -XX:HeapDumpPath="$CARBON_HOME/repository/logs/heap-dump.hprof" \ - $JAVA_OPTS \ - -Dcom.sun.management.jmxremote \ - -classpath "$CARBON_CLASSPATH" \ - -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" \ - -Djava.io.tmpdir="$CARBON_HOME/tmp" \ - -Dcatalina.base="$CARBON_HOME/lib/tomcat" \ - -Dwso2.server.standalone=true \ - -Dcarbon.registry.root=/ \ - -Djava.command="$JAVACMD" \ - -Dcarbon.home="$CARBON_HOME" \ - -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \ - -Dcarbon.config.dir.path="$CARBON_HOME/repository/conf" \ - -Djava.util.logging.config.file="$CARBON_HOME/repository/conf/etc/logging-bridge.properties" \ - -Dcomponents.repo="$CARBON_HOME/repository/components/plugins" \ - -Dconf.location="$CARBON_HOME/repository/conf"\ - -Dcom.atomikos.icatch.file="$CARBON_HOME/lib/transactions.properties" \ - -Dcom.atomikos.icatch.hide_init_file_path=true \ - -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false \ - -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true \ - -Dcom.sun.jndi.ldap.connect.pool.authentication=simple \ - -Dcom.sun.jndi.ldap.connect.pool.timeout=3000 \ - -Dorg.terracotta.quartz.skipUpdateCheck=true \ - -Djava.security.egd=file:/dev/./urandom \ - -Dfile.encoding=UTF8 \ - -Djava.net.preferIPv4Stack=true \ - -Dcom.ibm.cacheLocalHost=true \ - $NODE_PARAMS \ - org.wso2.carbon.bootstrap.Bootstrap $* - status=$? -done diff --git a/pattern-2/confs/apim-analytics-2/repository/conf/analytics/spark/spark-defaults.conf b/pattern-2/confs/apim-analytics-2/repository/conf/analytics/spark/spark-defaults.conf deleted file mode 100755 index 92fbc882..00000000 --- a/pattern-2/confs/apim-analytics-2/repository/conf/analytics/spark/spark-defaults.conf +++ /dev/null @@ -1,122 +0,0 @@ -# ------------------------------------------------------ -# CARBON RELATED SPARK PROPERTIES -# ------------------------------------------------------ -# Carbon specific properties when running Spark in the Carbon environment. -# Should start with the prefix "carbon." - -# carbon.spark.master config has 3 states -# 1. (default) local mode - spark starts in the local mode (NOTE: carbon.spark.master.count property -# will not be considered here) -# ex: "carbon.spark.master local" or "carbon.spark.master local[2]" -# 2. client mode - DAS acts as a client for an external Spark cluster (NOTE: carbon.spark.master.count property -# will not be considered here) -# ex: "carbon.spark.master spark://:" -# 3. cluster mode - DAS creates its own Spark cluster usign Carbon Clustering -# ex: "carbon.spark.master local" AND "carbon.spark.master.count " - -carbon.spark.master local -carbon.spark.master.count 2 - -#This configuration is used to limit the number of results returned from spark query execution -#To return all the results, set this to -1 -carbon.spark.results.limit 1000 - -# Below configuratoin can be used to point to a symbolic link to WSO2 DAS HOME -# carbon.das.symbolic.link /home/ubuntu/das/das_symlink/ - -# Below configuration can be used with the spark fair scheduler, when fair schedule pools are used. the -# defualt pool name for carbon is 'carbon-pool' -# carbon.scheduler.pool carbon-pool - - - -# ------------------------------------------------------ -# SPARK PROPERTIES -# ------------------------------------------------------ -# Default system properties included when running spark. -# This is useful for setting default environmental settings. -# Check http://spark.apache.org/docs/latest/configuration.html for further information - -# Application (Spark Driver) Properties -# ------------------------------------------------------ -spark.app.name CarbonAnalytics -# Spark Driver will be running inside the carbon JVM. Hence the below properties are obsolete -# spark.driver.cores 1 -# spark.driver.memory 512m - -# Runtime Environment -# ------------------------------------------------------ - -# Spark UI -spark.ui.port 4040 -spark.history.ui.port 18080 - -# Compression and Serialization -spark.serializer org.apache.spark.serializer.KryoSerializer -spark.kryoserializer.buffer 256k -spark.kryoserializer.buffer.max 256m - -# Execution Behavior - -# Networking -spark.blockManager.port 12000 -spark.broadcast.port 12500 -spark.driver.port 13000 -spark.executor.port 13500 -spark.fileserver.port 14000 -spark.replClassServer.port 14500 -spark.akka.timeout 1000s - -# Scheduling -spark.scheduler.mode FAIR -# this property can be set to specify where hte fairscheduler.xml file is. the carbon specific -# fairscheduler.xml is in the /repository/conf/analytics/spark directory -# spark.scheduler.allocation.file /repository/conf/analytics/spark/fairscheduler.xml - -# Dynamic Allocation - -# Security - -# Encryption - -# Standalone Cluster Configs -spark.deploy.recoveryMode CUSTOM -spark.deploy.recoveryMode.factory org.wso2.carbon.analytics.spark.core.deploy.AnalyticsRecoveryModeFactory - -# Master -spark.master.port 7077 -spark.master.rest.port 6066 -spark.master.webui.port 8081 - -# Worker -spark.worker.cores 1 -spark.worker.memory 1g -spark.worker.dir work -spark.worker.port 11000 -spark.worker.webui.port 11500 - -# Executors -# spark.executor.cores 1 ; Default: Takes all the available cores in the worker -spark.executor.memory 1g -spark.executor.logs.rolling.strategy size -spark.executor.logs.rolling.maxSize 10000000 -spark.executor.logs.rolling.maxRetainedFiles 10 - -# spark.cores.max ; Default: Int.MAX_VALUE; The maximum amount of CPU cores to request for the application from across -# the cluster (not from each machine) - - -# Spark Logging -# ------------------------------------------------------ -# To allow event logging for spark you need to uncomment -# the line spark.eventlog.log true and set the directory in which the -# logs will be stored. - -# spark.eventLog.enabled true -# spark.eventLog.dir - -# YARN related configs -# ------------------------------------------------------ -# spark.yarn.jar - - diff --git a/pattern-2/confs/apim-analytics-2/repository/conf/axis2/axis2.xml b/pattern-2/confs/apim-analytics-2/repository/conf/axis2/axis2.xml deleted file mode 100644 index bea4911e..00000000 --- a/pattern-2/confs/apim-analytics-2/repository/conf/axis2/axis2.xml +++ /dev/null @@ -1,728 +0,0 @@ - - - - - - - - - - - - - true - true - optional - true - work/mtom - 4000 - - ${childfirstCL} - - - true - - - true - - - - false - - inmemory - - - - - - - services - - - axis2services - - - axis2modules - - - WSO2 API Manager Analytics Server-2.1.0 - - - WSO2 API Manager Analytics Server-2.1.0 - - - - - - - false - - - - - - false - - - true - - - - ./repository/deployment/server/synapse-configs - - - - . - - - . - - - WSO2 Carbon Server - - - - - - - ${jaxwsparam} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 9763 - - - - - - - - - - - - 9443 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - HTTP/1.1 - chunked - - true - - - HTTP/1.1 - chunked - - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - kubernetes - org.wso2.carbon.membership.scheme.kubernetes.KubernetesMembershipScheme - wso2apim-analytics-1,wso2apim-analytics-2 - wso2 - - - - - wso2.am.analytics.domain - - - - - - 45564 - - 100 - - 60 - - - - - - 127.0.0.1 - - - - - - 4000 - - - - - - - - - - - - - - - - - - 127.0.0.1 - 4000 - - - - - - - - - diff --git a/pattern-2/confs/apim-analytics-2/repository/conf/axis2/axis2_client.xml b/pattern-2/confs/apim-analytics-2/repository/conf/axis2/axis2_client.xml deleted file mode 100644 index a8b584d0..00000000 --- a/pattern-2/confs/apim-analytics-2/repository/conf/axis2/axis2_client.xml +++ /dev/null @@ -1,300 +0,0 @@ - - - - - - - true - false - false - - - 500 - - 15000 - - - false - - - - true - - - - - - false - - - admin - axis2 - - - - - - - - - - - - - - - - - - - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 6071 - - - - - - - - - - - - - - - - - - - - - - HTTP/1.1 - chunked - 60000 - 60000 - - - HTTP/1.1 - chunked - 60000 - 60000 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pattern-2/confs/apim-analytics-2/repository/conf/axis2/tenant-axis2.xml b/pattern-2/confs/apim-analytics-2/repository/conf/axis2/tenant-axis2.xml deleted file mode 100644 index c6fe9d23..00000000 --- a/pattern-2/confs/apim-analytics-2/repository/conf/axis2/tenant-axis2.xml +++ /dev/null @@ -1,285 +0,0 @@ - - - - - - - - - true - true - optional - - - true - - - false - - - - true - - - - - - false - - - false - - - axis2services - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pattern-2/confs/apim-analytics-2/repository/conf/carbon.xml b/pattern-2/confs/apim-analytics-2/repository/conf/carbon.xml deleted file mode 100755 index d86e8678..00000000 --- a/pattern-2/confs/apim-analytics-2/repository/conf/carbon.xml +++ /dev/null @@ -1,695 +0,0 @@ - - - - - - - - WSO2 API Manager Analytics Server - - - AM-Analytics - - - 2.1.0 - - - wso2apim-analytics - - - wso2apim-analytics - - - local:/${carbon.context}/services/ - - - - - - - DataAnalyticsServer - ComplexEventProcessor - - - - - - - org.wso2.carbon - - - / - - - - - - - - - 15 - - - - - - - - - 1 - - - - - 9999 - - 11111 - - - - - - 10389 - - 8000 - - - - - - 10500 - - - - - - - - - org.wso2.carbon.tomcat.jndi.CarbonJavaURLContextFactory - - - - - - - - - java - - - - - - - - - - false - - - false - - - 600 - - - - false - - - - - - - - 153722867280912 - - - - - - - - - 15 - - - - - - ${carbon.home}/repository/deployment/server/ - - - 15 - - - ${carbon.home}/repository/conf/axis2/axis2.xml - - - 30000 - - - ${carbon.home}/repository/deployment/client/ - - ${carbon.home}/repository/conf/axis2/axis2_client.xml - - true - - - - - - - - - - admin - Default Administrator Role - - - user - Default User Role - - - - - - - - - - - - ${carbon.home}/repository/resources/security/wso2carbon.jks - - JKS - - wso2carbon - - wso2carbon - - wso2carbon - - - - - - ${carbon.home}/repository/resources/security/client-truststore.jks - - JKS - - wso2carbon - - - - - - - - - - - - - - - - - - - UserManager - - - false - - - - - - true - allow - - - - - - - - - - - false - - (.*)(/images|/css|/js|/docs)(.*) - - - - - - - true - - - - - ${carbon.home}/tmp/work - - - - - - true - - - 10 - - - 30 - - - - - - 100 - - - - keystore - certificate - * - - org.wso2.carbon.ui.transports.fileupload.AnyFileUploadExecutor - - - - - jarZip - - org.wso2.carbon.ui.transports.fileupload.JarZipUploadExecutor - - - - dbs - - org.wso2.carbon.ui.transports.fileupload.DBSFileUploadExecutor - - - - tools - - org.wso2.carbon.ui.transports.fileupload.ToolsFileUploadExecutor - - - - toolsAny - - org.wso2.carbon.ui.transports.fileupload.ToolsAnyFileUploadExecutor - - - - - - - - - - info - org.wso2.carbon.core.transports.util.InfoProcessor - - - wsdl - org.wso2.carbon.core.transports.util.Wsdl11Processor - - - wsdl2 - org.wso2.carbon.core.transports.util.Wsdl20Processor - - - xsd - org.wso2.carbon.core.transports.util.XsdProcessor - - - - - - false - false - true - svn - http://svnrepo.example.com/repos/ - username - password - true - - - - - - - - - - - - - - - ${require.carbon.servlet} - - - - - true - - - - - - - default repository - http://product-dist.wso2.com/p2/carbon/releases/wilkes/ - - - - - - - - true - - - - - - true - - diff --git a/pattern-2/confs/apim-analytics-2/repository/conf/datasources/analytics-datasources.xml b/pattern-2/confs/apim-analytics-2/repository/conf/datasources/analytics-datasources.xml deleted file mode 100755 index e6fd18e7..00000000 --- a/pattern-2/confs/apim-analytics-2/repository/conf/datasources/analytics-datasources.xml +++ /dev/null @@ -1,110 +0,0 @@ - - - - org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader - - - - - - - - WSO2_ANALYTICS_EVENT_STORE_DB - The datasource used for analytics record store - - - jdbc:mysql://apim-rdbms:3306/statdb?autoReconnect=true&relaxAutoCommit=true - root - root - com.mysql.jdbc.Driver - 50 - 60000 - true - SELECT 1 - 30000 - false - READ_COMMITTED - - - - - - WSO2_ANALYTICS_PROCESSED_DATA_STORE_DB - The datasource used for analytics record store - - - jdbc:mysql://apim-rdbms:3306/statdb?autoReconnect=true&relaxAutoCommit=true - root - root - com.mysql.jdbc.Driver - 50 - 60000 - true - SELECT 1 - 30000 - false - READ_COMMITTED - - - - - - - - - - - - - - diff --git a/pattern-2/confs/apim-analytics-2/repository/conf/datasources/master-datasources.xml b/pattern-2/confs/apim-analytics-2/repository/conf/datasources/master-datasources.xml deleted file mode 100755 index eebb492a..00000000 --- a/pattern-2/confs/apim-analytics-2/repository/conf/datasources/master-datasources.xml +++ /dev/null @@ -1,109 +0,0 @@ - - - - org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader - - - - - - WSO2_CARBON_DB - The datasource used for registry and user manager - - jdbc/WSO2CarbonDB - - - - jdbc:h2:repository/database/WSO2CARBON_DB;DB_CLOSE_ON_EXIT=FALSE - wso2carbon - wso2carbon - org.h2.Driver - 50 - 60000 - true - SELECT 1 - 30000 - - - - - - WSO2UM_DB - The datasource used by user manager - - jdbc/WSO2UM_DB - - - - jdbc:mysql://apim-rdbms:3306/userdb?autoReconnect=true - root - root - com.mysql.jdbc.Driver - 50 - 60000 - true - SELECT 1 - 30000 - - - - - - WSO2REG_DB - The datasource used by the registry - - jdbc/WSO2REG_DB - - - - jdbc:mysql://apim-rdbms:3306/govregdb?autoReconnect=true - root - root - com.mysql.jdbc.Driver - 50 - 60000 - true - SELECT 1 - 30000 - - - - - - - - - - diff --git a/pattern-2/confs/apim-analytics-2/repository/conf/datasources/stats-datasources.xml b/pattern-2/confs/apim-analytics-2/repository/conf/datasources/stats-datasources.xml deleted file mode 100755 index b25bf493..00000000 --- a/pattern-2/confs/apim-analytics-2/repository/conf/datasources/stats-datasources.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader - - - - - WSO2AM_STATS_DB - The datasource used for setting statistics to API Manager - - jdbc/WSO2AM_STATS_DB - - - - jdbc:mysql://apim-rdbms:3306/statdb?autoReconnect=true&relaxAutoCommit=true - root - root - com.mysql.jdbc.Driver - 50 - 60000 - true - SELECT 1 - 30000 - false - - - - - - - diff --git a/pattern-2/confs/apim-analytics-2/repository/conf/event-processor.xml b/pattern-2/confs/apim-analytics-2/repository/conf/event-processor.xml deleted file mode 100644 index 25ea40ef..00000000 --- a/pattern-2/confs/apim-analytics-2/repository/conf/event-processor.xml +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - - - - - - 10000 - - wso2apim-analytics-2 - 11224 - 20000 - 20000 - - 5242880 - - UTF-8 - 1024 - 30000 - - 1000000 - - 10 - - 1000000 - - 10 - - - wso2apim-analytics-2 - 10005 - 15000 - 10000 - - - wso2apim-analytics-2 - 11000 - - 5242880 - - UTF-8 - 1024 - 30000 - - - 15 - 10 - - cep_persistence - - - - - - - - - - - 0.0.0.0 - 8904 - - - 0.0.0.0 - 11000 - - - - - - - localhost - 8904 - - - localhost - 8905 - - - - 20000 - - 5000 - - 10000 - - - - - - 15000 - 15100 - - - 20000 - - 8192 - - 8192 - - 5242880 - - UTF-8 - - 10000 - - 20000 - - - - 1024 - - 5242880 - - UTF-8 - - 20000 - - - - 60000 - 60000 - - - org.wso2.cep.storm.dependencies.jar - - - - 20000 - - - - - diff --git a/pattern-2/confs/apim-analytics-2/repository/conf/registry.xml b/pattern-2/confs/apim-analytics-2/repository/conf/registry.xml deleted file mode 100644 index a223a80a..00000000 --- a/pattern-2/confs/apim-analytics-2/repository/conf/registry.xml +++ /dev/null @@ -1,149 +0,0 @@ - - - - - - - - wso2registry - false - true - / - - - jdbc/WSO2CarbonDB - - - - jdbc/WSO2REG_DB - - - gov - root@jdbc:mysql://apim_rdbms:3306/regdb - govregistry - false - true - / - - - gov - /_system/governance - - - gov - /_system/analytics_config - - - - - - - - - - - - 35 - 3 - - 50 - - 50 - - /_system/local/repository/components/org.wso2.carbon.registry/indexing/lastaccesstime - - - - - - - - - - - - - - - - - - - - - - false - - - - true - true - true - true - - diff --git a/pattern-2/confs/apim-analytics-2/repository/conf/tomcat/catalina-server.xml b/pattern-2/confs/apim-analytics-2/repository/conf/tomcat/catalina-server.xml deleted file mode 100755 index 742f4a31..00000000 --- a/pattern-2/confs/apim-analytics-2/repository/conf/tomcat/catalina-server.xml +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pattern-2/confs/apim-analytics-2/repository/conf/user-mgt.xml b/pattern-2/confs/apim-analytics-2/repository/conf/user-mgt.xml deleted file mode 100755 index de5e9db7..00000000 --- a/pattern-2/confs/apim-analytics-2/repository/conf/user-mgt.xml +++ /dev/null @@ -1,259 +0,0 @@ - - - - - - true - admin - - admin - admin - - everyone - true - jdbc/WSO2UM_DB - - - - - org.wso2.carbon.user.core.tenant.JDBCTenantManager - false - true - true - ^[\S]{3,30}$ - ^[\S]{3,30}$ - Username pattern policy violated - ^[\S]{5,30}$ - ^[\S]{5,30}$ - Password length should be within 5 to 30 characters - ^[\S]{3,30}$ - ^[\S]{3,30}$ - true - false - true - SHA-256 - true - , - 100 - 100 - true - false - - - - - - - - - - - - - /permission - true - false - - - - - diff --git a/pattern-1/confs/apim-analytics-2/repository/conf/carbon.xml b/pattern-2/confs/apim-analytics/carbon.xml old mode 100755 new mode 100644 similarity index 99% rename from pattern-1/confs/apim-analytics-2/repository/conf/carbon.xml rename to pattern-2/confs/apim-analytics/carbon.xml index d86e8678..815352d9 --- a/pattern-1/confs/apim-analytics-2/repository/conf/carbon.xml +++ b/pattern-2/confs/apim-analytics/carbon.xml @@ -36,7 +36,7 @@ - 2.1.0 + 2.1.1.SNAPSHOT - https://wso2apim.wso2.svc:9443${carbon.context}services/ + https://wso2apim-service:${mgt.transport.https.port}${carbon.context}services/ ${admin.username} @@ -56,8 +56,6 @@ Token generation the implementation is provided in URLSafeJWTGenerator --> - - ${admin.password} - http://wso2apim-gw,https://wso2apim-gw + http://${carbon.local.ip}:${http.nio.port},https://${carbon.local.ip}:${https.nio.port} @@ -108,6 +106,15 @@ false + + true + + true @@ -136,20 +143,20 @@ Ex - Multiple Receiver Groups with two receivers each {tcp://localhost:7612/,tcp://localhost:7613},{tcp://localhost:7712/,tcp://localhost:7713/} --> - tcp://wso2apim-analytics-1:7612|tcp://wso2apim-analytics-2:7612 - ssl://wso2apim-analytics-1:7712|ssl://wso2apim-analytics-2:7712 + tcp://wso2apim-analytics-service:7612 + ssl://wso2apim-analytics-service:7712 - admin + ${admin.username} - admin + ${admin.password} org.wso2.carbon.apimgt.usage.client.impl.APIUsageStatisticsRdbmsClientImpl https://wso2apim-analytics:9444 - admin - admin + ${admin.username} + ${admin.password} @@ -190,7 +197,7 @@ org.wso2.analytics.apim.alertStakeholderInfo - 1.0.0 + 1.0.1 @@ -202,7 +209,7 @@ --> - https://wso2apim-km-internal.wso2.svc:9443${carbon.context}services/ + https://wso2apim-km:${mgt.transport.https.port}${carbon.context}services/ ${admin.username} @@ -249,6 +256,8 @@ + + am_application_scope + false true @@ -287,7 +297,7 @@ https://wso2apim/store - https://wso2apim.wso2.svc:9443${carbon.context}services/ + https://wso2apim-service:${mgt.transport.https.port}${carbon.context}services/ ${admin.username} @@ -325,6 +335,8 @@ + + true - - - - false - - - - - /resource - admin - 1.0.0 - none - none - Any - - - - - - - @@ -571,13 +543,15 @@ true - - true + Binary {tcp://wso2apim-pubstore-tm-1:9611}, {tcp://wso2apim-pubstore-tm-2:9611} {ssl://wso2apim-pubstore-tm-1:9711}, {ssl://wso2apim-pubstore-tm-2:9711} ${admin.username} ${admin.password} + + + true 1000 200 @@ -589,7 +563,8 @@ - https://wso2apim.wso2.svc:9443${carbon.context}services/ + true + https://wso2apim-service:${mgt.transport.https.port}${carbon.context}services/ ${admin.username} ${admin.password} @@ -600,33 +575,16 @@ true - tcp://${carbon.local.ip}:${jms.port} - ${admin.username} - ${admin.password} throttleData TopicConnectionFactory topic org.wso2.andes.jndi.PropertiesFileInitialContextFactory - - amqp://admin:admin@clientID/carbon?failover='roundrobin'%26cyclecount='2'%26brokerlist='tcp://wso2apim-pubstore-tm-1:5672?retries='5'%26connectdelay='50';tcp://wso2apim-pubstore-tm-2:5672?retries='5'%26connectdelay='50'' + amqp://admin:admin@clientID/carbon?failover='roundrobin'%26cyclecount='2'%26brokerlist='tcp://wso2apim-pubstore-tm-1:5672?retries='5'%26connectdelay='50';tcp://wso2apim-pubstore-tm-2:5672?retries='5'%26connectdelay='50'' - - 20 - 100 - 1000 - 10 - - - - - - - - - + + Supported Languages/Frameworks : android, java, scala, csharp, dart, flash, groovy, javascript, jmeter, + nodejs, perl, php, python, ruby, swift, clojure, asyncScala, csharpDotNet2--> java,android diff --git a/pattern-2/confs/apim-pubstore-tm-1/repository/conf/axis2/axis2.xml b/pattern-2/confs/apim-gateway/axis2/axis2.xml old mode 100755 new mode 100644 similarity index 96% rename from pattern-2/confs/apim-pubstore-tm-1/repository/conf/axis2/axis2.xml rename to pattern-2/confs/apim-gateway/axis2/axis2.xml index 72085ff4..740d7b36 --- a/pattern-2/confs/apim-pubstore-tm-1/repository/conf/axis2/axis2.xml +++ b/pattern-2/confs/apim-gateway/axis2/axis2.xml @@ -168,14 +168,16 @@ class="org.apache.axis2.format.PlainTextFormatter"/> - + + class="org.apache.synapse.commons.json.JsonFormatter"/--> + - + + class="org.apache.synapse.commons.json.JsonBuilder"/--> + + @@ -543,6 +548,14 @@ wso2carbon + + + + + + repository/resources/security/sslprofiles.xml + 600000 + AllowAll @@ -601,6 +614,15 @@ outflowFaultSeq + + outflowDispatchSeq + outflowFaultSeq + + repository/resources/security/client-truststore.jks + wso2carbon + + + @@ -633,7 +655,7 @@ getting this node to join the cluster. --> + enable="false"> kubernetes - org.wso2.carbon.membership.scheme.kubernetes.KubernetesMembershipScheme - wso2apim-pubstore-tm-1,wso2apim-pubstore-tm-2 - wso2 @@ -687,7 +706,7 @@ --> - api-manager + am-gateway - - - api-manager - 4000 - - + org.wso2.carbon.membership.scheme.kubernetes.KubernetesMembershipScheme + wso2 + wso2apim-gateway-service + true + false - 2.1.0 + 2.2.0 - wso2apim + wso2apim-gateway - wso2apim + wso2apim-gateway + + claim_mgt_menu + identity_mgt_emailtemplate_menu + identity_security_questions_menu + - - + + 50000 true - 720 @@ -108,10 +110,27 @@ --> - -1 - -1 - -1 - -1 + + + + + + + + - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/identity/connect/register + ${carbon.protocol}://${carbon.host}:${carbon.management.port}/api/identity/oauth2/dcr/v1.0/register ${carbon.protocol}://${carbon.host}:${carbon.management.port}/oauth2/jwks ${carbon.protocol}://${carbon.host}:${carbon.management.port}/oauth2/oidcdiscovery @@ -147,19 +166,13 @@ 84600 - 300 - - true + 0 true org.wso2.carbon.identity.oauth.tokenprocessor.PlainTextPersistenceProcessor - - - - false - - + + false @@ -196,6 +209,8 @@ client_credentials org.wso2.carbon.apimgt.keymgt.handlers.ExtendedClientCredentialsGrantHandler + false + false urn:ietf:params:oauth:grant-type:saml2-bearer @@ -206,18 +221,65 @@ org.wso2.carbon.identity.oauth.common.NTLMAuthenticationValidator org.wso2.carbon.identity.oauth2.token.handlers.grant.iwa.ntlm.NTLMAuthenticationGrantHandlerWithHandshake + + urn:ietf:params:oauth:grant-type:jwt-bearer + org.wso2.carbon.identity.oauth2.grant.jwt.JWTBearerGrantHandler + org.wso2.carbon.identity.oauth2.grant.jwt.JWTGrantValidator + + + + + authorization_code + + + implicit + + - + + + + + + + + + + + + + false + + + + + FEDERATED + org.wso2.carbon.identity.openidconnect.DefaultIDTokenBuilder SHA256withRSA + + RSA-OAEP + + A128GCM + + + RSA1_5 + RSA-OAEP + + + A128GCM + A192GCM + A256GCM + A128CBC-HS256 + A128CBC+HS256 + + true + false + + 120 + + + + request_param_value_builder + org.wso2.carbon.identity.openidconnect.RequestParamRequestObjectBuilder + + + + org.wso2.carbon.identity.openidconnect.RequestObjectValidatorImpl + + + true + 0 + 5 + @@ -276,8 +391,6 @@ - 157680000 - 157680000 ${carbon.host} + true + + + + + + + + + false + true + true + + true + - + + + @@ -432,54 +583,151 @@ + + + + + + + + + + + - - - - - - - - - - + name="AppAuthFrameworkSessionContextCache" timeout="300"/> + + + + + name="AuthorizationGrantCache" timeout="300"/> - + name="OAuthCache" timeout="300"/> + name="OAuthScopeCache" timeout="300"/> + name="OAuthSessionDataCache" timeout="300"/> + name="SAMLSSOParticipantCache" timeout="300"/> + name="SAMLSSOSessionIndexCache" timeout="300"/> + + + + + + + + - + + + + + + /permission/admin/manage/identity/usermgt/view + + + /permission/admin/manage/identity/usermgt/view + + + + + /permission/admin/manage/identity/consentmgt/add + + + + /permission/admin/manage/identity/consentmgt/delete + + + /permission/admin/manage/identity/consentmgt/add + + + + /permission/admin/manage/identity/consentmgt/delete + + + /permission/admin/manage/identity/consentmgt/add + + + + /permission/admin/manage/identity/consentmgt/delete + + + /permission/admin/manage/identity/applicationmgt/create + + + /permission/admin/manage/identity/applicationmgt/delete + + + /permission/admin/manage/identity/applicationmgt/update + + + /permission/admin/manage/identity/applicationmgt/view + /permission/admin/manage/identity/applicationmgt/delete @@ -492,6 +740,69 @@ /permission/admin/manage/identity/pep + + /permission/admin/manage/identity/usermgt/create + + + /permission/admin/manage/identity/usermgt/list + + + /permission/admin/manage/identity/rolemgt/create + + + /permission/admin/manage/identity/rolemgt/view + + + /permission/admin/manage/identity/usermgt/view + + + /permission/admin/manage/identity/usermgt/update + + + /permission/admin/manage/identity/usermgt/update + + + /permission/admin/manage/identity/usermgt/delete + + + /permission/admin/manage/identity/rolemgt/view + + + /permission/admin/manage/identity/rolemgt/update + + + /permission/admin/manage/identity/rolemgt/update + + + /permission/admin/manage/identity/rolemgt/delete + + + /permission/admin/login + + + /permission/admin/manage/identity/usermgt/delete + + + /permission/admin/login + + + /permission/admin/login + + + /permission/admin/manage/identity/usermgt/create + + + + + + + + + /permission/admin/manage/identity/usermgt + + + /permission/admin/manage/identity/applicationmgt + - /api/identity/user/v0.9 - /api/identity/recovery/v0.9 - /oauth2 - /api/identity/entitlement + /api/identity/user/v1.0/ + /api/identity/consent-mgt/v1.0/ + /api/identity/recovery/v0.9/ + /oauth2/ + /scim2/ + /api/identity/entitlement/ + /api/identity/oauth2/dcr/v1.0/ /identity/(.*) diff --git a/pattern-2/confs/apim-gw-manager-worker/repository/conf/registry.xml b/pattern-2/confs/apim-gateway/registry.xml old mode 100755 new mode 100644 similarity index 93% rename from pattern-2/confs/apim-gw-manager-worker/repository/conf/registry.xml rename to pattern-2/confs/apim-gateway/registry.xml index e004a457..3da454e5 --- a/pattern-2/confs/apim-gw-manager-worker/repository/conf/registry.xml +++ b/pattern-2/confs/apim-gateway/registry.xml @@ -1,374 +1,384 @@ - - - - - - - wso2registry - false - true - / - - - jdbc/WSO2CarbonDB - - - - jdbc/WSO2REG_DB - - - gov - root@jdbc:mysql://apim_rdbms:3306/regdb - govregistry - false - true - / - - - gov - /_system/governance - - - gov - /_system/config - - - - - - .* - - - - - - - - .* - - - - - - - - true - - /trunk/schemas/ - - - /trunk/wsdls/ - - - /trunk/policies/ - - - - application/wsdl+xml - - - - - - - application/wsdl+xml - application/xsd+xml - 50 - true - - 3 - - /trunk/schemas/ - - - /trunk/wsdls/ - - - application/vnd.wso2.governance-archive - - - - - - - - 1.0.0-SNAPSHOT - true - - dev - qa - live - - - application/vnd.wso2-service+xml - - - - - - - - application/vnd.wso2-service+xml - - - - - - - - application/vnd.wso2-api+xml - - - - - - - - /_system/governance/event/topics/registry/notifications/.* - - - - - - - - - Created - Tested - Deployed - - - application/vnd.wso2-smart-link - - - - - - - - /trunk/policies/ - - - application/policy+xml - - - - - - - - true - - /trunk/schemas/ - - - application/x-xsd+xml - - - - - - - - application/vnd.wso2-hyperlink - - - - - - - application/vnd.wso2.endpoint - - /trunk/endpoints/ - - - - - - - - application/vnd.wso2-uri+xml - - - - - - - - .* - - - - - - - .* - - - - - - - workflow-config - - - - - - - - - - - - - - - - - - - - true - 35 - 3 - - 40 - - 40 - - /_system/local/repository/components/org.wso2.carbon.registry/indexing/lastaccesstime - - - - - - - - - - - - - - - - - - - - - - false - - - - true - true - true - true - - /trunk/services/ - - - - - false - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + wso2registry + false + true + / + + + jdbc/WSO2CarbonDB + + + + jdbc/WSO2REG_DB + + + gov + wso2carbon@jdbc:mysql://wso2apim-pattern-2-rdbms-service:3306/WSO2AM_COMMON_DB + govregistry + false + true + / + + + gov + /_system/governance + + + gov + /_system/config + + + + + + + .* + + + + + + + + .* + + + + + + + + true + + /trunk/schemas/ + + + /trunk/wsdls/ + + + /trunk/policies/ + + + + application/wsdl+xml + + + + + + + application/wsdl+xml + application/xsd+xml + 50 + true + + 3 + + /trunk/schemas/ + + + /trunk/wsdls/ + + + application/vnd.wso2.governance-archive + + + + + + + + 1.0.0-SNAPSHOT + true + + dev + qa + live + + + application/vnd.wso2-service+xml + + + + + + + + application/vnd.wso2-service+xml + + + + + + + + application/vnd.wso2-api+xml + + + + + + + + /_system/governance/event/topics/registry/notifications/.* + + + + + + + + + Created + Tested + Deployed + + + application/vnd.wso2-smart-link + + + + + + + + /trunk/policies/ + + + application/policy+xml + + + + + + + + true + + /trunk/schemas/ + + + application/x-xsd+xml + + + + + + + + application/vnd.wso2-hyperlink + + + + + + + application/vnd.wso2.endpoint + + /trunk/endpoints/ + + + + + + + + application/vnd.wso2-uri+xml + + + + + + + + .* + + + + + + + .* + + + + + + + workflow-config + + + + + + + + + + + + + + + + + + + + + + + true + + 35 + 3 + + 40 + + 40 + + /_system/local/repository/components/org.wso2.carbon.registry/indexing/lastaccesstime + + + + + + + + + + + + + + + + + + + + + + + false + + + + true + true + true + true + + /trunk/services/ + + + + + false + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pattern-1/confs/apim-analytics-2/repository/conf/user-mgt.xml b/pattern-2/confs/apim-gateway/user-mgt.xml old mode 100755 new mode 100644 similarity index 93% rename from pattern-1/confs/apim-analytics-2/repository/conf/user-mgt.xml rename to pattern-2/confs/apim-gateway/user-mgt.xml index de5e9db7..7c0fa72e --- a/pattern-1/confs/apim-analytics-2/repository/conf/user-mgt.xml +++ b/pattern-2/confs/apim-gateway/user-mgt.xml @@ -1,3 +1,4 @@ + - - true + true admin admin admin - everyone + everyone + true + true jdbc/WSO2UM_DB - - @@ -84,9 +84,9 @@ (objectClass=groupOfNames) member false - [a-zA-Z0-9._-|//]{3,30}$ + [a-zA-Z0-9._\-|//]{3,30}$ ^[\S]{5,30}$ - [a-zA-Z0-9._-|//]{3,30}$ + [a-zA-Z0-9._\-|//]{3,30}$ false PLAIN_TEXT , @@ -99,8 +99,7 @@ true - - - - /permission true @@ -218,7 +216,6 @@ - - - - - - - WSO2 API Manager - - - AM - - - 2.1.0 - - - wso2apim-gw - - - wso2apim-gw - - - local:/${carbon.context}/services/ - - - - - - - APIManager - - - - - - - org.wso2.carbon - - - / - - - - - - - - - 15 - - - - - - - - - 0 - - - - - 9999 - - 11111 - - - - - - 10389 - - 8000 - - - - - - 10500 - - - - - - - - - org.wso2.carbon.tomcat.jndi.CarbonJavaURLContextFactory - - - - - - - - - java - - - - - - - - - - false - - - false - - - 600 - - - - false - - - - - - - - 30 - - - - - - - - - 15 - - - - - - ${carbon.home}/repository/deployment/server/ - - - 15 - - - ${carbon.home}/repository/conf/axis2/axis2.xml - - - 30000 - - - ${carbon.home}/repository/deployment/client/ - - ${carbon.home}/repository/conf/axis2/axis2_client.xml - - true - - - - - - - - - - admin - Default Administrator Role - - - user - Default User Role - - - - - - - - - - - - ${carbon.home}/repository/resources/security/wso2carbon.jks - - JKS - - wso2carbon - - wso2carbon - - wso2carbon - - - - - - ${carbon.home}/repository/resources/security/client-truststore.jks - - JKS - - wso2carbon - - - - - - - - - - - - - - - - - - - UserManager - - - false - - - - - - true - allow - - - - - - - - ${carbon.home}/tmp/work - - - - - - true - - - 10 - - - 30 - - - - - - 100 - - - - keystore - certificate - * - - org.wso2.carbon.ui.transports.fileupload.AnyFileUploadExecutor - - - - - jarZip - - org.wso2.carbon.ui.transports.fileupload.JarZipUploadExecutor - - - - dbs - - org.wso2.carbon.ui.transports.fileupload.DBSFileUploadExecutor - - - - tools - - org.wso2.carbon.ui.transports.fileupload.ToolsFileUploadExecutor - - - - toolsAny - - org.wso2.carbon.ui.transports.fileupload.ToolsAnyFileUploadExecutor - - - - - - - - - - info - org.wso2.carbon.core.transports.util.InfoProcessor - - - wsdl - org.wso2.carbon.core.transports.util.Wsdl11Processor - - - wsdl2 - org.wso2.carbon.core.transports.util.Wsdl20Processor - - - xsd - org.wso2.carbon.core.transports.util.XsdProcessor - - - - - - false - false - true - svn - http://svnrepo.example.com/repos/ - username - password - true - - - - - - - - - - - - - - - ${require.carbon.servlet} - - - - - true - - - - - - - default repository - http://product-dist.wso2.com/p2/carbon/releases/wilkes/ - - - - - - - - true - - - - - - true - - diff --git a/pattern-2/confs/apim-gw-manager-worker/repository/conf/jndi.properties b/pattern-2/confs/apim-gw-manager-worker/repository/conf/jndi.properties deleted file mode 100755 index 21befd18..00000000 --- a/pattern-2/confs/apim-gw-manager-worker/repository/conf/jndi.properties +++ /dev/null @@ -1,29 +0,0 @@ -# -# Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -# -# Licensed 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. -# - -# register some connection factories -# connectionfactory.[jndiname] = [ConnectionURL] -connectionfactory.TopicConnectionFactory = amqp://admin:admin@clientid/carbon?brokerlist='tcp://localhost:5672' - -connectionfactory.QueueConnectionFactory = amqp://admin:admin@clientID/test?brokerlist='tcp://localhost:5672' - -# register some queues in JNDI using the form -# queue.[jndiName] = [physicalName] -#queue.MyQueue = example.MyQueue - -# register some topics in JNDI using the form -# topic.[jndiName] = [physicalName] -topic.throttleData = throttleData diff --git a/pattern-2/confs/apim-gw-manager-worker/repository/conf/log4j.properties b/pattern-2/confs/apim-gw-manager-worker/repository/conf/log4j.properties deleted file mode 100755 index 55c79f90..00000000 --- a/pattern-2/confs/apim-gw-manager-worker/repository/conf/log4j.properties +++ /dev/null @@ -1,220 +0,0 @@ -# -# Copyright (c) 2005-2015, WSO2 Inc. (http://wso2.com) All Rights Reserved. -# -# Licensed 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. -# - -## -# This is the log4j configuration file used by WSO2 AM -# ===================================================== -# -# IMPORTANT : Please do not remove or change the names of any of the Appenders defined here. -# The layout pattern & log file can be changed using the WSO2 AM Management Console, and those -# settings will override the settings in this file. -## - - -# the root category is ERROR (applies for all 3rd party JARs etc) and will be logged to the -# LOG_APPENDER and the CONSOLE_APPENDER - -log4j.rootLogger=ERROR, CARBON_CONSOLE, CARBON_LOGFILE, CARBON_MEMORY, CARBON_SYS_LOG, ERROR_LOGFILE, DAS_AGENT - -log4j.logger.AUDIT_LOG=INFO, AUDIT_LOGFILE - -log4j.category.org.apache.synapse=INFO -log4j.category.org.apache.synapse.transport=INFO -log4j.category.org.apache.axis2=INFO -log4j.category.org.apache.axis2.transport=INFO -log4j.logger.com.atomikos=INFO,ATOMIKOS -log4j.logger.org.quartz=WARN -log4j.logger.org.wso2=INFO -log4j.logger.org.wso2.carbon=INFO -#log4j.category.org.apache.synapse.transport.nhttp.util=DEBUG -#log4j.category.org.apache.http.impl.nio.reactor=DEBUG -#log4j.logger.org.wso2.carbon.utils.deployment.ComponentBuilder=DEBUG -#log4j.logger.org.wso2.carbon.utils.deployment.OSGiBundleDeployer=DEBUG -log4j.logger.org.apache.catalina=WARN -log4j.logger.org.apache.coyote=WARN -log4j.logger.org.apache.axis2.enterprise=FATAL -log4j.logger.de.hunsicker.jalopy.io=FATAL - -# uncomment the following logs to see HTTP headers and messages -#log4j.logger.org.apache.synapse.transport.http.headers=DEBUG -#log4j.logger.org.apache.synapse.transport.http.wire=DEBUG - -# qpid related logs for the message broker -log4j.logger.qpid=WARN -log4j.logger.org.apache.qpid=WARN -log4j.logger.org.apache.qpid.server.Main=INFO -log4j.logger.qpid.message=WARN -log4j.logger.qpid.message.broker.listening=INFO -log4j.logger.org.wso2.carbon.databridge.agent.thrift.AsyncDataPublisher=WARN - -# The console appender is used to display general information at console -log4j.appender.CARBON_CONSOLE=org.wso2.carbon.utils.logging.appenders.CarbonConsoleAppender -log4j.appender.CARBON_CONSOLE.layout=org.apache.log4j.PatternLayout -log4j.appender.CARBON_CONSOLE.layout.ConversionPattern=[%d{ISO8601}] %5p - %c{1} %m%n - -# Configure the service logger at INFO level. Writes only run-time/mediation-time audit messages -log4j.category.SERVICE_LOGGER=INFO, SERVICE_APPENDER -log4j.additivity.SERVICE_LOGGER=false -log4j.appender.SERVICE_APPENDER=org.apache.log4j.RollingFileAppender -log4j.appender.SERVICE_APPENDER.File=${carbon.home}/repository/logs/${instance.log}/wso2-apigw-service${instance.log}.log -log4j.appender.SERVICE_APPENDER.MaxFileSize=1000KB -log4j.appender.SERVICE_APPENDER.MaxBackupIndex=10 -log4j.appender.SERVICE_APPENDER.layout=org.apache.log4j.PatternLayout -log4j.appender.SERVICE_APPENDER.layout.ConversionPattern=%d{ISO8601} [%X{ip}-%X{host}] [%t] %5p %c{1} %m%n - -# The trace logger dumps enough information @INFO level, but maybe pushed upto TRACE. -# Writes only run-time/mediation time tracing/debug messages for messages passing through trace -# enabled sequences, mediators and services. Enabling tracing on these has a performance impact -log4j.category.TRACE_LOGGER=INFO, TRACE_APPENDER, TRACE_MEMORYAPPENDER -log4j.additivity.TRACE_LOGGER=false -log4j.appender.TRACE_APPENDER=org.apache.log4j.DailyRollingFileAppender -log4j.appender.TRACE_APPENDER.File=${carbon.home}/repository/logs/${instance.log}/wso2-apigw-trace${instance.log}.log -log4j.appender.TRACE_APPENDER.Append=true -log4j.appender.TRACE_APPENDER.layout=org.apache.log4j.PatternLayout -log4j.appender.TRACE_APPENDER.layout.ConversionPattern=%d{HH:mm:ss,SSS} [%X{ip}-%X{host}] [%t] %5p %c{1} %m%n - -# The memory appender for trace logger -log4j.appender.TRACE_MEMORYAPPENDER=org.wso2.carbon.utils.logging.appenders.MemoryAppender -log4j.appender.TRACE_MEMORYAPPENDER.bufferSize=2000 -log4j.appender.TRACE_MEMORYAPPENDER.layout=org.apache.log4j.PatternLayout -log4j.appender.TRACE_MEMORYAPPENDER.layout.ConversionPattern=%d{HH:mm:ss,SSS} [%X{ip}-%X{host}] [%t] %5p %m%n - -# CARBON_LOGFILE is set to be a DailyRollingFileAppender using a PatternLayout. -log4j.appender.CARBON_LOGFILE=org.wso2.carbon.utils.logging.appenders.CarbonDailyRollingFileAppender -# Log file will be overridden by the configuration setting in the DB -# This path should be relative to WSO2 Carbon Home -log4j.appender.CARBON_LOGFILE.File=${carbon.home}/repository/logs/${instance.log}/wso2carbon${instance.log}.log -log4j.appender.CARBON_LOGFILE.Append=true -log4j.appender.CARBON_LOGFILE.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout -# ConversionPattern will be overridden by the configuration setting in the DB -log4j.appender.CARBON_LOGFILE.layout.ConversionPattern=TID: [%T] [%S] [%d] %P%5p {%c} - %x %m {%c}%n -log4j.appender.CARBON_LOGFILE.layout.TenantPattern=%U%@%D [%T] [%S] -log4j.appender.CARBON_LOGFILE.threshold=DEBUG - -# The standard error log where all the warnings, errors and fatal errors will be logged -log4j.appender.ERROR_LOGFILE=org.apache.log4j.FileAppender -log4j.appender.ERROR_LOGFILE.File=${carbon.home}/repository/logs/${instance.log}/wso2-apigw-errors.log -log4j.appender.ERROR_LOGFILE.layout=org.apache.log4j.PatternLayout -log4j.appender.ERROR_LOGFILE.layout.ConversionPattern=%d{ISO8601} [%X{ip}-%X{host}] [%t] %5p %c{1} %m%n -log4j.appender.ERROR_LOGFILE.threshold=WARN - -# The memory appender for logging -log4j.appender.CARBON_MEMORY=org.wso2.carbon.logging.service.appender.CarbonMemoryAppender -log4j.appender.CARBON_MEMORY.bufferSize=2000 -log4j.appender.CARBON_MEMORY.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout -# ConversionPattern will be overridden by the configuration setting in the DB -log4j.appender.CARBON_MEMORY.layout.ConversionPattern=TID: [%T] [%S] [%d] %P%5p {%c} - %x %m {%c}%n -log4j.appender.CARBON_MEMORY.layout.TenantPattern=%U%@%D [%T] [%S] -log4j.appender.CARBON_MEMORY.columnList=%T,%S,%A,%d,%c,%p,%m,%H,%I,%Stacktrace -log4j.appender.CARBON_MEMORY.threshold=DEBUG - -# LOGEVENT is set to be a LogEventAppender using a PatternLayout to send logs to LOGEVENT -log4j.appender.LOGEVENT=org.wso2.carbon.logging.appender.LogEventAppender -log4j.appender.LOGEVENT.url=tcp://localhost:7611 -log4j.appender.LOGEVENT.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout -log4j.appender.LOGEVENT.columnList=%T,%S,%A,%d,%c,%p,%m,%I,%Stacktrace -log4j.appender.LOGEVENT.userName=admin -log4j.appender.LOGEVENT.password=admin -log4j.appender.LOGEVENT.processingLimit=1000 -log4j.appender.LOGEVENT.maxTolerableConsecutiveFailure=20 - - -log4j.appender.CARBON_SYS_LOG = org.apache.log4j.net.SyslogAppender -log4j.appender.CARBON_SYS_LOG.layout=org.apache.log4j.PatternLayout -log4j.appender.CARBON_SYS_LOG.layout.ConversionPattern=[%d] %5p - %x %m {%c}%n -log4j.appender.CARBON_SYS_LOG.SyslogHost=localhost -log4j.appender.CARBON_SYS_LOG.Facility=USER -log4j.appender.CARBON_SYS_LOG.threshold=DEBUG - -# LOGEVENT is set to be a LogEventAppender using a PatternLayout to send logs to LOGEVENT -log4j.appender.LOGEVENT=org.wso2.carbon.logging.appender.LogEventAppender -log4j.appender.LOGEVENT.url=tcp://localhost:7611 -log4j.appender.LOGEVENT.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout -log4j.appender.LOGEVENT.columnList=%T,%S,%A,%d,%c,%p,%m,%H,%I,%Stacktrace -log4j.appender.LOGEVENT.userName=admin -log4j.appender.LOGEVENT.password=admin - -log4j.logger.org.apache.directory.shared.ldap=WARN, CARBON_CONSOLE -log4j.logger.org.apache.directory.server.ldap.handlers=WARN, CARBON_CONSOLE -log4j.logger.org.apache.directory.shared.ldap.entry.DefaultServerAttribute=FATAL, CARBON_CONSOLE -log4j.logger.org.apache.directory.shared.ldap.ldif.LdifReader=ERROR, CARBON_CONSOLE -log4j.logger.org.apache.directory.server.ldap.LdapProtocolHandler=ERROR, CARBON_CONSOLE - -## Trace Logger configuration which will append to a XMPP chatroom or JID ## -#log4j.appender.XMPP_APPENDER=org.wso2.carbon.utils.logging.IMAppender -#log4j.appender.XMPP_APPENDER.host=jabber.org -#log4j.appender.XMPP_APPENDER.username=wso2esb -#log4j.appender.XMPP_APPENDER.password=wso2esb -#log4j.appender.XMPP_APPENDER.recipient=ruwan@jabber.org -#log4j.appender.XMPP_APPENDER.layout=org.apache.log4j.PatternLayout -#log4j.appender.XMPP_APPENDER.layout.ConversionPattern=[%X{host}] [%t] %-5p [%d{HH:mm:ss,SSS}] %C{1} - %m%n - -# Appender config to AUDIT_LOGFILE -log4j.appender.AUDIT_LOGFILE=org.apache.log4j.DailyRollingFileAppender -log4j.appender.AUDIT_LOGFILE.File=${carbon.home}/repository/logs/audit.log -log4j.appender.AUDIT_LOGFILE.Append=true -log4j.appender.AUDIT_LOGFILE.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout -log4j.appender.AUDIT_LOGFILE.layout.ConversionPattern=[%d] %P%5p - %x %m %n -log4j.appender.AUDIT_LOGFILE.layout.TenantPattern=%U%@%D [%T] [%S] -log4j.appender.AUDIT_LOGFILE.threshold=INFO -log4j.additivity.AUDIT_LOG=false - -# Appender config to send Atomikos transaction logs to new log file tm.out. -log4j.appender.ATOMIKOS = org.apache.log4j.RollingFileAppender -log4j.appender.ATOMIKOS.File = repository/logs/tm.out -log4j.appender.ATOMIKOS.Append = true -log4j.appender.ATOMIKOS.layout = org.apache.log4j.PatternLayout -log4j.appender.ATOMIKOS.layout.ConversionPattern=%p %t %c - %m%n -log4j.additivity.com.atomikos=false - -# DAS_AGENT is set to be a Custom Log Appender. -log4j.appender.DAS_AGENT=org.wso2.carbon.analytics.shared.data.agents.log4j.appender.LogEventAppender -# DAS_AGENT uses PatternLayout. -log4j.appender.DAS_AGENT.layout=org.wso2.carbon.analytics.shared.data.agents.log4j.util.TenantAwarePatternLayout -log4j.appender.DAS_AGENT.columnList=%D,%S,%A,%d,%c,%p,%m,%H,%I,%Stacktrace -log4j.appender.DAS_AGENT.userName=admin -log4j.appender.DAS_AGENT.password=admin -log4j.appender.DAS_AGENT.url=tcp://wso2apim-analytics-1:7612|tcp://wso2apim-analytics-2:7612 -log4j.appender.DAS_AGENT.maxTolerableConsecutiveFailure=5 -log4j.appender.DAS_AGENT.streamDef=loganalyzer:1.0.0 -log4j.logger.trace.messages=TRACE,CARBON_TRACE_LOGFILE - -# Appender config to CARBON_TRACE_LOGFILE -log4j.appender.CARBON_TRACE_LOGFILE=org.apache.log4j.DailyRollingFileAppender -log4j.appender.CARBON_TRACE_LOGFILE.File=${carbon.home}/repository/logs/${instance.log}/wso2carbon-trace-messages${instance.log}.log -log4j.appender.CARBON_TRACE_LOGFILE.Append=true -log4j.appender.CARBON_TRACE_LOGFILE.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout -log4j.appender.CARBON_TRACE_LOGFILE.layout.ConversionPattern=[%d] %P%5p {%c} - %x %m %n -log4j.appender.CARBON_TRACE_LOGFILE.layout.TenantPattern=%U%@%D [%T] [%S] -log4j.appender.CARBON_TRACE_LOGFILE.threshold=TRACE -log4j.additivity.trace.messages=false - - -# The event trace logger dumps enough information @INFO level, but maybe pushed upto TRACE. -# Writes only run-time/event processing time tracing/debug messages for event passing through trace -# enabled transport adapters event formatters, builders and processors. Enabling event tracing on these has a performance impact -log4j.category.EVENT_TRACE_LOGGER=INFO, EVENT_TRACE_APPENDER, EVENT_TRACE_MEMORYAPPENDER -log4j.additivity.EVENT_TRACE_LOGGER=false -log4j.appender.EVENT_TRACE_APPENDER=org.apache.log4j.DailyRollingFileAppender -log4j.appender.EVENT_TRACE_APPENDER.File=${carbon.home}/repository/logs/${instance.log}/wso2-cep-trace${instance.log}.log -log4j.appender.EVENT_TRACE_APPENDER.Append=true -log4j.appender.EVENT_TRACE_APPENDER.layout=org.apache.log4j.PatternLayout -log4j.appender.EVENT_TRACE_APPENDER.layout.ConversionPattern=%d{HH:mm:ss,SSS} [%X{ip}-%X{host}] [%t] %5p %c{1} %m%n -# The memory appender for trace logger -log4j.appender.EVENT_TRACE_MEMORYAPPENDER=org.wso2.carbon.utils.logging.appenders.MemoryAppender -log4j.appender.EVENT_TRACE_MEMORYAPPENDER.bufferSize=2000 -log4j.appender.EVENT_TRACE_MEMORYAPPENDER.layout=org.apache.log4j.PatternLayout -log4j.appender.EVENT_TRACE_MEMORYAPPENDER.layout.ConversionPattern=%d{HH:mm:ss,SSS} [%X{ip}-%X{host}] [%t] %5p %m%n diff --git a/pattern-2/confs/apim-gw-manager-worker/repository/conf/security/Owasp.CsrfGuard.Carbon.properties b/pattern-2/confs/apim-gw-manager-worker/repository/conf/security/Owasp.CsrfGuard.Carbon.properties deleted file mode 100755 index 466aa73b..00000000 --- a/pattern-2/confs/apim-gw-manager-worker/repository/conf/security/Owasp.CsrfGuard.Carbon.properties +++ /dev/null @@ -1,471 +0,0 @@ -# The OWASP CSRFGuard Project, BSD License -# Eric Sheridan (eric@infraredsecurity.com), Copyright (c) 2011 -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# -# 1. Redistributions of source code must retain the above copyright notice, -# this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. Neither the name of OWASP nor the names of its contributors may be used -# to endorse or promote products derived from this software without specific -# prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -# From: https://github.com/esheri3/OWASP-CSRFGuard/blob/master/csrfguard-test/src/main/webapp/WEB-INF/csrfguard.properties - -# Common substitutions -# %servletContext% is the servlet context (e.g. the configured app prefix or war file name, or blank. -# e.g. if you deploy a default warfile as someApp.war, then %servletContext% will be /someApp -# if there isnt a context it will be the empty string. So to use this in the configuration, use e.g. %servletContext%/something.html -# which will translate to e.g. /someApp/something.html - -# Logger -# -# The logger property (org.owasp.csrfguard.Logger) defines the qualified class name of -# the object responsible for processing all log messages produced by CSRFGuard. The default -# CSRFGuard logger is org.owasp.csrfguard.log.ConsoleLogger. This class logs all messages -# to System.out which JavaEE application servers redirect to a vendor specific log file. -# Developers can customize the logging behavior of CSRFGuard by implementing the -# org.owasp.csrfguard.log.ILogger interface and setting the logger property to the new -# logger's qualified class name. The following configuration snippet instructs OWASP CSRFGuard -# to capture all log messages to the console: -# -# org.owasp.csrfguard.Logger=org.owasp.csrfguard.log.ConsoleLogger -org.owasp.csrfguard.Logger=org.owasp.csrfguard.log.JavaLogger - -# Which configuration provider factory you want to use. The default is org.owasp.csrfguard.config.PropertiesConfigurationProviderFactory -# Another configuration provider has more features including config overlays: org.owasp.csrfguard.config.overlay.ConfigurationOverlayProviderFactory -# The default configuration provider is: org.owasp.csrfguard.config.overlay.ConfigurationAutodetectProviderFactory -# which will look for an overlay file, it is there, and the factory inside that file is set it will use it, otherwise will be PropertiesConfigurationProviderFactory -# it needs to implement org.owasp.csrfguard.config.ConfigurationProviderFactory -org.owasp.csrfguard.configuration.provider.factory = org.owasp.csrfguard.config.overlay.ConfigurationAutodetectProviderFactory - - -# If csrfguard filter is enabled -org.owasp.csrfguard.Enabled = true - -# If csrf guard filter should check even if there is no session for the user -# Note: this changed around 2014/04, the default behavior used to be to -# not check if there is no session. If you want the legacy behavior (if your app -# is not susceptible to CSRF if the user has no session), set this to false -org.owasp.csrfguard.ValidateWhenNoSessionExists = true - -# New Token Landing Page -# -# The new token landing page property (org.owasp.csrfguard.NewTokenLandingPage) defines where -# to send a user if the token is being generated for the first time, and the use new token landing -# page boolean property (org.owasp.csrfguard.UseNewTokenLandingPage) determines if any redirect happens. -# UseNewTokenLandingPage defaults to false if NewTokenLandingPage is not specified, and to true -# if it is specified.. If UseNewTokenLandingPage is set true then this request is generated -# using auto-posting forms and will only contain the CSRF prevention token parameter, if -# applicable. All query-string or form parameters sent with the original request will be -# discarded. If this property is not defined, CSRFGuard will instead auto-post the user to the -# original context and servlet path. The following configuration snippet instructs OWASP CSRFGuard to -# redirect the user to %servletContext%/index.html when the user visits a protected resource -# without having a corresponding CSRF token present in the HttpSession object: -# -# org.owasp.csrfguard.NewTokenLandingPage=%servletContext%/index.html - - -# Protected Methods -# -# The protected methods property (org.owasp.csrfguard.ProtectedMethods) defines a comma -# separated list of HTTP request methods that should be protected by CSRFGuard. The default -# list is an empty list which will cause all HTTP methods to be protected, thus preserving -# legacy behavior. This setting allows the user to inform CSRFGuard that only requests of the -# given types should be considered for protection. All HTTP methods not in the list will be -# considered safe (i.e. view only / unable to modify data). This should be used only when the -# user has concrete knowledge that all requests made via methods not in the list -# are safe (i.e. do not apply an action to any data) since it can actually introduce new -# security vulnerabilities. For example: the user thinks that all actionable requests are -# only available by POST requests when in fact some are available via GET requests. If the -# user has excluded GET requests from the list then they have introduced a vulnerability. -# The following configuration snippet instructs OWASP CSRFGuard to protect only the POST, -# PUT, and DELETE HTTP methods. -# -# org.owasp.csrfguard.ProtectedMethods=POST,PUT,DELETE - -# or you can configure all to be protected, and specify which is unprotected. This is the preferred approach - -# WSO2 : Since state-changing operations are not performed via HTTP GET, -# disabling CSRF validation for GET method. -org.owasp.csrfguard.UnprotectedMethods=GET - -# Unique Per-Page Tokens -# -# The unique token per-page property (org.owasp.csrfguard.TokenPerPage) is a boolean value that -# determines if CSRFGuard should make use of unique per-page (i.e. URI) prevention tokens as -# opposed to unique per-session prevention tokens. When a user requests a protected resource, -# CSRFGuard will determine if a page specific token has been previously generated. If a page -# specific token has not yet been previously generated, CSRFGuard will verify the request was -# submitted with the per-session token intact. After verifying the presence of the per-session token, -# CSRFGuard will create a page specific token that is required for all subsequent requests to the -# associated resource. The per-session CSRF token can only be used when requesting a resource for -# the first time. All subsequent requests must have the per-page token intact or the request will -# be treated as a CSRF attack. This behavior can be changed with the org.owasp.csrfguard.TokenPerPagePrecreate -# property. Enabling this property will make CSRFGuard calculate the per page token prior to a first -# visit. This option only works with JSTL token injection and is useful for preserving the validity of -# links if the user pushes the back button. There may be a performance impact when enabling this option -# if the .jsp has a large number of proctected links that need tokens to be calculated. -# Use of the unique token per page property is currently experimental -# but provides a significant amount of improved security. Consider the exposure of a CSRF token using -# the legacy unique per-session model. Exposure of this token facilitates the attacker's ability to -# carry out a CSRF attack against the victim's active session for any resource exposed by the web -# application. Now consider the exposure of a CSRF token using the experimental unique token per-page -# model. Exposure of this token would only allow the attacker to carry out a CSRF attack against the -# victim's active session for a small subset of resources exposed by the web application. Use of the -# unique token per-page property is a strong defense in depth strategy significantly reducing the -# impact of exposed CSRF prevention tokens. The following configuration snippet instructs OWASP -# CSRFGuard to utilize the unique token per-page model: -# -# org.owasp.csrfguard.TokenPerPage=true -# org.owasp.csrfguard.TokenPerPagePrecreate=false - -# WSO2 : Considering overhead, necessity, as well as current unintended behaviour -# of library after blocking a CSRF attack, disabling per-page tokens. -org.owasp.csrfguard.TokenPerPage=false -org.owasp.csrfguard.TokenPerPagePrecreate=false - -# Token Rotation -# -# The rotate token property (org.owasp.csrfguard.Rotate) is a boolean value that determines if -# CSRFGuard should generate and utilize a new token after verifying the previous token. Rotation -# helps minimize the window of opportunity an attacker has to leverage the victim's stolen token -# in a targeted CSRF attack. However, this functionality generally causes navigation problems in -# most applications. Specifically, the 'Back' button in the browser will often cease to function -# properly. When a user hits the 'Back' button and interacts with the HTML, the browser may submit -# an old token causing CSRFGuard to incorrectly believe this request is a CSRF attack in progress -# (i.e. a 'false positive'). Users can prevent this scenario by preventing the caching of HTML pages -# containing FORM submissions using the cache-control header. However, this may also introduce -# performance problems as the browser will have to request HTML on a more frequent basis. The following -# configuration snippet enables token rotation: -# -# org.owasp.csrfguard.Rotate=true - -# Ajax and XMLHttpRequest Support -# -# The Ajax property (org.owasp.csrfguard.Ajax) is a boolean value that indicates whether or not OWASP -# CSRFGuard should support the injection and verification of unique per-session prevention tokens for -# XMLHttpRequests. To leverage Ajax support, the user must not only set this property to true but must -# also reference the JavaScript DOM Manipulation code using a script element. This dynamic script will -# override the send method of the XMLHttpRequest object to ensure the submission of an X-Requested-With -# header name value pair coupled with the submission of a custom header name value pair for each request. -# The name of the custom header is the value of the token name property and the value of the header is -# always the unique per-session token value. This custom header is analogous to the HTTP parameter name -# value pairs submitted via traditional GET and POST requests. If the X-Requested-With header was sent -# in the HTTP request, then CSRFGuard will look for the presence and ensure the validity of the unique -# per-session token in the custom header name value pair. Note that verification of these headers takes -# precedence over verification of the CSRF token supplied as an HTTP parameter. More specifically, -# CSRFGuard does not verify the presence of the CSRF token if the Ajax support property is enabled and -# the corresponding X-Requested-With and custom headers are embedded within the request. The following -# configuration snippet instructs OWASP CSRFGuard to support Ajax requests by verifying the presence and -# correctness of the X-Requested-With and custom headers: -# -# org.owasp.csrfguard.Ajax=true -org.owasp.csrfguard.Ajax=true - -# The default behavior of CSRFGuard is to protect all pages. Pages marked as unprotected will not be protected. -# If the Protect property is enabled, this behavior is reversed. Pages must be marked as protected to be protected. -# All other pages will not be protected. This is useful when the CsrfGuardFilter is aggressively mapped (ex: /*), -# but you only want to protect a few pages. -# -# org.owasp.csrfguard.Protect=true - -# Unprotected Pages: -# -# The unprotected pages property (org.owasp.csrfguard.unprotected.*) defines a series of pages that -# should not be protected by CSRFGuard. Such configurations are useful when the CsrfGuardFilter is -# aggressively mapped (ex: /*). The syntax of the property name is org.owasp.csrfguard.unprotected.[PageName], -# where PageName is some arbitrary identifier that can be used to reference a resource. The syntax of -# defining the uri of unprotected pages is the same as the syntax used by the JavaEE container for uri mapping. -# Specifically, CSRFGuard will identify the first match (if any) between the requested uri and an unprotected -# page in order of declaration. Match criteria is as follows: -# -# Case 1: exact match between request uri and unprotected page -# Case 2: longest path prefix match, beginning / and ending /* -# Case 3: extension match, beginning *. -# Case 4: if the value starts with ^ and ends with $, it will be evaulated as a regex. Note that before the -# regex is compiled, any common variables will be substituted (e.g. %servletContext%) -# Default: requested resource must be validated by CSRFGuard -# -# The following code snippet illustrates the four use cases over four examples. The first two examples -# (Tag and JavaScriptServlet) look for direct URI matches. The third example (Html) looks for all resources -# ending in a .html extension. The next example (Public) looks for all resources prefixed with the URI path /MySite/Public/*. -# The last example looks for resources that end in Public.do -# -# org.owasp.csrfguard.unprotected.Tag=%servletContext%/tag.jsp -# org.owasp.csrfguard.unprotected.JavaScriptServlet=%servletContext%/JavaScriptServlet -# org.owasp.csrfguard.unprotected.Html=*.html -# org.owasp.csrfguard.unprotected.Public=%servletContext%/Public/* -# regex example starts with ^ and ends with $, and the %servletContext% is evaluated before the regex -# org.owasp.csrfguard.unprotected.PublicServlet=^%servletContext%/.*Public\.do$ - -#org.owasp.csrfguard.unprotected.Default=%servletContext%/ -#org.owasp.csrfguard.unprotected.Upload=%servletContext%/upload.html -#org.owasp.csrfguard.unprotected.JavaScriptServlet=%servletContext%/JavaScriptServlet -#org.owasp.csrfguard.unprotected.Ajax=%servletContext%/ajax.html -#org.owasp.csrfguard.unprotected.Error=%servletContext%/error.html -#org.owasp.csrfguard.unprotected.Index=%servletContext%/index.html -#org.owasp.csrfguard.unprotected.JavaScript=%servletContext%/javascript.html -#org.owasp.csrfguard.unprotected.Tag=%servletContext%/tag.jsp -#org.owasp.csrfguard.unprotected.Redirect=%servletContext%/redirect.jsp -#org.owasp.csrfguard.unprotected.Forward=%servletContext%/forward.jsp -#org.owasp.csrfguard.unprotected.Session=%servletContext%/session.jsp - -# Actions: Responding to Attacks -# -# The actions directive (org.owasp.csrfguard.action.*) gives the user the ability to specify one or more -# actions that should be invoked when a CSRF attack is detected. Every action must implement the -# org.owasp.csrfguard.action.IAction interface either directly or indirectly through the -# org.owasp.csrfguard.action.AbstractAction helper class. Many actions accept parameters that can be specified -# along with the action class declaration. These parameters are consumed at runtime and impact the behavior of -# the associated action. -# -# The syntax for defining and configuring CSRFGuard actions is relatively straight forward. Let us assume we wish -# to redirect the user to a default page when a CSRF attack is detected. A redirect action already exists within -# the CSRFGuard bundle and is available via the class name org.owasp.csrfguard.actions.Redirect. In order to enable -# this action, we capture the following declaration in the Owasp.CsrfGuard.properties file: -# -# syntax: org.owasp.csrfguard.action.[actionName]=[className] -# example: org.owasp.csrfguard.action.class.Redirect=org.owasp.csrfguard.actions.Redirect -# -# The aforementioned directive declares an action called "Redirect" (i.e. [actionName]) referencing the Java class -# "org.owasp.csrfguard.actions.Redirect" (i.e. [className]). Anytime a CSRF attack is detected, the Redirect action -# will be executed. You may be asking yourself, "but how do I specify where the user is redirected?"; this is where -# action parameters come into play. In order to specify the redirect location, we capture the following declaration -# in the Owasp.CsrfGuard.properties file: -# -# syntax: org.owasp.csrfguard.action.[actionName].[parameterName]=[parameterValue] -# example: org.owasp.csrfguard.action.Redirect.ErrorPage=%servletContext%/error.html -# -# The aforementioned directive declares an action parameter called "ErrorPage" (i.e. [parameterName]) with the value -# of "%servletContext%/error.html" (i.e. [parameterValue]) for the action "Redirect" (i.e. [actionName]). The -# Redirect action expects the "ErrorPage" parameter to be defined and will redirect the user to this location when -# an attack is detected. -# -#org.owasp.csrfguard.action.Empty=org.owasp.csrfguard.action.Empty -org.owasp.csrfguard.action.Log=org.owasp.csrfguard.action.Log -org.owasp.csrfguard.action.Log.Message=potential cross-site request forgery (CSRF) attack thwarted (user:%user%, ip:%remote_ip%, method:%request_method%, uri:%request_uri%, error:%exception_message%) -#org.owasp.csrfguard.action.Invalidate=org.owasp.csrfguard.action.Invalidate - -# WSO2 : Disable redirecting user to an error page after blocking a CSRF attack -#org.owasp.csrfguard.action.Redirect=org.owasp.csrfguard.action.Redirect -#org.owasp.csrfguard.action.Redirect.Page=%servletContext%/error.html - -#org.owasp.csrfguard.action.RequestAttribute=org.owasp.csrfguard.action.RequestAttribute -#org.owasp.csrfguard.action.RequestAttribute.AttributeName=Owasp_CsrfGuard_Exception_Key - -# WSO2 : Disabling token rotation after blocking a CSRF attack, since this behaviour -# will break back navigation after blocking an attack. -#org.owasp.csrfguard.action.Rotate=org.owasp.csrfguard.action.Rotate - -#org.owasp.csrfguard.action.SessionAttribute=org.owasp.csrfguard.action.SessionAttribute -#org.owasp.csrfguard.action.SessionAttribute.AttributeName=Owasp_CsrfGuard_Exception_Key - -# WSO2 : Enable sending a 403 error after blocking a CSRF attack. Product teams -# can add error page that handles 403 or “org.owasp.csrfguard.action.Error” to -# display custom error pages. -org.owasp.csrfguard.action.Error=org.owasp.csrfguard.action.Error -org.owasp.csrfguard.action.Error.Code=403 -org.owasp.csrfguard.action.Error.Message=Security violation. - -# Token Name -# -# The token name property (org.owasp.csrfguard.TokenName) defines the name of the HTTP parameter -# to contain the value of the OWASP CSRFGuard token for each request. The following configuration -# snippet sets the CSRFGuard token parameter name to the value OWASP_CSRFTOKEN: -# -# org.owasp.csrfguard.TokenName=OWASP_CSRFTOKEN - -# WSO2 : Since, CSRFGuard will send relevant token name as HTTP header -# “X-” prefix was added to express that this is a non-standard header. -org.owasp.csrfguard.TokenName=X-CSRF-Token - -# Session Key -# -# The session key property (org.owasp.csrfguard.SessionKey) defines the string literal used to save -# and lookup the CSRFGuard token from the session. This value is used by the filter and the tag -# libraries to retrieve and set the token value in the session. Developers can use this key to -# programmatically lookup the token within their own code. The following configuration snippet sets -# the session key to the value OWASP_CSRFTOKEN: -# -# org.owasp.csrfguard.SessionKey=OWASP_CSRFTOKEN -org.owasp.csrfguard.SessionKey=OWASP_CSRFTOKEN - -# Token Length -# -# The token length property (org.owasp.csrfguard.TokenLength) defines the number of characters that -# should be found within the CSRFGuard token. Note that characters are delimited by dashes (-) in groups -# of four. For cosmetic reasons, users are encourage to ensure the token length is divisible by four. -# The following configuration snippet sets the token length property to 32 characters: -# -# org.owasp.csrfguard.TokenLength=32 -org.owasp.csrfguard.TokenLength=32 - -# Pseudo-random Number Generator -# -# The pseudo-random number generator property (org.owasp.csrfguard.PRNG) defines what PRNG should be used -# to generate the OWASP CSRFGuard token. Always ensure this value references a cryptographically strong -# pseudo-random number generator algorithm. The following configuration snippet sets the pseudo-random number -# generator to SHA1PRNG: -# -# org.owasp.csrfguard.PRNG=SHA1PRNG -org.owasp.csrfguard.PRNG=SHA1PRNG - -# Pseudo-random Number Generator Provider - -# The pseudo-random number generator provider property (org.owasp.csrfguard.PRNG.Provider) defines which -# provider's implementation of org.owasp.csrfguard.PRNG we should utilize. The following configuration -# snippet instructs the JVM to leverage SUN's implementation of the algorithm denoted by the -# org.owasp.csrfguard.PRNG property: - -# org.owasp.csrfguard.PRNG.Provider=SUN -# WSO2 - Pseudo-random number generator provider should be configured based on -# environment (SUN/IBMJCE) -org.owasp.csrfguard.PRNG.Provider=SUN - -# If not specifying the print config option in the web.xml, you can specify it here, to print the config -# on startup - -# WSO2 : Disable printing configuration during start-up -org.owasp.csrfguard.Config.Print = false - -########################### -## Javascript servlet settings if not set in web.xml -## https://www.owasp.org/index.php/CSRFGuard_3_Token_Injection -########################### - -# leave this blank and blank in web.xml and it will read from META-INF/csrfguard.js from the jarfile -# Denotes the location of the JavaScript template file that should be consumed and dynamically -# augmented by the JavaScriptServlet class. The default value is WEB-INF/Owasp.CsrfGuard.js. -# Use of this property and the existence of the specified template file is required. -org.owasp.csrfguard.JavascriptServlet.sourceFile = - -# Boolean value that determines whether or not the dynamic JavaScript code should be strict -# with regards to what links it should inject the CSRF prevention token. With a value of true, -# the JavaScript code will only place the token in links that point to the same exact domain -# from which the HTML originated. With a value of false, the JavaScript code will place the -# token in links that not only point to the same exact domain from which the HTML originated, -# but sub-domains as well. -org.owasp.csrfguard.JavascriptServlet.domainStrict = true - -# Allows the developer to specify the value of the Cache-Control header in the HTTP response -# when serving the dynamic JavaScript file. The default value is private, maxage=28800. -# Caching of the dynamic JavaScript file is intended to minimize traffic and improve performance. -# Note that the Cache-Control header is always set to "no-store" when either the "Rotate" -# "TokenPerPage" options is set to true in Owasp.CsrfGuard.properties. -org.owasp.csrfguard.JavascriptServlet.cacheControl = private, maxage=28800 - -# Allows the developer to specify a regular expression describing the required value of the -# Referer header. Any attempts to access the servlet with a Referer header that does not -# match the captured expression is discarded. Inclusion of referer header checking is to -# help minimize the risk of JavaScript Hijacking attacks that attempt to steal tokens from -# the dynamically generated JavaScript. While the primary defenses against JavaScript -# Hijacking attacks are implemented within the dynamic JavaScript itself, referer header -# checking is implemented to achieve defense in depth. -org.owasp.csrfguard.JavascriptServlet.refererPattern = .* - -# Similar to javascript servlet referer pattern, but this will make sure the referer of the -# javascript servlet matches the domain of the request. If there is no referer (proxy strips it?) -# then it will not fail. Generally this is a good idea to be true. -org.owasp.csrfguard.JavascriptServlet.refererMatchDomain = true - -# Boolean value that determines whether or not the dynamic JavaScript code should -# inject the CSRF prevention token as a hidden field into HTML forms. The default -# value is true. Developers are strongly discouraged from disabling this property -# as most server-side state changing actions are triggered via a POST request. -org.owasp.csrfguard.JavascriptServlet.injectIntoForms = true - -# if the token should be injected in GET forms (which will be on the URL) -# if the HTTP method GET is unprotected, then this should likely be false - -# WSO2 : Disable JavaScript from injecting token value to HTTP GET based forms. -# This prevents token leakage that could occur when sending token in URL. -# State-changing actions should not be performed over HTTP GET -org.owasp.csrfguard.JavascriptServlet.injectGetForms = false - -# if the token should be injected in the action in forms -# note, if injectIntoForms is true, then this might not need to be true - -# WSO2 : Disable JavaScript from injecting token value to form action. -# This prevents token leakage that could occur when sending token in URL. -org.owasp.csrfguard.JavascriptServlet.injectFormAttributes = false - - -# Boolean value that determines whether or not the dynamic JavaScript code should -# inject the CSRF prevention token in the query string of src and href attributes. -# Injecting the CSRF prevention token in a URL resource increases its general risk -# of exposure to unauthorized parties. However, most JavaEE web applications respond -# in the exact same manner to HTTP requests and their associated parameters regardless -# of the HTTP method. The risk associated with not protecting GET requests in this -# situation is perceived greater than the risk of exposing the token in protected GET -# requests. As a result, the default value of this attribute is set to true. Developers -# that are confident their server-side state changing controllers will only respond to -# POST requests (i.e. discarding GET requests) are strongly encouraged to disable this property. - -# WSO2 : Disable JavaScript from injecting token value to “src” and “href”. -# This prevents token leakage that could occur when sending token in URL. -org.owasp.csrfguard.JavascriptServlet.injectIntoAttributes = false - - -# WSO2 : Changing X-Request-With header text to avoid unnecessary information disclosure. -org.owasp.csrfguard.JavascriptServlet.xRequestedWith = WSO2 CSRF Protection - -########################### -## Config overlay settings if you have the provider above set to ConfigurationOverlayProvider -## This CSRF config provider uses Internet2 Configuration Overlays (documented on Internet2 wiki) -## By default the configuration is read from the Owasp.CsrfGuard.properties -## (which should not be edited), and the Owasp.CsrfGuard.overlay.properties overlays -## the base settings. See the Owasp.CsrfGuard.properties for the possible -## settings that can be applied to the Owasp.CsrfGuard.overlay.properties -########################### - -# comma separated config files that override each other (files on the right override the left) -# each should start with file: or classpath: -# e.g. classpath:Owasp.CsrfGuard.properties, file:c:/temp/myFile.properties -org.owasp.csrfguard.configOverlay.hierarchy = classpath:Owasp.CsrfGuard.properties, classpath:Owasp.CsrfGuard.overlay.properties - -# seconds between checking to see if the config files are updated -org.owasp.csrfguard.configOverlay.secondsBetweenUpdateChecks = 60 - - -########################### - - -# please remove the below entry to enable protection for services. - -#carbon -org.owasp.csrfguard.unprotected.Services=%servletContext%/services/* - -#identity -org.owasp.csrfguard.unprotected.oauth=%servletContext%/commonauth/* -org.owasp.csrfguard.unprotected.samlsso=%servletContext%/samlsso/* -org.owasp.csrfguard.unprotected.authenticationendpoint=%servletContext%/authenticationendpoint/* -org.owasp.csrfguard.unprotected.wso2=%servletContext%/wso2/* -org.owasp.csrfguard.unprotected.oauth2=%servletContext%/oauth2/* -org.owasp.csrfguard.unprotected.openid=%servletContext%/openid/* -org.owasp.csrfguard.unprotected.openidserver=%servletContext%/openidserver/* -org.owasp.csrfguard.unprotected.passivests=%servletContext%/passivests/* -org.owasp.csrfguard.unprotected.thrift=%servletContext%/thriftAuthenticator/* -org.owasp.csrfguard.unprotected.passivests=%servletContext%/passivests/* -org.owasp.csrfguard.unprotected.acs=%servletContext%/acs/* -org.owasp.csrfguard.unprotected.iwa=%servletContext%/iwa/* -org.owasp.csrfguard.unprotected.oauthiwa=%servletContext%/commonauth/iwa/* - -#apim -org.owasp.csrfguard.unprotected.publisher.rest.api=%servletContext%/api/am/publisher/* -org.owasp.csrfguard.unprotected.store.rest.api=%servletContext%/api/am/store/* diff --git a/pattern-2/confs/apim-gw-manager-worker/repository/conf/tomcat/catalina-server.xml b/pattern-2/confs/apim-gw-manager-worker/repository/conf/tomcat/catalina-server.xml deleted file mode 100755 index 742f4a31..00000000 --- a/pattern-2/confs/apim-gw-manager-worker/repository/conf/tomcat/catalina-server.xml +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pattern-2/confs/apim-gw-manager-worker/repository/conf/user-mgt.xml b/pattern-2/confs/apim-gw-manager-worker/repository/conf/user-mgt.xml deleted file mode 100755 index de5e9db7..00000000 --- a/pattern-2/confs/apim-gw-manager-worker/repository/conf/user-mgt.xml +++ /dev/null @@ -1,259 +0,0 @@ - - - - - - true - admin - - admin - admin - - everyone - true - jdbc/WSO2UM_DB - - - - - org.wso2.carbon.user.core.tenant.JDBCTenantManager - false - true - true - ^[\S]{3,30}$ - ^[\S]{3,30}$ - Username pattern policy violated - ^[\S]{5,30}$ - ^[\S]{5,30}$ - Password length should be within 5 to 30 characters - ^[\S]{3,30}$ - ^[\S]{3,30}$ - true - false - true - SHA-256 - true - , - 100 - 100 - true - false - - - - - - - - - - - - - /permission - true - false - - - - - diff --git a/pattern-2/confs/apim-is-as-km/repository/conf/axis2/axis2.xml b/pattern-2/confs/apim-is-as-km/repository/conf/axis2/axis2.xml deleted file mode 100644 index a261f1a5..00000000 --- a/pattern-2/confs/apim-is-as-km/repository/conf/axis2/axis2.xml +++ /dev/null @@ -1,728 +0,0 @@ - - - - - - - - - - - - - true - true - optional - true - work/mtom - 4000 - - ${childfirstCL} - - - true - - - true - - - - false - - inmemory - - - - - - - services - - - axis2services - - - axis2modules - - - WSO2 Identity Server-5.3.0 - - - WSO2 Identity Server-5.3.0 - - - - - - - false - - - - - - false - - - true - - - - ./repository/deployment/server/synapse-configs - - - - . - - - . - - - WSO2 Carbon Server - - - - - - - ${jaxwsparam} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 9763 - - - - - - - - - - - - 9443 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - HTTP/1.1 - chunked - - true - - - HTTP/1.1 - chunked - - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - kubernetes - org.wso2.carbon.membership.scheme.kubernetes.KubernetesMembershipScheme - wso2apim-km-clustering - wso2 - - - - - wso2.carbon.domain - - - - - - 45564 - - 100 - - 60 - - - - - - api-manager - - - - - - 4000 - - - - - - - - - - - - - - - - - - 127.0.0.1 - 4000 - - - - - - - - - diff --git a/pattern-2/confs/apim-is-as-km/repository/conf/carbon.xml b/pattern-2/confs/apim-is-as-km/repository/conf/carbon.xml deleted file mode 100755 index 50986486..00000000 --- a/pattern-2/confs/apim-is-as-km/repository/conf/carbon.xml +++ /dev/null @@ -1,684 +0,0 @@ - - - - - - - - WSO2 Identity Server - - - IS - - - 5.3.0 - - - wso2apim-is-as-km - - - wso2apim-is-as-km - - - local:/${carbon.context}/services/ - - - - - - - IdentityServer - - - - - - - org.wso2.carbon - - - / - - - - - - - - - 15 - - - - - - - - - 0 - - - - - 9999 - - 11111 - - - - - - 10389 - - 8000 - - - - - - 10500 - - - - - - - - - org.wso2.carbon.tomcat.jndi.CarbonJavaURLContextFactory - - - - - - - - - java - - - - - - - - - - false - - - false - - - 600 - - - - false - - - - - - - - 30 - - - - - - - - - 15 - - - - - - ${carbon.home}/repository/deployment/server/ - - - 15 - - - ${carbon.home}/repository/conf/axis2/axis2.xml - - - 30000 - - - ${carbon.home}/repository/deployment/client/ - - ${carbon.home}/repository/conf/axis2/axis2_client.xml - - true - - - - - - - - - - admin - Default Administrator Role - - - user - Default User Role - - - - - - - - - - - - ${carbon.home}/repository/resources/security/wso2carbon.jks - - JKS - - wso2carbon - - wso2carbon - - wso2carbon - - - - - - ${carbon.home}/repository/resources/security/client-truststore.jks - - JKS - - wso2carbon - - - - - - - - - - - - - - - - - - - UserManager - - - false - - org.wso2.carbon.identity.provider.AttributeCallbackHandler - - - org.wso2.carbon.identity.sts.store.DBTokenStore - - - true - allow - - - - - - -claim_mgt_menu -identity_mgt_emailtemplate_menu -identity_security_questions_menu - - - - ${carbon.home}/tmp/work - - - - - - true - - - 10 - - - 30 - - - - - - 100 - - - - keystore - certificate - * - - org.wso2.carbon.ui.transports.fileupload.AnyFileUploadExecutor - - - - - jarZip - - org.wso2.carbon.ui.transports.fileupload.JarZipUploadExecutor - - - - dbs - - org.wso2.carbon.ui.transports.fileupload.DBSFileUploadExecutor - - - - tools - - org.wso2.carbon.ui.transports.fileupload.ToolsFileUploadExecutor - - - - toolsAny - - org.wso2.carbon.ui.transports.fileupload.ToolsAnyFileUploadExecutor - - - - - - - - - - info - org.wso2.carbon.core.transports.util.InfoProcessor - - - wsdl - org.wso2.carbon.core.transports.util.Wsdl11Processor - - - wsdl2 - org.wso2.carbon.core.transports.util.Wsdl20Processor - - - xsd - org.wso2.carbon.core.transports.util.XsdProcessor - - - - - - false - false - true - svn - http://svnrepo.example.com/repos/ - username - password - true - - - - - - - - - - - - - - - ${require.carbon.servlet} - - - - - true - - - - - - - default repository - http://product-dist.wso2.com/p2/carbon/releases/wilkes/ - - - - - - - - true - - - - - - true - - diff --git a/pattern-2/confs/apim-is-as-km/repository/conf/datasources/master-datasources.xml b/pattern-2/confs/apim-is-as-km/repository/conf/datasources/master-datasources.xml deleted file mode 100644 index 6e0b4623..00000000 --- a/pattern-2/confs/apim-is-as-km/repository/conf/datasources/master-datasources.xml +++ /dev/null @@ -1,173 +0,0 @@ - - - - org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader - - - - - - WSO2_CARBON_DB - The datasource used for registry and user manager - - jdbc/WSO2CarbonDB - - - - jdbc:h2:repository/database/WSO2CARBON_DB;DB_CLOSE_ON_EXIT=FALSE - wso2carbon - wso2carbon - org.h2.Driver - 50 - 60000 - true - SELECT 1 - 30000 - - - - - - WSO2AM_DB - The datasource used for API Manager database - - jdbc/WSO2AM_DB - - - - jdbc:mysql://apim-rdbms:3306/apimgtdb?autoReconnect=true - root - root - false - com.mysql.jdbc.Driver - 50 - 60000 - true - SELECT 1 - 30000 - - - - - - WSO2UM_DB - The datasource used by user manager - - jdbc/WSO2UM_DB - - - - jdbc:mysql://apim-rdbms:3306/userdb?autoReconnect=true - root - root - com.mysql.jdbc.Driver - 50 - 60000 - true - SELECT 1 - 30000 - - - - - - WSO2REG_DB - The datasource used by the registry - - jdbc/WSO2REG_DB - - - - jdbc:mysql://apim-rdbms:3306/govregdb?autoReconnect=true - root - root - com.mysql.jdbc.Driver - 50 - 60000 - true - SELECT 1 - 30000 - - - - - - WSO2AM_STATS_DB - The datasource used for getting statistics to API Manager - - jdbc/WSO2AM_STATS_DB - - - - jdbc:h2:;AUTO_SERVER=TRUE - wso2carbon - wso2carbon - org.h2.Driver - 50 - 60000 - true - SELECT 1 - 30000 - - - - - - WSO2_MB_STORE_DB - The datasource used for message broker database - - WSO2MBStoreDB - - - - jdbc:h2:repository/database/WSO2MB_DB;DB_CLOSE_ON_EXIT=FALSE;LOCK_TIMEOUT=60000 - wso2carbon - wso2carbon - org.h2.Driver - 50 - 60000 - true - SELECT 1 - 30000 - false - - - - - - - - - diff --git a/pattern-2/confs/apim-is-as-km/repository/conf/registry.xml b/pattern-2/confs/apim-is-as-km/repository/conf/registry.xml deleted file mode 100644 index 59cd2450..00000000 --- a/pattern-2/confs/apim-is-as-km/repository/conf/registry.xml +++ /dev/null @@ -1,155 +0,0 @@ - - - - - - - - wso2registry - false - true - / - - - jdbc/WSO2CarbonDB - - - - jdbc/WSO2REG_DB - - - gov - root@jdbc:mysql://apim_rdbms:3306/regdb - govregistry - false - true - / - - - gov - /_system/governance - - - gov - /_system/config - - - - - application/xacml-policy+xml - - - - - - - - - - - - - false - 35 - 5 - - 40 - - 40 - - /_system/local/repository/components/org.wso2.carbon.registry/indexing/lastaccesstime - - - - - - - - - - - - - - - - - - - - - false - - - - true - true - true - true - - diff --git a/pattern-2/confs/apim-is-as-km/repository/conf/tomcat/catalina-server.xml b/pattern-2/confs/apim-is-as-km/repository/conf/tomcat/catalina-server.xml deleted file mode 100755 index 3bede8f8..00000000 --- a/pattern-2/confs/apim-is-as-km/repository/conf/tomcat/catalina-server.xml +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pattern-2/confs/apim-is-as-km/repository/conf/user-mgt.xml b/pattern-2/confs/apim-is-as-km/repository/conf/user-mgt.xml deleted file mode 100644 index 6114545e..00000000 --- a/pattern-2/confs/apim-is-as-km/repository/conf/user-mgt.xml +++ /dev/null @@ -1,260 +0,0 @@ - - - - - - true - admin - - admin - admin - - everyone - true - true - jdbc/WSO2UM_DB - - - - - - - - - - - - - - org.wso2.carbon.user.core.tenant.CommonHybridLDAPTenantManager - ldap://localhost:${Ports.EmbeddedLDAP.LDAPServerPort} - uid=admin,ou=system - admin - false - ou=Users,dc=wso2,dc=org - identityPerson - uid - (&(objectClass=person)(uid=?)) - (objectClass=person) - - true - true - ou=Groups,dc=wso2,dc=org - groupOfNames - cn - (&(objectClass=groupOfNames)(cn=?)) - (objectClass=groupOfNames) - member - false - [a-zA-Z0-9._-|//]{3,30}$ - ^[\S]{3,30}$ - Username pattern policy violated - ^[\S]{5,30}$ - ^[\S]{5,30}$ - Password length should be within 5 to 30 characters - [a-zA-Z0-9._-|//]{3,30}$ - ^[\S]{3,30}$ - true - false - true - PLAIN_TEXT - , - 100 - 100 - false - WSO2.ORG - true - false - 5000 - - - - - - /permission - true - false - - - - - diff --git a/pattern-2/confs/apim-km/repository/conf/api-manager.xml b/pattern-2/confs/apim-km/api-manager.xml old mode 100755 new mode 100644 similarity index 85% rename from pattern-2/confs/apim-km/repository/conf/api-manager.xml rename to pattern-2/confs/apim-km/api-manager.xml index aafc5b6a..1f08960c --- a/pattern-2/confs/apim-km/repository/conf/api-manager.xml +++ b/pattern-2/confs/apim-km/api-manager.xml @@ -56,8 +56,6 @@ Token generation the implementation is provided in URLSafeJWTGenerator --> - - - - Production and Sandbox - This is a hybrid gateway that handles both production and sandbox token traffic. - - https://wso2apim-manager-worker.wso2.svc:9443${carbon.context}services/ - - ${admin.username} - - ${admin.password} - - http://wso2apim-gw,https://wso2apim-gw + + + + + + + + + + + + + + Production Gateway + Production Gateway Environment + https://wso2apim-gateway-service:9443${carbon.context}services/ + admin + admin + https://wso2apim-gateway @@ -108,6 +114,15 @@ false + + true + + true @@ -136,20 +151,20 @@ Ex - Multiple Receiver Groups with two receivers each {tcp://localhost:7612/,tcp://localhost:7613},{tcp://localhost:7712/,tcp://localhost:7713/} --> - tcp://wso2apim-analytics-1:7612|tcp://wso2apim-analytics-2:7612 - ssl://wso2apim-analytics-1:7712|ssl://wso2apim-analytics-2:7712 + tcp://wso2apim-analytics-service:7612 + ssl://wso2apim-analytics-service:7712 - admin + ${admin.username} - admin + ${admin.password} org.wso2.carbon.apimgt.usage.client.impl.APIUsageStatisticsRdbmsClientImpl https://wso2apim-analytics:9444 - admin - admin + ${admin.username} + ${admin.password} @@ -190,7 +205,7 @@ org.wso2.analytics.apim.alertStakeholderInfo - 1.0.0 + 1.0.1 @@ -249,6 +264,8 @@ + + am_application_scope - https://wso2apim-gw.wso2.svc:8243/revoke + https://wso2apim-gateway-service:8243/revoke @@ -280,6 +297,7 @@ + false true @@ -325,6 +343,8 @@ + + true - - - - false - - - - - /resource - admin - 1.0.0 - none - none - Any - - - - - - - @@ -571,13 +551,15 @@ true - - true + Binary {tcp://wso2apim-pubstore-tm-1:9611}, {tcp://wso2apim-pubstore-tm-2:9611} {ssl://wso2apim-pubstore-tm-1:9711}, {ssl://wso2apim-pubstore-tm-2:9711} ${admin.username} ${admin.password} + + + true 1000 200 @@ -589,7 +571,8 @@ - https://localhost:${mgt.transport.https.port}${carbon.context}services/ + true + https://wso2apim-service:${mgt.transport.https.port}${carbon.context}services/ ${admin.username} ${admin.password} @@ -600,33 +583,16 @@ true - tcp://${carbon.local.ip}:${jms.port} - ${admin.username} - ${admin.password} throttleData TopicConnectionFactory topic org.wso2.andes.jndi.PropertiesFileInitialContextFactory - - amqp://admin:admin@clientID/carbon?failover='roundrobin'%26cyclecount='2'%26brokerlist='tcp://wso2apim-pubstore-tm-1:5672?retries='5'%26connectdelay='50';tcp://wso2apim-pubstore-tm-2:5672?retries='5'%26connectdelay='50'' + amqp://admin:admin@clientID/carbon?failover='roundrobin'%26cyclecount='2'%26brokerlist='tcp://wso2apim-pubstore-tm-1:5672?retries='5'%26connectdelay='50';tcp://wso2apim-pubstore-tm-2:5672?retries='5'%26connectdelay='50'' - - 20 - 100 - 1000 - 10 - - - org.wso2.andes.jndi.PropertiesFileInitialContextFactory - repository/conf/jndi.properties - topic - throttleData - allow - TopicConnectionFactory - + + Supported Languages/Frameworks : android, java, scala, csharp, dart, flash, groovy, javascript, jmeter, + nodejs, perl, php, python, ruby, swift, clojure, asyncScala, csharpDotNet2--> java,android diff --git a/pattern-2/confs/apim-gw-manager-worker/repository/conf/axis2/axis2.xml b/pattern-2/confs/apim-km/axis2/axis2.xml old mode 100755 new mode 100644 similarity index 95% rename from pattern-2/confs/apim-gw-manager-worker/repository/conf/axis2/axis2.xml rename to pattern-2/confs/apim-km/axis2/axis2.xml index 540530cb..95fe2dff --- a/pattern-2/confs/apim-gw-manager-worker/repository/conf/axis2/axis2.xml +++ b/pattern-2/confs/apim-km/axis2/axis2.xml @@ -168,14 +168,16 @@ class="org.apache.axis2.format.PlainTextFormatter"/> - + + class="org.apache.synapse.commons.json.JsonFormatter"/--> + - + + class="org.apache.synapse.commons.json.JsonBuilder"/--> + + @@ -543,6 +548,14 @@ wso2carbon + + + + + + repository/resources/security/sslprofiles.xml + 600000 + AllowAll @@ -596,10 +609,19 @@ - - outflowDispatchSeq - outflowFaultSeq - + + + + + + + + + + + + + @@ -633,7 +655,7 @@ getting this node to join the cluster. --> + enable="false"> kubernetes - org.wso2.carbon.membership.scheme.kubernetes.KubernetesMembershipScheme - wso2apim-manager-worker - wso2 @@ -687,7 +706,7 @@ --> - api-manager + am-km - - - api-manager - 4000 - - + org.wso2.carbon.membership.scheme.kubernetes.KubernetesMembershipScheme + wso2 + wso2apim-km + true + false - 2.1.0 + 2.2.0 + + claim_mgt_menu + identity_mgt_emailtemplate_menu + identity_security_questions_menu + - - + + 50000 true - 720 @@ -108,10 +110,27 @@ --> - -1 - -1 - -1 - -1 + + + + + + + + - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/identity/connect/register + ${carbon.protocol}://${carbon.host}:${carbon.management.port}/api/identity/oauth2/dcr/v1.0/register ${carbon.protocol}://${carbon.host}:${carbon.management.port}/oauth2/jwks ${carbon.protocol}://${carbon.host}:${carbon.management.port}/oauth2/oidcdiscovery @@ -147,19 +166,13 @@ 84600 - 300 - - true + 0 true org.wso2.carbon.identity.oauth.tokenprocessor.PlainTextPersistenceProcessor - - - - false - - + + false @@ -196,6 +209,8 @@ client_credentials org.wso2.carbon.apimgt.keymgt.handlers.ExtendedClientCredentialsGrantHandler + false + false urn:ietf:params:oauth:grant-type:saml2-bearer @@ -206,18 +221,65 @@ org.wso2.carbon.identity.oauth.common.NTLMAuthenticationValidator org.wso2.carbon.identity.oauth2.token.handlers.grant.iwa.ntlm.NTLMAuthenticationGrantHandlerWithHandshake + + urn:ietf:params:oauth:grant-type:jwt-bearer + org.wso2.carbon.identity.oauth2.grant.jwt.JWTBearerGrantHandler + org.wso2.carbon.identity.oauth2.grant.jwt.JWTGrantValidator + + + + + authorization_code + + + implicit + + - + + + + + + + + + + + + + false + + + + + FEDERATED + org.wso2.carbon.identity.openidconnect.DefaultIDTokenBuilder SHA256withRSA + + RSA-OAEP + + A128GCM + + + RSA1_5 + RSA-OAEP + + + A128GCM + A192GCM + A256GCM + A128CBC-HS256 + A128CBC+HS256 + + true + false + + 120 + + + + request_param_value_builder + org.wso2.carbon.identity.openidconnect.RequestParamRequestObjectBuilder + + + + org.wso2.carbon.identity.openidconnect.RequestObjectValidatorImpl + + + true + 0 + 5 + @@ -276,8 +391,6 @@ - 157680000 - 157680000 ${carbon.host} + true + + + + + + + + + false + true + true + + true + - + + + @@ -432,54 +583,151 @@ + + + + + + + + + + + - - - - - - - - - - + name="AppAuthFrameworkSessionContextCache" timeout="300"/> + + + + + name="AuthorizationGrantCache" timeout="300"/> - + name="OAuthCache" timeout="300"/> + name="OAuthScopeCache" timeout="300"/> + name="OAuthSessionDataCache" timeout="300"/> + name="SAMLSSOParticipantCache" timeout="300"/> + name="SAMLSSOSessionIndexCache" timeout="300"/> + + + + + + + + - + + + + + + /permission/admin/manage/identity/usermgt/view + + + /permission/admin/manage/identity/usermgt/view + + + + + /permission/admin/manage/identity/consentmgt/add + + + + /permission/admin/manage/identity/consentmgt/delete + + + /permission/admin/manage/identity/consentmgt/add + + + + /permission/admin/manage/identity/consentmgt/delete + + + /permission/admin/manage/identity/consentmgt/add + + + + /permission/admin/manage/identity/consentmgt/delete + + + /permission/admin/manage/identity/applicationmgt/create + + + /permission/admin/manage/identity/applicationmgt/delete + + + /permission/admin/manage/identity/applicationmgt/update + + + /permission/admin/manage/identity/applicationmgt/view + /permission/admin/manage/identity/applicationmgt/delete @@ -492,6 +740,69 @@ /permission/admin/manage/identity/pep + + /permission/admin/manage/identity/usermgt/create + + + /permission/admin/manage/identity/usermgt/list + + + /permission/admin/manage/identity/rolemgt/create + + + /permission/admin/manage/identity/rolemgt/view + + + /permission/admin/manage/identity/usermgt/view + + + /permission/admin/manage/identity/usermgt/update + + + /permission/admin/manage/identity/usermgt/update + + + /permission/admin/manage/identity/usermgt/delete + + + /permission/admin/manage/identity/rolemgt/view + + + /permission/admin/manage/identity/rolemgt/update + + + /permission/admin/manage/identity/rolemgt/update + + + /permission/admin/manage/identity/rolemgt/delete + + + /permission/admin/login + + + /permission/admin/manage/identity/usermgt/delete + + + /permission/admin/login + + + /permission/admin/login + + + /permission/admin/manage/identity/usermgt/create + + + + + + + + + /permission/admin/manage/identity/usermgt + + + /permission/admin/manage/identity/applicationmgt + - /api/identity/user/v0.9 - /api/identity/recovery/v0.9 - /oauth2 - /api/identity/entitlement + /api/identity/user/v1.0/ + /api/identity/consent-mgt/v1.0/ + /api/identity/recovery/v0.9/ + /oauth2/ + /scim2/ + /api/identity/entitlement/ + /api/identity/oauth2/dcr/v1.0/ /identity/(.*) diff --git a/pattern-1/confs/apim-manager-worker/repository/conf/registry.xml b/pattern-2/confs/apim-km/registry.xml old mode 100755 new mode 100644 similarity index 93% rename from pattern-1/confs/apim-manager-worker/repository/conf/registry.xml rename to pattern-2/confs/apim-km/registry.xml index e004a457..3da454e5 --- a/pattern-1/confs/apim-manager-worker/repository/conf/registry.xml +++ b/pattern-2/confs/apim-km/registry.xml @@ -1,374 +1,384 @@ - - - - - - - wso2registry - false - true - / - - - jdbc/WSO2CarbonDB - - - - jdbc/WSO2REG_DB - - - gov - root@jdbc:mysql://apim_rdbms:3306/regdb - govregistry - false - true - / - - - gov - /_system/governance - - - gov - /_system/config - - - - - - .* - - - - - - - - .* - - - - - - - - true - - /trunk/schemas/ - - - /trunk/wsdls/ - - - /trunk/policies/ - - - - application/wsdl+xml - - - - - - - application/wsdl+xml - application/xsd+xml - 50 - true - - 3 - - /trunk/schemas/ - - - /trunk/wsdls/ - - - application/vnd.wso2.governance-archive - - - - - - - - 1.0.0-SNAPSHOT - true - - dev - qa - live - - - application/vnd.wso2-service+xml - - - - - - - - application/vnd.wso2-service+xml - - - - - - - - application/vnd.wso2-api+xml - - - - - - - - /_system/governance/event/topics/registry/notifications/.* - - - - - - - - - Created - Tested - Deployed - - - application/vnd.wso2-smart-link - - - - - - - - /trunk/policies/ - - - application/policy+xml - - - - - - - - true - - /trunk/schemas/ - - - application/x-xsd+xml - - - - - - - - application/vnd.wso2-hyperlink - - - - - - - application/vnd.wso2.endpoint - - /trunk/endpoints/ - - - - - - - - application/vnd.wso2-uri+xml - - - - - - - - .* - - - - - - - .* - - - - - - - workflow-config - - - - - - - - - - - - - - - - - - - - true - 35 - 3 - - 40 - - 40 - - /_system/local/repository/components/org.wso2.carbon.registry/indexing/lastaccesstime - - - - - - - - - - - - - - - - - - - - - - false - - - - true - true - true - true - - /trunk/services/ - - - - - false - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + wso2registry + false + true + / + + + jdbc/WSO2CarbonDB + + + + jdbc/WSO2REG_DB + + + gov + wso2carbon@jdbc:mysql://wso2apim-pattern-2-rdbms-service:3306/WSO2AM_COMMON_DB + govregistry + false + true + / + + + gov + /_system/governance + + + gov + /_system/config + + + + + + + .* + + + + + + + + .* + + + + + + + + true + + /trunk/schemas/ + + + /trunk/wsdls/ + + + /trunk/policies/ + + + + application/wsdl+xml + + + + + + + application/wsdl+xml + application/xsd+xml + 50 + true + + 3 + + /trunk/schemas/ + + + /trunk/wsdls/ + + + application/vnd.wso2.governance-archive + + + + + + + + 1.0.0-SNAPSHOT + true + + dev + qa + live + + + application/vnd.wso2-service+xml + + + + + + + + application/vnd.wso2-service+xml + + + + + + + + application/vnd.wso2-api+xml + + + + + + + + /_system/governance/event/topics/registry/notifications/.* + + + + + + + + + Created + Tested + Deployed + + + application/vnd.wso2-smart-link + + + + + + + + /trunk/policies/ + + + application/policy+xml + + + + + + + + true + + /trunk/schemas/ + + + application/x-xsd+xml + + + + + + + + application/vnd.wso2-hyperlink + + + + + + + application/vnd.wso2.endpoint + + /trunk/endpoints/ + + + + + + + + application/vnd.wso2-uri+xml + + + + + + + + .* + + + + + + + .* + + + + + + + workflow-config + + + + + + + + + + + + + + + + + + + + + + + true + + 35 + 3 + + 40 + + 40 + + /_system/local/repository/components/org.wso2.carbon.registry/indexing/lastaccesstime + + + + + + + + + + + + + + + + + + + + + + + false + + + + true + true + true + true + + /trunk/services/ + + + + + false + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pattern-2/confs/apim-km/repository/conf/axis2/axis2.xml b/pattern-2/confs/apim-km/repository/conf/axis2/axis2.xml deleted file mode 100755 index bd4db2c7..00000000 --- a/pattern-2/confs/apim-km/repository/conf/axis2/axis2.xml +++ /dev/null @@ -1,949 +0,0 @@ - - - - - - - - - - - true - - true - - - false - - false - - - false - - work/mtom - - 4000 - - - false - - - inmemory - - - - - services - - - axis2services - - - axis2modules - - - WSO2 AM 2.1.0 - WSO2 AM 2.1.0 - - - - false - - - - - - - false - - - true - - - 30000 - - - repository/deployment/server/synapse-configs - - . - - . - - localhost - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 8280 - true - - - org.wso2.carbon.mediation.transport.handlers.PassThroughNHttpGetProcessor - - - - - - - - - - - - 8243 - true - - - org.wso2.carbon.mediation.transport.handlers.PassThroughNHttpGetProcessor - - - repository/resources/security/wso2carbon.jks - JKS - wso2carbon - wso2carbon - - - - - repository/resources/security/client-truststore.jks - JKS - wso2carbon - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - - - - - - - - - - - - - - - - - true - - - repository/resources/security/wso2carbon.jks - JKS - wso2carbon - wso2carbon - - - - - repository/resources/security/client-truststore.jks - JKS - wso2carbon - - - AllowAll - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - kubernetes - org.wso2.carbon.membership.scheme.kubernetes.KubernetesMembershipScheme - wso2apim-km-clustering - wso2 - - - - - wso2.am.domain - - - - - - 45564 - - 100 - - 60 - - - - - - api-manager - - - - - - 4000 - - - - - - - - - - - - - - - api-manager - 4000 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pattern-2/confs/apim-km/repository/conf/jndi.properties b/pattern-2/confs/apim-km/repository/conf/jndi.properties deleted file mode 100755 index 21befd18..00000000 --- a/pattern-2/confs/apim-km/repository/conf/jndi.properties +++ /dev/null @@ -1,29 +0,0 @@ -# -# Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -# -# Licensed 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. -# - -# register some connection factories -# connectionfactory.[jndiname] = [ConnectionURL] -connectionfactory.TopicConnectionFactory = amqp://admin:admin@clientid/carbon?brokerlist='tcp://localhost:5672' - -connectionfactory.QueueConnectionFactory = amqp://admin:admin@clientID/test?brokerlist='tcp://localhost:5672' - -# register some queues in JNDI using the form -# queue.[jndiName] = [physicalName] -#queue.MyQueue = example.MyQueue - -# register some topics in JNDI using the form -# topic.[jndiName] = [physicalName] -topic.throttleData = throttleData diff --git a/pattern-2/confs/apim-km/repository/conf/log4j.properties b/pattern-2/confs/apim-km/repository/conf/log4j.properties deleted file mode 100755 index 55c79f90..00000000 --- a/pattern-2/confs/apim-km/repository/conf/log4j.properties +++ /dev/null @@ -1,220 +0,0 @@ -# -# Copyright (c) 2005-2015, WSO2 Inc. (http://wso2.com) All Rights Reserved. -# -# Licensed 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. -# - -## -# This is the log4j configuration file used by WSO2 AM -# ===================================================== -# -# IMPORTANT : Please do not remove or change the names of any of the Appenders defined here. -# The layout pattern & log file can be changed using the WSO2 AM Management Console, and those -# settings will override the settings in this file. -## - - -# the root category is ERROR (applies for all 3rd party JARs etc) and will be logged to the -# LOG_APPENDER and the CONSOLE_APPENDER - -log4j.rootLogger=ERROR, CARBON_CONSOLE, CARBON_LOGFILE, CARBON_MEMORY, CARBON_SYS_LOG, ERROR_LOGFILE, DAS_AGENT - -log4j.logger.AUDIT_LOG=INFO, AUDIT_LOGFILE - -log4j.category.org.apache.synapse=INFO -log4j.category.org.apache.synapse.transport=INFO -log4j.category.org.apache.axis2=INFO -log4j.category.org.apache.axis2.transport=INFO -log4j.logger.com.atomikos=INFO,ATOMIKOS -log4j.logger.org.quartz=WARN -log4j.logger.org.wso2=INFO -log4j.logger.org.wso2.carbon=INFO -#log4j.category.org.apache.synapse.transport.nhttp.util=DEBUG -#log4j.category.org.apache.http.impl.nio.reactor=DEBUG -#log4j.logger.org.wso2.carbon.utils.deployment.ComponentBuilder=DEBUG -#log4j.logger.org.wso2.carbon.utils.deployment.OSGiBundleDeployer=DEBUG -log4j.logger.org.apache.catalina=WARN -log4j.logger.org.apache.coyote=WARN -log4j.logger.org.apache.axis2.enterprise=FATAL -log4j.logger.de.hunsicker.jalopy.io=FATAL - -# uncomment the following logs to see HTTP headers and messages -#log4j.logger.org.apache.synapse.transport.http.headers=DEBUG -#log4j.logger.org.apache.synapse.transport.http.wire=DEBUG - -# qpid related logs for the message broker -log4j.logger.qpid=WARN -log4j.logger.org.apache.qpid=WARN -log4j.logger.org.apache.qpid.server.Main=INFO -log4j.logger.qpid.message=WARN -log4j.logger.qpid.message.broker.listening=INFO -log4j.logger.org.wso2.carbon.databridge.agent.thrift.AsyncDataPublisher=WARN - -# The console appender is used to display general information at console -log4j.appender.CARBON_CONSOLE=org.wso2.carbon.utils.logging.appenders.CarbonConsoleAppender -log4j.appender.CARBON_CONSOLE.layout=org.apache.log4j.PatternLayout -log4j.appender.CARBON_CONSOLE.layout.ConversionPattern=[%d{ISO8601}] %5p - %c{1} %m%n - -# Configure the service logger at INFO level. Writes only run-time/mediation-time audit messages -log4j.category.SERVICE_LOGGER=INFO, SERVICE_APPENDER -log4j.additivity.SERVICE_LOGGER=false -log4j.appender.SERVICE_APPENDER=org.apache.log4j.RollingFileAppender -log4j.appender.SERVICE_APPENDER.File=${carbon.home}/repository/logs/${instance.log}/wso2-apigw-service${instance.log}.log -log4j.appender.SERVICE_APPENDER.MaxFileSize=1000KB -log4j.appender.SERVICE_APPENDER.MaxBackupIndex=10 -log4j.appender.SERVICE_APPENDER.layout=org.apache.log4j.PatternLayout -log4j.appender.SERVICE_APPENDER.layout.ConversionPattern=%d{ISO8601} [%X{ip}-%X{host}] [%t] %5p %c{1} %m%n - -# The trace logger dumps enough information @INFO level, but maybe pushed upto TRACE. -# Writes only run-time/mediation time tracing/debug messages for messages passing through trace -# enabled sequences, mediators and services. Enabling tracing on these has a performance impact -log4j.category.TRACE_LOGGER=INFO, TRACE_APPENDER, TRACE_MEMORYAPPENDER -log4j.additivity.TRACE_LOGGER=false -log4j.appender.TRACE_APPENDER=org.apache.log4j.DailyRollingFileAppender -log4j.appender.TRACE_APPENDER.File=${carbon.home}/repository/logs/${instance.log}/wso2-apigw-trace${instance.log}.log -log4j.appender.TRACE_APPENDER.Append=true -log4j.appender.TRACE_APPENDER.layout=org.apache.log4j.PatternLayout -log4j.appender.TRACE_APPENDER.layout.ConversionPattern=%d{HH:mm:ss,SSS} [%X{ip}-%X{host}] [%t] %5p %c{1} %m%n - -# The memory appender for trace logger -log4j.appender.TRACE_MEMORYAPPENDER=org.wso2.carbon.utils.logging.appenders.MemoryAppender -log4j.appender.TRACE_MEMORYAPPENDER.bufferSize=2000 -log4j.appender.TRACE_MEMORYAPPENDER.layout=org.apache.log4j.PatternLayout -log4j.appender.TRACE_MEMORYAPPENDER.layout.ConversionPattern=%d{HH:mm:ss,SSS} [%X{ip}-%X{host}] [%t] %5p %m%n - -# CARBON_LOGFILE is set to be a DailyRollingFileAppender using a PatternLayout. -log4j.appender.CARBON_LOGFILE=org.wso2.carbon.utils.logging.appenders.CarbonDailyRollingFileAppender -# Log file will be overridden by the configuration setting in the DB -# This path should be relative to WSO2 Carbon Home -log4j.appender.CARBON_LOGFILE.File=${carbon.home}/repository/logs/${instance.log}/wso2carbon${instance.log}.log -log4j.appender.CARBON_LOGFILE.Append=true -log4j.appender.CARBON_LOGFILE.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout -# ConversionPattern will be overridden by the configuration setting in the DB -log4j.appender.CARBON_LOGFILE.layout.ConversionPattern=TID: [%T] [%S] [%d] %P%5p {%c} - %x %m {%c}%n -log4j.appender.CARBON_LOGFILE.layout.TenantPattern=%U%@%D [%T] [%S] -log4j.appender.CARBON_LOGFILE.threshold=DEBUG - -# The standard error log where all the warnings, errors and fatal errors will be logged -log4j.appender.ERROR_LOGFILE=org.apache.log4j.FileAppender -log4j.appender.ERROR_LOGFILE.File=${carbon.home}/repository/logs/${instance.log}/wso2-apigw-errors.log -log4j.appender.ERROR_LOGFILE.layout=org.apache.log4j.PatternLayout -log4j.appender.ERROR_LOGFILE.layout.ConversionPattern=%d{ISO8601} [%X{ip}-%X{host}] [%t] %5p %c{1} %m%n -log4j.appender.ERROR_LOGFILE.threshold=WARN - -# The memory appender for logging -log4j.appender.CARBON_MEMORY=org.wso2.carbon.logging.service.appender.CarbonMemoryAppender -log4j.appender.CARBON_MEMORY.bufferSize=2000 -log4j.appender.CARBON_MEMORY.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout -# ConversionPattern will be overridden by the configuration setting in the DB -log4j.appender.CARBON_MEMORY.layout.ConversionPattern=TID: [%T] [%S] [%d] %P%5p {%c} - %x %m {%c}%n -log4j.appender.CARBON_MEMORY.layout.TenantPattern=%U%@%D [%T] [%S] -log4j.appender.CARBON_MEMORY.columnList=%T,%S,%A,%d,%c,%p,%m,%H,%I,%Stacktrace -log4j.appender.CARBON_MEMORY.threshold=DEBUG - -# LOGEVENT is set to be a LogEventAppender using a PatternLayout to send logs to LOGEVENT -log4j.appender.LOGEVENT=org.wso2.carbon.logging.appender.LogEventAppender -log4j.appender.LOGEVENT.url=tcp://localhost:7611 -log4j.appender.LOGEVENT.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout -log4j.appender.LOGEVENT.columnList=%T,%S,%A,%d,%c,%p,%m,%I,%Stacktrace -log4j.appender.LOGEVENT.userName=admin -log4j.appender.LOGEVENT.password=admin -log4j.appender.LOGEVENT.processingLimit=1000 -log4j.appender.LOGEVENT.maxTolerableConsecutiveFailure=20 - - -log4j.appender.CARBON_SYS_LOG = org.apache.log4j.net.SyslogAppender -log4j.appender.CARBON_SYS_LOG.layout=org.apache.log4j.PatternLayout -log4j.appender.CARBON_SYS_LOG.layout.ConversionPattern=[%d] %5p - %x %m {%c}%n -log4j.appender.CARBON_SYS_LOG.SyslogHost=localhost -log4j.appender.CARBON_SYS_LOG.Facility=USER -log4j.appender.CARBON_SYS_LOG.threshold=DEBUG - -# LOGEVENT is set to be a LogEventAppender using a PatternLayout to send logs to LOGEVENT -log4j.appender.LOGEVENT=org.wso2.carbon.logging.appender.LogEventAppender -log4j.appender.LOGEVENT.url=tcp://localhost:7611 -log4j.appender.LOGEVENT.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout -log4j.appender.LOGEVENT.columnList=%T,%S,%A,%d,%c,%p,%m,%H,%I,%Stacktrace -log4j.appender.LOGEVENT.userName=admin -log4j.appender.LOGEVENT.password=admin - -log4j.logger.org.apache.directory.shared.ldap=WARN, CARBON_CONSOLE -log4j.logger.org.apache.directory.server.ldap.handlers=WARN, CARBON_CONSOLE -log4j.logger.org.apache.directory.shared.ldap.entry.DefaultServerAttribute=FATAL, CARBON_CONSOLE -log4j.logger.org.apache.directory.shared.ldap.ldif.LdifReader=ERROR, CARBON_CONSOLE -log4j.logger.org.apache.directory.server.ldap.LdapProtocolHandler=ERROR, CARBON_CONSOLE - -## Trace Logger configuration which will append to a XMPP chatroom or JID ## -#log4j.appender.XMPP_APPENDER=org.wso2.carbon.utils.logging.IMAppender -#log4j.appender.XMPP_APPENDER.host=jabber.org -#log4j.appender.XMPP_APPENDER.username=wso2esb -#log4j.appender.XMPP_APPENDER.password=wso2esb -#log4j.appender.XMPP_APPENDER.recipient=ruwan@jabber.org -#log4j.appender.XMPP_APPENDER.layout=org.apache.log4j.PatternLayout -#log4j.appender.XMPP_APPENDER.layout.ConversionPattern=[%X{host}] [%t] %-5p [%d{HH:mm:ss,SSS}] %C{1} - %m%n - -# Appender config to AUDIT_LOGFILE -log4j.appender.AUDIT_LOGFILE=org.apache.log4j.DailyRollingFileAppender -log4j.appender.AUDIT_LOGFILE.File=${carbon.home}/repository/logs/audit.log -log4j.appender.AUDIT_LOGFILE.Append=true -log4j.appender.AUDIT_LOGFILE.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout -log4j.appender.AUDIT_LOGFILE.layout.ConversionPattern=[%d] %P%5p - %x %m %n -log4j.appender.AUDIT_LOGFILE.layout.TenantPattern=%U%@%D [%T] [%S] -log4j.appender.AUDIT_LOGFILE.threshold=INFO -log4j.additivity.AUDIT_LOG=false - -# Appender config to send Atomikos transaction logs to new log file tm.out. -log4j.appender.ATOMIKOS = org.apache.log4j.RollingFileAppender -log4j.appender.ATOMIKOS.File = repository/logs/tm.out -log4j.appender.ATOMIKOS.Append = true -log4j.appender.ATOMIKOS.layout = org.apache.log4j.PatternLayout -log4j.appender.ATOMIKOS.layout.ConversionPattern=%p %t %c - %m%n -log4j.additivity.com.atomikos=false - -# DAS_AGENT is set to be a Custom Log Appender. -log4j.appender.DAS_AGENT=org.wso2.carbon.analytics.shared.data.agents.log4j.appender.LogEventAppender -# DAS_AGENT uses PatternLayout. -log4j.appender.DAS_AGENT.layout=org.wso2.carbon.analytics.shared.data.agents.log4j.util.TenantAwarePatternLayout -log4j.appender.DAS_AGENT.columnList=%D,%S,%A,%d,%c,%p,%m,%H,%I,%Stacktrace -log4j.appender.DAS_AGENT.userName=admin -log4j.appender.DAS_AGENT.password=admin -log4j.appender.DAS_AGENT.url=tcp://wso2apim-analytics-1:7612|tcp://wso2apim-analytics-2:7612 -log4j.appender.DAS_AGENT.maxTolerableConsecutiveFailure=5 -log4j.appender.DAS_AGENT.streamDef=loganalyzer:1.0.0 -log4j.logger.trace.messages=TRACE,CARBON_TRACE_LOGFILE - -# Appender config to CARBON_TRACE_LOGFILE -log4j.appender.CARBON_TRACE_LOGFILE=org.apache.log4j.DailyRollingFileAppender -log4j.appender.CARBON_TRACE_LOGFILE.File=${carbon.home}/repository/logs/${instance.log}/wso2carbon-trace-messages${instance.log}.log -log4j.appender.CARBON_TRACE_LOGFILE.Append=true -log4j.appender.CARBON_TRACE_LOGFILE.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout -log4j.appender.CARBON_TRACE_LOGFILE.layout.ConversionPattern=[%d] %P%5p {%c} - %x %m %n -log4j.appender.CARBON_TRACE_LOGFILE.layout.TenantPattern=%U%@%D [%T] [%S] -log4j.appender.CARBON_TRACE_LOGFILE.threshold=TRACE -log4j.additivity.trace.messages=false - - -# The event trace logger dumps enough information @INFO level, but maybe pushed upto TRACE. -# Writes only run-time/event processing time tracing/debug messages for event passing through trace -# enabled transport adapters event formatters, builders and processors. Enabling event tracing on these has a performance impact -log4j.category.EVENT_TRACE_LOGGER=INFO, EVENT_TRACE_APPENDER, EVENT_TRACE_MEMORYAPPENDER -log4j.additivity.EVENT_TRACE_LOGGER=false -log4j.appender.EVENT_TRACE_APPENDER=org.apache.log4j.DailyRollingFileAppender -log4j.appender.EVENT_TRACE_APPENDER.File=${carbon.home}/repository/logs/${instance.log}/wso2-cep-trace${instance.log}.log -log4j.appender.EVENT_TRACE_APPENDER.Append=true -log4j.appender.EVENT_TRACE_APPENDER.layout=org.apache.log4j.PatternLayout -log4j.appender.EVENT_TRACE_APPENDER.layout.ConversionPattern=%d{HH:mm:ss,SSS} [%X{ip}-%X{host}] [%t] %5p %c{1} %m%n -# The memory appender for trace logger -log4j.appender.EVENT_TRACE_MEMORYAPPENDER=org.wso2.carbon.utils.logging.appenders.MemoryAppender -log4j.appender.EVENT_TRACE_MEMORYAPPENDER.bufferSize=2000 -log4j.appender.EVENT_TRACE_MEMORYAPPENDER.layout=org.apache.log4j.PatternLayout -log4j.appender.EVENT_TRACE_MEMORYAPPENDER.layout.ConversionPattern=%d{HH:mm:ss,SSS} [%X{ip}-%X{host}] [%t] %5p %m%n diff --git a/pattern-2/confs/apim-km/repository/conf/tomcat/catalina-server.xml b/pattern-2/confs/apim-km/repository/conf/tomcat/catalina-server.xml deleted file mode 100755 index 742f4a31..00000000 --- a/pattern-2/confs/apim-km/repository/conf/tomcat/catalina-server.xml +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pattern-2/confs/apim-km/repository/conf/user-mgt.xml b/pattern-2/confs/apim-km/repository/conf/user-mgt.xml deleted file mode 100755 index de5e9db7..00000000 --- a/pattern-2/confs/apim-km/repository/conf/user-mgt.xml +++ /dev/null @@ -1,259 +0,0 @@ - - - - - - true - admin - - admin - admin - - everyone - true - jdbc/WSO2UM_DB - - - - - org.wso2.carbon.user.core.tenant.JDBCTenantManager - false - true - true - ^[\S]{3,30}$ - ^[\S]{3,30}$ - Username pattern policy violated - ^[\S]{5,30}$ - ^[\S]{5,30}$ - Password length should be within 5 to 30 characters - ^[\S]{3,30}$ - ^[\S]{3,30}$ - true - false - true - SHA-256 - true - , - 100 - 100 - true - false - - - - - - - - - - - - - /permission - true - false - - - - - diff --git a/pattern-2/confs/apim-km/user-mgt.xml b/pattern-2/confs/apim-km/user-mgt.xml new file mode 100644 index 00000000..7c0fa72e --- /dev/null +++ b/pattern-2/confs/apim-km/user-mgt.xml @@ -0,0 +1,256 @@ + + + + + + true + admin + + admin + admin + + everyone + + true + true + jdbc/WSO2UM_DB + + + + org.wso2.carbon.user.core.tenant.JDBCTenantManager + false + true + true + ^[\S]{3,30}$ + ^[\S]{3,30}$ + Username pattern policy violated + ^[\S]{5,30}$ + ^[\S]{5,30}$ + Password length should be within 5 to 30 characters + ^[\S]{3,30}$ + ^[\S]{3,30}$ + true + false + true + SHA-256 + true + , + 100 + 100 + true + false + + + + + + + + + /permission + true + false + + + + diff --git a/pattern-2/confs/apim-pubstore-tm-1/repository/conf/api-manager.xml b/pattern-2/confs/apim-pubstore-tm-1/api-manager.xml old mode 100755 new mode 100644 similarity index 84% rename from pattern-2/confs/apim-pubstore-tm-1/repository/conf/api-manager.xml rename to pattern-2/confs/apim-pubstore-tm-1/api-manager.xml index 61bdb381..db5e5973 --- a/pattern-2/confs/apim-pubstore-tm-1/repository/conf/api-manager.xml +++ b/pattern-2/confs/apim-pubstore-tm-1/api-manager.xml @@ -16,7 +16,7 @@ logic relies on this. --> - https://wso2apim-km-internal.wso2.svc:${mgt.transport.https.port}${carbon.context}services/ + https://wso2apim-km:${mgt.transport.https.port}${carbon.context}services/ ${admin.username} @@ -56,8 +56,6 @@ Token generation the implementation is provided in URLSafeJWTGenerator --> - - - - Production and Sandbox - This is a hybrid gateway that handles both production and sandbox token traffic. - - https://wso2apim-manager-worker.wso2.svc:9443${carbon.context}services/ - - ${admin.username} - - ${admin.password} - - http://wso2apim-gw,https://wso2apim-gw + + + + + + + + + + + + + + Production Gateway + Production Gateway Environment + https://wso2apim-gateway-service:9443${carbon.context}services/ + admin + admin + https://wso2apim-gateway @@ -108,6 +114,15 @@ false + + true + + true @@ -136,20 +151,20 @@ Ex - Multiple Receiver Groups with two receivers each {tcp://localhost:7612/,tcp://localhost:7613},{tcp://localhost:7712/,tcp://localhost:7713/} --> - tcp://wso2apim-analytics-1:7612|tcp://wso2apim-analytics-2:7612 - ssl://wso2apim-analytics-1:7712|ssl://wso2apim-analytics-2:7712 + tcp://wso2apim-analytics-service:7612 + ssl://wso2apim-analytics-service:7712 - admin + ${admin.username} - admin + ${admin.password} org.wso2.carbon.apimgt.usage.client.impl.APIUsageStatisticsRdbmsClientImpl https://wso2apim-analytics:9444 - admin - admin + ${admin.username} + ${admin.password} @@ -190,7 +205,7 @@ org.wso2.analytics.apim.alertStakeholderInfo - 1.0.0 + 1.0.1 @@ -202,7 +217,7 @@ --> - https://wso2apim-km-internal.wso2.svc:${mgt.transport.https.port}${carbon.context}services/ + https://wso2apim-km:${mgt.transport.https.port}${carbon.context}services/ ${admin.username} @@ -249,6 +264,8 @@ + + am_application_scope - https://wso2apim-gw.wso2.svc:8243/revoke + https://wso2apim-gateway-service:${https.nio.port}/revoke @@ -280,6 +297,7 @@ + false true @@ -325,6 +343,8 @@ + + true - - - - false - - - - - /resource - admin - 1.0.0 - none - none - Any - - - - - - - @@ -571,13 +551,15 @@ true - - true + Binary - {tcp://${carbon.local.ip}:${receiver.url.port}}, {tcp://wso2apim-pubstore-tm-2:9611} - {ssl://${carbon.local.ip}:${auth.url.port}}, {ssl://wso2apim-pubstore-tm-2:9711} + tcp://${carbon.local.ip}:${receiver.url.port},{tcp://wso2apim-pubstore-tm-2:9611} + ssl://${carbon.local.ip}:${auth.url.port},{ssl://wso2apim-pubstore-tm-2:9711} ${admin.username} ${admin.password} + + + true 1000 200 @@ -589,6 +571,7 @@ + true https://localhost:${mgt.transport.https.port}${carbon.context}services/ ${admin.username} ${admin.password} @@ -600,33 +583,16 @@ true - tcp://${carbon.local.ip}:${jms.port} - ${admin.username} - ${admin.password} throttleData TopicConnectionFactory topic org.wso2.andes.jndi.PropertiesFileInitialContextFactory - - amqp://admin:admin@clientID/carbon?failover='roundrobin'%26cyclecount='2'%26brokerlist='tcp://localhost:5672?retries='5'%26connectdelay='50';tcp://wso2apim-pubstore-tm-2:5672?retries='5'%26connectdelay='50'' + amqp://admin:admin@clientID/carbon?failover='roundrobin'%26cyclecount='2'%26brokerlist='tcp://127.0.0.1:5672?retries='5'%26connectdelay='50';tcp://wso2apim-pubstore-tm-2:5672?retries='5'%26connectdelay='50'' - - 20 - 100 - 1000 - 10 - - - org.wso2.andes.jndi.PropertiesFileInitialContextFactory - repository/conf/jndi.properties - topic - throttleData - allow - TopicConnectionFactory - + + Supported Languages/Frameworks : android, java, scala, csharp, dart, flash, groovy, javascript, jmeter, + nodejs, perl, php, python, ruby, swift, clojure, asyncScala, csharpDotNet2--> java,android diff --git a/pattern-1/confs/apim-worker/repository/conf/axis2/axis2.xml b/pattern-2/confs/apim-pubstore-tm-1/axis2/axis2.xml old mode 100755 new mode 100644 similarity index 95% rename from pattern-1/confs/apim-worker/repository/conf/axis2/axis2.xml rename to pattern-2/confs/apim-pubstore-tm-1/axis2/axis2.xml index a079bb60..3f728690 --- a/pattern-1/confs/apim-worker/repository/conf/axis2/axis2.xml +++ b/pattern-2/confs/apim-pubstore-tm-1/axis2/axis2.xml @@ -168,14 +168,16 @@ class="org.apache.axis2.format.PlainTextFormatter"/> - + + class="org.apache.synapse.commons.json.JsonFormatter"/--> + - + + class="org.apache.synapse.commons.json.JsonBuilder"/--> + + @@ -543,6 +548,14 @@ wso2carbon + + + + + + repository/resources/security/sslprofiles.xml + 600000 + AllowAll @@ -596,10 +609,19 @@ - - outflowDispatchSeq - outflowFaultSeq - + + + + + + + + + + + + + @@ -633,7 +655,7 @@ getting this node to join the cluster. --> + enable="false"> kubernetes - org.wso2.carbon.membership.scheme.kubernetes.KubernetesMembershipScheme - wso2apim-manager-worker,wso2apim-worker - wso2 @@ -687,7 +706,7 @@ --> - api-manager + wso2apim-pubstore-tm - - - api-manager - 4000 - - + org.wso2.carbon.membership.scheme.kubernetes.KubernetesMembershipScheme + wso2 + wso2apim-pubstore-tm-1,wso2apim-pubstore-tm-2 + true + false - 2.1.0 + 2.2.0 + + claim_mgt_menu + identity_mgt_emailtemplate_menu + identity_security_questions_menu + - - + + 50000 true - 720 @@ -108,10 +110,27 @@ --> - -1 - -1 - -1 - -1 + + + + + + + + - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/identity/connect/register + ${carbon.protocol}://${carbon.host}:${carbon.management.port}/api/identity/oauth2/dcr/v1.0/register ${carbon.protocol}://${carbon.host}:${carbon.management.port}/oauth2/jwks ${carbon.protocol}://${carbon.host}:${carbon.management.port}/oauth2/oidcdiscovery @@ -147,19 +166,13 @@ 84600 - 300 - - true + 0 true org.wso2.carbon.identity.oauth.tokenprocessor.PlainTextPersistenceProcessor - - - - false - - + + false @@ -196,6 +209,8 @@ client_credentials org.wso2.carbon.apimgt.keymgt.handlers.ExtendedClientCredentialsGrantHandler + false + false urn:ietf:params:oauth:grant-type:saml2-bearer @@ -206,18 +221,65 @@ org.wso2.carbon.identity.oauth.common.NTLMAuthenticationValidator org.wso2.carbon.identity.oauth2.token.handlers.grant.iwa.ntlm.NTLMAuthenticationGrantHandlerWithHandshake + + urn:ietf:params:oauth:grant-type:jwt-bearer + org.wso2.carbon.identity.oauth2.grant.jwt.JWTBearerGrantHandler + org.wso2.carbon.identity.oauth2.grant.jwt.JWTGrantValidator + + + + + authorization_code + + + implicit + + - + + + + + + + + + + + + + false + + + + + FEDERATED + org.wso2.carbon.identity.openidconnect.DefaultIDTokenBuilder SHA256withRSA + + RSA-OAEP + + A128GCM + + + RSA1_5 + RSA-OAEP + + + A128GCM + A192GCM + A256GCM + A128CBC-HS256 + A128CBC+HS256 + + true + false + + 120 + + + + request_param_value_builder + org.wso2.carbon.identity.openidconnect.RequestParamRequestObjectBuilder + + + + org.wso2.carbon.identity.openidconnect.RequestObjectValidatorImpl + + + true + 0 + 5 + @@ -276,8 +391,6 @@ - 157680000 - 157680000 ${carbon.host} + true + + + + + + + + + false + true + true + + true + - + + + @@ -432,54 +583,151 @@ + + + + + + + + + + + - - - - - - - - - - + name="AppAuthFrameworkSessionContextCache" timeout="300"/> + + + + + name="AuthorizationGrantCache" timeout="300"/> - + name="OAuthCache" timeout="300"/> + name="OAuthScopeCache" timeout="300"/> + name="OAuthSessionDataCache" timeout="300"/> + name="SAMLSSOParticipantCache" timeout="300"/> + name="SAMLSSOSessionIndexCache" timeout="300"/> + + + + + + + + - + + + + + + /permission/admin/manage/identity/usermgt/view + + + /permission/admin/manage/identity/usermgt/view + + + + + /permission/admin/manage/identity/consentmgt/add + + + + /permission/admin/manage/identity/consentmgt/delete + + + /permission/admin/manage/identity/consentmgt/add + + + + /permission/admin/manage/identity/consentmgt/delete + + + /permission/admin/manage/identity/consentmgt/add + + + + /permission/admin/manage/identity/consentmgt/delete + + + /permission/admin/manage/identity/applicationmgt/create + + + /permission/admin/manage/identity/applicationmgt/delete + + + /permission/admin/manage/identity/applicationmgt/update + + + /permission/admin/manage/identity/applicationmgt/view + /permission/admin/manage/identity/applicationmgt/delete @@ -492,6 +740,69 @@ /permission/admin/manage/identity/pep + + /permission/admin/manage/identity/usermgt/create + + + /permission/admin/manage/identity/usermgt/list + + + /permission/admin/manage/identity/rolemgt/create + + + /permission/admin/manage/identity/rolemgt/view + + + /permission/admin/manage/identity/usermgt/view + + + /permission/admin/manage/identity/usermgt/update + + + /permission/admin/manage/identity/usermgt/update + + + /permission/admin/manage/identity/usermgt/delete + + + /permission/admin/manage/identity/rolemgt/view + + + /permission/admin/manage/identity/rolemgt/update + + + /permission/admin/manage/identity/rolemgt/update + + + /permission/admin/manage/identity/rolemgt/delete + + + /permission/admin/login + + + /permission/admin/manage/identity/usermgt/delete + + + /permission/admin/login + + + /permission/admin/login + + + /permission/admin/manage/identity/usermgt/create + + + + + + + + + /permission/admin/manage/identity/usermgt + + + /permission/admin/manage/identity/applicationmgt + - /api/identity/user/v0.9 - /api/identity/recovery/v0.9 - /oauth2 - /api/identity/entitlement + /api/identity/user/v1.0/ + /api/identity/consent-mgt/v1.0/ + /api/identity/recovery/v0.9/ + /oauth2/ + /scim2/ + /api/identity/entitlement/ + /api/identity/oauth2/dcr/v1.0/ /identity/(.*) diff --git a/pattern-2/confs/apim-km/repository/conf/registry.xml b/pattern-2/confs/apim-pubstore-tm-1/registry.xml old mode 100755 new mode 100644 similarity index 93% rename from pattern-2/confs/apim-km/repository/conf/registry.xml rename to pattern-2/confs/apim-pubstore-tm-1/registry.xml index e004a457..3da454e5 --- a/pattern-2/confs/apim-km/repository/conf/registry.xml +++ b/pattern-2/confs/apim-pubstore-tm-1/registry.xml @@ -1,374 +1,384 @@ - - - - - - - wso2registry - false - true - / - - - jdbc/WSO2CarbonDB - - - - jdbc/WSO2REG_DB - - - gov - root@jdbc:mysql://apim_rdbms:3306/regdb - govregistry - false - true - / - - - gov - /_system/governance - - - gov - /_system/config - - - - - - .* - - - - - - - - .* - - - - - - - - true - - /trunk/schemas/ - - - /trunk/wsdls/ - - - /trunk/policies/ - - - - application/wsdl+xml - - - - - - - application/wsdl+xml - application/xsd+xml - 50 - true - - 3 - - /trunk/schemas/ - - - /trunk/wsdls/ - - - application/vnd.wso2.governance-archive - - - - - - - - 1.0.0-SNAPSHOT - true - - dev - qa - live - - - application/vnd.wso2-service+xml - - - - - - - - application/vnd.wso2-service+xml - - - - - - - - application/vnd.wso2-api+xml - - - - - - - - /_system/governance/event/topics/registry/notifications/.* - - - - - - - - - Created - Tested - Deployed - - - application/vnd.wso2-smart-link - - - - - - - - /trunk/policies/ - - - application/policy+xml - - - - - - - - true - - /trunk/schemas/ - - - application/x-xsd+xml - - - - - - - - application/vnd.wso2-hyperlink - - - - - - - application/vnd.wso2.endpoint - - /trunk/endpoints/ - - - - - - - - application/vnd.wso2-uri+xml - - - - - - - - .* - - - - - - - .* - - - - - - - workflow-config - - - - - - - - - - - - - - - - - - - - true - 35 - 3 - - 40 - - 40 - - /_system/local/repository/components/org.wso2.carbon.registry/indexing/lastaccesstime - - - - - - - - - - - - - - - - - - - - - - false - - - - true - true - true - true - - /trunk/services/ - - - - - false - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + wso2registry + false + true + / + + + jdbc/WSO2CarbonDB + + + + jdbc/WSO2REG_DB + + + gov + wso2carbon@jdbc:mysql://wso2apim-pattern-2-rdbms-service:3306/WSO2AM_COMMON_DB + govregistry + false + true + / + + + gov + /_system/governance + + + gov + /_system/config + + + + + + + .* + + + + + + + + .* + + + + + + + + true + + /trunk/schemas/ + + + /trunk/wsdls/ + + + /trunk/policies/ + + + + application/wsdl+xml + + + + + + + application/wsdl+xml + application/xsd+xml + 50 + true + + 3 + + /trunk/schemas/ + + + /trunk/wsdls/ + + + application/vnd.wso2.governance-archive + + + + + + + + 1.0.0-SNAPSHOT + true + + dev + qa + live + + + application/vnd.wso2-service+xml + + + + + + + + application/vnd.wso2-service+xml + + + + + + + + application/vnd.wso2-api+xml + + + + + + + + /_system/governance/event/topics/registry/notifications/.* + + + + + + + + + Created + Tested + Deployed + + + application/vnd.wso2-smart-link + + + + + + + + /trunk/policies/ + + + application/policy+xml + + + + + + + + true + + /trunk/schemas/ + + + application/x-xsd+xml + + + + + + + + application/vnd.wso2-hyperlink + + + + + + + application/vnd.wso2.endpoint + + /trunk/endpoints/ + + + + + + + + application/vnd.wso2-uri+xml + + + + + + + + .* + + + + + + + .* + + + + + + + workflow-config + + + + + + + + + + + + + + + + + + + + + + + true + + 35 + 3 + + 40 + + 40 + + /_system/local/repository/components/org.wso2.carbon.registry/indexing/lastaccesstime + + + + + + + + + + + + + + + + + + + + + + + false + + + + true + true + true + true + + /trunk/services/ + + + + + false + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pattern-2/confs/apim-pubstore-tm-1/repository/conf/datasources/master-datasources.xml b/pattern-2/confs/apim-pubstore-tm-1/repository/conf/datasources/master-datasources.xml deleted file mode 100755 index b51f449e..00000000 --- a/pattern-2/confs/apim-pubstore-tm-1/repository/conf/datasources/master-datasources.xml +++ /dev/null @@ -1,175 +0,0 @@ - - - - org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader - - - - - - WSO2_CARBON_DB - The datasource used for registry and user manager - - jdbc/WSO2CarbonDB - - - - jdbc:h2:repository/database/WSO2CARBON_DB;DB_CLOSE_ON_EXIT=FALSE - wso2carbon - wso2carbon - org.h2.Driver - 50 - 60000 - true - SELECT 1 - 30000 - - - - - - WSO2AM_DB - The datasource used for API Manager database - - jdbc/WSO2AM_DB - - - - jdbc:mysql://apim-rdbms:3306/apimgtdb?autoReconnect=true - root - root - false - com.mysql.jdbc.Driver - 50 - 60000 - true - SELECT 1 - 30000 - - - - - - WSO2UM_DB - The datasource used by user manager - - jdbc/WSO2UM_DB - - - - jdbc:mysql://apim-rdbms:3306/userdb?autoReconnect=true - root - root - com.mysql.jdbc.Driver - 50 - 60000 - true - SELECT 1 - 30000 - - - - - - WSO2REG_DB - The datasource used by the registry - - jdbc/WSO2REG_DB - - - - jdbc:mysql://apim-rdbms:3306/govregdb?autoReconnect=true - root - root - com.mysql.jdbc.Driver - 50 - 60000 - true - SELECT 1 - 30000 - - - - - - WSO2AM_STATS_DB - The datasource used for setting statistics to API Manager - - jdbc/WSO2AM_STATS_DB - - - - jdbc:mysql://apim-rdbms:3306/statdb?autoReconnect=true&relaxAutoCommit=true - root - root - com.mysql.jdbc.Driver - 50 - 60000 - true - SELECT 1 - 30000 - false - - - - - - WSO2_MB_STORE_DB - The datasource used for message broker database - - WSO2MBStoreDB - - - - jdbc:h2:repository/database/WSO2MB_DB;DB_CLOSE_ON_EXIT=FALSE;LOCK_TIMEOUT=60000 - wso2carbon - wso2carbon - org.h2.Driver - 50 - 60000 - true - SELECT 1 - 30000 - false - - - - - - - - - - diff --git a/pattern-2/confs/apim-pubstore-tm-1/repository/conf/identity/identity.xml b/pattern-2/confs/apim-pubstore-tm-1/repository/conf/identity/identity.xml deleted file mode 100755 index 111e7a9d..00000000 --- a/pattern-2/confs/apim-pubstore-tm-1/repository/conf/identity/identity.xml +++ /dev/null @@ -1,513 +0,0 @@ - - - - - - - jdbc/WSO2AM_DB - - - - - true - true - 0 - - true - 20160 - 1140 - - - true - 720 - - - - - - 15 - 20160 - - - - - ${carbon.home}/conf/keystores - SunX509 - SunX509 - - - SelfAndManaged - CertValidate - - - - - - - - - - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/openidserver - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/openid - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/authenticationendpoint/openid_login.do - - false - - 7200 - - false - - - - - - - - - - - - - - - - -1 - -1 - -1 - -1 - - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/oauth/request-token - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/oauth/authorize-url - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/oauth/access-token - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/oauth2/authorize - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/oauth2/token - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/oauth2/revoke - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/oauth2/introspect - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/oauth2/userinfo - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/oidc/checksession - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/oidc/logout - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/authenticationendpoint/oauth2_authz.do - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/authenticationendpoint/oauth2_error.do - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/authenticationendpoint/oauth2_consent.do - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/authenticationendpoint/oauth2_logout_consent.do - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/authenticationendpoint/oauth2_logout.do - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/.well-known/webfinger - - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/identity/connect/register - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/oauth2/jwks - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/oauth2/oidcdiscovery - - 300 - - 3600 - - 3600 - - 84600 - - 300 - - true - - true - - org.wso2.carbon.identity.oauth.tokenprocessor.PlainTextPersistenceProcessor - - - - false - - - - - - token - org.wso2.carbon.identity.oauth2.authz.handlers.TokenResponseTypeHandler - - - code - org.wso2.carbon.identity.oauth2.authz.handlers.CodeResponseTypeHandler - - - id_token - org.wso2.carbon.identity.oauth2.authz.handlers.TokenResponseTypeHandler - - - id_token token - org.wso2.carbon.identity.oauth2.authz.handlers.TokenResponseTypeHandler - - - - - - authorization_code - org.wso2.carbon.apimgt.keymgt.handlers.ExtendedAuthorizationCodeGrantHandler - - - password - org.wso2.carbon.apimgt.keymgt.handlers.ExtendedPasswordGrantHandler - - - refresh_token - org.wso2.carbon.identity.oauth2.token.handlers.grant.RefreshGrantHandler - - - client_credentials - org.wso2.carbon.apimgt.keymgt.handlers.ExtendedClientCredentialsGrantHandler - - - urn:ietf:params:oauth:grant-type:saml2-bearer - org.wso2.carbon.apimgt.keymgt.handlers.ExtendedSAML2BearerGrantHandler - - - iwa:ntlm - org.wso2.carbon.identity.oauth.common.NTLMAuthenticationValidator - org.wso2.carbon.identity.oauth2.token.handlers.grant.iwa.ntlm.NTLMAuthenticationGrantHandlerWithHandshake - - - - - - - - - - false - - - false - - - - - - false - org.wso2.carbon.identity.oauth2.authcontext.JWTTokenGenerator - org.wso2.carbon.identity.oauth2.authcontext.DefaultClaimsRetriever - http://wso2.org/claims - SHA256withRSA - 15 - - - - - - org.wso2.carbon.identity.openidconnect.DefaultIDTokenBuilder - SHA256withRSA - - - - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/oauth2/token - org.wso2.carbon.identity.openidconnect.SAMLAssertionClaimsCallback - 3600 - org.wso2.carbon.identity.oauth.endpoint.user.impl.UserInfoUserStoreClaimRetriever - org.wso2.carbon.identity.oauth.endpoint.user.impl.UserInforRequestDefaultValidator - org.wso2.carbon.identity.oauth.endpoint.user.impl.UserInfoISAccessTokenValidator - org.wso2.carbon.identity.oauth.endpoint.user.impl.UserInfoJSONResponseBuilder - false - - - - - - - gtalk - talk.google.com - 5222 - gmail.com - multifactor1@gmail.com - wso2carbon - - - - - 157680000 - 157680000 - ${carbon.host} - - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/samlsso - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/authenticationendpoint/samlsso_logout.do - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/authenticationendpoint/samlsso_notification.do - 5 - 60000 - - false - http://wso2.org/claims - - org.wso2.carbon.identity.sso.saml.builders.assertion.DefaultSAMLAssertionBuilder - org.wso2.carbon.identity.sso.saml.builders.encryption.DefaultSSOEncrypter - org.wso2.carbon.identity.sso.saml.builders.signature.DefaultSSOSigner - org.wso2.carbon.identity.sso.saml.validators.SAML2HTTPRedirectDeflateSignatureValidator - - - 5 - false - http://www.w3.org/2000/09/xmldsig#rsa-sha1 - http://www.w3.org/2000/09/xmldsig#sha1 - true - - - - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/services/wso2carbon-sts - - - - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/passivests - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/authenticationendpoint/retry.do - org.wso2.carbon.identity.sts.passive.utils.NoPersistenceTokenStore - true - - - - false - ${Ports.ThriftEntitlementReceivePort} - 10000 - - ${carbon.home}/repository/resources/security/wso2carbon.jks - wso2carbon - - - ${carbon.host} - - - - - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/wso2/scim/Users - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/wso2/scim/Groups - - - 5 - - - 10 - local://services - - - - - - - - - - - - org.wso2.carbon.identity.governance.store.JDBCIdentityDataStore - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /permission/admin/manage/identity/applicationmgt/delete - - - /permission/admin/manage/identity/applicationmgt/create - - - /permission/admin/manage/identity/applicationmgt/view - - - /permission/admin/manage/identity/pep - - - - - - - - /api/identity/user/v0.9 - /api/identity/recovery/v0.9 - /oauth2 - /api/identity/entitlement - - - /identity/(.*) - - - - 300 - diff --git a/pattern-2/confs/apim-pubstore-tm-1/repository/conf/jndi.properties b/pattern-2/confs/apim-pubstore-tm-1/repository/conf/jndi.properties deleted file mode 100755 index 21befd18..00000000 --- a/pattern-2/confs/apim-pubstore-tm-1/repository/conf/jndi.properties +++ /dev/null @@ -1,29 +0,0 @@ -# -# Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -# -# Licensed 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. -# - -# register some connection factories -# connectionfactory.[jndiname] = [ConnectionURL] -connectionfactory.TopicConnectionFactory = amqp://admin:admin@clientid/carbon?brokerlist='tcp://localhost:5672' - -connectionfactory.QueueConnectionFactory = amqp://admin:admin@clientID/test?brokerlist='tcp://localhost:5672' - -# register some queues in JNDI using the form -# queue.[jndiName] = [physicalName] -#queue.MyQueue = example.MyQueue - -# register some topics in JNDI using the form -# topic.[jndiName] = [physicalName] -topic.throttleData = throttleData diff --git a/pattern-2/confs/apim-pubstore-tm-1/repository/conf/log4j.properties b/pattern-2/confs/apim-pubstore-tm-1/repository/conf/log4j.properties deleted file mode 100755 index 55c79f90..00000000 --- a/pattern-2/confs/apim-pubstore-tm-1/repository/conf/log4j.properties +++ /dev/null @@ -1,220 +0,0 @@ -# -# Copyright (c) 2005-2015, WSO2 Inc. (http://wso2.com) All Rights Reserved. -# -# Licensed 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. -# - -## -# This is the log4j configuration file used by WSO2 AM -# ===================================================== -# -# IMPORTANT : Please do not remove or change the names of any of the Appenders defined here. -# The layout pattern & log file can be changed using the WSO2 AM Management Console, and those -# settings will override the settings in this file. -## - - -# the root category is ERROR (applies for all 3rd party JARs etc) and will be logged to the -# LOG_APPENDER and the CONSOLE_APPENDER - -log4j.rootLogger=ERROR, CARBON_CONSOLE, CARBON_LOGFILE, CARBON_MEMORY, CARBON_SYS_LOG, ERROR_LOGFILE, DAS_AGENT - -log4j.logger.AUDIT_LOG=INFO, AUDIT_LOGFILE - -log4j.category.org.apache.synapse=INFO -log4j.category.org.apache.synapse.transport=INFO -log4j.category.org.apache.axis2=INFO -log4j.category.org.apache.axis2.transport=INFO -log4j.logger.com.atomikos=INFO,ATOMIKOS -log4j.logger.org.quartz=WARN -log4j.logger.org.wso2=INFO -log4j.logger.org.wso2.carbon=INFO -#log4j.category.org.apache.synapse.transport.nhttp.util=DEBUG -#log4j.category.org.apache.http.impl.nio.reactor=DEBUG -#log4j.logger.org.wso2.carbon.utils.deployment.ComponentBuilder=DEBUG -#log4j.logger.org.wso2.carbon.utils.deployment.OSGiBundleDeployer=DEBUG -log4j.logger.org.apache.catalina=WARN -log4j.logger.org.apache.coyote=WARN -log4j.logger.org.apache.axis2.enterprise=FATAL -log4j.logger.de.hunsicker.jalopy.io=FATAL - -# uncomment the following logs to see HTTP headers and messages -#log4j.logger.org.apache.synapse.transport.http.headers=DEBUG -#log4j.logger.org.apache.synapse.transport.http.wire=DEBUG - -# qpid related logs for the message broker -log4j.logger.qpid=WARN -log4j.logger.org.apache.qpid=WARN -log4j.logger.org.apache.qpid.server.Main=INFO -log4j.logger.qpid.message=WARN -log4j.logger.qpid.message.broker.listening=INFO -log4j.logger.org.wso2.carbon.databridge.agent.thrift.AsyncDataPublisher=WARN - -# The console appender is used to display general information at console -log4j.appender.CARBON_CONSOLE=org.wso2.carbon.utils.logging.appenders.CarbonConsoleAppender -log4j.appender.CARBON_CONSOLE.layout=org.apache.log4j.PatternLayout -log4j.appender.CARBON_CONSOLE.layout.ConversionPattern=[%d{ISO8601}] %5p - %c{1} %m%n - -# Configure the service logger at INFO level. Writes only run-time/mediation-time audit messages -log4j.category.SERVICE_LOGGER=INFO, SERVICE_APPENDER -log4j.additivity.SERVICE_LOGGER=false -log4j.appender.SERVICE_APPENDER=org.apache.log4j.RollingFileAppender -log4j.appender.SERVICE_APPENDER.File=${carbon.home}/repository/logs/${instance.log}/wso2-apigw-service${instance.log}.log -log4j.appender.SERVICE_APPENDER.MaxFileSize=1000KB -log4j.appender.SERVICE_APPENDER.MaxBackupIndex=10 -log4j.appender.SERVICE_APPENDER.layout=org.apache.log4j.PatternLayout -log4j.appender.SERVICE_APPENDER.layout.ConversionPattern=%d{ISO8601} [%X{ip}-%X{host}] [%t] %5p %c{1} %m%n - -# The trace logger dumps enough information @INFO level, but maybe pushed upto TRACE. -# Writes only run-time/mediation time tracing/debug messages for messages passing through trace -# enabled sequences, mediators and services. Enabling tracing on these has a performance impact -log4j.category.TRACE_LOGGER=INFO, TRACE_APPENDER, TRACE_MEMORYAPPENDER -log4j.additivity.TRACE_LOGGER=false -log4j.appender.TRACE_APPENDER=org.apache.log4j.DailyRollingFileAppender -log4j.appender.TRACE_APPENDER.File=${carbon.home}/repository/logs/${instance.log}/wso2-apigw-trace${instance.log}.log -log4j.appender.TRACE_APPENDER.Append=true -log4j.appender.TRACE_APPENDER.layout=org.apache.log4j.PatternLayout -log4j.appender.TRACE_APPENDER.layout.ConversionPattern=%d{HH:mm:ss,SSS} [%X{ip}-%X{host}] [%t] %5p %c{1} %m%n - -# The memory appender for trace logger -log4j.appender.TRACE_MEMORYAPPENDER=org.wso2.carbon.utils.logging.appenders.MemoryAppender -log4j.appender.TRACE_MEMORYAPPENDER.bufferSize=2000 -log4j.appender.TRACE_MEMORYAPPENDER.layout=org.apache.log4j.PatternLayout -log4j.appender.TRACE_MEMORYAPPENDER.layout.ConversionPattern=%d{HH:mm:ss,SSS} [%X{ip}-%X{host}] [%t] %5p %m%n - -# CARBON_LOGFILE is set to be a DailyRollingFileAppender using a PatternLayout. -log4j.appender.CARBON_LOGFILE=org.wso2.carbon.utils.logging.appenders.CarbonDailyRollingFileAppender -# Log file will be overridden by the configuration setting in the DB -# This path should be relative to WSO2 Carbon Home -log4j.appender.CARBON_LOGFILE.File=${carbon.home}/repository/logs/${instance.log}/wso2carbon${instance.log}.log -log4j.appender.CARBON_LOGFILE.Append=true -log4j.appender.CARBON_LOGFILE.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout -# ConversionPattern will be overridden by the configuration setting in the DB -log4j.appender.CARBON_LOGFILE.layout.ConversionPattern=TID: [%T] [%S] [%d] %P%5p {%c} - %x %m {%c}%n -log4j.appender.CARBON_LOGFILE.layout.TenantPattern=%U%@%D [%T] [%S] -log4j.appender.CARBON_LOGFILE.threshold=DEBUG - -# The standard error log where all the warnings, errors and fatal errors will be logged -log4j.appender.ERROR_LOGFILE=org.apache.log4j.FileAppender -log4j.appender.ERROR_LOGFILE.File=${carbon.home}/repository/logs/${instance.log}/wso2-apigw-errors.log -log4j.appender.ERROR_LOGFILE.layout=org.apache.log4j.PatternLayout -log4j.appender.ERROR_LOGFILE.layout.ConversionPattern=%d{ISO8601} [%X{ip}-%X{host}] [%t] %5p %c{1} %m%n -log4j.appender.ERROR_LOGFILE.threshold=WARN - -# The memory appender for logging -log4j.appender.CARBON_MEMORY=org.wso2.carbon.logging.service.appender.CarbonMemoryAppender -log4j.appender.CARBON_MEMORY.bufferSize=2000 -log4j.appender.CARBON_MEMORY.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout -# ConversionPattern will be overridden by the configuration setting in the DB -log4j.appender.CARBON_MEMORY.layout.ConversionPattern=TID: [%T] [%S] [%d] %P%5p {%c} - %x %m {%c}%n -log4j.appender.CARBON_MEMORY.layout.TenantPattern=%U%@%D [%T] [%S] -log4j.appender.CARBON_MEMORY.columnList=%T,%S,%A,%d,%c,%p,%m,%H,%I,%Stacktrace -log4j.appender.CARBON_MEMORY.threshold=DEBUG - -# LOGEVENT is set to be a LogEventAppender using a PatternLayout to send logs to LOGEVENT -log4j.appender.LOGEVENT=org.wso2.carbon.logging.appender.LogEventAppender -log4j.appender.LOGEVENT.url=tcp://localhost:7611 -log4j.appender.LOGEVENT.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout -log4j.appender.LOGEVENT.columnList=%T,%S,%A,%d,%c,%p,%m,%I,%Stacktrace -log4j.appender.LOGEVENT.userName=admin -log4j.appender.LOGEVENT.password=admin -log4j.appender.LOGEVENT.processingLimit=1000 -log4j.appender.LOGEVENT.maxTolerableConsecutiveFailure=20 - - -log4j.appender.CARBON_SYS_LOG = org.apache.log4j.net.SyslogAppender -log4j.appender.CARBON_SYS_LOG.layout=org.apache.log4j.PatternLayout -log4j.appender.CARBON_SYS_LOG.layout.ConversionPattern=[%d] %5p - %x %m {%c}%n -log4j.appender.CARBON_SYS_LOG.SyslogHost=localhost -log4j.appender.CARBON_SYS_LOG.Facility=USER -log4j.appender.CARBON_SYS_LOG.threshold=DEBUG - -# LOGEVENT is set to be a LogEventAppender using a PatternLayout to send logs to LOGEVENT -log4j.appender.LOGEVENT=org.wso2.carbon.logging.appender.LogEventAppender -log4j.appender.LOGEVENT.url=tcp://localhost:7611 -log4j.appender.LOGEVENT.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout -log4j.appender.LOGEVENT.columnList=%T,%S,%A,%d,%c,%p,%m,%H,%I,%Stacktrace -log4j.appender.LOGEVENT.userName=admin -log4j.appender.LOGEVENT.password=admin - -log4j.logger.org.apache.directory.shared.ldap=WARN, CARBON_CONSOLE -log4j.logger.org.apache.directory.server.ldap.handlers=WARN, CARBON_CONSOLE -log4j.logger.org.apache.directory.shared.ldap.entry.DefaultServerAttribute=FATAL, CARBON_CONSOLE -log4j.logger.org.apache.directory.shared.ldap.ldif.LdifReader=ERROR, CARBON_CONSOLE -log4j.logger.org.apache.directory.server.ldap.LdapProtocolHandler=ERROR, CARBON_CONSOLE - -## Trace Logger configuration which will append to a XMPP chatroom or JID ## -#log4j.appender.XMPP_APPENDER=org.wso2.carbon.utils.logging.IMAppender -#log4j.appender.XMPP_APPENDER.host=jabber.org -#log4j.appender.XMPP_APPENDER.username=wso2esb -#log4j.appender.XMPP_APPENDER.password=wso2esb -#log4j.appender.XMPP_APPENDER.recipient=ruwan@jabber.org -#log4j.appender.XMPP_APPENDER.layout=org.apache.log4j.PatternLayout -#log4j.appender.XMPP_APPENDER.layout.ConversionPattern=[%X{host}] [%t] %-5p [%d{HH:mm:ss,SSS}] %C{1} - %m%n - -# Appender config to AUDIT_LOGFILE -log4j.appender.AUDIT_LOGFILE=org.apache.log4j.DailyRollingFileAppender -log4j.appender.AUDIT_LOGFILE.File=${carbon.home}/repository/logs/audit.log -log4j.appender.AUDIT_LOGFILE.Append=true -log4j.appender.AUDIT_LOGFILE.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout -log4j.appender.AUDIT_LOGFILE.layout.ConversionPattern=[%d] %P%5p - %x %m %n -log4j.appender.AUDIT_LOGFILE.layout.TenantPattern=%U%@%D [%T] [%S] -log4j.appender.AUDIT_LOGFILE.threshold=INFO -log4j.additivity.AUDIT_LOG=false - -# Appender config to send Atomikos transaction logs to new log file tm.out. -log4j.appender.ATOMIKOS = org.apache.log4j.RollingFileAppender -log4j.appender.ATOMIKOS.File = repository/logs/tm.out -log4j.appender.ATOMIKOS.Append = true -log4j.appender.ATOMIKOS.layout = org.apache.log4j.PatternLayout -log4j.appender.ATOMIKOS.layout.ConversionPattern=%p %t %c - %m%n -log4j.additivity.com.atomikos=false - -# DAS_AGENT is set to be a Custom Log Appender. -log4j.appender.DAS_AGENT=org.wso2.carbon.analytics.shared.data.agents.log4j.appender.LogEventAppender -# DAS_AGENT uses PatternLayout. -log4j.appender.DAS_AGENT.layout=org.wso2.carbon.analytics.shared.data.agents.log4j.util.TenantAwarePatternLayout -log4j.appender.DAS_AGENT.columnList=%D,%S,%A,%d,%c,%p,%m,%H,%I,%Stacktrace -log4j.appender.DAS_AGENT.userName=admin -log4j.appender.DAS_AGENT.password=admin -log4j.appender.DAS_AGENT.url=tcp://wso2apim-analytics-1:7612|tcp://wso2apim-analytics-2:7612 -log4j.appender.DAS_AGENT.maxTolerableConsecutiveFailure=5 -log4j.appender.DAS_AGENT.streamDef=loganalyzer:1.0.0 -log4j.logger.trace.messages=TRACE,CARBON_TRACE_LOGFILE - -# Appender config to CARBON_TRACE_LOGFILE -log4j.appender.CARBON_TRACE_LOGFILE=org.apache.log4j.DailyRollingFileAppender -log4j.appender.CARBON_TRACE_LOGFILE.File=${carbon.home}/repository/logs/${instance.log}/wso2carbon-trace-messages${instance.log}.log -log4j.appender.CARBON_TRACE_LOGFILE.Append=true -log4j.appender.CARBON_TRACE_LOGFILE.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout -log4j.appender.CARBON_TRACE_LOGFILE.layout.ConversionPattern=[%d] %P%5p {%c} - %x %m %n -log4j.appender.CARBON_TRACE_LOGFILE.layout.TenantPattern=%U%@%D [%T] [%S] -log4j.appender.CARBON_TRACE_LOGFILE.threshold=TRACE -log4j.additivity.trace.messages=false - - -# The event trace logger dumps enough information @INFO level, but maybe pushed upto TRACE. -# Writes only run-time/event processing time tracing/debug messages for event passing through trace -# enabled transport adapters event formatters, builders and processors. Enabling event tracing on these has a performance impact -log4j.category.EVENT_TRACE_LOGGER=INFO, EVENT_TRACE_APPENDER, EVENT_TRACE_MEMORYAPPENDER -log4j.additivity.EVENT_TRACE_LOGGER=false -log4j.appender.EVENT_TRACE_APPENDER=org.apache.log4j.DailyRollingFileAppender -log4j.appender.EVENT_TRACE_APPENDER.File=${carbon.home}/repository/logs/${instance.log}/wso2-cep-trace${instance.log}.log -log4j.appender.EVENT_TRACE_APPENDER.Append=true -log4j.appender.EVENT_TRACE_APPENDER.layout=org.apache.log4j.PatternLayout -log4j.appender.EVENT_TRACE_APPENDER.layout.ConversionPattern=%d{HH:mm:ss,SSS} [%X{ip}-%X{host}] [%t] %5p %c{1} %m%n -# The memory appender for trace logger -log4j.appender.EVENT_TRACE_MEMORYAPPENDER=org.wso2.carbon.utils.logging.appenders.MemoryAppender -log4j.appender.EVENT_TRACE_MEMORYAPPENDER.bufferSize=2000 -log4j.appender.EVENT_TRACE_MEMORYAPPENDER.layout=org.apache.log4j.PatternLayout -log4j.appender.EVENT_TRACE_MEMORYAPPENDER.layout.ConversionPattern=%d{HH:mm:ss,SSS} [%X{ip}-%X{host}] [%t] %5p %m%n diff --git a/pattern-2/confs/apim-pubstore-tm-1/repository/conf/registry.xml b/pattern-2/confs/apim-pubstore-tm-1/repository/conf/registry.xml deleted file mode 100755 index e004a457..00000000 --- a/pattern-2/confs/apim-pubstore-tm-1/repository/conf/registry.xml +++ /dev/null @@ -1,374 +0,0 @@ - - - - - - - wso2registry - false - true - / - - - jdbc/WSO2CarbonDB - - - - jdbc/WSO2REG_DB - - - gov - root@jdbc:mysql://apim_rdbms:3306/regdb - govregistry - false - true - / - - - gov - /_system/governance - - - gov - /_system/config - - - - - - .* - - - - - - - - .* - - - - - - - - true - - /trunk/schemas/ - - - /trunk/wsdls/ - - - /trunk/policies/ - - - - application/wsdl+xml - - - - - - - application/wsdl+xml - application/xsd+xml - 50 - true - - 3 - - /trunk/schemas/ - - - /trunk/wsdls/ - - - application/vnd.wso2.governance-archive - - - - - - - - 1.0.0-SNAPSHOT - true - - dev - qa - live - - - application/vnd.wso2-service+xml - - - - - - - - application/vnd.wso2-service+xml - - - - - - - - application/vnd.wso2-api+xml - - - - - - - - /_system/governance/event/topics/registry/notifications/.* - - - - - - - - - Created - Tested - Deployed - - - application/vnd.wso2-smart-link - - - - - - - - /trunk/policies/ - - - application/policy+xml - - - - - - - - true - - /trunk/schemas/ - - - application/x-xsd+xml - - - - - - - - application/vnd.wso2-hyperlink - - - - - - - application/vnd.wso2.endpoint - - /trunk/endpoints/ - - - - - - - - application/vnd.wso2-uri+xml - - - - - - - - .* - - - - - - - .* - - - - - - - workflow-config - - - - - - - - - - - - - - - - - - - - true - 35 - 3 - - 40 - - 40 - - /_system/local/repository/components/org.wso2.carbon.registry/indexing/lastaccesstime - - - - - - - - - - - - - - - - - - - - - - false - - - - true - true - true - true - - /trunk/services/ - - - - - false - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pattern-2/confs/apim-pubstore-tm-1/repository/conf/tomcat/catalina-server.xml b/pattern-2/confs/apim-pubstore-tm-1/repository/conf/tomcat/catalina-server.xml deleted file mode 100755 index 742f4a31..00000000 --- a/pattern-2/confs/apim-pubstore-tm-1/repository/conf/tomcat/catalina-server.xml +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pattern-2/confs/apim-pubstore-tm-1/repository/conf/user-mgt.xml b/pattern-2/confs/apim-pubstore-tm-1/repository/conf/user-mgt.xml deleted file mode 100755 index de5e9db7..00000000 --- a/pattern-2/confs/apim-pubstore-tm-1/repository/conf/user-mgt.xml +++ /dev/null @@ -1,259 +0,0 @@ - - - - - - true - admin - - admin - admin - - everyone - true - jdbc/WSO2UM_DB - - - - - org.wso2.carbon.user.core.tenant.JDBCTenantManager - false - true - true - ^[\S]{3,30}$ - ^[\S]{3,30}$ - Username pattern policy violated - ^[\S]{5,30}$ - ^[\S]{5,30}$ - Password length should be within 5 to 30 characters - ^[\S]{3,30}$ - ^[\S]{3,30}$ - true - false - true - SHA-256 - true - , - 100 - 100 - true - false - - - - - - - - - - - - - /permission - true - false - - - - - diff --git a/pattern-2/confs/apim-pubstore-tm-1/user-mgt.xml b/pattern-2/confs/apim-pubstore-tm-1/user-mgt.xml new file mode 100644 index 00000000..7c0fa72e --- /dev/null +++ b/pattern-2/confs/apim-pubstore-tm-1/user-mgt.xml @@ -0,0 +1,256 @@ + + + + + + true + admin + + admin + admin + + everyone + + true + true + jdbc/WSO2UM_DB + + + + org.wso2.carbon.user.core.tenant.JDBCTenantManager + false + true + true + ^[\S]{3,30}$ + ^[\S]{3,30}$ + Username pattern policy violated + ^[\S]{5,30}$ + ^[\S]{5,30}$ + Password length should be within 5 to 30 characters + ^[\S]{3,30}$ + ^[\S]{3,30}$ + true + false + true + SHA-256 + true + , + 100 + 100 + true + false + + + + + + + + + /permission + true + false + + + + diff --git a/pattern-1/confs/apim-manager-worker/repository/conf/api-manager.xml b/pattern-2/confs/apim-pubstore-tm-2/api-manager.xml old mode 100755 new mode 100644 similarity index 84% rename from pattern-1/confs/apim-manager-worker/repository/conf/api-manager.xml rename to pattern-2/confs/apim-pubstore-tm-2/api-manager.xml index a13a27d5..06877943 --- a/pattern-1/confs/apim-manager-worker/repository/conf/api-manager.xml +++ b/pattern-2/confs/apim-pubstore-tm-2/api-manager.xml @@ -16,7 +16,7 @@ logic relies on this. --> - https://wso2apim.wso2.svc:9443${carbon.context}services/ + https://wso2apim-km:${mgt.transport.https.port}${carbon.context}services/ ${admin.username} @@ -56,8 +56,6 @@ Token generation the implementation is provided in URLSafeJWTGenerator --> - - - - Production and Sandbox - This is a hybrid gateway that handles both production and sandbox token traffic. - - https://localhost:${mgt.transport.https.port}${carbon.context}services/ - - ${admin.username} - - ${admin.password} - - http://wso2apim-gw,https://wso2apim-gw + + + + + + + + + + + + + + Production Gateway + Production Gateway Environment + https://wso2apim-gateway-service:9443${carbon.context}services/ + admin + admin + https://wso2apim-gateway @@ -108,6 +114,15 @@ false + + true + + true @@ -136,20 +151,20 @@ Ex - Multiple Receiver Groups with two receivers each {tcp://localhost:7612/,tcp://localhost:7613},{tcp://localhost:7712/,tcp://localhost:7713/} --> - tcp://wso2apim-analytics-1:7612|tcp://wso2apim-analytics-2:7612 - ssl://wso2apim-analytics-1:7712|ssl://wso2apim-analytics-2:7712 + tcp://wso2apim-analytics-service:7612 + ssl://wso2apim-analytics-service:7712 - admin + ${admin.username} - admin + ${admin.password} org.wso2.carbon.apimgt.usage.client.impl.APIUsageStatisticsRdbmsClientImpl https://wso2apim-analytics:9444 - admin - admin + ${admin.username} + ${admin.password} @@ -190,7 +205,7 @@ org.wso2.analytics.apim.alertStakeholderInfo - 1.0.0 + 1.0.1 @@ -202,7 +217,7 @@ --> - https://wso2apim.wso2.svc:9443${carbon.context}services/ + https://wso2apim-km:${mgt.transport.https.port}${carbon.context}services/ ${admin.username} @@ -220,7 +235,7 @@ 10000 - false + true localhost @@ -249,6 +264,8 @@ + + am_application_scope - https://localhost:${https.nio.port}/revoke + https://wso2apim-gateway-service:${https.nio.port}/revoke @@ -280,6 +297,7 @@ + false true @@ -287,7 +305,7 @@ https://wso2apim/store - https://wso2apim-manager-worker.wso2.svc:9443${carbon.context}services/ + https://localhost:${mgt.transport.https.port}${carbon.context}services/ ${admin.username} @@ -325,6 +343,8 @@ + + true - - - - false - - - - - /resource - admin - 1.0.0 - none - none - Any - - - - - - - @@ -571,13 +551,15 @@ true - - true + Binary - {tcp://${carbon.local.ip}:${receiver.url.port}}, {tcp://wso2apim-worker:9611} - {ssl://${carbon.local.ip}:${auth.url.port}}, {ssl://wso2apim-worker:9711} + tcp://${carbon.local.ip}:${receiver.url.port},{tcp://wso2apim-pubstore-tm-1:9611} + ssl://${carbon.local.ip}:${auth.url.port},{ssl://wso2apim-pubstore-tm-1:9711} ${admin.username} ${admin.password} + + + true 1000 200 @@ -589,6 +571,7 @@ + true https://localhost:${mgt.transport.https.port}${carbon.context}services/ ${admin.username} ${admin.password} @@ -600,33 +583,16 @@ true - tcp://${carbon.local.ip}:${jms.port} - ${admin.username} - ${admin.password} throttleData TopicConnectionFactory topic org.wso2.andes.jndi.PropertiesFileInitialContextFactory - - amqp://admin:admin@clientID/carbon?failover='roundrobin'%26cyclecount='2'%26brokerlist='tcp://localhost:5672?retries='5'%26connectdelay='50';tcp://wso2apim-worker:5672?retries='5'%26connectdelay='50'' + amqp://admin:admin@clientID/carbon?failover='roundrobin'%26cyclecount='2'%26brokerlist='tcp://127.0.0.1:5672?retries='5'%26connectdelay='50';tcp://wso2apim-pubstore-tm-1:5672?retries='5'%26connectdelay='50'' - - 20 - 100 - 1000 - 10 - - - org.wso2.andes.jndi.PropertiesFileInitialContextFactory - repository/conf/jndi.properties - topic - throttleData - allow - TopicConnectionFactory - + + Supported Languages/Frameworks : android, java, scala, csharp, dart, flash, groovy, javascript, jmeter, + nodejs, perl, php, python, ruby, swift, clojure, asyncScala, csharpDotNet2--> java,android diff --git a/pattern-2/confs/apim-pubstore-tm-2/repository/conf/axis2/axis2.xml b/pattern-2/confs/apim-pubstore-tm-2/axis2/axis2.xml old mode 100755 new mode 100644 similarity index 95% rename from pattern-2/confs/apim-pubstore-tm-2/repository/conf/axis2/axis2.xml rename to pattern-2/confs/apim-pubstore-tm-2/axis2/axis2.xml index 72085ff4..2cc3872b --- a/pattern-2/confs/apim-pubstore-tm-2/repository/conf/axis2/axis2.xml +++ b/pattern-2/confs/apim-pubstore-tm-2/axis2/axis2.xml @@ -168,14 +168,16 @@ class="org.apache.axis2.format.PlainTextFormatter"/> - + + class="org.apache.synapse.commons.json.JsonFormatter"/--> + - + + class="org.apache.synapse.commons.json.JsonBuilder"/--> + + @@ -543,6 +548,14 @@ wso2carbon + + + + + + repository/resources/security/sslprofiles.xml + 600000 + AllowAll @@ -596,10 +609,19 @@ - - outflowDispatchSeq - outflowFaultSeq - + + + + + + + + + + + + + @@ -633,7 +655,7 @@ getting this node to join the cluster. --> + enable="false"> kubernetes - org.wso2.carbon.membership.scheme.kubernetes.KubernetesMembershipScheme - wso2apim-pubstore-tm-1,wso2apim-pubstore-tm-2 - wso2 @@ -687,7 +706,7 @@ --> - api-manager + wso2apim-pubstore-tm - - - api-manager - 4000 - - + org.wso2.carbon.membership.scheme.kubernetes.KubernetesMembershipScheme + wso2 + wso2apim-pubstore-tm-1,wso2apim-pubstore-tm-2 + true + false - 2.1.0 + 2.2.0 + + claim_mgt_menu + identity_mgt_emailtemplate_menu + identity_security_questions_menu + - - + + + + + diff --git a/pattern-2/confs/apim-km/repository/conf/identity/identity.xml b/pattern-2/confs/apim-pubstore-tm-2/identity/identity.xml old mode 100755 new mode 100644 similarity index 54% rename from pattern-2/confs/apim-km/repository/conf/identity/identity.xml rename to pattern-2/confs/apim-pubstore-tm-2/identity/identity.xml index 111e7a9d..39c70e26 --- a/pattern-2/confs/apim-km/repository/conf/identity/identity.xml +++ b/pattern-2/confs/apim-pubstore-tm-2/identity/identity.xml @@ -33,10 +33,12 @@ true 20160 1140 + + + 50000 true - 720 @@ -108,10 +110,27 @@ --> - -1 - -1 - -1 - -1 + + + + + + + + - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/identity/connect/register + ${carbon.protocol}://${carbon.host}:${carbon.management.port}/api/identity/oauth2/dcr/v1.0/register ${carbon.protocol}://${carbon.host}:${carbon.management.port}/oauth2/jwks ${carbon.protocol}://${carbon.host}:${carbon.management.port}/oauth2/oidcdiscovery @@ -147,19 +166,13 @@ 84600 - 300 - - true + 0 true org.wso2.carbon.identity.oauth.tokenprocessor.PlainTextPersistenceProcessor - - - - false - - + + false @@ -196,6 +209,8 @@ client_credentials org.wso2.carbon.apimgt.keymgt.handlers.ExtendedClientCredentialsGrantHandler + false + false urn:ietf:params:oauth:grant-type:saml2-bearer @@ -206,18 +221,65 @@ org.wso2.carbon.identity.oauth.common.NTLMAuthenticationValidator org.wso2.carbon.identity.oauth2.token.handlers.grant.iwa.ntlm.NTLMAuthenticationGrantHandlerWithHandshake + + urn:ietf:params:oauth:grant-type:jwt-bearer + org.wso2.carbon.identity.oauth2.grant.jwt.JWTBearerGrantHandler + org.wso2.carbon.identity.oauth2.grant.jwt.JWTGrantValidator + + + + + authorization_code + + + implicit + + - + + + + + + + + + + + + + false + + + + + FEDERATED + org.wso2.carbon.identity.openidconnect.DefaultIDTokenBuilder SHA256withRSA + + RSA-OAEP + + A128GCM + + + RSA1_5 + RSA-OAEP + + + A128GCM + A192GCM + A256GCM + A128CBC-HS256 + A128CBC+HS256 + + true + false + + 120 + + + + request_param_value_builder + org.wso2.carbon.identity.openidconnect.RequestParamRequestObjectBuilder + + + + org.wso2.carbon.identity.openidconnect.RequestObjectValidatorImpl + + + true + 0 + 5 + @@ -276,8 +391,6 @@ - 157680000 - 157680000 ${carbon.host} + true + + + + + + + + + false + true + true + + true + - + + + @@ -432,54 +583,151 @@ + + + + + + + + + + + - - - - - - - - - - + name="AppAuthFrameworkSessionContextCache" timeout="300"/> + + + + + name="AuthorizationGrantCache" timeout="300"/> - + name="OAuthCache" timeout="300"/> + name="OAuthScopeCache" timeout="300"/> + name="OAuthSessionDataCache" timeout="300"/> + name="SAMLSSOParticipantCache" timeout="300"/> + name="SAMLSSOSessionIndexCache" timeout="300"/> + + + + + + + + - + + + + + + /permission/admin/manage/identity/usermgt/view + + + /permission/admin/manage/identity/usermgt/view + + + + + /permission/admin/manage/identity/consentmgt/add + + + + /permission/admin/manage/identity/consentmgt/delete + + + /permission/admin/manage/identity/consentmgt/add + + + + /permission/admin/manage/identity/consentmgt/delete + + + /permission/admin/manage/identity/consentmgt/add + + + + /permission/admin/manage/identity/consentmgt/delete + + + /permission/admin/manage/identity/applicationmgt/create + + + /permission/admin/manage/identity/applicationmgt/delete + + + /permission/admin/manage/identity/applicationmgt/update + + + /permission/admin/manage/identity/applicationmgt/view + /permission/admin/manage/identity/applicationmgt/delete @@ -492,6 +740,69 @@ /permission/admin/manage/identity/pep + + /permission/admin/manage/identity/usermgt/create + + + /permission/admin/manage/identity/usermgt/list + + + /permission/admin/manage/identity/rolemgt/create + + + /permission/admin/manage/identity/rolemgt/view + + + /permission/admin/manage/identity/usermgt/view + + + /permission/admin/manage/identity/usermgt/update + + + /permission/admin/manage/identity/usermgt/update + + + /permission/admin/manage/identity/usermgt/delete + + + /permission/admin/manage/identity/rolemgt/view + + + /permission/admin/manage/identity/rolemgt/update + + + /permission/admin/manage/identity/rolemgt/update + + + /permission/admin/manage/identity/rolemgt/delete + + + /permission/admin/login + + + /permission/admin/manage/identity/usermgt/delete + + + /permission/admin/login + + + /permission/admin/login + + + /permission/admin/manage/identity/usermgt/create + + + + + + + + + /permission/admin/manage/identity/usermgt + + + /permission/admin/manage/identity/applicationmgt + - /api/identity/user/v0.9 - /api/identity/recovery/v0.9 - /oauth2 - /api/identity/entitlement + /api/identity/user/v1.0/ + /api/identity/consent-mgt/v1.0/ + /api/identity/recovery/v0.9/ + /oauth2/ + /scim2/ + /api/identity/entitlement/ + /api/identity/oauth2/dcr/v1.0/ /identity/(.*) diff --git a/pattern-1/confs/apim-worker/repository/conf/registry.xml b/pattern-2/confs/apim-pubstore-tm-2/registry.xml old mode 100755 new mode 100644 similarity index 93% rename from pattern-1/confs/apim-worker/repository/conf/registry.xml rename to pattern-2/confs/apim-pubstore-tm-2/registry.xml index e004a457..3da454e5 --- a/pattern-1/confs/apim-worker/repository/conf/registry.xml +++ b/pattern-2/confs/apim-pubstore-tm-2/registry.xml @@ -1,374 +1,384 @@ - - - - - - - wso2registry - false - true - / - - - jdbc/WSO2CarbonDB - - - - jdbc/WSO2REG_DB - - - gov - root@jdbc:mysql://apim_rdbms:3306/regdb - govregistry - false - true - / - - - gov - /_system/governance - - - gov - /_system/config - - - - - - .* - - - - - - - - .* - - - - - - - - true - - /trunk/schemas/ - - - /trunk/wsdls/ - - - /trunk/policies/ - - - - application/wsdl+xml - - - - - - - application/wsdl+xml - application/xsd+xml - 50 - true - - 3 - - /trunk/schemas/ - - - /trunk/wsdls/ - - - application/vnd.wso2.governance-archive - - - - - - - - 1.0.0-SNAPSHOT - true - - dev - qa - live - - - application/vnd.wso2-service+xml - - - - - - - - application/vnd.wso2-service+xml - - - - - - - - application/vnd.wso2-api+xml - - - - - - - - /_system/governance/event/topics/registry/notifications/.* - - - - - - - - - Created - Tested - Deployed - - - application/vnd.wso2-smart-link - - - - - - - - /trunk/policies/ - - - application/policy+xml - - - - - - - - true - - /trunk/schemas/ - - - application/x-xsd+xml - - - - - - - - application/vnd.wso2-hyperlink - - - - - - - application/vnd.wso2.endpoint - - /trunk/endpoints/ - - - - - - - - application/vnd.wso2-uri+xml - - - - - - - - .* - - - - - - - .* - - - - - - - workflow-config - - - - - - - - - - - - - - - - - - - - true - 35 - 3 - - 40 - - 40 - - /_system/local/repository/components/org.wso2.carbon.registry/indexing/lastaccesstime - - - - - - - - - - - - - - - - - - - - - - false - - - - true - true - true - true - - /trunk/services/ - - - - - false - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + wso2registry + false + true + / + + + jdbc/WSO2CarbonDB + + + + jdbc/WSO2REG_DB + + + gov + wso2carbon@jdbc:mysql://wso2apim-pattern-2-rdbms-service:3306/WSO2AM_COMMON_DB + govregistry + false + true + / + + + gov + /_system/governance + + + gov + /_system/config + + + + + + + .* + + + + + + + + .* + + + + + + + + true + + /trunk/schemas/ + + + /trunk/wsdls/ + + + /trunk/policies/ + + + + application/wsdl+xml + + + + + + + application/wsdl+xml + application/xsd+xml + 50 + true + + 3 + + /trunk/schemas/ + + + /trunk/wsdls/ + + + application/vnd.wso2.governance-archive + + + + + + + + 1.0.0-SNAPSHOT + true + + dev + qa + live + + + application/vnd.wso2-service+xml + + + + + + + + application/vnd.wso2-service+xml + + + + + + + + application/vnd.wso2-api+xml + + + + + + + + /_system/governance/event/topics/registry/notifications/.* + + + + + + + + + Created + Tested + Deployed + + + application/vnd.wso2-smart-link + + + + + + + + /trunk/policies/ + + + application/policy+xml + + + + + + + + true + + /trunk/schemas/ + + + application/x-xsd+xml + + + + + + + + application/vnd.wso2-hyperlink + + + + + + + application/vnd.wso2.endpoint + + /trunk/endpoints/ + + + + + + + + application/vnd.wso2-uri+xml + + + + + + + + .* + + + + + + + .* + + + + + + + workflow-config + + + + + + + + + + + + + + + + + + + + + + + true + + 35 + 3 + + 40 + + 40 + + /_system/local/repository/components/org.wso2.carbon.registry/indexing/lastaccesstime + + + + + + + + + + + + + + + + + + + + + + + false + + + + true + true + true + true + + /trunk/services/ + + + + + false + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pattern-2/confs/apim-pubstore-tm-2/repository/conf/api-manager.xml b/pattern-2/confs/apim-pubstore-tm-2/repository/conf/api-manager.xml deleted file mode 100755 index f60478a6..00000000 --- a/pattern-2/confs/apim-pubstore-tm-2/repository/conf/api-manager.xml +++ /dev/null @@ -1,678 +0,0 @@ - - - jdbc/WSO2AM_DB - - - Synapse - - - false - - - - - https://wso2apim-km-internal.wso2.svc:${mgt.transport.https.port}${carbon.context}services/ - - ${admin.username} - - ${admin.password} - - false - - - - - - - - X-JWT-Assertion - - - - - - - - - - - - org.wso2.carbon.apimgt.keymgt.token.JWTGenerator - - - - - - - - - - - - - - - - - - - Production and Sandbox - This is a hybrid gateway that handles both production and sandbox token traffic. - - https://wso2apim-manager-worker.wso2.svc:9443${carbon.context}services/ - - ${admin.username} - - ${admin.password} - - http://wso2apim-gw,https://wso2apim-gw - - - - - - - true - - true - - false - - false - - - - - - - - - - - - true - - - tcp://wso2apim-analytics-1:7612|tcp://wso2apim-analytics-2:7612 - ssl://wso2apim-analytics-1:7712|ssl://wso2apim-analytics-2:7712 - - admin - - admin - - - org.wso2.carbon.apimgt.usage.client.impl.APIUsageStatisticsRdbmsClientImpl - - - https://wso2apim-analytics:9444 - admin - admin - - - false - - - org.wso2.carbon.apimgt.usage.publisher.APIMgtUsageDataBridgeDataPublisher - - - false - - - - org.wso2.apimgt.statistics.request - 1.1.0 - - - org.wso2.apimgt.statistics.response - 1.1.0 - - - org.wso2.apimgt.statistics.fault - 1.0.0 - - - org.wso2.apimgt.statistics.throttle - 1.0.0 - - - org.wso2.apimgt.statistics.workflow - 1.0.0 - - - org.wso2.apimgt.statistics.execution.time - 1.0.0 - - - org.wso2.analytics.apim.alertStakeholderInfo - 1.0.0 - - - - - - - - - https://wso2apim-km-internal.wso2.svc:${mgt.transport.https.port}${carbon.context}services/ - - - ${admin.username} - - ${admin.password} - - - WSClient - 10000 - - - true - localhost - - - - - org.wso2.carbon.apimgt.keymgt.handlers.DefaultKeyValidationHandler - - - - - - - - - - am_application_scope - - - - /oauth2/token - - https://wso2apim-gw.wso2.svc:8243/revoke - - false - - - - - - true - - - - - - - true - false - https://wso2apim/store - - - https://localhost:${mgt.transport.https.port}${carbon.context}services/ - - ${admin.username} - - - ${admin.password} - - false - - false - - - - - true - - - true - - - - - - - false - https://wso2apim/publisher - - - - - - - - - - - - - false - - - - - /resource - admin - 1.0.0 - none - none - Any - - - - - - - - - - - true - - - * - - - GET,PUT,POST,DELETE,PATCH,OPTIONS - - - authorization,Access-Control-Allow-Origin,Content-Type,SOAPAction - - - - false - - - - - - - - - - /api/am/publisher/{version}/swagger.json - GET,HEAD - - - /api/am/store/{version}/swagger.json - GET,HEAD - - - /api/am/admin/{version}/swagger.json - GET,HEAD - - - /api/am/store/{version}/apis - GET,HEAD - - - /api/am/store/{version}/apis/{apiId} - GET,HEAD - - - /api/am/store/{version}/apis/{apiId}/swagger - GET,HEAD - - - /api/am/store/{version}/apis/{apiId}/documents - GET,HEAD - - - /api/am/store/{version}/apis/{apiId}/documents/{documentId} - GET,HEAD - - - /api/am/store/{version}/apis/{apiId}/documents/{documentId}/content - GET,HEAD - - - /api/am/store/{version}/apis/{apiId}/thumbnail - GET,HEAD - - - /api/am/store/{version}/tags - GET,HEAD - - - /api/am/store/{version}/tiers/{tierLevel} - GET,HEAD - - - /api/am/store/{version}/tiers/{tierLevel}/{tierName} - GET,HEAD - - - - - /api/am/store/{version}/apis - GET - - - /api/am/store/{version}/apis/generate-sdk - POST - - - /api/am/store/{version}/apis/{apiId}/documents - GET - - - /api/am/store/{version}/applications - GET - - - /api/am/store/{version}/applications/generate-keys - POST - - - /api/am/store/{version}/subscriptions - GET,POST - - - /api/am/store/{version}/tags - GET - - - /api/am/store/{version}/tiers/{tierLevel} - GET - - - /api/am/store/{version}/tiers/{tierLevel}/{tierName} - GET - - - /api/am/publisher/{version}/apis - GET,POST - - - /api/am/publisher/{version}/apis/{apiId} - GET,DELETE,PUT - - - /api/am/publisher/{version}/apis/{apiId}/swagger - GET,PUT - - - /api/am/publisher/{version}/apis/{apiId}/thumbnail - GET,POST - - - /api/am/publisher/{version}/apis/{apiId}/change-lifecycle - POST - - - /api/am/publisher/{version}/apis/{apiId}/copy-api - POST - - - /api/am/publisher/{version}/applications/{applicationId} - GET - - - /api/am/publisher/{version}/apis/{apiId}/documents - GET,POST - - - /api/am/publisher/{version}/apis/{apiId}/documents/{documentId}/content - GET,POST - - - /api/am/publisher/{version}/apis/{apiId}/documents/{documentId} - GET,PUT,DELETE - - - /api/am/publisher/{version}/environments - GET - - - /api/am/publisher/{version}/subscriptions - GET - - - /api/am/publisher/{version}/subscriptions/block-subscription - POST - - - /api/am/publisher/{version}/subscriptions/{subscriptionId} - GET - - - /api/am/publisher/{version}/subscriptions/unblock-subscription - POST - - - /api/am/publisher/{version}/tiers/{tierLevel} - GET,POST - - - /api/am/publisher/{version}/tiers/{tierLevel}/{tierName} - GET,PUT,DELETE - - - /api/am/publisher/{version}/tiers/update-permission - POST - - - - - true - - true - Binary - {tcp://${carbon.local.ip}:${receiver.url.port}}, {tcp://wso2apim-pubstore-tm-1:9611} - {ssl://${carbon.local.ip}:${auth.url.port}}, {ssl://wso2apim-pubstore-tm-1:9711} - ${admin.username} - ${admin.password} - - 1000 - 200 - - - 200 - 1000 - 200 - - - - https://localhost:9443${carbon.context}services/ - ${admin.username} - ${admin.password} - - - true - - - - true - tcp://${carbon.local.ip}:${jms.port} - ${admin.username} - ${admin.password} - throttleData - - - TopicConnectionFactory - topic - org.wso2.andes.jndi.PropertiesFileInitialContextFactory - - amqp://admin:admin@clientID/carbon?failover='roundrobin'%26cyclecount='2'%26brokerlist='tcp://127.0.0.1:5672?retries='5'%26connectdelay='50';tcp://wso2apim-pubstore-tm-1:5672?retries='5'%26connectdelay='50'' - - - 20 - 100 - 1000 - 10 - - - - org.wso2.andes.jndi.PropertiesFileInitialContextFactory - repository/conf/jndi.properties - topic - throttleData - allow - TopicConnectionFactory - - - true - false - false - false - - - false - https://localhost:9445/bpmn - ${admin.username} - ${admin.password} - https://localhost:${mgt.transport.https.port}/api/am/publisher/v0.10/workflows/update-workflow-status - https://localhost:${https.nio.port}/token - https://localhost:${mgt.transport.https.port}/client-registration/v0.10/register - ${admin.username} - ${admin.password} - - - - - org.wso2 - org.wso2.client. - org.wso2.client.model. - org.wso2.client.api. - - java,android - - - - diff --git a/pattern-2/confs/apim-pubstore-tm-2/repository/conf/datasources/master-datasources.xml b/pattern-2/confs/apim-pubstore-tm-2/repository/conf/datasources/master-datasources.xml deleted file mode 100755 index b51f449e..00000000 --- a/pattern-2/confs/apim-pubstore-tm-2/repository/conf/datasources/master-datasources.xml +++ /dev/null @@ -1,175 +0,0 @@ - - - - org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader - - - - - - WSO2_CARBON_DB - The datasource used for registry and user manager - - jdbc/WSO2CarbonDB - - - - jdbc:h2:repository/database/WSO2CARBON_DB;DB_CLOSE_ON_EXIT=FALSE - wso2carbon - wso2carbon - org.h2.Driver - 50 - 60000 - true - SELECT 1 - 30000 - - - - - - WSO2AM_DB - The datasource used for API Manager database - - jdbc/WSO2AM_DB - - - - jdbc:mysql://apim-rdbms:3306/apimgtdb?autoReconnect=true - root - root - false - com.mysql.jdbc.Driver - 50 - 60000 - true - SELECT 1 - 30000 - - - - - - WSO2UM_DB - The datasource used by user manager - - jdbc/WSO2UM_DB - - - - jdbc:mysql://apim-rdbms:3306/userdb?autoReconnect=true - root - root - com.mysql.jdbc.Driver - 50 - 60000 - true - SELECT 1 - 30000 - - - - - - WSO2REG_DB - The datasource used by the registry - - jdbc/WSO2REG_DB - - - - jdbc:mysql://apim-rdbms:3306/govregdb?autoReconnect=true - root - root - com.mysql.jdbc.Driver - 50 - 60000 - true - SELECT 1 - 30000 - - - - - - WSO2AM_STATS_DB - The datasource used for setting statistics to API Manager - - jdbc/WSO2AM_STATS_DB - - - - jdbc:mysql://apim-rdbms:3306/statdb?autoReconnect=true&relaxAutoCommit=true - root - root - com.mysql.jdbc.Driver - 50 - 60000 - true - SELECT 1 - 30000 - false - - - - - - WSO2_MB_STORE_DB - The datasource used for message broker database - - WSO2MBStoreDB - - - - jdbc:h2:repository/database/WSO2MB_DB;DB_CLOSE_ON_EXIT=FALSE;LOCK_TIMEOUT=60000 - wso2carbon - wso2carbon - org.h2.Driver - 50 - 60000 - true - SELECT 1 - 30000 - false - - - - - - - - - - diff --git a/pattern-2/confs/apim-pubstore-tm-2/repository/conf/identity/identity.xml b/pattern-2/confs/apim-pubstore-tm-2/repository/conf/identity/identity.xml deleted file mode 100755 index 111e7a9d..00000000 --- a/pattern-2/confs/apim-pubstore-tm-2/repository/conf/identity/identity.xml +++ /dev/null @@ -1,513 +0,0 @@ - - - - - - - jdbc/WSO2AM_DB - - - - - true - true - 0 - - true - 20160 - 1140 - - - true - 720 - - - - - - 15 - 20160 - - - - - ${carbon.home}/conf/keystores - SunX509 - SunX509 - - - SelfAndManaged - CertValidate - - - - - - - - - - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/openidserver - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/openid - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/authenticationendpoint/openid_login.do - - false - - 7200 - - false - - - - - - - - - - - - - - - - -1 - -1 - -1 - -1 - - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/oauth/request-token - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/oauth/authorize-url - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/oauth/access-token - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/oauth2/authorize - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/oauth2/token - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/oauth2/revoke - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/oauth2/introspect - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/oauth2/userinfo - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/oidc/checksession - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/oidc/logout - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/authenticationendpoint/oauth2_authz.do - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/authenticationendpoint/oauth2_error.do - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/authenticationendpoint/oauth2_consent.do - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/authenticationendpoint/oauth2_logout_consent.do - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/authenticationendpoint/oauth2_logout.do - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/.well-known/webfinger - - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/identity/connect/register - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/oauth2/jwks - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/oauth2/oidcdiscovery - - 300 - - 3600 - - 3600 - - 84600 - - 300 - - true - - true - - org.wso2.carbon.identity.oauth.tokenprocessor.PlainTextPersistenceProcessor - - - - false - - - - - - token - org.wso2.carbon.identity.oauth2.authz.handlers.TokenResponseTypeHandler - - - code - org.wso2.carbon.identity.oauth2.authz.handlers.CodeResponseTypeHandler - - - id_token - org.wso2.carbon.identity.oauth2.authz.handlers.TokenResponseTypeHandler - - - id_token token - org.wso2.carbon.identity.oauth2.authz.handlers.TokenResponseTypeHandler - - - - - - authorization_code - org.wso2.carbon.apimgt.keymgt.handlers.ExtendedAuthorizationCodeGrantHandler - - - password - org.wso2.carbon.apimgt.keymgt.handlers.ExtendedPasswordGrantHandler - - - refresh_token - org.wso2.carbon.identity.oauth2.token.handlers.grant.RefreshGrantHandler - - - client_credentials - org.wso2.carbon.apimgt.keymgt.handlers.ExtendedClientCredentialsGrantHandler - - - urn:ietf:params:oauth:grant-type:saml2-bearer - org.wso2.carbon.apimgt.keymgt.handlers.ExtendedSAML2BearerGrantHandler - - - iwa:ntlm - org.wso2.carbon.identity.oauth.common.NTLMAuthenticationValidator - org.wso2.carbon.identity.oauth2.token.handlers.grant.iwa.ntlm.NTLMAuthenticationGrantHandlerWithHandshake - - - - - - - - - - false - - - false - - - - - - false - org.wso2.carbon.identity.oauth2.authcontext.JWTTokenGenerator - org.wso2.carbon.identity.oauth2.authcontext.DefaultClaimsRetriever - http://wso2.org/claims - SHA256withRSA - 15 - - - - - - org.wso2.carbon.identity.openidconnect.DefaultIDTokenBuilder - SHA256withRSA - - - - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/oauth2/token - org.wso2.carbon.identity.openidconnect.SAMLAssertionClaimsCallback - 3600 - org.wso2.carbon.identity.oauth.endpoint.user.impl.UserInfoUserStoreClaimRetriever - org.wso2.carbon.identity.oauth.endpoint.user.impl.UserInforRequestDefaultValidator - org.wso2.carbon.identity.oauth.endpoint.user.impl.UserInfoISAccessTokenValidator - org.wso2.carbon.identity.oauth.endpoint.user.impl.UserInfoJSONResponseBuilder - false - - - - - - - gtalk - talk.google.com - 5222 - gmail.com - multifactor1@gmail.com - wso2carbon - - - - - 157680000 - 157680000 - ${carbon.host} - - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/samlsso - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/authenticationendpoint/samlsso_logout.do - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/authenticationendpoint/samlsso_notification.do - 5 - 60000 - - false - http://wso2.org/claims - - org.wso2.carbon.identity.sso.saml.builders.assertion.DefaultSAMLAssertionBuilder - org.wso2.carbon.identity.sso.saml.builders.encryption.DefaultSSOEncrypter - org.wso2.carbon.identity.sso.saml.builders.signature.DefaultSSOSigner - org.wso2.carbon.identity.sso.saml.validators.SAML2HTTPRedirectDeflateSignatureValidator - - - 5 - false - http://www.w3.org/2000/09/xmldsig#rsa-sha1 - http://www.w3.org/2000/09/xmldsig#sha1 - true - - - - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/services/wso2carbon-sts - - - - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/passivests - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/authenticationendpoint/retry.do - org.wso2.carbon.identity.sts.passive.utils.NoPersistenceTokenStore - true - - - - false - ${Ports.ThriftEntitlementReceivePort} - 10000 - - ${carbon.home}/repository/resources/security/wso2carbon.jks - wso2carbon - - - ${carbon.host} - - - - - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/wso2/scim/Users - ${carbon.protocol}://${carbon.host}:${carbon.management.port}/wso2/scim/Groups - - - 5 - - - 10 - local://services - - - - - - - - - - - - org.wso2.carbon.identity.governance.store.JDBCIdentityDataStore - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /permission/admin/manage/identity/applicationmgt/delete - - - /permission/admin/manage/identity/applicationmgt/create - - - /permission/admin/manage/identity/applicationmgt/view - - - /permission/admin/manage/identity/pep - - - - - - - - /api/identity/user/v0.9 - /api/identity/recovery/v0.9 - /oauth2 - /api/identity/entitlement - - - /identity/(.*) - - - - 300 - diff --git a/pattern-2/confs/apim-pubstore-tm-2/repository/conf/jndi.properties b/pattern-2/confs/apim-pubstore-tm-2/repository/conf/jndi.properties deleted file mode 100755 index 21befd18..00000000 --- a/pattern-2/confs/apim-pubstore-tm-2/repository/conf/jndi.properties +++ /dev/null @@ -1,29 +0,0 @@ -# -# Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -# -# Licensed 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. -# - -# register some connection factories -# connectionfactory.[jndiname] = [ConnectionURL] -connectionfactory.TopicConnectionFactory = amqp://admin:admin@clientid/carbon?brokerlist='tcp://localhost:5672' - -connectionfactory.QueueConnectionFactory = amqp://admin:admin@clientID/test?brokerlist='tcp://localhost:5672' - -# register some queues in JNDI using the form -# queue.[jndiName] = [physicalName] -#queue.MyQueue = example.MyQueue - -# register some topics in JNDI using the form -# topic.[jndiName] = [physicalName] -topic.throttleData = throttleData diff --git a/pattern-2/confs/apim-pubstore-tm-2/repository/conf/log4j.properties b/pattern-2/confs/apim-pubstore-tm-2/repository/conf/log4j.properties deleted file mode 100755 index 55c79f90..00000000 --- a/pattern-2/confs/apim-pubstore-tm-2/repository/conf/log4j.properties +++ /dev/null @@ -1,220 +0,0 @@ -# -# Copyright (c) 2005-2015, WSO2 Inc. (http://wso2.com) All Rights Reserved. -# -# Licensed 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. -# - -## -# This is the log4j configuration file used by WSO2 AM -# ===================================================== -# -# IMPORTANT : Please do not remove or change the names of any of the Appenders defined here. -# The layout pattern & log file can be changed using the WSO2 AM Management Console, and those -# settings will override the settings in this file. -## - - -# the root category is ERROR (applies for all 3rd party JARs etc) and will be logged to the -# LOG_APPENDER and the CONSOLE_APPENDER - -log4j.rootLogger=ERROR, CARBON_CONSOLE, CARBON_LOGFILE, CARBON_MEMORY, CARBON_SYS_LOG, ERROR_LOGFILE, DAS_AGENT - -log4j.logger.AUDIT_LOG=INFO, AUDIT_LOGFILE - -log4j.category.org.apache.synapse=INFO -log4j.category.org.apache.synapse.transport=INFO -log4j.category.org.apache.axis2=INFO -log4j.category.org.apache.axis2.transport=INFO -log4j.logger.com.atomikos=INFO,ATOMIKOS -log4j.logger.org.quartz=WARN -log4j.logger.org.wso2=INFO -log4j.logger.org.wso2.carbon=INFO -#log4j.category.org.apache.synapse.transport.nhttp.util=DEBUG -#log4j.category.org.apache.http.impl.nio.reactor=DEBUG -#log4j.logger.org.wso2.carbon.utils.deployment.ComponentBuilder=DEBUG -#log4j.logger.org.wso2.carbon.utils.deployment.OSGiBundleDeployer=DEBUG -log4j.logger.org.apache.catalina=WARN -log4j.logger.org.apache.coyote=WARN -log4j.logger.org.apache.axis2.enterprise=FATAL -log4j.logger.de.hunsicker.jalopy.io=FATAL - -# uncomment the following logs to see HTTP headers and messages -#log4j.logger.org.apache.synapse.transport.http.headers=DEBUG -#log4j.logger.org.apache.synapse.transport.http.wire=DEBUG - -# qpid related logs for the message broker -log4j.logger.qpid=WARN -log4j.logger.org.apache.qpid=WARN -log4j.logger.org.apache.qpid.server.Main=INFO -log4j.logger.qpid.message=WARN -log4j.logger.qpid.message.broker.listening=INFO -log4j.logger.org.wso2.carbon.databridge.agent.thrift.AsyncDataPublisher=WARN - -# The console appender is used to display general information at console -log4j.appender.CARBON_CONSOLE=org.wso2.carbon.utils.logging.appenders.CarbonConsoleAppender -log4j.appender.CARBON_CONSOLE.layout=org.apache.log4j.PatternLayout -log4j.appender.CARBON_CONSOLE.layout.ConversionPattern=[%d{ISO8601}] %5p - %c{1} %m%n - -# Configure the service logger at INFO level. Writes only run-time/mediation-time audit messages -log4j.category.SERVICE_LOGGER=INFO, SERVICE_APPENDER -log4j.additivity.SERVICE_LOGGER=false -log4j.appender.SERVICE_APPENDER=org.apache.log4j.RollingFileAppender -log4j.appender.SERVICE_APPENDER.File=${carbon.home}/repository/logs/${instance.log}/wso2-apigw-service${instance.log}.log -log4j.appender.SERVICE_APPENDER.MaxFileSize=1000KB -log4j.appender.SERVICE_APPENDER.MaxBackupIndex=10 -log4j.appender.SERVICE_APPENDER.layout=org.apache.log4j.PatternLayout -log4j.appender.SERVICE_APPENDER.layout.ConversionPattern=%d{ISO8601} [%X{ip}-%X{host}] [%t] %5p %c{1} %m%n - -# The trace logger dumps enough information @INFO level, but maybe pushed upto TRACE. -# Writes only run-time/mediation time tracing/debug messages for messages passing through trace -# enabled sequences, mediators and services. Enabling tracing on these has a performance impact -log4j.category.TRACE_LOGGER=INFO, TRACE_APPENDER, TRACE_MEMORYAPPENDER -log4j.additivity.TRACE_LOGGER=false -log4j.appender.TRACE_APPENDER=org.apache.log4j.DailyRollingFileAppender -log4j.appender.TRACE_APPENDER.File=${carbon.home}/repository/logs/${instance.log}/wso2-apigw-trace${instance.log}.log -log4j.appender.TRACE_APPENDER.Append=true -log4j.appender.TRACE_APPENDER.layout=org.apache.log4j.PatternLayout -log4j.appender.TRACE_APPENDER.layout.ConversionPattern=%d{HH:mm:ss,SSS} [%X{ip}-%X{host}] [%t] %5p %c{1} %m%n - -# The memory appender for trace logger -log4j.appender.TRACE_MEMORYAPPENDER=org.wso2.carbon.utils.logging.appenders.MemoryAppender -log4j.appender.TRACE_MEMORYAPPENDER.bufferSize=2000 -log4j.appender.TRACE_MEMORYAPPENDER.layout=org.apache.log4j.PatternLayout -log4j.appender.TRACE_MEMORYAPPENDER.layout.ConversionPattern=%d{HH:mm:ss,SSS} [%X{ip}-%X{host}] [%t] %5p %m%n - -# CARBON_LOGFILE is set to be a DailyRollingFileAppender using a PatternLayout. -log4j.appender.CARBON_LOGFILE=org.wso2.carbon.utils.logging.appenders.CarbonDailyRollingFileAppender -# Log file will be overridden by the configuration setting in the DB -# This path should be relative to WSO2 Carbon Home -log4j.appender.CARBON_LOGFILE.File=${carbon.home}/repository/logs/${instance.log}/wso2carbon${instance.log}.log -log4j.appender.CARBON_LOGFILE.Append=true -log4j.appender.CARBON_LOGFILE.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout -# ConversionPattern will be overridden by the configuration setting in the DB -log4j.appender.CARBON_LOGFILE.layout.ConversionPattern=TID: [%T] [%S] [%d] %P%5p {%c} - %x %m {%c}%n -log4j.appender.CARBON_LOGFILE.layout.TenantPattern=%U%@%D [%T] [%S] -log4j.appender.CARBON_LOGFILE.threshold=DEBUG - -# The standard error log where all the warnings, errors and fatal errors will be logged -log4j.appender.ERROR_LOGFILE=org.apache.log4j.FileAppender -log4j.appender.ERROR_LOGFILE.File=${carbon.home}/repository/logs/${instance.log}/wso2-apigw-errors.log -log4j.appender.ERROR_LOGFILE.layout=org.apache.log4j.PatternLayout -log4j.appender.ERROR_LOGFILE.layout.ConversionPattern=%d{ISO8601} [%X{ip}-%X{host}] [%t] %5p %c{1} %m%n -log4j.appender.ERROR_LOGFILE.threshold=WARN - -# The memory appender for logging -log4j.appender.CARBON_MEMORY=org.wso2.carbon.logging.service.appender.CarbonMemoryAppender -log4j.appender.CARBON_MEMORY.bufferSize=2000 -log4j.appender.CARBON_MEMORY.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout -# ConversionPattern will be overridden by the configuration setting in the DB -log4j.appender.CARBON_MEMORY.layout.ConversionPattern=TID: [%T] [%S] [%d] %P%5p {%c} - %x %m {%c}%n -log4j.appender.CARBON_MEMORY.layout.TenantPattern=%U%@%D [%T] [%S] -log4j.appender.CARBON_MEMORY.columnList=%T,%S,%A,%d,%c,%p,%m,%H,%I,%Stacktrace -log4j.appender.CARBON_MEMORY.threshold=DEBUG - -# LOGEVENT is set to be a LogEventAppender using a PatternLayout to send logs to LOGEVENT -log4j.appender.LOGEVENT=org.wso2.carbon.logging.appender.LogEventAppender -log4j.appender.LOGEVENT.url=tcp://localhost:7611 -log4j.appender.LOGEVENT.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout -log4j.appender.LOGEVENT.columnList=%T,%S,%A,%d,%c,%p,%m,%I,%Stacktrace -log4j.appender.LOGEVENT.userName=admin -log4j.appender.LOGEVENT.password=admin -log4j.appender.LOGEVENT.processingLimit=1000 -log4j.appender.LOGEVENT.maxTolerableConsecutiveFailure=20 - - -log4j.appender.CARBON_SYS_LOG = org.apache.log4j.net.SyslogAppender -log4j.appender.CARBON_SYS_LOG.layout=org.apache.log4j.PatternLayout -log4j.appender.CARBON_SYS_LOG.layout.ConversionPattern=[%d] %5p - %x %m {%c}%n -log4j.appender.CARBON_SYS_LOG.SyslogHost=localhost -log4j.appender.CARBON_SYS_LOG.Facility=USER -log4j.appender.CARBON_SYS_LOG.threshold=DEBUG - -# LOGEVENT is set to be a LogEventAppender using a PatternLayout to send logs to LOGEVENT -log4j.appender.LOGEVENT=org.wso2.carbon.logging.appender.LogEventAppender -log4j.appender.LOGEVENT.url=tcp://localhost:7611 -log4j.appender.LOGEVENT.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout -log4j.appender.LOGEVENT.columnList=%T,%S,%A,%d,%c,%p,%m,%H,%I,%Stacktrace -log4j.appender.LOGEVENT.userName=admin -log4j.appender.LOGEVENT.password=admin - -log4j.logger.org.apache.directory.shared.ldap=WARN, CARBON_CONSOLE -log4j.logger.org.apache.directory.server.ldap.handlers=WARN, CARBON_CONSOLE -log4j.logger.org.apache.directory.shared.ldap.entry.DefaultServerAttribute=FATAL, CARBON_CONSOLE -log4j.logger.org.apache.directory.shared.ldap.ldif.LdifReader=ERROR, CARBON_CONSOLE -log4j.logger.org.apache.directory.server.ldap.LdapProtocolHandler=ERROR, CARBON_CONSOLE - -## Trace Logger configuration which will append to a XMPP chatroom or JID ## -#log4j.appender.XMPP_APPENDER=org.wso2.carbon.utils.logging.IMAppender -#log4j.appender.XMPP_APPENDER.host=jabber.org -#log4j.appender.XMPP_APPENDER.username=wso2esb -#log4j.appender.XMPP_APPENDER.password=wso2esb -#log4j.appender.XMPP_APPENDER.recipient=ruwan@jabber.org -#log4j.appender.XMPP_APPENDER.layout=org.apache.log4j.PatternLayout -#log4j.appender.XMPP_APPENDER.layout.ConversionPattern=[%X{host}] [%t] %-5p [%d{HH:mm:ss,SSS}] %C{1} - %m%n - -# Appender config to AUDIT_LOGFILE -log4j.appender.AUDIT_LOGFILE=org.apache.log4j.DailyRollingFileAppender -log4j.appender.AUDIT_LOGFILE.File=${carbon.home}/repository/logs/audit.log -log4j.appender.AUDIT_LOGFILE.Append=true -log4j.appender.AUDIT_LOGFILE.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout -log4j.appender.AUDIT_LOGFILE.layout.ConversionPattern=[%d] %P%5p - %x %m %n -log4j.appender.AUDIT_LOGFILE.layout.TenantPattern=%U%@%D [%T] [%S] -log4j.appender.AUDIT_LOGFILE.threshold=INFO -log4j.additivity.AUDIT_LOG=false - -# Appender config to send Atomikos transaction logs to new log file tm.out. -log4j.appender.ATOMIKOS = org.apache.log4j.RollingFileAppender -log4j.appender.ATOMIKOS.File = repository/logs/tm.out -log4j.appender.ATOMIKOS.Append = true -log4j.appender.ATOMIKOS.layout = org.apache.log4j.PatternLayout -log4j.appender.ATOMIKOS.layout.ConversionPattern=%p %t %c - %m%n -log4j.additivity.com.atomikos=false - -# DAS_AGENT is set to be a Custom Log Appender. -log4j.appender.DAS_AGENT=org.wso2.carbon.analytics.shared.data.agents.log4j.appender.LogEventAppender -# DAS_AGENT uses PatternLayout. -log4j.appender.DAS_AGENT.layout=org.wso2.carbon.analytics.shared.data.agents.log4j.util.TenantAwarePatternLayout -log4j.appender.DAS_AGENT.columnList=%D,%S,%A,%d,%c,%p,%m,%H,%I,%Stacktrace -log4j.appender.DAS_AGENT.userName=admin -log4j.appender.DAS_AGENT.password=admin -log4j.appender.DAS_AGENT.url=tcp://wso2apim-analytics-1:7612|tcp://wso2apim-analytics-2:7612 -log4j.appender.DAS_AGENT.maxTolerableConsecutiveFailure=5 -log4j.appender.DAS_AGENT.streamDef=loganalyzer:1.0.0 -log4j.logger.trace.messages=TRACE,CARBON_TRACE_LOGFILE - -# Appender config to CARBON_TRACE_LOGFILE -log4j.appender.CARBON_TRACE_LOGFILE=org.apache.log4j.DailyRollingFileAppender -log4j.appender.CARBON_TRACE_LOGFILE.File=${carbon.home}/repository/logs/${instance.log}/wso2carbon-trace-messages${instance.log}.log -log4j.appender.CARBON_TRACE_LOGFILE.Append=true -log4j.appender.CARBON_TRACE_LOGFILE.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout -log4j.appender.CARBON_TRACE_LOGFILE.layout.ConversionPattern=[%d] %P%5p {%c} - %x %m %n -log4j.appender.CARBON_TRACE_LOGFILE.layout.TenantPattern=%U%@%D [%T] [%S] -log4j.appender.CARBON_TRACE_LOGFILE.threshold=TRACE -log4j.additivity.trace.messages=false - - -# The event trace logger dumps enough information @INFO level, but maybe pushed upto TRACE. -# Writes only run-time/event processing time tracing/debug messages for event passing through trace -# enabled transport adapters event formatters, builders and processors. Enabling event tracing on these has a performance impact -log4j.category.EVENT_TRACE_LOGGER=INFO, EVENT_TRACE_APPENDER, EVENT_TRACE_MEMORYAPPENDER -log4j.additivity.EVENT_TRACE_LOGGER=false -log4j.appender.EVENT_TRACE_APPENDER=org.apache.log4j.DailyRollingFileAppender -log4j.appender.EVENT_TRACE_APPENDER.File=${carbon.home}/repository/logs/${instance.log}/wso2-cep-trace${instance.log}.log -log4j.appender.EVENT_TRACE_APPENDER.Append=true -log4j.appender.EVENT_TRACE_APPENDER.layout=org.apache.log4j.PatternLayout -log4j.appender.EVENT_TRACE_APPENDER.layout.ConversionPattern=%d{HH:mm:ss,SSS} [%X{ip}-%X{host}] [%t] %5p %c{1} %m%n -# The memory appender for trace logger -log4j.appender.EVENT_TRACE_MEMORYAPPENDER=org.wso2.carbon.utils.logging.appenders.MemoryAppender -log4j.appender.EVENT_TRACE_MEMORYAPPENDER.bufferSize=2000 -log4j.appender.EVENT_TRACE_MEMORYAPPENDER.layout=org.apache.log4j.PatternLayout -log4j.appender.EVENT_TRACE_MEMORYAPPENDER.layout.ConversionPattern=%d{HH:mm:ss,SSS} [%X{ip}-%X{host}] [%t] %5p %m%n diff --git a/pattern-2/confs/apim-pubstore-tm-2/repository/conf/registry.xml b/pattern-2/confs/apim-pubstore-tm-2/repository/conf/registry.xml deleted file mode 100755 index e004a457..00000000 --- a/pattern-2/confs/apim-pubstore-tm-2/repository/conf/registry.xml +++ /dev/null @@ -1,374 +0,0 @@ - - - - - - - wso2registry - false - true - / - - - jdbc/WSO2CarbonDB - - - - jdbc/WSO2REG_DB - - - gov - root@jdbc:mysql://apim_rdbms:3306/regdb - govregistry - false - true - / - - - gov - /_system/governance - - - gov - /_system/config - - - - - - .* - - - - - - - - .* - - - - - - - - true - - /trunk/schemas/ - - - /trunk/wsdls/ - - - /trunk/policies/ - - - - application/wsdl+xml - - - - - - - application/wsdl+xml - application/xsd+xml - 50 - true - - 3 - - /trunk/schemas/ - - - /trunk/wsdls/ - - - application/vnd.wso2.governance-archive - - - - - - - - 1.0.0-SNAPSHOT - true - - dev - qa - live - - - application/vnd.wso2-service+xml - - - - - - - - application/vnd.wso2-service+xml - - - - - - - - application/vnd.wso2-api+xml - - - - - - - - /_system/governance/event/topics/registry/notifications/.* - - - - - - - - - Created - Tested - Deployed - - - application/vnd.wso2-smart-link - - - - - - - - /trunk/policies/ - - - application/policy+xml - - - - - - - - true - - /trunk/schemas/ - - - application/x-xsd+xml - - - - - - - - application/vnd.wso2-hyperlink - - - - - - - application/vnd.wso2.endpoint - - /trunk/endpoints/ - - - - - - - - application/vnd.wso2-uri+xml - - - - - - - - .* - - - - - - - .* - - - - - - - workflow-config - - - - - - - - - - - - - - - - - - - - true - 35 - 3 - - 40 - - 40 - - /_system/local/repository/components/org.wso2.carbon.registry/indexing/lastaccesstime - - - - - - - - - - - - - - - - - - - - - - false - - - - true - true - true - true - - /trunk/services/ - - - - - false - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pattern-2/confs/apim-pubstore-tm-2/repository/conf/tomcat/catalina-server.xml b/pattern-2/confs/apim-pubstore-tm-2/repository/conf/tomcat/catalina-server.xml deleted file mode 100755 index 742f4a31..00000000 --- a/pattern-2/confs/apim-pubstore-tm-2/repository/conf/tomcat/catalina-server.xml +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pattern-2/confs/apim-pubstore-tm-2/repository/conf/user-mgt.xml b/pattern-2/confs/apim-pubstore-tm-2/repository/conf/user-mgt.xml deleted file mode 100755 index de5e9db7..00000000 --- a/pattern-2/confs/apim-pubstore-tm-2/repository/conf/user-mgt.xml +++ /dev/null @@ -1,259 +0,0 @@ - - - - - - true - admin - - admin - admin - - everyone - true - jdbc/WSO2UM_DB - - - - - org.wso2.carbon.user.core.tenant.JDBCTenantManager - false - true - true - ^[\S]{3,30}$ - ^[\S]{3,30}$ - Username pattern policy violated - ^[\S]{5,30}$ - ^[\S]{5,30}$ - Password length should be within 5 to 30 characters - ^[\S]{3,30}$ - ^[\S]{3,30}$ - true - false - true - SHA-256 - true - , - 100 - 100 - true - false - - - - - - - - - - - - - /permission - true - false - - - - - diff --git a/pattern-2/confs/apim-pubstore-tm-2/user-mgt.xml b/pattern-2/confs/apim-pubstore-tm-2/user-mgt.xml new file mode 100644 index 00000000..7c0fa72e --- /dev/null +++ b/pattern-2/confs/apim-pubstore-tm-2/user-mgt.xml @@ -0,0 +1,256 @@ + + + + + + true + admin + + admin + admin + + everyone + + true + true + jdbc/WSO2UM_DB + + + + org.wso2.carbon.user.core.tenant.JDBCTenantManager + false + true + true + ^[\S]{3,30}$ + ^[\S]{3,30}$ + Username pattern policy violated + ^[\S]{5,30}$ + ^[\S]{5,30}$ + Password length should be within 5 to 30 characters + ^[\S]{3,30}$ + ^[\S]{3,30}$ + true + false + true + SHA-256 + true + , + 100 + 100 + true + false + + + + + + + + + /permission + true + false + + + + diff --git a/pattern-2/extras/confs/rdbms/mysql/dbscripts/init.sql b/pattern-2/extras/confs/rdbms/mysql/dbscripts/init.sql new file mode 100644 index 00000000..6d052ac0 --- /dev/null +++ b/pattern-2/extras/confs/rdbms/mysql/dbscripts/init.sql @@ -0,0 +1,1882 @@ +-- +-- Copyright 2018 WSO2 Inc. (http://wso2.org) +-- +-- Licensed 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. +-- + +DROP DATABASE IF EXISTS WSO2AM_COMMON_DB; +DROP DATABASE IF EXISTS WSO2AM_APIMGT_DB; +DROP DATABASE IF EXISTS WSO2AM_STAT_DB; +DROP DATABASE IF EXISTS WSO2_ANALYTICS_EVENT_STORE_DB; +DROP DATABASE IF EXISTS WSO2_ANALYTICS_PROCESSED_DATA_STORE_DB; + +CREATE DATABASE WSO2AM_COMMON_DB; +CREATE DATABASE WSO2AM_APIMGT_DB; +CREATE DATABASE WSO2AM_STAT_DB; +CREATE DATABASE WSO2_ANALYTICS_EVENT_STORE_DB; +CREATE DATABASE WSO2_ANALYTICS_PROCESSED_DATA_STORE_DB; + +CREATE USER IF NOT EXISTS 'wso2carbon'@'%' IDENTIFIED BY 'wso2carbon'; +GRANT ALL ON WSO2AM_COMMON_DB.* TO 'wso2carbon'@'%' IDENTIFIED BY 'wso2carbon'; +GRANT ALL ON WSO2AM_APIMGT_DB.* TO 'wso2carbon'@'%' IDENTIFIED BY 'wso2carbon'; +GRANT ALL ON WSO2AM_STAT_DB.* TO 'wso2carbon'@'%' IDENTIFIED BY 'wso2carbon'; +GRANT ALL ON WSO2_ANALYTICS_EVENT_STORE_DB.* TO 'wso2carbon'@'%' IDENTIFIED BY 'wso2carbon'; +GRANT ALL ON WSO2_ANALYTICS_PROCESSED_DATA_STORE_DB.* TO 'wso2carbon'@'%' IDENTIFIED BY 'wso2carbon'; + +USE WSO2AM_COMMON_DB; + +CREATE TABLE IF NOT EXISTS REG_CLUSTER_LOCK ( + REG_LOCK_NAME VARCHAR (20), + REG_LOCK_STATUS VARCHAR (20), + REG_LOCKED_TIME TIMESTAMP, + REG_TENANT_ID INTEGER DEFAULT 0, + PRIMARY KEY (REG_LOCK_NAME) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS REG_LOG ( + REG_LOG_ID INTEGER AUTO_INCREMENT, + REG_PATH VARCHAR (750), + REG_USER_ID VARCHAR (31) NOT NULL, + REG_LOGGED_TIME TIMESTAMP NOT NULL, + REG_ACTION INTEGER NOT NULL, + REG_ACTION_DATA VARCHAR (500), + REG_TENANT_ID INTEGER DEFAULT 0, + PRIMARY KEY (REG_LOG_ID, REG_TENANT_ID) +)ENGINE INNODB; + +CREATE INDEX REG_LOG_IND_BY_REGLOG USING HASH ON REG_LOG(REG_LOGGED_TIME, REG_TENANT_ID); + +-- The REG_PATH_VALUE should be less than 767 bytes, and hence was fixed at 750. +-- See CARBON-5917. + +CREATE TABLE IF NOT EXISTS REG_PATH( + REG_PATH_ID INTEGER NOT NULL AUTO_INCREMENT, + REG_PATH_VALUE VARCHAR(750) NOT NULL, + REG_PATH_PARENT_ID INTEGER, + REG_TENANT_ID INTEGER DEFAULT 0, + CONSTRAINT PK_REG_PATH PRIMARY KEY(REG_PATH_ID, REG_TENANT_ID) +)ENGINE INNODB; + +CREATE INDEX REG_PATH_IND_BY_PATH_VALUE USING HASH ON REG_PATH(REG_PATH_VALUE, REG_TENANT_ID); +CREATE INDEX REG_PATH_IND_BY_PATH_PARENT_ID USING HASH ON REG_PATH(REG_PATH_PARENT_ID, REG_TENANT_ID); + +CREATE TABLE IF NOT EXISTS REG_CONTENT ( + REG_CONTENT_ID INTEGER NOT NULL AUTO_INCREMENT, + REG_CONTENT_DATA LONGBLOB, + REG_TENANT_ID INTEGER DEFAULT 0, + CONSTRAINT PK_REG_CONTENT PRIMARY KEY(REG_CONTENT_ID, REG_TENANT_ID) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS REG_CONTENT_HISTORY ( + REG_CONTENT_ID INTEGER NOT NULL, + REG_CONTENT_DATA LONGBLOB, + REG_DELETED SMALLINT, + REG_TENANT_ID INTEGER DEFAULT 0, + CONSTRAINT PK_REG_CONTENT_HISTORY PRIMARY KEY(REG_CONTENT_ID, REG_TENANT_ID) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS REG_RESOURCE ( + REG_PATH_ID INTEGER NOT NULL, + REG_NAME VARCHAR(256), + REG_VERSION INTEGER NOT NULL AUTO_INCREMENT, + REG_MEDIA_TYPE VARCHAR(500), + REG_CREATOR VARCHAR(31) NOT NULL, + REG_CREATED_TIME TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + REG_LAST_UPDATOR VARCHAR(31), + REG_LAST_UPDATED_TIME TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + REG_DESCRIPTION VARCHAR(1000), + REG_CONTENT_ID INTEGER, + REG_TENANT_ID INTEGER DEFAULT 0, + REG_UUID VARCHAR(100) NOT NULL, + CONSTRAINT PK_REG_RESOURCE PRIMARY KEY(REG_VERSION, REG_TENANT_ID) +)ENGINE INNODB; + +ALTER TABLE REG_RESOURCE ADD CONSTRAINT REG_RESOURCE_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID); +ALTER TABLE REG_RESOURCE ADD CONSTRAINT REG_RESOURCE_FK_BY_CONTENT_ID FOREIGN KEY (REG_CONTENT_ID, REG_TENANT_ID) REFERENCES REG_CONTENT (REG_CONTENT_ID, REG_TENANT_ID); +CREATE INDEX REG_RESOURCE_IND_BY_NAME USING HASH ON REG_RESOURCE(REG_NAME, REG_TENANT_ID); +CREATE INDEX REG_RESOURCE_IND_BY_PATH_ID_NAME USING HASH ON REG_RESOURCE(REG_PATH_ID, REG_NAME, REG_TENANT_ID); +CREATE INDEX REG_RESOURCE_IND_BY_UUID USING HASH ON REG_RESOURCE(REG_UUID); +CREATE INDEX REG_RESOURCE_IND_BY_TENAN USING HASH ON REG_RESOURCE(REG_TENANT_ID, REG_UUID); +CREATE INDEX REG_RESOURCE_IND_BY_TYPE USING HASH ON REG_RESOURCE(REG_TENANT_ID, REG_MEDIA_TYPE); + +CREATE TABLE IF NOT EXISTS REG_RESOURCE_HISTORY ( + REG_PATH_ID INTEGER NOT NULL, + REG_NAME VARCHAR(256), + REG_VERSION INTEGER NOT NULL, + REG_MEDIA_TYPE VARCHAR(500), + REG_CREATOR VARCHAR(31) NOT NULL, + REG_CREATED_TIME TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + REG_LAST_UPDATOR VARCHAR(31), + REG_LAST_UPDATED_TIME TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + REG_DESCRIPTION VARCHAR(1000), + REG_CONTENT_ID INTEGER, + REG_DELETED SMALLINT, + REG_TENANT_ID INTEGER DEFAULT 0, + REG_UUID VARCHAR(100) NOT NULL, + CONSTRAINT PK_REG_RESOURCE_HISTORY PRIMARY KEY(REG_VERSION, REG_TENANT_ID) +)ENGINE INNODB; + +ALTER TABLE REG_RESOURCE_HISTORY ADD CONSTRAINT REG_RESOURCE_HIST_FK_BY_PATHID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID); +ALTER TABLE REG_RESOURCE_HISTORY ADD CONSTRAINT REG_RESOURCE_HIST_FK_BY_CONTENT_ID FOREIGN KEY (REG_CONTENT_ID, REG_TENANT_ID) REFERENCES REG_CONTENT_HISTORY (REG_CONTENT_ID, REG_TENANT_ID); +CREATE INDEX REG_RESOURCE_HISTORY_IND_BY_NAME USING HASH ON REG_RESOURCE_HISTORY(REG_NAME, REG_TENANT_ID); +CREATE INDEX REG_RESOURCE_HISTORY_IND_BY_PATH_ID_NAME USING HASH ON REG_RESOURCE(REG_PATH_ID, REG_NAME, REG_TENANT_ID); + +CREATE TABLE IF NOT EXISTS REG_COMMENT ( + REG_ID INTEGER NOT NULL AUTO_INCREMENT, + REG_COMMENT_TEXT VARCHAR(500) NOT NULL, + REG_USER_ID VARCHAR(31) NOT NULL, + REG_COMMENTED_TIME TIMESTAMP NOT NULL, + REG_TENANT_ID INTEGER DEFAULT 0, + CONSTRAINT PK_REG_COMMENT PRIMARY KEY(REG_ID, REG_TENANT_ID) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS REG_RESOURCE_COMMENT ( + REG_COMMENT_ID INTEGER NOT NULL, + REG_VERSION INTEGER, + REG_PATH_ID INTEGER, + REG_RESOURCE_NAME VARCHAR(256), + REG_TENANT_ID INTEGER DEFAULT 0 +)ENGINE INNODB; + +ALTER TABLE REG_RESOURCE_COMMENT ADD CONSTRAINT REG_RESOURCE_COMMENT_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID); +ALTER TABLE REG_RESOURCE_COMMENT ADD CONSTRAINT REG_RESOURCE_COMMENT_FK_BY_COMMENT_ID FOREIGN KEY (REG_COMMENT_ID, REG_TENANT_ID) REFERENCES REG_COMMENT (REG_ID, REG_TENANT_ID); +CREATE INDEX REG_RESOURCE_COMMENT_IND_BY_PATH_ID_AND_RESOURCE_NAME USING HASH ON REG_RESOURCE_COMMENT(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID); +CREATE INDEX REG_RESOURCE_COMMENT_IND_BY_VERSION USING HASH ON REG_RESOURCE_COMMENT(REG_VERSION, REG_TENANT_ID); + +CREATE TABLE IF NOT EXISTS REG_RATING ( + REG_ID INTEGER NOT NULL AUTO_INCREMENT, + REG_RATING INTEGER NOT NULL, + REG_USER_ID VARCHAR(31) NOT NULL, + REG_RATED_TIME TIMESTAMP NOT NULL, + REG_TENANT_ID INTEGER DEFAULT 0, + CONSTRAINT PK_REG_RATING PRIMARY KEY(REG_ID, REG_TENANT_ID) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS REG_RESOURCE_RATING ( + REG_RATING_ID INTEGER NOT NULL, + REG_VERSION INTEGER, + REG_PATH_ID INTEGER, + REG_RESOURCE_NAME VARCHAR(256), + REG_TENANT_ID INTEGER DEFAULT 0 +)ENGINE INNODB; + +ALTER TABLE REG_RESOURCE_RATING ADD CONSTRAINT REG_RESOURCE_RATING_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID); +ALTER TABLE REG_RESOURCE_RATING ADD CONSTRAINT REG_RESOURCE_RATING_FK_BY_RATING_ID FOREIGN KEY (REG_RATING_ID, REG_TENANT_ID) REFERENCES REG_RATING (REG_ID, REG_TENANT_ID); +CREATE INDEX REG_RESOURCE_RATING_IND_BY_PATH_ID_AND_RESOURCE_NAME USING HASH ON REG_RESOURCE_RATING(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID); +CREATE INDEX REG_RESOURCE_RATING_IND_BY_VERSION USING HASH ON REG_RESOURCE_RATING(REG_VERSION, REG_TENANT_ID); + + +CREATE TABLE IF NOT EXISTS REG_TAG ( + REG_ID INTEGER NOT NULL AUTO_INCREMENT, + REG_TAG_NAME VARCHAR(500) NOT NULL, + REG_USER_ID VARCHAR(31) NOT NULL, + REG_TAGGED_TIME TIMESTAMP NOT NULL, + REG_TENANT_ID INTEGER DEFAULT 0, + CONSTRAINT PK_REG_TAG PRIMARY KEY(REG_ID, REG_TENANT_ID) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS REG_RESOURCE_TAG ( + REG_TAG_ID INTEGER NOT NULL, + REG_VERSION INTEGER, + REG_PATH_ID INTEGER, + REG_RESOURCE_NAME VARCHAR(256), + REG_TENANT_ID INTEGER DEFAULT 0 +)ENGINE INNODB; + +ALTER TABLE REG_RESOURCE_TAG ADD CONSTRAINT REG_RESOURCE_TAG_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID); +ALTER TABLE REG_RESOURCE_TAG ADD CONSTRAINT REG_RESOURCE_TAG_FK_BY_TAG_ID FOREIGN KEY (REG_TAG_ID, REG_TENANT_ID) REFERENCES REG_TAG (REG_ID, REG_TENANT_ID); +CREATE INDEX REG_RESOURCE_TAG_IND_BY_PATH_ID_AND_RESOURCE_NAME USING HASH ON REG_RESOURCE_TAG(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID); +CREATE INDEX REG_RESOURCE_TAG_IND_BY_VERSION USING HASH ON REG_RESOURCE_TAG(REG_VERSION, REG_TENANT_ID); + +CREATE TABLE IF NOT EXISTS REG_PROPERTY ( + REG_ID INTEGER NOT NULL AUTO_INCREMENT, + REG_NAME VARCHAR(100) NOT NULL, + REG_VALUE VARCHAR(1000), + REG_TENANT_ID INTEGER DEFAULT 0, + CONSTRAINT PK_REG_PROPERTY PRIMARY KEY(REG_ID, REG_TENANT_ID) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS REG_RESOURCE_PROPERTY ( + REG_PROPERTY_ID INTEGER NOT NULL, + REG_VERSION INTEGER, + REG_PATH_ID INTEGER, + REG_RESOURCE_NAME VARCHAR(256), + REG_TENANT_ID INTEGER DEFAULT 0 +)ENGINE INNODB; + +ALTER TABLE REG_RESOURCE_PROPERTY ADD CONSTRAINT REG_RESOURCE_PROPERTY_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID); +ALTER TABLE REG_RESOURCE_PROPERTY ADD CONSTRAINT REG_RESOURCE_PROPERTY_FK_BY_TAG_ID FOREIGN KEY (REG_PROPERTY_ID, REG_TENANT_ID) REFERENCES REG_PROPERTY (REG_ID, REG_TENANT_ID); +CREATE INDEX REG_RESOURCE_PROPERTY_IND_BY_PATH_ID_AND_RESOURCE_NAME USING HASH ON REG_RESOURCE_PROPERTY(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID); +CREATE INDEX REG_RESOURCE_PROPERTY_IND_BY_VERSION USING HASH ON REG_RESOURCE_PROPERTY(REG_VERSION, REG_TENANT_ID); + +-- CREATE TABLE IF NOT EXISTS REG_ASSOCIATIONS ( +-- SRC_PATH_ID INTEGER, +-- SRC_RESOURCE_NAME VARCHAR(256), +-- SRC_VERSION INTEGER, +-- TGT_PATH_ID INTEGER, +-- TGT_RESOURCE_NAME VARCHAR(256), +-- TGT_VERSION INTEGER +-- )ENGINE INNODB; +-- +-- ALTER TABLE REG_ASSOCIATIONS ADD CONSTRAINT REG_ASSOCIATIONS_FK_BY_SRC_PATH_ID FOREIGN KEY (SRC_PATH_ID) REFERENCES REG_PATH (PATH_ID); +-- ALTER TABLE REG_ASSOCIATIONS ADD CONSTRAINT REG_ASSOCIATIONS_FK_BY_TGT_PATH_ID FOREIGN KEY (TGT_PATH_ID) REFERENCES REG_PATH (PATH_ID); +-- CREATE INDEX REG_ASSOCIATIONS_IND_BY_SRC_VERSION ON REG_ASSOCIATIONS(SRC_VERSION); +-- CREATE INDEX REG_ASSOCIATIONS_IND_BY_TGT_VERSION ON REG_ASSOCIATIONS(TGT_VERSION); +-- CREATE INDEX REG_ASSOCIATIONS_IND_BY_SRC_RESOURCE_NAME ON REG_ASSOCIATIONS(SRC_RESOURCE_NAME); +-- CREATE INDEX REG_ASSOCIATIONS_IND_BY_TGT_RESOURCE_NAME ON REG_ASSOCIATIONS(TGT_RESOURCE_NAME); + + + +CREATE TABLE IF NOT EXISTS REG_ASSOCIATION ( + REG_ASSOCIATION_ID INTEGER AUTO_INCREMENT, + REG_SOURCEPATH VARCHAR (750) NOT NULL, + REG_TARGETPATH VARCHAR (750) NOT NULL, + REG_ASSOCIATION_TYPE VARCHAR (2000) NOT NULL, + REG_TENANT_ID INTEGER DEFAULT 0, + PRIMARY KEY (REG_ASSOCIATION_ID, REG_TENANT_ID) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS REG_SNAPSHOT ( + REG_SNAPSHOT_ID INTEGER NOT NULL AUTO_INCREMENT, + REG_PATH_ID INTEGER NOT NULL, + REG_RESOURCE_NAME VARCHAR(255), + REG_RESOURCE_VIDS LONGBLOB NOT NULL, + REG_TENANT_ID INTEGER DEFAULT 0, + CONSTRAINT PK_REG_SNAPSHOT PRIMARY KEY(REG_SNAPSHOT_ID, REG_TENANT_ID) +)ENGINE INNODB; + +CREATE INDEX REG_SNAPSHOT_IND_BY_PATH_ID_AND_RESOURCE_NAME USING HASH ON REG_SNAPSHOT(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID); + +ALTER TABLE REG_SNAPSHOT ADD CONSTRAINT REG_SNAPSHOT_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID); + + +-- ################################ +-- USER MANAGER TABLES +-- ################################ + +CREATE TABLE UM_TENANT ( + UM_ID INTEGER NOT NULL AUTO_INCREMENT, + UM_DOMAIN_NAME VARCHAR(255) NOT NULL, + UM_EMAIL VARCHAR(255), + UM_ACTIVE BOOLEAN DEFAULT FALSE, + UM_CREATED_DATE TIMESTAMP NOT NULL, + UM_USER_CONFIG LONGBLOB, + PRIMARY KEY (UM_ID), + UNIQUE(UM_DOMAIN_NAME) +)ENGINE INNODB; + +CREATE TABLE UM_DOMAIN( + UM_DOMAIN_ID INTEGER NOT NULL AUTO_INCREMENT, + UM_DOMAIN_NAME VARCHAR(255), + UM_TENANT_ID INTEGER DEFAULT 0, + PRIMARY KEY (UM_DOMAIN_ID, UM_TENANT_ID) +)ENGINE INNODB; + +CREATE UNIQUE INDEX INDEX_UM_TENANT_UM_DOMAIN_NAME + ON UM_TENANT (UM_DOMAIN_NAME); + +CREATE TABLE UM_USER ( + UM_ID INTEGER NOT NULL AUTO_INCREMENT, + UM_USER_NAME VARCHAR(255) NOT NULL, + UM_USER_PASSWORD VARCHAR(255) NOT NULL, + UM_SALT_VALUE VARCHAR(31), + UM_REQUIRE_CHANGE BOOLEAN DEFAULT FALSE, + UM_CHANGED_TIME TIMESTAMP NOT NULL, + UM_TENANT_ID INTEGER DEFAULT 0, + PRIMARY KEY (UM_ID, UM_TENANT_ID), + UNIQUE(UM_USER_NAME, UM_TENANT_ID) +)ENGINE INNODB; + +CREATE TABLE UM_SYSTEM_USER ( + UM_ID INTEGER NOT NULL AUTO_INCREMENT, + UM_USER_NAME VARCHAR(255) NOT NULL, + UM_USER_PASSWORD VARCHAR(255) NOT NULL, + UM_SALT_VALUE VARCHAR(31), + UM_REQUIRE_CHANGE BOOLEAN DEFAULT FALSE, + UM_CHANGED_TIME TIMESTAMP NOT NULL, + UM_TENANT_ID INTEGER DEFAULT 0, + PRIMARY KEY (UM_ID, UM_TENANT_ID), + UNIQUE(UM_USER_NAME, UM_TENANT_ID) +)ENGINE INNODB; + +CREATE TABLE UM_ROLE ( + UM_ID INTEGER NOT NULL AUTO_INCREMENT, + UM_ROLE_NAME VARCHAR(255) NOT NULL, + UM_TENANT_ID INTEGER DEFAULT 0, + UM_SHARED_ROLE BOOLEAN DEFAULT FALSE, + PRIMARY KEY (UM_ID, UM_TENANT_ID), + UNIQUE(UM_ROLE_NAME, UM_TENANT_ID) +)ENGINE INNODB; + + +CREATE TABLE UM_MODULE( + UM_ID INTEGER NOT NULL AUTO_INCREMENT, + UM_MODULE_NAME VARCHAR(100), + UNIQUE(UM_MODULE_NAME), + PRIMARY KEY(UM_ID) +)ENGINE INNODB; + +CREATE TABLE UM_MODULE_ACTIONS( + UM_ACTION VARCHAR(255) NOT NULL, + UM_MODULE_ID INTEGER NOT NULL, + PRIMARY KEY(UM_ACTION, UM_MODULE_ID), + FOREIGN KEY (UM_MODULE_ID) REFERENCES UM_MODULE(UM_ID) ON DELETE CASCADE +)ENGINE INNODB; + +CREATE TABLE UM_PERMISSION ( + UM_ID INTEGER NOT NULL AUTO_INCREMENT, + UM_RESOURCE_ID VARCHAR(255) NOT NULL, + UM_ACTION VARCHAR(255) NOT NULL, + UM_TENANT_ID INTEGER DEFAULT 0, + UM_MODULE_ID INTEGER DEFAULT 0, + UNIQUE(UM_RESOURCE_ID,UM_ACTION, UM_TENANT_ID), + PRIMARY KEY (UM_ID, UM_TENANT_ID) +)ENGINE INNODB; + +CREATE INDEX INDEX_UM_PERMISSION_UM_RESOURCE_ID_UM_ACTION ON UM_PERMISSION (UM_RESOURCE_ID, UM_ACTION, UM_TENANT_ID); + +CREATE TABLE UM_ROLE_PERMISSION ( + UM_ID INTEGER NOT NULL AUTO_INCREMENT, + UM_PERMISSION_ID INTEGER NOT NULL, + UM_ROLE_NAME VARCHAR(255) NOT NULL, + UM_IS_ALLOWED SMALLINT NOT NULL, + UM_TENANT_ID INTEGER DEFAULT 0, + UM_DOMAIN_ID INTEGER, + UNIQUE (UM_PERMISSION_ID, UM_ROLE_NAME, UM_TENANT_ID, UM_DOMAIN_ID), + FOREIGN KEY (UM_PERMISSION_ID, UM_TENANT_ID) REFERENCES UM_PERMISSION(UM_ID, UM_TENANT_ID) ON DELETE CASCADE, + FOREIGN KEY (UM_DOMAIN_ID, UM_TENANT_ID) REFERENCES UM_DOMAIN(UM_DOMAIN_ID, UM_TENANT_ID) ON DELETE CASCADE, + PRIMARY KEY (UM_ID, UM_TENANT_ID) +)ENGINE INNODB; + +-- REMOVED UNIQUE (UM_PERMISSION_ID, UM_ROLE_ID) +CREATE TABLE UM_USER_PERMISSION ( + UM_ID INTEGER NOT NULL AUTO_INCREMENT, + UM_PERMISSION_ID INTEGER NOT NULL, + UM_USER_NAME VARCHAR(255) NOT NULL, + UM_IS_ALLOWED SMALLINT NOT NULL, + UM_TENANT_ID INTEGER DEFAULT 0, + FOREIGN KEY (UM_PERMISSION_ID, UM_TENANT_ID) REFERENCES UM_PERMISSION(UM_ID, UM_TENANT_ID) ON DELETE CASCADE, + PRIMARY KEY (UM_ID, UM_TENANT_ID) +)ENGINE INNODB; + +-- REMOVED UNIQUE (UM_PERMISSION_ID, UM_USER_ID) +CREATE TABLE UM_USER_ROLE ( + UM_ID INTEGER NOT NULL AUTO_INCREMENT, + UM_ROLE_ID INTEGER NOT NULL, + UM_USER_ID INTEGER NOT NULL, + UM_TENANT_ID INTEGER DEFAULT 0, + UNIQUE (UM_USER_ID, UM_ROLE_ID, UM_TENANT_ID), + FOREIGN KEY (UM_ROLE_ID, UM_TENANT_ID) REFERENCES UM_ROLE(UM_ID, UM_TENANT_ID), + FOREIGN KEY (UM_USER_ID, UM_TENANT_ID) REFERENCES UM_USER(UM_ID, UM_TENANT_ID), + PRIMARY KEY (UM_ID, UM_TENANT_ID) +)ENGINE INNODB; + +CREATE TABLE UM_SHARED_USER_ROLE( + UM_ROLE_ID INTEGER NOT NULL, + UM_USER_ID INTEGER NOT NULL, + UM_USER_TENANT_ID INTEGER NOT NULL, + UM_ROLE_TENANT_ID INTEGER NOT NULL, + UNIQUE(UM_USER_ID,UM_ROLE_ID,UM_USER_TENANT_ID, UM_ROLE_TENANT_ID), + FOREIGN KEY(UM_ROLE_ID,UM_ROLE_TENANT_ID) REFERENCES UM_ROLE(UM_ID,UM_TENANT_ID) ON DELETE CASCADE, + FOREIGN KEY(UM_USER_ID,UM_USER_TENANT_ID) REFERENCES UM_USER(UM_ID,UM_TENANT_ID) ON DELETE CASCADE +)ENGINE INNODB; + +CREATE TABLE UM_ACCOUNT_MAPPING( + UM_ID INTEGER NOT NULL AUTO_INCREMENT, + UM_USER_NAME VARCHAR(255) NOT NULL, + UM_TENANT_ID INTEGER NOT NULL, + UM_USER_STORE_DOMAIN VARCHAR(100), + UM_ACC_LINK_ID INTEGER NOT NULL, + UNIQUE(UM_USER_NAME, UM_TENANT_ID, UM_USER_STORE_DOMAIN, UM_ACC_LINK_ID), + FOREIGN KEY (UM_TENANT_ID) REFERENCES UM_TENANT(UM_ID) ON DELETE CASCADE, + PRIMARY KEY (UM_ID) +)ENGINE INNODB; + + +CREATE TABLE UM_USER_ATTRIBUTE ( + UM_ID INTEGER NOT NULL AUTO_INCREMENT, + UM_ATTR_NAME VARCHAR(255) NOT NULL, + UM_ATTR_VALUE VARCHAR(1024), + UM_PROFILE_ID VARCHAR(255), + UM_USER_ID INTEGER, + UM_TENANT_ID INTEGER DEFAULT 0, + FOREIGN KEY (UM_USER_ID, UM_TENANT_ID) REFERENCES UM_USER(UM_ID, UM_TENANT_ID), + PRIMARY KEY (UM_ID, UM_TENANT_ID) +)ENGINE INNODB; + +CREATE INDEX UM_USER_ID_INDEX ON UM_USER_ATTRIBUTE(UM_USER_ID); + +CREATE TABLE UM_DIALECT( + UM_ID INTEGER NOT NULL AUTO_INCREMENT, + UM_DIALECT_URI VARCHAR(255) NOT NULL, + UM_TENANT_ID INTEGER DEFAULT 0, + UNIQUE(UM_DIALECT_URI, UM_TENANT_ID), + PRIMARY KEY (UM_ID, UM_TENANT_ID) +)ENGINE INNODB; + +CREATE TABLE UM_CLAIM( + UM_ID INTEGER NOT NULL AUTO_INCREMENT, + UM_DIALECT_ID INTEGER NOT NULL, + UM_CLAIM_URI VARCHAR(255) NOT NULL, + UM_DISPLAY_TAG VARCHAR(255), + UM_DESCRIPTION VARCHAR(255), + UM_MAPPED_ATTRIBUTE_DOMAIN VARCHAR(255), + UM_MAPPED_ATTRIBUTE VARCHAR(255), + UM_REG_EX VARCHAR(255), + UM_SUPPORTED SMALLINT, + UM_REQUIRED SMALLINT, + UM_DISPLAY_ORDER INTEGER, + UM_CHECKED_ATTRIBUTE SMALLINT, + UM_READ_ONLY SMALLINT, + UM_TENANT_ID INTEGER DEFAULT 0, + UNIQUE(UM_DIALECT_ID, UM_CLAIM_URI, UM_TENANT_ID,UM_MAPPED_ATTRIBUTE_DOMAIN), + FOREIGN KEY(UM_DIALECT_ID, UM_TENANT_ID) REFERENCES UM_DIALECT(UM_ID, UM_TENANT_ID), + PRIMARY KEY (UM_ID, UM_TENANT_ID) +)ENGINE INNODB; + + +CREATE TABLE UM_PROFILE_CONFIG( + UM_ID INTEGER NOT NULL AUTO_INCREMENT, + UM_DIALECT_ID INTEGER NOT NULL, + UM_PROFILE_NAME VARCHAR(255), + UM_TENANT_ID INTEGER DEFAULT 0, + FOREIGN KEY(UM_DIALECT_ID, UM_TENANT_ID) REFERENCES UM_DIALECT(UM_ID, UM_TENANT_ID), + PRIMARY KEY (UM_ID, UM_TENANT_ID) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS UM_CLAIM_BEHAVIOR( + UM_ID INTEGER NOT NULL AUTO_INCREMENT, + UM_PROFILE_ID INTEGER, + UM_CLAIM_ID INTEGER, + UM_BEHAVIOUR SMALLINT, + UM_TENANT_ID INTEGER DEFAULT 0, + FOREIGN KEY(UM_PROFILE_ID, UM_TENANT_ID) REFERENCES UM_PROFILE_CONFIG(UM_ID,UM_TENANT_ID), + FOREIGN KEY(UM_CLAIM_ID, UM_TENANT_ID) REFERENCES UM_CLAIM(UM_ID,UM_TENANT_ID), + PRIMARY KEY(UM_ID, UM_TENANT_ID) +)ENGINE INNODB; + +CREATE TABLE UM_HYBRID_ROLE( + UM_ID INTEGER NOT NULL AUTO_INCREMENT, + UM_ROLE_NAME VARCHAR(255), + UM_TENANT_ID INTEGER DEFAULT 0, + PRIMARY KEY (UM_ID, UM_TENANT_ID) +)ENGINE INNODB; + +CREATE TABLE UM_HYBRID_USER_ROLE( + UM_ID INTEGER NOT NULL AUTO_INCREMENT, + UM_USER_NAME VARCHAR(255), + UM_ROLE_ID INTEGER NOT NULL, + UM_TENANT_ID INTEGER DEFAULT 0, + UM_DOMAIN_ID INTEGER, + UNIQUE (UM_USER_NAME, UM_ROLE_ID, UM_TENANT_ID, UM_DOMAIN_ID), + FOREIGN KEY (UM_ROLE_ID, UM_TENANT_ID) REFERENCES UM_HYBRID_ROLE(UM_ID, UM_TENANT_ID) ON DELETE CASCADE, + FOREIGN KEY (UM_DOMAIN_ID, UM_TENANT_ID) REFERENCES UM_DOMAIN(UM_DOMAIN_ID, UM_TENANT_ID) ON DELETE CASCADE, + PRIMARY KEY (UM_ID, UM_TENANT_ID) +)ENGINE INNODB; + +CREATE TABLE UM_SYSTEM_ROLE( + UM_ID INTEGER NOT NULL AUTO_INCREMENT, + UM_ROLE_NAME VARCHAR(255), + UM_TENANT_ID INTEGER DEFAULT 0, + PRIMARY KEY (UM_ID, UM_TENANT_ID) +)ENGINE INNODB; + +CREATE INDEX SYSTEM_ROLE_IND_BY_RN_TI ON UM_SYSTEM_ROLE(UM_ROLE_NAME, UM_TENANT_ID); + +CREATE TABLE UM_SYSTEM_USER_ROLE( + UM_ID INTEGER NOT NULL AUTO_INCREMENT, + UM_USER_NAME VARCHAR(255), + UM_ROLE_ID INTEGER NOT NULL, + UM_TENANT_ID INTEGER DEFAULT 0, + UNIQUE (UM_USER_NAME, UM_ROLE_ID, UM_TENANT_ID), + FOREIGN KEY (UM_ROLE_ID, UM_TENANT_ID) REFERENCES UM_SYSTEM_ROLE(UM_ID, UM_TENANT_ID), + PRIMARY KEY (UM_ID, UM_TENANT_ID) +)ENGINE INNODB; + + +CREATE TABLE UM_HYBRID_REMEMBER_ME( + UM_ID INTEGER NOT NULL AUTO_INCREMENT, + UM_USER_NAME VARCHAR(255) NOT NULL, + UM_COOKIE_VALUE VARCHAR(1024), + UM_CREATED_TIME TIMESTAMP, + UM_TENANT_ID INTEGER DEFAULT 0, + PRIMARY KEY (UM_ID, UM_TENANT_ID) +)ENGINE INNODB; + +USE WSO2AM_APIMGT_DB; + +-- Start of IDENTITY Tables-- + +CREATE TABLE IF NOT EXISTS IDN_BASE_TABLE ( + PRODUCT_NAME VARCHAR(20), + PRIMARY KEY (PRODUCT_NAME) +)ENGINE INNODB; + +INSERT INTO IDN_BASE_TABLE values ('WSO2 Identity Server'); + +CREATE TABLE IF NOT EXISTS IDN_OAUTH_CONSUMER_APPS ( + ID INTEGER NOT NULL AUTO_INCREMENT, + CONSUMER_KEY VARCHAR(255), + CONSUMER_SECRET VARCHAR(2048), + USERNAME VARCHAR(255), + TENANT_ID INTEGER DEFAULT 0, + USER_DOMAIN VARCHAR(50), + APP_NAME VARCHAR(255), + OAUTH_VERSION VARCHAR(128), + CALLBACK_URL VARCHAR(1024), + GRANT_TYPES VARCHAR (1024), + PKCE_MANDATORY CHAR(1) DEFAULT '0', + PKCE_SUPPORT_PLAIN CHAR(1) DEFAULT '0', + APP_STATE VARCHAR (25) DEFAULT 'ACTIVE', + USER_ACCESS_TOKEN_EXPIRE_TIME BIGINT DEFAULT 3600000, + APP_ACCESS_TOKEN_EXPIRE_TIME BIGINT DEFAULT 3600000, + REFRESH_TOKEN_EXPIRE_TIME BIGINT DEFAULT 84600000, + CONSTRAINT CONSUMER_KEY_CONSTRAINT UNIQUE (CONSUMER_KEY), + PRIMARY KEY (ID) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS IDN_OAUTH2_SCOPE_VALIDATORS ( + APP_ID INTEGER NOT NULL, + SCOPE_VALIDATOR VARCHAR (128) NOT NULL, + PRIMARY KEY (APP_ID,SCOPE_VALIDATOR), + FOREIGN KEY (APP_ID) REFERENCES IDN_OAUTH_CONSUMER_APPS(ID) ON DELETE CASCADE +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS IDN_OAUTH1A_REQUEST_TOKEN ( + REQUEST_TOKEN VARCHAR(255), + REQUEST_TOKEN_SECRET VARCHAR(512), + CONSUMER_KEY_ID INTEGER, + CALLBACK_URL VARCHAR(1024), + SCOPE VARCHAR(2048), + AUTHORIZED VARCHAR(128), + OAUTH_VERIFIER VARCHAR(512), + AUTHZ_USER VARCHAR(512), + TENANT_ID INTEGER DEFAULT -1, + PRIMARY KEY (REQUEST_TOKEN), + FOREIGN KEY (CONSUMER_KEY_ID) REFERENCES IDN_OAUTH_CONSUMER_APPS(ID) ON DELETE CASCADE +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS IDN_OAUTH1A_ACCESS_TOKEN ( + ACCESS_TOKEN VARCHAR(255), + ACCESS_TOKEN_SECRET VARCHAR(512), + CONSUMER_KEY_ID INTEGER, + SCOPE VARCHAR(2048), + AUTHZ_USER VARCHAR(512), + TENANT_ID INTEGER DEFAULT -1, + PRIMARY KEY (ACCESS_TOKEN), + FOREIGN KEY (CONSUMER_KEY_ID) REFERENCES IDN_OAUTH_CONSUMER_APPS(ID) ON DELETE CASCADE +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS IDN_OAUTH2_ACCESS_TOKEN ( + TOKEN_ID VARCHAR (255), + ACCESS_TOKEN VARCHAR(2048), + REFRESH_TOKEN VARCHAR(2048), + CONSUMER_KEY_ID INTEGER, + AUTHZ_USER VARCHAR (100), + TENANT_ID INTEGER, + USER_DOMAIN VARCHAR(50), + USER_TYPE VARCHAR (25), + GRANT_TYPE VARCHAR (50), + TIME_CREATED TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + REFRESH_TOKEN_TIME_CREATED TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + VALIDITY_PERIOD BIGINT, + REFRESH_TOKEN_VALIDITY_PERIOD BIGINT, + TOKEN_SCOPE_HASH VARCHAR(32), + TOKEN_STATE VARCHAR(25) DEFAULT 'ACTIVE', + TOKEN_STATE_ID VARCHAR (128) DEFAULT 'NONE', + SUBJECT_IDENTIFIER VARCHAR(255), + ACCESS_TOKEN_HASH VARCHAR(512), + REFRESH_TOKEN_HASH VARCHAR(512), + PRIMARY KEY (TOKEN_ID), + FOREIGN KEY (CONSUMER_KEY_ID) REFERENCES IDN_OAUTH_CONSUMER_APPS(ID) ON DELETE CASCADE, + CONSTRAINT CON_APP_KEY UNIQUE (CONSUMER_KEY_ID,AUTHZ_USER,TENANT_ID,USER_DOMAIN,USER_TYPE,TOKEN_SCOPE_HASH, + TOKEN_STATE,TOKEN_STATE_ID) +)ENGINE INNODB; + +CREATE INDEX IDX_AT_CK_AU ON IDN_OAUTH2_ACCESS_TOKEN(CONSUMER_KEY_ID, AUTHZ_USER, TOKEN_STATE, USER_TYPE); + +CREATE INDEX IDX_TC ON IDN_OAUTH2_ACCESS_TOKEN(TIME_CREATED); + +CREATE INDEX IDX_ATH ON IDN_OAUTH2_ACCESS_TOKEN(ACCESS_TOKEN_HASH); + +CREATE TABLE IF NOT EXISTS IDN_OAUTH2_AUTHORIZATION_CODE ( + CODE_ID VARCHAR (255), + AUTHORIZATION_CODE VARCHAR(2048), + CONSUMER_KEY_ID INTEGER, + CALLBACK_URL VARCHAR(1024), + SCOPE VARCHAR(2048), + AUTHZ_USER VARCHAR (100), + TENANT_ID INTEGER, + USER_DOMAIN VARCHAR(50), + TIME_CREATED TIMESTAMP, + VALIDITY_PERIOD BIGINT, + STATE VARCHAR (25) DEFAULT 'ACTIVE', + TOKEN_ID VARCHAR(255), + SUBJECT_IDENTIFIER VARCHAR(255), + PKCE_CODE_CHALLENGE VARCHAR(255), + PKCE_CODE_CHALLENGE_METHOD VARCHAR(128), + AUTHORIZATION_CODE_HASH VARCHAR(512), + PRIMARY KEY (CODE_ID), + FOREIGN KEY (CONSUMER_KEY_ID) REFERENCES IDN_OAUTH_CONSUMER_APPS(ID) ON DELETE CASCADE +)ENGINE INNODB; + +CREATE INDEX IDX_AUTHORIZATION_CODE_HASH ON IDN_OAUTH2_AUTHORIZATION_CODE (AUTHORIZATION_CODE_HASH,CONSUMER_KEY_ID); + +CREATE TABLE IF NOT EXISTS IDN_OAUTH2_ACCESS_TOKEN_SCOPE ( + TOKEN_ID VARCHAR (255), + TOKEN_SCOPE VARCHAR (60), + TENANT_ID INTEGER DEFAULT -1, + PRIMARY KEY (TOKEN_ID, TOKEN_SCOPE), + FOREIGN KEY (TOKEN_ID) REFERENCES IDN_OAUTH2_ACCESS_TOKEN(TOKEN_ID) ON DELETE CASCADE +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS IDN_OAUTH2_SCOPE ( + SCOPE_ID INTEGER NOT NULL AUTO_INCREMENT, + NAME VARCHAR(255) NOT NULL, + DISPLAY_NAME VARCHAR(255) NOT NULL, + DESCRIPTION VARCHAR(512), + TENANT_ID INTEGER NOT NULL DEFAULT -1, + PRIMARY KEY (SCOPE_ID) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS IDN_OAUTH2_SCOPE_BINDING ( + SCOPE_ID INTEGER NOT NULL, + SCOPE_BINDING VARCHAR(255), + FOREIGN KEY (SCOPE_ID) REFERENCES IDN_OAUTH2_SCOPE(SCOPE_ID) ON DELETE CASCADE +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS IDN_OAUTH2_RESOURCE_SCOPE ( + RESOURCE_PATH VARCHAR(255) NOT NULL, + SCOPE_ID INTEGER NOT NULL, + TENANT_ID INTEGER DEFAULT -1, + PRIMARY KEY (RESOURCE_PATH), + FOREIGN KEY (SCOPE_ID) REFERENCES IDN_OAUTH2_SCOPE (SCOPE_ID) ON DELETE CASCADE +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS IDN_SCIM_GROUP ( + ID INTEGER AUTO_INCREMENT, + TENANT_ID INTEGER NOT NULL, + ROLE_NAME VARCHAR(255) NOT NULL, + ATTR_NAME VARCHAR(1024) NOT NULL, + ATTR_VALUE VARCHAR(1024), + PRIMARY KEY (ID) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS IDN_OPENID_REMEMBER_ME ( + USER_NAME VARCHAR(255) NOT NULL, + TENANT_ID INTEGER DEFAULT 0, + COOKIE_VALUE VARCHAR(1024), + CREATED_TIME TIMESTAMP, + PRIMARY KEY (USER_NAME, TENANT_ID) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS IDN_OPENID_USER_RPS ( + USER_NAME VARCHAR(255) NOT NULL, + TENANT_ID INTEGER DEFAULT 0, + RP_URL VARCHAR(255) NOT NULL, + TRUSTED_ALWAYS VARCHAR(128) DEFAULT 'FALSE', + LAST_VISIT DATE NOT NULL, + VISIT_COUNT INTEGER DEFAULT 0, + DEFAULT_PROFILE_NAME VARCHAR(255) DEFAULT 'DEFAULT', + PRIMARY KEY (USER_NAME, TENANT_ID, RP_URL) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS IDN_OPENID_ASSOCIATIONS ( + HANDLE VARCHAR(255) NOT NULL, + ASSOC_TYPE VARCHAR(255) NOT NULL, + EXPIRE_IN TIMESTAMP NOT NULL, + MAC_KEY VARCHAR(255) NOT NULL, + ASSOC_STORE VARCHAR(128) DEFAULT 'SHARED', + TENANT_ID INTEGER DEFAULT -1, + PRIMARY KEY (HANDLE) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS IDN_STS_STORE ( + ID INTEGER AUTO_INCREMENT, + TOKEN_ID VARCHAR(255) NOT NULL, + TOKEN_CONTENT BLOB(1024) NOT NULL, + CREATE_DATE TIMESTAMP NOT NULL, + EXPIRE_DATE TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + STATE INTEGER DEFAULT 0, + PRIMARY KEY (ID) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS IDN_IDENTITY_USER_DATA ( + TENANT_ID INTEGER DEFAULT -1234, + USER_NAME VARCHAR(255) NOT NULL, + DATA_KEY VARCHAR(255) NOT NULL, + DATA_VALUE VARCHAR(2048), + PRIMARY KEY (TENANT_ID, USER_NAME, DATA_KEY) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS IDN_IDENTITY_META_DATA ( + USER_NAME VARCHAR(255) NOT NULL, + TENANT_ID INTEGER DEFAULT -1234, + METADATA_TYPE VARCHAR(255) NOT NULL, + METADATA VARCHAR(255) NOT NULL, + VALID VARCHAR(255) NOT NULL, + PRIMARY KEY (TENANT_ID, USER_NAME, METADATA_TYPE,METADATA) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS IDN_THRIFT_SESSION ( + SESSION_ID VARCHAR(255) NOT NULL, + USER_NAME VARCHAR(255) NOT NULL, + CREATED_TIME VARCHAR(255) NOT NULL, + LAST_MODIFIED_TIME VARCHAR(255) NOT NULL, + TENANT_ID INTEGER DEFAULT -1, + PRIMARY KEY (SESSION_ID) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS IDN_AUTH_SESSION_STORE ( + SESSION_ID VARCHAR (100) NOT NULL, + SESSION_TYPE VARCHAR(100) NOT NULL, + OPERATION VARCHAR(10) NOT NULL, + SESSION_OBJECT BLOB, + TIME_CREATED BIGINT, + TENANT_ID INTEGER DEFAULT -1, + PRIMARY KEY (SESSION_ID, SESSION_TYPE, TIME_CREATED, OPERATION) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS SP_APP ( + ID INTEGER NOT NULL AUTO_INCREMENT, + TENANT_ID INTEGER NOT NULL, + APP_NAME VARCHAR (255) NOT NULL , + USER_STORE VARCHAR (255) NOT NULL, + USERNAME VARCHAR (255) NOT NULL , + DESCRIPTION VARCHAR (1024), + ROLE_CLAIM VARCHAR (512), + AUTH_TYPE VARCHAR (255) NOT NULL, + PROVISIONING_USERSTORE_DOMAIN VARCHAR (512), + IS_LOCAL_CLAIM_DIALECT CHAR(1) DEFAULT '1', + IS_SEND_LOCAL_SUBJECT_ID CHAR(1) DEFAULT '0', + IS_SEND_AUTH_LIST_OF_IDPS CHAR(1) DEFAULT '0', + IS_USE_TENANT_DOMAIN_SUBJECT CHAR(1) DEFAULT '1', + IS_USE_USER_DOMAIN_SUBJECT CHAR(1) DEFAULT '1', + ENABLE_AUTHORIZATION CHAR(1) DEFAULT '0', + SUBJECT_CLAIM_URI VARCHAR (512), + IS_SAAS_APP CHAR(1) DEFAULT '0', + IS_DUMB_MODE CHAR(1) DEFAULT '0', + PRIMARY KEY (ID) +)ENGINE INNODB; + +ALTER TABLE SP_APP ADD CONSTRAINT APPLICATION_NAME_CONSTRAINT UNIQUE(APP_NAME, TENANT_ID); + +CREATE TABLE IF NOT EXISTS SP_METADATA ( + ID INTEGER AUTO_INCREMENT, + SP_ID INTEGER, + NAME VARCHAR(255) NOT NULL, + VALUE VARCHAR(255) NOT NULL, + DISPLAY_NAME VARCHAR(255), + TENANT_ID INTEGER DEFAULT -1, + PRIMARY KEY (ID), + CONSTRAINT SP_METADATA_CONSTRAINT UNIQUE (SP_ID, NAME), + FOREIGN KEY (SP_ID) REFERENCES SP_APP(ID) ON DELETE CASCADE +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS SP_INBOUND_AUTH ( + ID INTEGER NOT NULL AUTO_INCREMENT, + TENANT_ID INTEGER NOT NULL, + INBOUND_AUTH_KEY VARCHAR (255), + INBOUND_AUTH_TYPE VARCHAR (255) NOT NULL, + INBOUND_CONFIG_TYPE VARCHAR (255) NOT NULL, + PROP_NAME VARCHAR (255), + PROP_VALUE VARCHAR (1024) , + APP_ID INTEGER NOT NULL, + PRIMARY KEY (ID) +)ENGINE INNODB; + +ALTER TABLE SP_INBOUND_AUTH ADD CONSTRAINT APPLICATION_ID_CONSTRAINT FOREIGN KEY (APP_ID) REFERENCES SP_APP (ID) ON DELETE CASCADE; + +CREATE TABLE IF NOT EXISTS SP_AUTH_STEP ( + ID INTEGER NOT NULL AUTO_INCREMENT, + TENANT_ID INTEGER NOT NULL, + STEP_ORDER INTEGER DEFAULT 1, + APP_ID INTEGER NOT NULL , + IS_SUBJECT_STEP CHAR(1) DEFAULT '0', + IS_ATTRIBUTE_STEP CHAR(1) DEFAULT '0', + PRIMARY KEY (ID) +)ENGINE INNODB; + +ALTER TABLE SP_AUTH_STEP ADD CONSTRAINT APPLICATION_ID_CONSTRAINT_STEP FOREIGN KEY (APP_ID) REFERENCES SP_APP (ID) ON DELETE CASCADE; + +CREATE TABLE IF NOT EXISTS SP_FEDERATED_IDP ( + ID INTEGER NOT NULL, + TENANT_ID INTEGER NOT NULL, + AUTHENTICATOR_ID INTEGER NOT NULL, + PRIMARY KEY (ID, AUTHENTICATOR_ID) +)ENGINE INNODB; + +ALTER TABLE SP_FEDERATED_IDP ADD CONSTRAINT STEP_ID_CONSTRAINT FOREIGN KEY (ID) REFERENCES SP_AUTH_STEP (ID) ON DELETE CASCADE; + +CREATE TABLE IF NOT EXISTS SP_CLAIM_MAPPING ( + ID INTEGER NOT NULL AUTO_INCREMENT, + TENANT_ID INTEGER NOT NULL, + IDP_CLAIM VARCHAR (512) NOT NULL , + SP_CLAIM VARCHAR (512) NOT NULL , + APP_ID INTEGER NOT NULL, + IS_REQUESTED VARCHAR(128) DEFAULT '0', + IS_MANDATORY VARCHAR(128) DEFAULT '0', + DEFAULT_VALUE VARCHAR(255), + PRIMARY KEY (ID) +)ENGINE INNODB; + +ALTER TABLE SP_CLAIM_MAPPING ADD CONSTRAINT CLAIMID_APPID_CONSTRAINT FOREIGN KEY (APP_ID) REFERENCES SP_APP (ID) ON DELETE CASCADE; + +CREATE TABLE IF NOT EXISTS SP_ROLE_MAPPING ( + ID INTEGER NOT NULL AUTO_INCREMENT, + TENANT_ID INTEGER NOT NULL, + IDP_ROLE VARCHAR (255) NOT NULL , + SP_ROLE VARCHAR (255) NOT NULL , + APP_ID INTEGER NOT NULL, + PRIMARY KEY (ID) +)ENGINE INNODB; + +ALTER TABLE SP_ROLE_MAPPING ADD CONSTRAINT ROLEID_APPID_CONSTRAINT FOREIGN KEY (APP_ID) REFERENCES SP_APP (ID) ON DELETE CASCADE; + +CREATE TABLE IF NOT EXISTS SP_REQ_PATH_AUTHENTICATOR ( + ID INTEGER NOT NULL AUTO_INCREMENT, + TENANT_ID INTEGER NOT NULL, + AUTHENTICATOR_NAME VARCHAR (255) NOT NULL , + APP_ID INTEGER NOT NULL, + PRIMARY KEY (ID) +)ENGINE INNODB; + +ALTER TABLE SP_REQ_PATH_AUTHENTICATOR ADD CONSTRAINT REQ_AUTH_APPID_CONSTRAINT FOREIGN KEY (APP_ID) REFERENCES SP_APP (ID) ON DELETE CASCADE; + +CREATE TABLE IF NOT EXISTS SP_PROVISIONING_CONNECTOR ( + ID INTEGER NOT NULL AUTO_INCREMENT, + TENANT_ID INTEGER NOT NULL, + IDP_NAME VARCHAR (255) NOT NULL , + CONNECTOR_NAME VARCHAR (255) NOT NULL , + APP_ID INTEGER NOT NULL, + IS_JIT_ENABLED CHAR(1) NOT NULL DEFAULT '0', + BLOCKING CHAR(1) NOT NULL DEFAULT '0', + RULE_ENABLED CHAR(1) NOT NULL DEFAULT '0', + PRIMARY KEY (ID) +)ENGINE INNODB; + +ALTER TABLE SP_PROVISIONING_CONNECTOR ADD CONSTRAINT PRO_CONNECTOR_APPID_CONSTRAINT FOREIGN KEY (APP_ID) REFERENCES SP_APP (ID) ON DELETE CASCADE; + +CREATE TABLE SP_AUTH_SCRIPT ( + ID INTEGER AUTO_INCREMENT NOT NULL, + TENANT_ID INTEGER NOT NULL, + APP_ID INTEGER NOT NULL, + TYPE VARCHAR(255) NOT NULL, + CONTENT BLOB DEFAULT NULL, + IS_ENABLED CHAR(1) NOT NULL DEFAULT '0', + PRIMARY KEY (ID)); + +CREATE TABLE IF NOT EXISTS IDP ( + ID INTEGER AUTO_INCREMENT, + TENANT_ID INTEGER, + NAME VARCHAR(254) NOT NULL, + IS_ENABLED CHAR(1) NOT NULL DEFAULT '1', + IS_PRIMARY CHAR(1) NOT NULL DEFAULT '0', + HOME_REALM_ID VARCHAR(254), + IMAGE MEDIUMBLOB, + CERTIFICATE BLOB, + ALIAS VARCHAR(254), + INBOUND_PROV_ENABLED CHAR (1) NOT NULL DEFAULT '0', + INBOUND_PROV_USER_STORE_ID VARCHAR(254), + USER_CLAIM_URI VARCHAR(254), + ROLE_CLAIM_URI VARCHAR(254), + DESCRIPTION VARCHAR (1024), + DEFAULT_AUTHENTICATOR_NAME VARCHAR(254), + DEFAULT_PRO_CONNECTOR_NAME VARCHAR(254), + PROVISIONING_ROLE VARCHAR(128), + IS_FEDERATION_HUB CHAR(1) NOT NULL DEFAULT '0', + IS_LOCAL_CLAIM_DIALECT CHAR(1) NOT NULL DEFAULT '0', + DISPLAY_NAME VARCHAR(255), + PRIMARY KEY (ID), + UNIQUE (TENANT_ID, NAME) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS IDP_ROLE ( + ID INTEGER AUTO_INCREMENT, + IDP_ID INTEGER, + TENANT_ID INTEGER, + ROLE VARCHAR(254), + PRIMARY KEY (ID), + UNIQUE (IDP_ID, ROLE), + FOREIGN KEY (IDP_ID) REFERENCES IDP(ID) ON DELETE CASCADE +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS IDP_ROLE_MAPPING ( + ID INTEGER AUTO_INCREMENT, + IDP_ROLE_ID INTEGER, + TENANT_ID INTEGER, + USER_STORE_ID VARCHAR (253), + LOCAL_ROLE VARCHAR(253), + PRIMARY KEY (ID), + UNIQUE (IDP_ROLE_ID, TENANT_ID, USER_STORE_ID, LOCAL_ROLE), + FOREIGN KEY (IDP_ROLE_ID) REFERENCES IDP_ROLE(ID) ON DELETE CASCADE +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS IDP_CLAIM ( + ID INTEGER AUTO_INCREMENT, + IDP_ID INTEGER, + TENANT_ID INTEGER, + CLAIM VARCHAR(254), + PRIMARY KEY (ID), + UNIQUE (IDP_ID, CLAIM), + FOREIGN KEY (IDP_ID) REFERENCES IDP(ID) ON DELETE CASCADE +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS IDP_CLAIM_MAPPING ( + ID INTEGER AUTO_INCREMENT, + IDP_CLAIM_ID INTEGER, + TENANT_ID INTEGER, + LOCAL_CLAIM VARCHAR(253), + DEFAULT_VALUE VARCHAR(255), + IS_REQUESTED VARCHAR(128) DEFAULT '0', + PRIMARY KEY (ID), + UNIQUE (IDP_CLAIM_ID, TENANT_ID, LOCAL_CLAIM), + FOREIGN KEY (IDP_CLAIM_ID) REFERENCES IDP_CLAIM(ID) ON DELETE CASCADE +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS IDP_AUTHENTICATOR ( + ID INTEGER AUTO_INCREMENT, + TENANT_ID INTEGER, + IDP_ID INTEGER, + NAME VARCHAR(255) NOT NULL, + IS_ENABLED CHAR (1) DEFAULT '1', + DISPLAY_NAME VARCHAR(255), + PRIMARY KEY (ID), + UNIQUE (TENANT_ID, IDP_ID, NAME), + FOREIGN KEY (IDP_ID) REFERENCES IDP(ID) ON DELETE CASCADE +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS IDP_METADATA ( + ID INTEGER AUTO_INCREMENT, + IDP_ID INTEGER, + NAME VARCHAR(255) NOT NULL, + VALUE VARCHAR(255) NOT NULL, + DISPLAY_NAME VARCHAR(255), + TENANT_ID INTEGER DEFAULT -1, + PRIMARY KEY (ID), + CONSTRAINT IDP_METADATA_CONSTRAINT UNIQUE (IDP_ID, NAME), + FOREIGN KEY (IDP_ID) REFERENCES IDP(ID) ON DELETE CASCADE +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS IDP_AUTHENTICATOR_PROPERTY ( + ID INTEGER AUTO_INCREMENT, + TENANT_ID INTEGER, + AUTHENTICATOR_ID INTEGER, + PROPERTY_KEY VARCHAR(255) NOT NULL, + PROPERTY_VALUE VARCHAR(2047), + IS_SECRET CHAR (1) DEFAULT '0', + PRIMARY KEY (ID), + UNIQUE (TENANT_ID, AUTHENTICATOR_ID, PROPERTY_KEY), + FOREIGN KEY (AUTHENTICATOR_ID) REFERENCES IDP_AUTHENTICATOR(ID) ON DELETE CASCADE +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS IDP_PROVISIONING_CONFIG ( + ID INTEGER AUTO_INCREMENT, + TENANT_ID INTEGER, + IDP_ID INTEGER, + PROVISIONING_CONNECTOR_TYPE VARCHAR(255) NOT NULL, + IS_ENABLED CHAR (1) DEFAULT '0', + IS_BLOCKING CHAR (1) DEFAULT '0', + IS_RULES_ENABLED CHAR (1) DEFAULT '0', + PRIMARY KEY (ID), + UNIQUE (TENANT_ID, IDP_ID, PROVISIONING_CONNECTOR_TYPE), + FOREIGN KEY (IDP_ID) REFERENCES IDP(ID) ON DELETE CASCADE +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS IDP_PROV_CONFIG_PROPERTY ( + ID INTEGER AUTO_INCREMENT, + TENANT_ID INTEGER, + PROVISIONING_CONFIG_ID INTEGER, + PROPERTY_KEY VARCHAR(255) NOT NULL, + PROPERTY_VALUE VARCHAR(2048), + PROPERTY_BLOB_VALUE BLOB, + PROPERTY_TYPE CHAR(32) NOT NULL, + IS_SECRET CHAR (1) DEFAULT '0', + PRIMARY KEY (ID), + UNIQUE (TENANT_ID, PROVISIONING_CONFIG_ID, PROPERTY_KEY), + FOREIGN KEY (PROVISIONING_CONFIG_ID) REFERENCES IDP_PROVISIONING_CONFIG(ID) ON DELETE CASCADE +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS IDP_PROVISIONING_ENTITY ( + ID INTEGER AUTO_INCREMENT, + PROVISIONING_CONFIG_ID INTEGER, + ENTITY_TYPE VARCHAR(255) NOT NULL, + ENTITY_LOCAL_USERSTORE VARCHAR(255) NOT NULL, + ENTITY_NAME VARCHAR(255) NOT NULL, + ENTITY_VALUE VARCHAR(255), + TENANT_ID INTEGER, + ENTITY_LOCAL_ID VARCHAR(255), + PRIMARY KEY (ID), + UNIQUE (ENTITY_TYPE, TENANT_ID, ENTITY_LOCAL_USERSTORE, ENTITY_NAME, PROVISIONING_CONFIG_ID), + UNIQUE (PROVISIONING_CONFIG_ID, ENTITY_TYPE, ENTITY_VALUE), + FOREIGN KEY (PROVISIONING_CONFIG_ID) REFERENCES IDP_PROVISIONING_CONFIG(ID) ON DELETE CASCADE +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS IDP_LOCAL_CLAIM ( + ID INTEGER AUTO_INCREMENT, + TENANT_ID INTEGER, + IDP_ID INTEGER, + CLAIM_URI VARCHAR(255) NOT NULL, + DEFAULT_VALUE VARCHAR(255), + IS_REQUESTED VARCHAR(128) DEFAULT '0', + PRIMARY KEY (ID), + UNIQUE (TENANT_ID, IDP_ID, CLAIM_URI), + FOREIGN KEY (IDP_ID) REFERENCES IDP(ID) ON DELETE CASCADE +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS IDN_ASSOCIATED_ID ( + ID INTEGER AUTO_INCREMENT, + IDP_USER_ID VARCHAR(255) NOT NULL, + TENANT_ID INTEGER DEFAULT -1234, + IDP_ID INTEGER NOT NULL, + DOMAIN_NAME VARCHAR(255) NOT NULL, + USER_NAME VARCHAR(255) NOT NULL, + PRIMARY KEY (ID), + UNIQUE(IDP_USER_ID, TENANT_ID, IDP_ID), + FOREIGN KEY (IDP_ID) REFERENCES IDP(ID) ON DELETE CASCADE +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS IDN_USER_ACCOUNT_ASSOCIATION ( + ASSOCIATION_KEY VARCHAR(255) NOT NULL, + TENANT_ID INTEGER, + DOMAIN_NAME VARCHAR(255) NOT NULL, + USER_NAME VARCHAR(255) NOT NULL, + PRIMARY KEY (TENANT_ID, DOMAIN_NAME, USER_NAME) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS FIDO_DEVICE_STORE ( + TENANT_ID INTEGER, + DOMAIN_NAME VARCHAR(255) NOT NULL, + USER_NAME VARCHAR(45) NOT NULL, + TIME_REGISTERED TIMESTAMP, + KEY_HANDLE VARCHAR(200) NOT NULL, + DEVICE_DATA VARCHAR(2048) NOT NULL, + PRIMARY KEY (TENANT_ID, DOMAIN_NAME, USER_NAME, KEY_HANDLE) + )ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS WF_REQUEST ( + UUID VARCHAR (45), + CREATED_BY VARCHAR (255), + TENANT_ID INTEGER DEFAULT -1, + OPERATION_TYPE VARCHAR (50), + CREATED_AT TIMESTAMP, + UPDATED_AT TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + STATUS VARCHAR (30), + REQUEST BLOB, + PRIMARY KEY (UUID) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS WF_BPS_PROFILE ( + PROFILE_NAME VARCHAR(45), + HOST_URL_MANAGER VARCHAR(255), + HOST_URL_WORKER VARCHAR(255), + USERNAME VARCHAR(45), + PASSWORD VARCHAR(1023), + CALLBACK_HOST VARCHAR (45), + CALLBACK_USERNAME VARCHAR (45), + CALLBACK_PASSWORD VARCHAR (255), + TENANT_ID INTEGER DEFAULT -1, + PRIMARY KEY (PROFILE_NAME, TENANT_ID) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS WF_WORKFLOW( + ID VARCHAR (45), + WF_NAME VARCHAR (45), + DESCRIPTION VARCHAR (255), + TEMPLATE_ID VARCHAR (45), + IMPL_ID VARCHAR (45), + TENANT_ID INTEGER DEFAULT -1, + PRIMARY KEY (ID) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS WF_WORKFLOW_ASSOCIATION( + ID INTEGER NOT NULL AUTO_INCREMENT, + ASSOC_NAME VARCHAR (45), + EVENT_ID VARCHAR(45), + ASSOC_CONDITION VARCHAR (2000), + WORKFLOW_ID VARCHAR (45), + IS_ENABLED CHAR (1) DEFAULT '1', + TENANT_ID INTEGER DEFAULT -1, + PRIMARY KEY(ID), + FOREIGN KEY (WORKFLOW_ID) REFERENCES WF_WORKFLOW(ID)ON DELETE CASCADE +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS WF_WORKFLOW_CONFIG_PARAM( + WORKFLOW_ID VARCHAR (45), + PARAM_NAME VARCHAR (45), + PARAM_VALUE VARCHAR (1000), + PARAM_QNAME VARCHAR (45), + PARAM_HOLDER VARCHAR (45), + TENANT_ID INTEGER DEFAULT -1, + PRIMARY KEY (WORKFLOW_ID, PARAM_NAME, PARAM_QNAME, PARAM_HOLDER), + FOREIGN KEY (WORKFLOW_ID) REFERENCES WF_WORKFLOW(ID)ON DELETE CASCADE +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS WF_REQUEST_ENTITY_RELATIONSHIP( + REQUEST_ID VARCHAR (45), + ENTITY_NAME VARCHAR (255), + ENTITY_TYPE VARCHAR (50), + TENANT_ID INTEGER DEFAULT -1, + PRIMARY KEY(REQUEST_ID, ENTITY_NAME, ENTITY_TYPE, TENANT_ID), + FOREIGN KEY (REQUEST_ID) REFERENCES WF_REQUEST(UUID)ON DELETE CASCADE +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS WF_WORKFLOW_REQUEST_RELATION( + RELATIONSHIP_ID VARCHAR (45), + WORKFLOW_ID VARCHAR (45), + REQUEST_ID VARCHAR (45), + UPDATED_AT TIMESTAMP, + STATUS VARCHAR (30), + TENANT_ID INTEGER DEFAULT -1, + PRIMARY KEY (RELATIONSHIP_ID), + FOREIGN KEY (WORKFLOW_ID) REFERENCES WF_WORKFLOW(ID)ON DELETE CASCADE, + FOREIGN KEY (REQUEST_ID) REFERENCES WF_REQUEST(UUID)ON DELETE CASCADE +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS IDN_RECOVERY_DATA ( + USER_NAME VARCHAR(255) NOT NULL, + USER_DOMAIN VARCHAR(127) NOT NULL, + TENANT_ID INTEGER DEFAULT -1, + CODE VARCHAR(255) NOT NULL, + SCENARIO VARCHAR(255) NOT NULL, + STEP VARCHAR(127) NOT NULL, + TIME_CREATED TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + REMAINING_SETS VARCHAR(2500) DEFAULT NULL, + PRIMARY KEY(USER_NAME, USER_DOMAIN, TENANT_ID, SCENARIO,STEP), + UNIQUE(CODE) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS IDN_PASSWORD_HISTORY_DATA ( + ID INTEGER NOT NULL AUTO_INCREMENT, + USER_NAME VARCHAR(255) NOT NULL, + USER_DOMAIN VARCHAR(127) NOT NULL, + TENANT_ID INTEGER DEFAULT -1, + SALT_VALUE VARCHAR(255), + HASH VARCHAR(255) NOT NULL, + TIME_CREATED TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY(ID), + UNIQUE (USER_NAME,USER_DOMAIN,TENANT_ID,SALT_VALUE,HASH) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS IDN_CLAIM_DIALECT ( + ID INTEGER NOT NULL AUTO_INCREMENT, + DIALECT_URI VARCHAR (255) NOT NULL, + TENANT_ID INTEGER NOT NULL, + PRIMARY KEY (ID), + CONSTRAINT DIALECT_URI_CONSTRAINT UNIQUE (DIALECT_URI, TENANT_ID) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS IDN_CLAIM ( + ID INTEGER NOT NULL AUTO_INCREMENT, + DIALECT_ID INTEGER, + CLAIM_URI VARCHAR (255) NOT NULL, + TENANT_ID INTEGER NOT NULL, + PRIMARY KEY (ID), + FOREIGN KEY (DIALECT_ID) REFERENCES IDN_CLAIM_DIALECT(ID) ON DELETE CASCADE, + CONSTRAINT CLAIM_URI_CONSTRAINT UNIQUE (DIALECT_ID, CLAIM_URI, TENANT_ID) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS IDN_CLAIM_MAPPED_ATTRIBUTE ( + ID INTEGER NOT NULL AUTO_INCREMENT, + LOCAL_CLAIM_ID INTEGER, + USER_STORE_DOMAIN_NAME VARCHAR (255) NOT NULL, + ATTRIBUTE_NAME VARCHAR (255) NOT NULL, + TENANT_ID INTEGER NOT NULL, + PRIMARY KEY (ID), + FOREIGN KEY (LOCAL_CLAIM_ID) REFERENCES IDN_CLAIM(ID) ON DELETE CASCADE, + CONSTRAINT USER_STORE_DOMAIN_CONSTRAINT UNIQUE (LOCAL_CLAIM_ID, USER_STORE_DOMAIN_NAME, TENANT_ID) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS IDN_CLAIM_PROPERTY ( + ID INTEGER NOT NULL AUTO_INCREMENT, + LOCAL_CLAIM_ID INTEGER, + PROPERTY_NAME VARCHAR (255) NOT NULL, + PROPERTY_VALUE VARCHAR (255) NOT NULL, + TENANT_ID INTEGER NOT NULL, + PRIMARY KEY (ID), + FOREIGN KEY (LOCAL_CLAIM_ID) REFERENCES IDN_CLAIM(ID) ON DELETE CASCADE, + CONSTRAINT PROPERTY_NAME_CONSTRAINT UNIQUE (LOCAL_CLAIM_ID, PROPERTY_NAME, TENANT_ID) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS IDN_CLAIM_MAPPING ( + ID INTEGER NOT NULL AUTO_INCREMENT, + EXT_CLAIM_ID INTEGER NOT NULL, + MAPPED_LOCAL_CLAIM_ID INTEGER NOT NULL, + TENANT_ID INTEGER NOT NULL, + PRIMARY KEY (ID), + FOREIGN KEY (EXT_CLAIM_ID) REFERENCES IDN_CLAIM(ID) ON DELETE CASCADE, + FOREIGN KEY (MAPPED_LOCAL_CLAIM_ID) REFERENCES IDN_CLAIM(ID) ON DELETE CASCADE, + CONSTRAINT EXT_TO_LOC_MAPPING_CONSTRN UNIQUE (EXT_CLAIM_ID, TENANT_ID) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS IDN_SAML2_ASSERTION_STORE ( + ID INTEGER NOT NULL AUTO_INCREMENT, + SAML2_ID VARCHAR(255) , + SAML2_ISSUER VARCHAR(255) , + SAML2_SUBJECT VARCHAR(255) , + SAML2_SESSION_INDEX VARCHAR(255) , + SAML2_AUTHN_CONTEXT_CLASS_REF VARCHAR(255) , + SAML2_ASSERTION VARCHAR(4096) , + PRIMARY KEY (ID) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS IDN_OIDC_JTI ( + JWT_ID VARCHAR(255) NOT NULL, + EXP_TIME TIMESTAMP NOT NULL , + TIME_CREATED TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP , + PRIMARY KEY (JWT_ID) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS IDN_OIDC_PROPERTY ( + ID INTEGER NOT NULL AUTO_INCREMENT, + TENANT_ID INTEGER, + CONSUMER_KEY VARCHAR(255) , + PROPERTY_KEY VARCHAR(255) NOT NULL, + PROPERTY_VALUE VARCHAR(2047) , + PRIMARY KEY (ID), + FOREIGN KEY (CONSUMER_KEY) REFERENCES IDN_OAUTH_CONSUMER_APPS(CONSUMER_KEY) ON DELETE CASCADE +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS IDN_OIDC_REQ_OBJECT_REFERENCE ( + ID INTEGER NOT NULL AUTO_INCREMENT, + CONSUMER_KEY_ID INTEGER , + CODE_ID VARCHAR(255) , + TOKEN_ID VARCHAR(255) , + SESSION_DATA_KEY VARCHAR(255), + PRIMARY KEY (ID), + FOREIGN KEY (CONSUMER_KEY_ID) REFERENCES IDN_OAUTH_CONSUMER_APPS(ID) ON DELETE CASCADE, + FOREIGN KEY (TOKEN_ID) REFERENCES IDN_OAUTH2_ACCESS_TOKEN(TOKEN_ID) ON DELETE CASCADE, + FOREIGN KEY (CODE_ID) REFERENCES IDN_OAUTH2_AUTHORIZATION_CODE(CODE_ID) ON DELETE CASCADE +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS IDN_OIDC_REQ_OBJECT_CLAIMS ( + ID INTEGER NOT NULL AUTO_INCREMENT, + REQ_OBJECT_ID INTEGER, + CLAIM_ATTRIBUTE VARCHAR(255) , + ESSENTIAL CHAR(1) NOT NULL DEFAULT '0' , + VALUE VARCHAR(255) , + IS_USERINFO CHAR(1) NOT NULL DEFAULT '0', + PRIMARY KEY (ID), + FOREIGN KEY (REQ_OBJECT_ID) REFERENCES IDN_OIDC_REQ_OBJECT_REFERENCE (ID) ON DELETE CASCADE +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS IDN_OIDC_REQ_OBJ_CLAIM_VALUES ( + ID INTEGER NOT NULL AUTO_INCREMENT, + REQ_OBJECT_CLAIMS_ID INTEGER , + CLAIM_VALUES VARCHAR(255) , + PRIMARY KEY (ID), + FOREIGN KEY (REQ_OBJECT_CLAIMS_ID) REFERENCES IDN_OIDC_REQ_OBJECT_CLAIMS(ID) ON DELETE CASCADE +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS IDN_CERTIFICATE ( + ID INTEGER NOT NULL AUTO_INCREMENT, + NAME VARCHAR(100), + CERTIFICATE_IN_PEM BLOB, + TENANT_ID INTEGER DEFAULT 0, + PRIMARY KEY(ID), + CONSTRAINT CERTIFICATE_UNIQUE_KEY UNIQUE (NAME, TENANT_ID) +)ENGINE INNODB; + + +-- End of IDENTITY Tables-- + +-- Start of CONSENT-MGT Tables -- + +CREATE TABLE CM_PII_CATEGORY ( + ID INTEGER AUTO_INCREMENT, + NAME VARCHAR(255) NOT NULL, + DESCRIPTION VARCHAR(1023), + DISPLAY_NAME VARCHAR(255), + IS_SENSITIVE INTEGER NOT NULL, + TENANT_ID INTEGER DEFAULT '-1234', + UNIQUE KEY (NAME, TENANT_ID), + PRIMARY KEY (ID) +)ENGINE INNODB; + +CREATE TABLE CM_RECEIPT ( + CONSENT_RECEIPT_ID VARCHAR(255) NOT NULL, + VERSION VARCHAR(255) NOT NULL, + JURISDICTION VARCHAR(255) NOT NULL, + CONSENT_TIMESTAMP TIMESTAMP NOT NULL, + COLLECTION_METHOD VARCHAR(255) NOT NULL, + LANGUAGE VARCHAR(255) NOT NULL, + PII_PRINCIPAL_ID VARCHAR(255) NOT NULL, + PRINCIPAL_TENANT_ID INTEGER DEFAULT '-1234', + POLICY_URL VARCHAR(255) NOT NULL, + STATE VARCHAR(255) NOT NULL, + PII_CONTROLLER VARCHAR(2048) NOT NULL, + PRIMARY KEY (CONSENT_RECEIPT_ID) +)ENGINE INNODB; + +CREATE TABLE CM_PURPOSE ( + ID INTEGER AUTO_INCREMENT, + NAME VARCHAR(255) NOT NULL, + DESCRIPTION VARCHAR(1023), + TENANT_ID INTEGER DEFAULT '-1234', + UNIQUE KEY (NAME, TENANT_ID), + PRIMARY KEY (ID) +)ENGINE INNODB; + +CREATE TABLE CM_PURPOSE_CATEGORY ( + ID INTEGER AUTO_INCREMENT, + NAME VARCHAR(255) NOT NULL, + DESCRIPTION VARCHAR(1023), + TENANT_ID INTEGER DEFAULT '-1234', + UNIQUE KEY (NAME, TENANT_ID), + PRIMARY KEY (ID) +)ENGINE INNODB; + +CREATE TABLE CM_RECEIPT_SP_ASSOC ( + ID INTEGER AUTO_INCREMENT, + CONSENT_RECEIPT_ID VARCHAR(255) NOT NULL, + SP_NAME VARCHAR(255) NOT NULL, + SP_DISPLAY_NAME VARCHAR(255), + SP_DESCRIPTION VARCHAR(255), + SP_TENANT_ID INTEGER DEFAULT '-1234', + UNIQUE KEY (CONSENT_RECEIPT_ID, SP_NAME, SP_TENANT_ID), + PRIMARY KEY (ID) +)ENGINE INNODB; + +CREATE TABLE CM_SP_PURPOSE_ASSOC ( + ID INTEGER AUTO_INCREMENT, + RECEIPT_SP_ASSOC INTEGER NOT NULL, + PURPOSE_ID INTEGER NOT NULL, + CONSENT_TYPE VARCHAR(255) NOT NULL, + IS_PRIMARY_PURPOSE INTEGER NOT NULL, + TERMINATION VARCHAR(255) NOT NULL, + THIRD_PARTY_DISCLOSURE INTEGER NOT NULL, + THIRD_PARTY_NAME VARCHAR(255), + UNIQUE KEY (RECEIPT_SP_ASSOC, PURPOSE_ID), + PRIMARY KEY (ID) +)ENGINE INNODB; + +CREATE TABLE CM_SP_PURPOSE_PURPOSE_CAT_ASSC ( + SP_PURPOSE_ASSOC_ID INTEGER NOT NULL, + PURPOSE_CATEGORY_ID INTEGER NOT NULL, + UNIQUE KEY (SP_PURPOSE_ASSOC_ID, PURPOSE_CATEGORY_ID) +)ENGINE INNODB; + +CREATE TABLE CM_PURPOSE_PII_CAT_ASSOC ( + PURPOSE_ID INTEGER NOT NULL, + CM_PII_CATEGORY_ID INTEGER NOT NULL, + UNIQUE KEY (PURPOSE_ID, CM_PII_CATEGORY_ID) +)ENGINE INNODB; + +CREATE TABLE CM_SP_PURPOSE_PII_CAT_ASSOC ( + SP_PURPOSE_ASSOC_ID INTEGER NOT NULL, + PII_CATEGORY_ID INTEGER NOT NULL, + VALIDITY VARCHAR(1023), + UNIQUE KEY (SP_PURPOSE_ASSOC_ID, PII_CATEGORY_ID) +)ENGINE INNODB; + +CREATE TABLE CM_CONSENT_RECEIPT_PROPERTY ( + CONSENT_RECEIPT_ID VARCHAR(255) NOT NULL, + NAME VARCHAR(255) NOT NULL, + VALUE VARCHAR(1023) NOT NULL, + UNIQUE KEY (CONSENT_RECEIPT_ID, NAME) +)ENGINE INNODB; + +ALTER TABLE CM_RECEIPT_SP_ASSOC + ADD CONSTRAINT CM_RECEIPT_SP_ASSOC_fk0 FOREIGN KEY (CONSENT_RECEIPT_ID) REFERENCES CM_RECEIPT (CONSENT_RECEIPT_ID); + +ALTER TABLE CM_SP_PURPOSE_ASSOC + ADD CONSTRAINT CM_SP_PURPOSE_ASSOC_fk0 FOREIGN KEY (RECEIPT_SP_ASSOC) REFERENCES CM_RECEIPT_SP_ASSOC (ID); + +ALTER TABLE CM_SP_PURPOSE_ASSOC + ADD CONSTRAINT CM_SP_PURPOSE_ASSOC_fk1 FOREIGN KEY (PURPOSE_ID) REFERENCES CM_PURPOSE (ID); + +ALTER TABLE CM_SP_PURPOSE_PURPOSE_CAT_ASSC + ADD CONSTRAINT CM_SP_P_P_CAT_ASSOC_fk0 FOREIGN KEY (SP_PURPOSE_ASSOC_ID) REFERENCES CM_SP_PURPOSE_ASSOC (ID); + +ALTER TABLE CM_SP_PURPOSE_PURPOSE_CAT_ASSC + ADD CONSTRAINT CM_SP_P_P_CAT_ASSOC_fk1 FOREIGN KEY (PURPOSE_CATEGORY_ID) REFERENCES CM_PURPOSE_CATEGORY (ID); + +ALTER TABLE CM_SP_PURPOSE_PII_CAT_ASSOC + ADD CONSTRAINT CM_SP_P_PII_CAT_ASSOC_fk0 FOREIGN KEY (SP_PURPOSE_ASSOC_ID) REFERENCES CM_SP_PURPOSE_ASSOC (ID); + +ALTER TABLE CM_SP_PURPOSE_PII_CAT_ASSOC + ADD CONSTRAINT CM_SP_P_PII_CAT_ASSOC_fk1 FOREIGN KEY (PII_CATEGORY_ID) REFERENCES CM_PII_CATEGORY (ID); + +ALTER TABLE CM_CONSENT_RECEIPT_PROPERTY + ADD CONSTRAINT CM_CONSENT_RECEIPT_PRT_fk0 FOREIGN KEY (CONSENT_RECEIPT_ID) REFERENCES CM_RECEIPT (CONSENT_RECEIPT_ID); + +INSERT INTO CM_PURPOSE (NAME, DESCRIPTION, TENANT_ID) values ('DEFAULT', 'For core functionalities of the product', '-1234'); + +INSERT INTO CM_PURPOSE_CATEGORY (NAME, DESCRIPTION, TENANT_ID) VALUES ('DEFAULT','For core functionalities of the product', '-1234'); + +-- End of CONSENT-MGT Tables -- + +-- Start of API-MGT Tables -- +CREATE TABLE IF NOT EXISTS AM_SUBSCRIBER ( + SUBSCRIBER_ID INTEGER AUTO_INCREMENT, + USER_ID VARCHAR(255) NOT NULL, + TENANT_ID INTEGER NOT NULL, + EMAIL_ADDRESS VARCHAR(256) NULL, + DATE_SUBSCRIBED TIMESTAMP NOT NULL, + PRIMARY KEY (SUBSCRIBER_ID), + CREATED_BY VARCHAR(100), + CREATED_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + UPDATED_BY VARCHAR(100), + UPDATED_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + UNIQUE (TENANT_ID,USER_ID) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS AM_APPLICATION ( + APPLICATION_ID INTEGER AUTO_INCREMENT, + NAME VARCHAR(100), + SUBSCRIBER_ID INTEGER, + APPLICATION_TIER VARCHAR(50) DEFAULT 'Unlimited', + CALLBACK_URL VARCHAR(512), + DESCRIPTION VARCHAR(512), + APPLICATION_STATUS VARCHAR(50) DEFAULT 'APPROVED', + GROUP_ID VARCHAR(100), + CREATED_BY VARCHAR(100), + CREATED_TIME TIMESTAMP, + UPDATED_BY VARCHAR(100), + UPDATED_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + UUID VARCHAR(256), + FOREIGN KEY(SUBSCRIBER_ID) REFERENCES AM_SUBSCRIBER(SUBSCRIBER_ID) ON UPDATE CASCADE ON DELETE RESTRICT, + PRIMARY KEY(APPLICATION_ID), + UNIQUE (NAME,SUBSCRIBER_ID), + UNIQUE (UUID) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS AM_API ( + API_ID INTEGER AUTO_INCREMENT, + API_PROVIDER VARCHAR(200), + API_NAME VARCHAR(200), + API_VERSION VARCHAR(30), + CONTEXT VARCHAR(256), + CONTEXT_TEMPLATE VARCHAR(256), + API_TIER VARCHAR(256), + CREATED_BY VARCHAR(100), + CREATED_TIME TIMESTAMP, + UPDATED_BY VARCHAR(100), + UPDATED_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY(API_ID), + UNIQUE (API_PROVIDER,API_NAME,API_VERSION) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS AM_API_URL_MAPPING ( + URL_MAPPING_ID INTEGER AUTO_INCREMENT, + API_ID INTEGER NOT NULL, + HTTP_METHOD VARCHAR(20) NULL, + AUTH_SCHEME VARCHAR(50) NULL, + URL_PATTERN VARCHAR(512) NULL, + THROTTLING_TIER varchar(512) DEFAULT NULL, + MEDIATION_SCRIPT BLOB, + PRIMARY KEY (URL_MAPPING_ID) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS AM_SUBSCRIPTION ( + SUBSCRIPTION_ID INTEGER AUTO_INCREMENT, + TIER_ID VARCHAR(50), + API_ID INTEGER, + LAST_ACCESSED TIMESTAMP NULL, + APPLICATION_ID INTEGER, + SUB_STATUS VARCHAR(50), + SUBS_CREATE_STATE VARCHAR(50) DEFAULT 'SUBSCRIBE', + CREATED_BY VARCHAR(100), + CREATED_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + UPDATED_BY VARCHAR(100), + UPDATED_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + UUID VARCHAR(256), + FOREIGN KEY(APPLICATION_ID) REFERENCES AM_APPLICATION(APPLICATION_ID) ON UPDATE CASCADE ON DELETE RESTRICT, + FOREIGN KEY(API_ID) REFERENCES AM_API(API_ID) ON UPDATE CASCADE ON DELETE RESTRICT, + PRIMARY KEY (SUBSCRIPTION_ID), + UNIQUE (UUID) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS AM_SUBSCRIPTION_KEY_MAPPING ( + SUBSCRIPTION_ID INTEGER, + ACCESS_TOKEN VARCHAR(512), + KEY_TYPE VARCHAR(512) NOT NULL, + FOREIGN KEY(SUBSCRIPTION_ID) REFERENCES AM_SUBSCRIPTION(SUBSCRIPTION_ID) ON UPDATE CASCADE ON DELETE RESTRICT, + PRIMARY KEY(SUBSCRIPTION_ID,ACCESS_TOKEN) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS AM_APPLICATION_KEY_MAPPING ( + APPLICATION_ID INTEGER, + CONSUMER_KEY VARCHAR(255), + KEY_TYPE VARCHAR(512) NOT NULL, + STATE VARCHAR(30) NOT NULL, + CREATE_MODE VARCHAR(30) DEFAULT 'CREATED', + FOREIGN KEY(APPLICATION_ID) REFERENCES AM_APPLICATION(APPLICATION_ID) ON UPDATE CASCADE ON DELETE RESTRICT, + PRIMARY KEY(APPLICATION_ID,KEY_TYPE) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS AM_API_LC_EVENT ( + EVENT_ID INTEGER AUTO_INCREMENT, + API_ID INTEGER NOT NULL, + PREVIOUS_STATE VARCHAR(50), + NEW_STATE VARCHAR(50) NOT NULL, + USER_ID VARCHAR(255) NOT NULL, + TENANT_ID INTEGER NOT NULL, + EVENT_DATE TIMESTAMP NOT NULL, + FOREIGN KEY(API_ID) REFERENCES AM_API(API_ID) ON UPDATE CASCADE ON DELETE RESTRICT, + PRIMARY KEY (EVENT_ID) +)ENGINE INNODB; + +CREATE TABLE AM_APP_KEY_DOMAIN_MAPPING ( + CONSUMER_KEY VARCHAR(255), + AUTHZ_DOMAIN VARCHAR(255) DEFAULT 'ALL', + PRIMARY KEY (CONSUMER_KEY,AUTHZ_DOMAIN) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS AM_API_COMMENTS ( + COMMENT_ID INTEGER AUTO_INCREMENT, + COMMENT_TEXT VARCHAR(512), + COMMENTED_USER VARCHAR(255), + DATE_COMMENTED TIMESTAMP NOT NULL, + API_ID INTEGER NOT NULL, + FOREIGN KEY(API_ID) REFERENCES AM_API(API_ID) ON UPDATE CASCADE ON DELETE RESTRICT, + PRIMARY KEY (COMMENT_ID) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS AM_API_RATINGS ( + RATING_ID INTEGER AUTO_INCREMENT, + API_ID INTEGER, + RATING INTEGER, + SUBSCRIBER_ID INTEGER, + FOREIGN KEY(API_ID) REFERENCES AM_API(API_ID) ON UPDATE CASCADE ON DELETE RESTRICT, + FOREIGN KEY(SUBSCRIBER_ID) REFERENCES AM_SUBSCRIBER(SUBSCRIBER_ID) ON UPDATE CASCADE ON DELETE RESTRICT, +PRIMARY KEY (RATING_ID) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS AM_TIER_PERMISSIONS ( + TIER_PERMISSIONS_ID INTEGER AUTO_INCREMENT, + TIER VARCHAR(50) NOT NULL, + PERMISSIONS_TYPE VARCHAR(50) NOT NULL, + ROLES VARCHAR(512) NOT NULL, + TENANT_ID INTEGER NOT NULL, + PRIMARY KEY(TIER_PERMISSIONS_ID) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS AM_EXTERNAL_STORES ( + APISTORE_ID INTEGER AUTO_INCREMENT, + API_ID INTEGER, + STORE_ID VARCHAR(255) NOT NULL, + STORE_DISPLAY_NAME VARCHAR(255) NOT NULL, + STORE_ENDPOINT VARCHAR(255) NOT NULL, + STORE_TYPE VARCHAR(255) NOT NULL, +FOREIGN KEY(API_ID) REFERENCES AM_API(API_ID) ON UPDATE CASCADE ON DELETE RESTRICT, +PRIMARY KEY (APISTORE_ID) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS AM_WORKFLOWS( + WF_ID INTEGER AUTO_INCREMENT, + WF_REFERENCE VARCHAR(255) NOT NULL, + WF_TYPE VARCHAR(255) NOT NULL, + WF_STATUS VARCHAR(255) NOT NULL, + WF_CREATED_TIME TIMESTAMP, + WF_UPDATED_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP , + WF_STATUS_DESC VARCHAR(1000), + TENANT_ID INTEGER, + TENANT_DOMAIN VARCHAR(255), + WF_EXTERNAL_REFERENCE VARCHAR(255) NOT NULL, + PRIMARY KEY (WF_ID), + UNIQUE (WF_EXTERNAL_REFERENCE) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS AM_APPLICATION_REGISTRATION ( + REG_ID INT AUTO_INCREMENT, + SUBSCRIBER_ID INT, + WF_REF VARCHAR(255) NOT NULL, + APP_ID INT, + TOKEN_TYPE VARCHAR(30), + TOKEN_SCOPE VARCHAR(1500) DEFAULT 'default', + INPUTS VARCHAR(1000), + ALLOWED_DOMAINS VARCHAR(256), + VALIDITY_PERIOD BIGINT, + UNIQUE (SUBSCRIBER_ID,APP_ID,TOKEN_TYPE), + FOREIGN KEY(SUBSCRIBER_ID) REFERENCES AM_SUBSCRIBER(SUBSCRIBER_ID) ON UPDATE CASCADE ON DELETE RESTRICT, + FOREIGN KEY(APP_ID) REFERENCES AM_APPLICATION(APPLICATION_ID) ON UPDATE CASCADE ON DELETE RESTRICT, + PRIMARY KEY (REG_ID) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS AM_API_SCOPES ( + API_ID INTEGER NOT NULL, + SCOPE_ID INTEGER NOT NULL, + FOREIGN KEY (API_ID) REFERENCES AM_API (API_ID) ON DELETE CASCADE ON UPDATE CASCADE, + FOREIGN KEY (SCOPE_ID) REFERENCES IDN_OAUTH2_SCOPE (SCOPE_ID) ON DELETE CASCADE ON UPDATE CASCADE +)ENGINE = INNODB; + +CREATE TABLE IF NOT EXISTS AM_API_DEFAULT_VERSION ( + DEFAULT_VERSION_ID INT AUTO_INCREMENT, + API_NAME VARCHAR(256) NOT NULL , + API_PROVIDER VARCHAR(256) NOT NULL , + DEFAULT_API_VERSION VARCHAR(30) , + PUBLISHED_DEFAULT_API_VERSION VARCHAR(30) , + PRIMARY KEY (DEFAULT_VERSION_ID) +)ENGINE = INNODB; + +CREATE INDEX IDX_SUB_APP_ID ON AM_SUBSCRIPTION (APPLICATION_ID, SUBSCRIPTION_ID); + + +CREATE TABLE IF NOT EXISTS AM_ALERT_TYPES ( + ALERT_TYPE_ID INTEGER AUTO_INCREMENT, + ALERT_TYPE_NAME VARCHAR(255) NOT NULL , + STAKE_HOLDER VARCHAR(100) NOT NULL, + PRIMARY KEY (ALERT_TYPE_ID) +)ENGINE = INNODB; + +CREATE TABLE IF NOT EXISTS AM_ALERT_TYPES_VALUES ( + ALERT_TYPE_ID INTEGER, + USER_NAME VARCHAR(255) NOT NULL , + STAKE_HOLDER VARCHAR(100) NOT NULL , + PRIMARY KEY (ALERT_TYPE_ID,USER_NAME,STAKE_HOLDER) +)ENGINE = INNODB; + +CREATE TABLE IF NOT EXISTS AM_ALERT_EMAILLIST ( + EMAIL_LIST_ID INTEGER AUTO_INCREMENT, + USER_NAME VARCHAR(255) NOT NULL , + STAKE_HOLDER VARCHAR(100) NOT NULL , + PRIMARY KEY (EMAIL_LIST_ID,USER_NAME,STAKE_HOLDER) +)ENGINE = INNODB; + +CREATE TABLE IF NOT EXISTS AM_ALERT_EMAILLIST_DETAILS ( + EMAIL_LIST_ID INTEGER, + EMAIL VARCHAR(255), + PRIMARY KEY (EMAIL_LIST_ID,EMAIL) +)ENGINE = INNODB; + +INSERT INTO AM_ALERT_TYPES (ALERT_TYPE_NAME, STAKE_HOLDER) VALUES ('abnormalResponseTime', 'publisher'); +INSERT INTO AM_ALERT_TYPES (ALERT_TYPE_NAME, STAKE_HOLDER) VALUES ('abnormalBackendTime', 'publisher'); +INSERT INTO AM_ALERT_TYPES (ALERT_TYPE_NAME, STAKE_HOLDER) VALUES ('abnormalRequestsPerMin', 'subscriber'); +INSERT INTO AM_ALERT_TYPES (ALERT_TYPE_NAME, STAKE_HOLDER) VALUES ('RequestPatternChanged', 'subscriber'); +INSERT INTO AM_ALERT_TYPES (ALERT_TYPE_NAME, STAKE_HOLDER) VALUES ('UnusualIPAccessAlert', 'subscriber'); +INSERT INTO AM_ALERT_TYPES (ALERT_TYPE_NAME, STAKE_HOLDER) VALUES ('AbnormalRefreshAlert', 'subscriber'); +INSERT INTO AM_ALERT_TYPES (ALERT_TYPE_NAME, STAKE_HOLDER) VALUES ('FrequentTierHittingAlert', 'subscriber'); +INSERT INTO AM_ALERT_TYPES (ALERT_TYPE_NAME, STAKE_HOLDER) VALUES ('AbnormalTierUsage', 'publisher'); +INSERT INTO AM_ALERT_TYPES (ALERT_TYPE_NAME, STAKE_HOLDER) VALUES ('healthAvailabilityPerMin', 'publisher'); + + + +-- AM Throttling tables -- + +CREATE TABLE IF NOT EXISTS AM_POLICY_SUBSCRIPTION ( + POLICY_ID INT(11) NOT NULL AUTO_INCREMENT, + NAME VARCHAR(512) NOT NULL, + DISPLAY_NAME VARCHAR(512) NULL DEFAULT NULL, + TENANT_ID INT(11) NOT NULL, + DESCRIPTION VARCHAR(1024) NULL DEFAULT NULL, + QUOTA_TYPE VARCHAR(25) NOT NULL, + QUOTA INT(11) NOT NULL, + QUOTA_UNIT VARCHAR(10) NULL, + UNIT_TIME INT(11) NOT NULL, + TIME_UNIT VARCHAR(25) NOT NULL, + RATE_LIMIT_COUNT INT(11) NULL DEFAULT NULL, + RATE_LIMIT_TIME_UNIT VARCHAR(25) NULL DEFAULT NULL, + IS_DEPLOYED TINYINT(1) NOT NULL DEFAULT 0, + CUSTOM_ATTRIBUTES BLOB DEFAULT NULL, + STOP_ON_QUOTA_REACH BOOLEAN NOT NULL DEFAULT 0, + BILLING_PLAN VARCHAR(20) NOT NULL, + UUID VARCHAR(256), + PRIMARY KEY (POLICY_ID), + UNIQUE INDEX AM_POLICY_SUBSCRIPTION_NAME_TENANT (NAME, TENANT_ID), + UNIQUE (UUID) +)ENGINE = InnoDB; + +CREATE TABLE IF NOT EXISTS AM_POLICY_APPLICATION ( + POLICY_ID INT(11) NOT NULL AUTO_INCREMENT, + NAME VARCHAR(512) NOT NULL, + DISPLAY_NAME VARCHAR(512) NULL DEFAULT NULL, + TENANT_ID INT(11) NOT NULL, + DESCRIPTION VARCHAR(1024) NULL DEFAULT NULL, + QUOTA_TYPE VARCHAR(25) NOT NULL, + QUOTA INT(11) NOT NULL, + QUOTA_UNIT VARCHAR(10) NULL DEFAULT NULL, + UNIT_TIME INT(11) NOT NULL, + TIME_UNIT VARCHAR(25) NOT NULL, + IS_DEPLOYED TINYINT(1) NOT NULL DEFAULT 0, + CUSTOM_ATTRIBUTES BLOB DEFAULT NULL, + UUID VARCHAR(256), + PRIMARY KEY (POLICY_ID), + UNIQUE INDEX APP_NAME_TENANT (NAME, TENANT_ID), + UNIQUE (UUID) +)ENGINE = InnoDB; + +CREATE TABLE IF NOT EXISTS AM_POLICY_HARD_THROTTLING ( + POLICY_ID INT(11) NOT NULL AUTO_INCREMENT, + NAME VARCHAR(512) NOT NULL, + TENANT_ID INT(11) NOT NULL, + DESCRIPTION VARCHAR(1024) NULL DEFAULT NULL, + QUOTA_TYPE VARCHAR(25) NOT NULL, + QUOTA INT(11) NOT NULL, + QUOTA_UNIT VARCHAR(10) NULL DEFAULT NULL, + UNIT_TIME INT(11) NOT NULL, + TIME_UNIT VARCHAR(25) NOT NULL, + IS_DEPLOYED TINYINT(1) NOT NULL DEFAULT 0, + PRIMARY KEY (POLICY_ID), + UNIQUE INDEX POLICY_HARD_NAME_TENANT (NAME, TENANT_ID) +)ENGINE = InnoDB; + + +CREATE TABLE IF NOT EXISTS AM_API_THROTTLE_POLICY ( + POLICY_ID INT(11) NOT NULL AUTO_INCREMENT, + NAME VARCHAR(512) NOT NULL, + DISPLAY_NAME VARCHAR(512) NULL DEFAULT NULL, + TENANT_ID INT(11) NOT NULL, + DESCRIPTION VARCHAR (1024), + DEFAULT_QUOTA_TYPE VARCHAR(25) NOT NULL, + DEFAULT_QUOTA INTEGER NOT NULL, + DEFAULT_QUOTA_UNIT VARCHAR(10) NULL, + DEFAULT_UNIT_TIME INTEGER NOT NULL, + DEFAULT_TIME_UNIT VARCHAR(25) NOT NULL, + APPLICABLE_LEVEL VARCHAR(25) NOT NULL, + IS_DEPLOYED TINYINT(1) NOT NULL DEFAULT 0, + UUID VARCHAR(256), + PRIMARY KEY (POLICY_ID), + UNIQUE INDEX API_NAME_TENANT (NAME, TENANT_ID), + UNIQUE (UUID) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS AM_CONDITION_GROUP ( + CONDITION_GROUP_ID INTEGER NOT NULL AUTO_INCREMENT, + POLICY_ID INTEGER NOT NULL, + QUOTA_TYPE VARCHAR(25), + QUOTA INTEGER NOT NULL, + QUOTA_UNIT VARCHAR(10) NULL DEFAULT NULL, + UNIT_TIME INTEGER NOT NULL, + TIME_UNIT VARCHAR(25) NOT NULL, + DESCRIPTION VARCHAR (1024) NULL DEFAULT NULL, + PRIMARY KEY (CONDITION_GROUP_ID), + FOREIGN KEY (POLICY_ID) REFERENCES AM_API_THROTTLE_POLICY(POLICY_ID) ON DELETE CASCADE ON UPDATE CASCADE +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS AM_QUERY_PARAMETER_CONDITION ( + QUERY_PARAMETER_ID INTEGER NOT NULL AUTO_INCREMENT, + CONDITION_GROUP_ID INTEGER NOT NULL, + PARAMETER_NAME VARCHAR(255) DEFAULT NULL, + PARAMETER_VALUE VARCHAR(255) DEFAULT NULL, + IS_PARAM_MAPPING BOOLEAN DEFAULT 1, + PRIMARY KEY (QUERY_PARAMETER_ID), + FOREIGN KEY (CONDITION_GROUP_ID) REFERENCES AM_CONDITION_GROUP(CONDITION_GROUP_ID) ON DELETE CASCADE ON UPDATE CASCADE +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS AM_HEADER_FIELD_CONDITION ( + HEADER_FIELD_ID INTEGER NOT NULL AUTO_INCREMENT, + CONDITION_GROUP_ID INTEGER NOT NULL, + HEADER_FIELD_NAME VARCHAR(255) DEFAULT NULL, + HEADER_FIELD_VALUE VARCHAR(255) DEFAULT NULL, + IS_HEADER_FIELD_MAPPING BOOLEAN DEFAULT 1, + PRIMARY KEY (HEADER_FIELD_ID), + FOREIGN KEY (CONDITION_GROUP_ID) REFERENCES AM_CONDITION_GROUP(CONDITION_GROUP_ID) ON DELETE CASCADE ON UPDATE CASCADE +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS AM_JWT_CLAIM_CONDITION ( + JWT_CLAIM_ID INTEGER NOT NULL AUTO_INCREMENT, + CONDITION_GROUP_ID INTEGER NOT NULL, + CLAIM_URI VARCHAR(512) DEFAULT NULL, + CLAIM_ATTRIB VARCHAR(1024) DEFAULT NULL, + IS_CLAIM_MAPPING BOOLEAN DEFAULT 1, + PRIMARY KEY (JWT_CLAIM_ID), + FOREIGN KEY (CONDITION_GROUP_ID) REFERENCES AM_CONDITION_GROUP(CONDITION_GROUP_ID) ON DELETE CASCADE ON UPDATE CASCADE +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS AM_IP_CONDITION ( + AM_IP_CONDITION_ID INT NOT NULL AUTO_INCREMENT, + STARTING_IP VARCHAR(45) NULL, + ENDING_IP VARCHAR(45) NULL, + SPECIFIC_IP VARCHAR(45) NULL, + WITHIN_IP_RANGE BOOLEAN DEFAULT 1, + CONDITION_GROUP_ID INT NULL, + PRIMARY KEY (AM_IP_CONDITION_ID), + INDEX fk_AM_IP_CONDITION_1_idx (CONDITION_GROUP_ID ASC), CONSTRAINT fk_AM_IP_CONDITION_1 FOREIGN KEY (CONDITION_GROUP_ID) + REFERENCES AM_CONDITION_GROUP (CONDITION_GROUP_ID) ON DELETE CASCADE ON UPDATE CASCADE) +ENGINE = InnoDB; + + +CREATE TABLE IF NOT EXISTS AM_POLICY_GLOBAL ( + POLICY_ID INT(11) NOT NULL AUTO_INCREMENT, + NAME VARCHAR(512) NOT NULL, + KEY_TEMPLATE VARCHAR(512) NOT NULL, + TENANT_ID INT(11) NOT NULL, + DESCRIPTION VARCHAR(1024) NULL DEFAULT NULL, + SIDDHI_QUERY BLOB DEFAULT NULL, + IS_DEPLOYED TINYINT(1) NOT NULL DEFAULT 0, + UUID VARCHAR(256), + PRIMARY KEY (POLICY_ID), + UNIQUE (UUID) +)ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS AM_THROTTLE_TIER_PERMISSIONS ( + THROTTLE_TIER_PERMISSIONS_ID INT NOT NULL AUTO_INCREMENT, + TIER VARCHAR(50) NULL, + PERMISSIONS_TYPE VARCHAR(50) NULL, + ROLES VARCHAR(512) NULL, + TENANT_ID INT(11) NULL, + PRIMARY KEY (THROTTLE_TIER_PERMISSIONS_ID)) +ENGINE = InnoDB; + +CREATE TABLE `AM_BLOCK_CONDITIONS` ( + `CONDITION_ID` int(11) NOT NULL AUTO_INCREMENT, + `TYPE` varchar(45) DEFAULT NULL, + `VALUE` varchar(512) DEFAULT NULL, + `ENABLED` varchar(45) DEFAULT NULL, + `DOMAIN` varchar(45) DEFAULT NULL, + `UUID` VARCHAR(256), + PRIMARY KEY (`CONDITION_ID`), + UNIQUE (`UUID`) +) ENGINE=InnoDB; + +CREATE TABLE IF NOT EXISTS `AM_CERTIFICATE_METADATA` ( + `TENANT_ID` INT(11) NOT NULL, + `ALIAS` VARCHAR(45) NOT NULL, + `END_POINT` VARCHAR(100) NOT NULL, + CONSTRAINT PK_ALIAS PRIMARY KEY (`ALIAS`), + CONSTRAINT END_POINT_CONSTRAINT UNIQUE (`END_POINT`) +) ENGINE=InnoDB; + +CREATE TABLE IF NOT EXISTS AM_APPLICATION_GROUP_MAPPING ( + APPLICATION_ID INTEGER NOT NULL, + GROUP_ID VARCHAR(512) NOT NULL, + TENANT VARCHAR(255), + PRIMARY KEY (APPLICATION_ID,GROUP_ID,TENANT), + FOREIGN KEY (APPLICATION_ID) REFERENCES AM_APPLICATION(APPLICATION_ID) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB; + +CREATE TABLE IF NOT EXISTS AM_USAGE_UPLOADED_FILES ( + TENANT_DOMAIN varchar(255) NOT NULL, + FILE_NAME varchar(255) NOT NULL, + FILE_TIMESTAMP TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + FILE_PROCESSED tinyint(1) DEFAULT FALSE, + FILE_CONTENT MEDIUMBLOB DEFAULT NULL, + PRIMARY KEY (TENANT_DOMAIN, FILE_NAME, FILE_TIMESTAMP) +) ENGINE=InnoDB; + +CREATE TABLE IF NOT EXISTS AM_API_LC_PUBLISH_EVENTS ( + ID INTEGER(11) NOT NULL AUTO_INCREMENT, + TENANT_DOMAIN VARCHAR(500) NOT NULL, + API_ID VARCHAR(500) NOT NULL, + EVENT_TIME TIMESTAMP NOT NULL, + PRIMARY KEY (ID) +) ENGINE=InnoDB; +-- End of API-MGT Tables -- + +-- Performance indexes start-- + +create index IDX_ITS_LMT on IDN_THRIFT_SESSION (LAST_MODIFIED_TIME); +create index IDX_IOAT_UT on IDN_OAUTH2_ACCESS_TOKEN (USER_TYPE); +create index IDX_AAI_CTX on AM_API (CONTEXT); +create index IDX_AAKM_CK on AM_APPLICATION_KEY_MAPPING (CONSUMER_KEY); +create index IDX_AAUM_AI on AM_API_URL_MAPPING (API_ID); +create index IDX_AAUM_TT on AM_API_URL_MAPPING (THROTTLING_TIER); +create index IDX_AATP_DQT on AM_API_THROTTLE_POLICY (DEFAULT_QUOTA_TYPE); +create index IDX_ACG_QT on AM_CONDITION_GROUP (QUOTA_TYPE); +create index IDX_APS_QT on AM_POLICY_SUBSCRIPTION (QUOTA_TYPE); +create index IDX_AS_AITIAI on AM_SUBSCRIPTION (API_ID,TIER_ID,APPLICATION_ID); +create index IDX_APA_QT on AM_POLICY_APPLICATION (QUOTA_TYPE); +create index IDX_AA_AT_CB on AM_APPLICATION (APPLICATION_TIER,CREATED_BY); + +-- Performance indexes end-- diff --git a/pattern-2/artifacts/rdbms/rdbms-deployment.yaml b/pattern-2/extras/rdbms/mysql/mysql-deployment.yaml similarity index 59% rename from pattern-2/artifacts/rdbms/rdbms-deployment.yaml rename to pattern-2/extras/rdbms/mysql/mysql-deployment.yaml index 97f7aa84..1c050283 100644 --- a/pattern-2/artifacts/rdbms/rdbms-deployment.yaml +++ b/pattern-2/extras/rdbms/mysql/mysql-deployment.yaml @@ -12,39 +12,44 @@ # See the License for the specific language governing permissions and # limitations under the License. -apiVersion: extensions/v1beta1 +apiVersion: apps/v1beta1 kind: Deployment metadata: - name: apim-rdbms-deployment - labels: - app: apim-rdbms - pattern: wso2apim-pattern-2 + name: wso2apim-pattern-2-mysql-deployment spec: - strategy: - type: Recreate + replicas: 1 template: metadata: labels: - app: apim-rdbms - tier: apim-rdbms + deployment: wso2apim-pattern-2-mysql spec: containers: - - image: docker.wso2.com/apim-rdbms-kubernetes:2.1.0 - name: apim-rdbms + - name: wso2apim-pattern-2-mysql + image: mysql:5.7 imagePullPolicy: IfNotPresent + securityContext: + runAsUser: 999 env: - - - name: MYSQL_ROOT_PASSWORD - value: root + - name: MYSQL_ROOT_PASSWORD + value: root + - name: MYSQL_USER + value: wso2carbon + - name: MYSQL_PASSWORD + value: wso2carbon ports: - containerPort: 3306 - name: apim-rdbms + protocol: TCP volumeMounts: + - name: mysql-dbscripts + mountPath: /docker-entrypoint-initdb.d - name: apim-rdbms-persistent-storage mountPath: /var/lib/mysql args: ["--max-connections", "10000"] volumes: + - name: mysql-dbscripts + configMap: + name: mysql-dbscripts - name: apim-rdbms-persistent-storage persistentVolumeClaim: - claimName: apim-rdbms-volume-claim - serviceAccountName: "wso2svcacct" \ No newline at end of file + claimName: wso2apim-pattern-2-rdbms-volume-claim + serviceAccountName: "wso2svc-account" diff --git a/pattern-1/artifacts/rdbms/rdbms-persistent-volume-claim.yaml b/pattern-2/extras/rdbms/mysql/mysql-persistent-volume-claim.yaml similarity index 85% rename from pattern-1/artifacts/rdbms/rdbms-persistent-volume-claim.yaml rename to pattern-2/extras/rdbms/mysql/mysql-persistent-volume-claim.yaml index 21e2b996..13b08d4b 100644 --- a/pattern-1/artifacts/rdbms/rdbms-persistent-volume-claim.yaml +++ b/pattern-2/extras/rdbms/mysql/mysql-persistent-volume-claim.yaml @@ -15,13 +15,14 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: apim-rdbms-volume-claim - labels: - app: apim-rdbms - pattern: wso2apim-pattern-1 + name: wso2apim-pattern-2-rdbms-volume-claim spec: accessModes: - ReadWriteOnce resources: requests: storage: 20Gi + storageClassName: "" + selector: + matchLabels: + purpose: apim-rdbms-data diff --git a/pattern-2/artifacts/rdbms/rdbms-service.yaml b/pattern-2/extras/rdbms/mysql/mysql-service.yaml similarity index 79% rename from pattern-2/artifacts/rdbms/rdbms-service.yaml rename to pattern-2/extras/rdbms/mysql/mysql-service.yaml index 2b3e93e7..bf622270 100644 --- a/pattern-2/artifacts/rdbms/rdbms-service.yaml +++ b/pattern-2/extras/rdbms/mysql/mysql-service.yaml @@ -15,14 +15,13 @@ apiVersion: v1 kind: Service metadata: - name: apim-rdbms - labels: - app: apim-rdbms - pattern: wso2apim-pattern-2 + name: wso2apim-pattern-2-rdbms-service spec: - ports: - - port: 3306 + type: ClusterIP selector: - app: apim-rdbms - tier: apim-rdbms - clusterIP: None + deployment: wso2apim-pattern-2-mysql + ports: + - name: mysql-port + port: 3306 + targetPort: 3306 + protocol: TCP diff --git a/pattern-1/artifacts/apim/wso2apim-mgt-volume-claim.yaml b/pattern-2/extras/rdbms/volumes/persistent-volumes.yaml similarity index 68% rename from pattern-1/artifacts/apim/wso2apim-mgt-volume-claim.yaml rename to pattern-2/extras/rdbms/volumes/persistent-volumes.yaml index aaf4c892..d45cf1ad 100644 --- a/pattern-1/artifacts/apim/wso2apim-mgt-volume-claim.yaml +++ b/pattern-2/extras/rdbms/volumes/persistent-volumes.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +# Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,15 +13,17 @@ # limitations under the License. apiVersion: v1 -kind: PersistentVolumeClaim +kind: PersistentVolume metadata: - name: apim-mgt-volume-claim + name: wso2apim-pattern-2-rdbms-pv labels: - app: apim-gateway - pattern: wso2apim-pattern-1 + purpose: apim-rdbms-data spec: + capacity: + storage: 20Gi accessModes: - ReadWriteOnce - resources: - requests: - storage: 1Gi + persistentVolumeReclaimPolicy: Retain + nfs: + server: + path: "" diff --git a/pattern-1/artifacts/ingresses/wso2apim-analytics-ingress.yaml b/pattern-2/ingresses/wso2apim-analytics-ingress.yaml similarity index 77% rename from pattern-1/artifacts/ingresses/wso2apim-analytics-ingress.yaml rename to pattern-2/ingresses/wso2apim-analytics-ingress.yaml index d663f168..17bc21d1 100644 --- a/pattern-1/artifacts/ingresses/wso2apim-analytics-ingress.yaml +++ b/pattern-2/ingresses/wso2apim-analytics-ingress.yaml @@ -16,11 +16,12 @@ apiVersion: extensions/v1beta1 kind: Ingress metadata: name: wso2apim-analytics-ingress - labels: - pattern: wso2apim-pattern-1 annotations: kubernetes.io/ingress.class: "nginx" - ingress.kubernetes.io/ssl-passthrough: "true" + nginx.ingress.kubernetes.io/ssl-passthrough: "true" + nginx.ingress.kubernetes.io/affinity: "cookie" + nginx.ingress.kubernetes.io/session-cookie-name: "route" + nginx.ingress.kubernetes.io/session-cookie-hash: "sha1" spec: tls: - hosts: @@ -31,9 +32,5 @@ spec: paths: - path: / backend: - serviceName: wso2apim-analytics + serviceName: wso2apim-analytics-service servicePort: 9444 - - path: / - backend: - serviceName: wso2apim-analytics - servicePort: 9763 \ No newline at end of file diff --git a/pattern-2/ingresses/wso2apim-gateway-ingress.yaml b/pattern-2/ingresses/wso2apim-gateway-ingress.yaml new file mode 100644 index 00000000..bc14b6e5 --- /dev/null +++ b/pattern-2/ingresses/wso2apim-gateway-ingress.yaml @@ -0,0 +1,36 @@ +# Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +# +# Licensed 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. + +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: wso2apim-gateway-ingress + annotations: + kubernetes.io/ingress.class: "nginx" + nginx.ingress.kubernetes.io/ssl-passthrough: "true" + nginx.ingress.kubernetes.io/affinity: "cookie" + nginx.ingress.kubernetes.io/session-cookie-name: "route" + nginx.ingress.kubernetes.io/session-cookie-hash: "sha1" +spec: + tls: + - hosts: + - wso2apim-gateway + rules: + - host: wso2apim-gateway + http: + paths: + - path: / + backend: + serviceName: wso2apim-gateway-service + servicePort: 8243 diff --git a/pattern-1/artifacts/ingresses/wso2apim-ingress.yaml b/pattern-2/ingresses/wso2apim-ingress.yaml similarity index 60% rename from pattern-1/artifacts/ingresses/wso2apim-ingress.yaml rename to pattern-2/ingresses/wso2apim-ingress.yaml index c6303db6..2843a82f 100644 --- a/pattern-1/artifacts/ingresses/wso2apim-ingress.yaml +++ b/pattern-2/ingresses/wso2apim-ingress.yaml @@ -16,38 +16,21 @@ apiVersion: extensions/v1beta1 kind: Ingress metadata: name: wso2apim-ingress - labels: - pattern: wso2apim-pattern-1 annotations: - kubernetes.io/ingress.class : "nginx" - nginx.ingress.kubernetes.io/affinity : cookie - nginx.ingress.kubernetes.io/ssl-passthrough : "true" - + kubernetes.io/ingress.class: "nginx" + nginx.ingress.kubernetes.io/ssl-passthrough: "true" + nginx.ingress.kubernetes.io/affinity: "cookie" + nginx.ingress.kubernetes.io/session-cookie-name: "route" + nginx.ingress.kubernetes.io/session-cookie-hash: "sha1" spec: tls: - hosts: - wso2apim - - wso2apim-gw rules: - host: wso2apim http: paths: - path: / backend: - serviceName: wso2apim + serviceName: wso2apim-service servicePort: 9443 - - path: / - backend: - serviceName: wso2apim - servicePort: 9763 - - host: wso2apim-gw - http: - paths: - - path: / - backend: - serviceName: wso2apim - servicePort: 8243 - - path: / - backend: - serviceName: wso2apim - servicePort: 8280 diff --git a/pattern-2/scripts/README.md b/pattern-2/scripts/README.md new file mode 100644 index 00000000..b4fea16f --- /dev/null +++ b/pattern-2/scripts/README.md @@ -0,0 +1,156 @@ +# Kubernetes Test Resources for deployment of WSO2 API Manager with a separate Gateway and a separate Key Manager + +Kubernetes Test Resources for WSO2 API Manager pattern 2 contain artifacts, which can be used to test the core +Kubernetes resources provided for a deployment of WSO2 API Manager with a separate Gateway and a separate Key Manager +along with WSO2 API Manager Analytics support. + +## Prerequisites + +* In order to use WSO2 Kubernetes resources, you need an active WSO2 subscription. If you do not possess an active WSO2 +subscription already, you can sign up for a WSO2 Free Trial Subscription from [here](https://wso2.com/free-trial-subscription).

+ +* Install [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) and [Kubernetes client](https://kubernetes.io/docs/tasks/tools/install-kubectl/) +in order to run the steps provided in the following quick start guide.

+ +* An already setup [Kubernetes cluster](https://kubernetes.io/docs/setup/pick-right-solution/)

+ +* A pre-configured Network File System (NFS) to be used as the persistent volume for artifact sharing and persistence. +In the NFS server instance, create a Linux system user account named `wso2carbon` with user id `802` and a system group named `wso2` with group id `802`. +Add the `wso2carbon` user to the group `wso2`. + +``` +groupadd --system -g 802 wso2 +useradd --system -g 802 -u 802 wso2carbon +``` + +## Quick Start Guide + +>In the context of this document, `KUBERNETES_HOME` will refer to a local copy of the [`wso2/kubernetes-apim`](https://github.com/wso2/kubernetes-apim/) +Git repository.
+ +##### 1. Clone the Kubernetes Resources for WSO2 API Manager Git repository. + +``` +git clone https://github.com/wso2/kubernetes-apim.git +``` + +##### 2. Deploy Kubernetes Ingress resource. + +The WSO2 API Manager Kubernetes Ingress resource uses the NGINX Ingress Controller. + +In order to enable the NGINX Ingress controller in the desired cloud or on-premise environment, +please refer the official documentation, [NGINX Ingress Controller Installation Guide](https://kubernetes.github.io/ingress-nginx/deploy/). + +##### 3. Setup a Network File System (NFS) to be used for persistent storage. + +Create and export unique directories within the NFS server instance for each Kubernetes Persistent Volume resource defined in the +`/pattern-2/volumes/persistent-volumes.yaml` file. + +Grant ownership to `wso2carbon` user and `wso2` group, for each of the previously created directories. + +``` +sudo chown -R wso2carbon:wso2 +``` + +Grant read-write-execute permissions to the `wso2carbon` user, for each of the previously created directories. + +``` +chmod -R 700 +``` + +Update each Kubernetes Persistent Volume resource with the corresponding NFS server IP (`NFS_SERVER_IP`) and exported, NFS server directory path (`NFS_LOCATION_PATH`). + +##### 4. Setup product database(s). + +For **evaluation purposes**, + +* You can use Kubernetes resources provided in the directory `/pattern-2/extras/rdbms/mysql` +for deploying the product databases, using MySQL in Kubernetes. However, this approach of product database deployment is +**not recommended** for a production setup. + +* For using these Kubernetes resources, + + Here, a Network File System (NFS) is needed to be used for persisting MySQL DB data. + + Create and export a directory within the NFS server instance. + + Provide read-write-execute permissions to other users for the created folder. + + Update the Kubernetes Persistent Volume resource with the corresponding NFS server IP (`NFS_SERVER_IP`) and exported, + NFS server directory path (`NFS_LOCATION_PATH`) in `/pattern-2/extras/rdbms/volumes/persistent-volumes.yaml`. + +In a **production grade setup**, + +* Setup the external product databases. Please refer to WSO2 API Manager's [official documentation](https://docs.wso2.com/display/AM220/Installing+and+Configuring+the+Databases) + on creating the required databases for the deployment. + + Provide appropriate connection URLs, corresponding to the created external databases and the relevant driver class names for the data sources defined in + the following files: + + * `/pattern-2/confs/apim-analytics/datasources/analytics-datasources.xml` + * `/pattern-2/confs/apim-analytics/datasources/master-datasources.xml` + * `/pattern-2/confs/apim-analytics/datasources/stats-datasources.xml` + * `/pattern-2/confs/apim-gateway/datasources/master-datasources.xml` + * `/pattern-2/confs/apim-km/datasources/master-datasources.xml` + * `/pattern-2/confs/apim-pubstore-tm-1/datasources/master-datasources.xml` + * `/pattern-2/confs/apim-pubstore-tm-2/datasources/master-datasources.xml` + + Please refer WSO2's [official documentation](https://docs.wso2.com/display/ADMIN44x/Configuring+master-datasources.xml) on configuring data sources. + +##### 5. Deploy Kubernetes resources. + +Change directory to `/pattern-2/scripts` and execute the `deploy.sh` shell script on the terminal, with the appropriate configurations as follows: + +``` +./deploy.sh --wso2-username= --wso2-password= --cluster-admin-password= +``` + +* A Kubernetes Secret named `wso2creds` in the cluster to authenticate with the [`WSO2 Docker Registry`](https://docker.wso2.com), to pull the required images. +The following details need to be replaced in the relevant command. + +`WSO2_USERNAME`: Your WSO2 username
+`WSO2_PASSWORD`: Your WSO2 password + +* A Kubernetes role and a role binding necessary for the Kubernetes API requests made from Kubernetes membership scheme. + +`K8S_CLUSTER_ADMIN_PASSWORD`: Kubernetes cluster admin password + +>To un-deploy, be on the same directory and execute the `undeploy.sh` shell script on the terminal. + +##### 6. Access Management Consoles. + +Default deployment will expose `wso2apim`, `wso2apim-gateway` and `wso2apim-analytics` hosts. + +To access the console in the environment, + +1. Obtain the external IP (`EXTERNAL-IP`) of the Ingress resources by listing down the Kubernetes Ingresses (using `kubectl get ing`). + +e.g. + +``` +NAME HOSTS ADDRESS PORTS AGE +wso2apim-ingress wso2apim 80, 443 7m +wso2apim-analytics-ingress wso2apim-analytics 80, 443 7m +wso2apim-gateway-ingress wso2apim-gateway 80, 443 6m +``` + +2. Add the above host as an entry in /etc/hosts file as follows: + +``` + wso2apim-analytics + wso2apim + wso2apim-gateway +``` + +3. Try navigating to `https://wso2apim/carbon` and `https://wso2apim-analytics/carbon` from your favorite browser. + +##### 7. Scale up using `kubectl scale`. + +Default deployment runs a single replica (or pod) of WSO2 API Manager Gateway. To scale this deployment into any `` number of +container replicas, upon your requirement, simply run following Kubernetes client command on the terminal. + +``` +kubectl scale --replicas= -f /pattern-2/apim-gw/wso2apim-gateway-deployment.yaml +``` + +For example, If `` is 2, you are here scaling up this deployment from 1 to 2 container replicas. diff --git a/pattern-2/scripts/deploy.sh b/pattern-2/scripts/deploy.sh new file mode 100755 index 00000000..48e887e5 --- /dev/null +++ b/pattern-2/scripts/deploy.sh @@ -0,0 +1,157 @@ +#!/bin/bash + +# ------------------------------------------------------------------------ +# Copyright 2017 WSO2, Inc. (http://wso2.com) +# +# Licensed 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 +# ------------------------------------------------------------------------ + +set -e + +ECHO=`which echo` +KUBECTL=`which kubectl` + +# methods +function echoBold () { + ${ECHO} -e $'\e[1m'"${1}"$'\e[0m' +} + +function usage () { + echoBold "This script automates the installation of WSO2 EI Integrator Analytics Kubernetes resources\n" + echoBold "Allowed arguments:\n" + echoBold "-h | --help" + echoBold "--wu | --wso2-username\t\tYour WSO2 username" + echoBold "--wp | --wso2-password\t\tYour WSO2 password" + echoBold "--cap | --cluster-admin-password\tKubernetes cluster admin password\n\n" +} + +WSO2_SUBSCRIPTION_USERNAME='' +WSO2_SUBSCRIPTION_PASSWORD='' +ADMIN_PASSWORD='' + +# capture named arguments +while [ "$1" != "" ]; do + PARAM=`echo $1 | awk -F= '{print $1}'` + VALUE=`echo $1 | awk -F= '{print $2}'` + + case ${PARAM} in + -h | --help) + usage + exit 1 + ;; + --wu | --wso2-username) + WSO2_SUBSCRIPTION_USERNAME=${VALUE} + ;; + --wp | --wso2-password) + WSO2_SUBSCRIPTION_PASSWORD=${VALUE} + ;; + --cap | --cluster-admin-password) + ADMIN_PASSWORD=${VALUE} + ;; + *) + echoBold "ERROR: unknown parameter \"${PARAM}\"" + usage + exit 1 + ;; + esac + shift +done + +# create a new Kubernetes Namespace +${KUBECTL} create namespace wso2 + +# create a new service account in 'wso2' Kubernetes Namespace +${KUBECTL} create serviceaccount wso2svc-account -n wso2 + +# switch the context to new 'wso2' namespace +${KUBECTL} config set-context $(${KUBECTL} config current-context) --namespace=wso2 + +# create a Kubernetes Secret for passing WSO2 Private Docker Registry credentials +${KUBECTL} create secret docker-registry wso2creds --docker-server=docker.wso2.com --docker-username=${WSO2_SUBSCRIPTION_USERNAME} --docker-password=${WSO2_SUBSCRIPTION_PASSWORD} --docker-email=${WSO2_SUBSCRIPTION_USERNAME} + +# create Kubernetes Role and Role Binding necessary for the Kubernetes API requests made from Kubernetes membership scheme +${KUBECTL} create --username=admin --password=${ADMIN_PASSWORD} -f ../../rbac/rbac.yaml + +echoBold 'Creating ConfigMaps...' +# create the APIM Gateway ConfigMaps +${KUBECTL} create configmap apim-gateway-conf --from-file=../confs/apim-gateway/ +${KUBECTL} create configmap apim-gateway-conf-axis2 --from-file=../confs/apim-gateway/axis2/ +${KUBECTL} create configmap apim-gateway-conf-datasources --from-file=../confs/apim-gateway/datasources/ +${KUBECTL} create configmap apim-gateway-conf-identity --from-file=../confs/apim-gateway/identity/ +# create the APIM Analytics ConfigMaps +${KUBECTL} create configmap apim-analytics-conf --from-file=../confs/apim-analytics/ +${KUBECTL} create configmap apim-analytics-conf-datasources --from-file=../confs/apim-analytics/datasources/ +# create the APIM Publisher-Store-Traffic-Manager ConfigMaps +${KUBECTL} create configmap apim-pubstore-tm-1-conf --from-file=../confs/apim-pubstore-tm-1/ +${KUBECTL} create configmap apim-pubstore-tm-1-conf-axis2 --from-file=../confs/apim-pubstore-tm-1/axis2/ +${KUBECTL} create configmap apim-pubstore-tm-1-conf-datasources --from-file=../confs/apim-pubstore-tm-1/datasources/ +${KUBECTL} create configmap apim-pubstore-tm-1-conf-identity --from-file=../confs/apim-pubstore-tm-1/identity/ +${KUBECTL} create configmap apim-pubstore-tm-2-conf --from-file=../confs/apim-pubstore-tm-2/ +${KUBECTL} create configmap apim-pubstore-tm-2-conf-axis2 --from-file=../confs/apim-pubstore-tm-2/axis2/ +${KUBECTL} create configmap apim-pubstore-tm-2-conf-datasources --from-file=../confs/apim-pubstore-tm-2/datasources/ +${KUBECTL} create configmap apim-pubstore-tm-2-conf-identity --from-file=../confs/apim-pubstore-tm-2/identity/ +# create the APIM KeyManager ConfigMaps +${KUBECTL} create configmap apim-km-conf --from-file=../confs/apim-km/ +${KUBECTL} create configmap apim-km-conf-axis2 --from-file=../confs/apim-km/axis2/ +${KUBECTL} create configmap apim-km-conf-datasources --from-file=../confs/apim-km/datasources/ +${KUBECTL} create configmap apim-km-conf-identity --from-file=../confs/apim-km/identity/ + +${KUBECTL} create configmap mysql-dbscripts --from-file=../extras/confs/rdbms/mysql/dbscripts/ + +${KUBECTL} create -f ../apim-pubstore-tm/wso2apim-pubstore-tm-1-service.yaml +${KUBECTL} create -f ../apim-pubstore-tm/wso2apim-pubstore-tm-2-service.yaml +${KUBECTL} create -f ../apim-pubstore-tm/wso2apim-service.yaml +${KUBECTL} create -f ../apim-km/wso2apim-km-service.yaml +${KUBECTL} create -f ../apim-gw/wso2apim-gateway-service.yaml +${KUBECTL} create -f ../apim-analytics/wso2apim-analytics-service.yaml + +# MySQL +echoBold 'Deploying WSO2 API Manager Databases...' +${KUBECTL} create -f ../extras/rdbms/mysql/mysql-persistent-volume-claim.yaml +${KUBECTL} create -f ../extras/rdbms/volumes/persistent-volumes.yaml +${KUBECTL} create -f ../extras/rdbms/mysql/mysql-deployment.yaml +${KUBECTL} create -f ../extras/rdbms/mysql/mysql-service.yaml +sleep 30s + +echoBold 'Deploying persistent storage resources...' +${KUBECTL} create -f ../volumes/persistent-volumes.yaml + +echoBold 'Deploying WSO2 API Manager Analytics...' +${KUBECTL} create -f ../apim-analytics/wso2apim-analytics-volume-claims.yaml +${KUBECTL} create -f ../apim-analytics/wso2apim-analytics-deployment.yaml +sleep 3m + +echoBold 'Deploying WSO2 API Manager Publisher-Store-Traffic-Manager...' +${KUBECTL} create -f ../apim-pubstore-tm/wso2apim-pubstore-tm-1-deployment.yaml +sleep 1m +${KUBECTL} create -f ../apim-pubstore-tm/wso2apim-pubstore-tm-2-deployment.yaml +sleep 3m + +echoBold 'Deploying WSO2 API Manager Key Manager...' +${KUBECTL} create -f ../apim-km/wso2apim-km-deployment.yaml +sleep 2m + +${KUBECTL} create -f ../apim-gw/wso2apim-gateway-volume-claim.yaml +${KUBECTL} create -f ../apim-gw/wso2apim-gateway-deployment.yaml +sleep 2m + +echoBold 'Deploying Ingresses...' +${KUBECTL} create -f ../ingresses/wso2apim-gateway-ingress.yaml +${KUBECTL} create -f ../ingresses/wso2apim-ingress.yaml +${KUBECTL} create -f ../ingresses/wso2apim-analytics-ingress.yaml + +echoBold 'Finished' +echo 'To access the WSO2 API Manager Management console, try https://wso2apim/carbon in your browser.' +echo 'To access the WSO2 API Manager Publisher, try https://wso2apim/publisher in your browser.' +echo 'To access the WSO2 API Manager Store, try https://wso2apim/store in your browser.' +echo 'To access the WSO2 API Manager Analytics management console, try https://wso2apim-analytics/carbon in your browser.' diff --git a/pattern-2/scripts/undeploy.sh b/pattern-2/scripts/undeploy.sh new file mode 100755 index 00000000..8f023361 --- /dev/null +++ b/pattern-2/scripts/undeploy.sh @@ -0,0 +1,66 @@ +#!/bin/bash + +# ------------------------------------------------------------------------ +# Copyright 2017 WSO2, Inc. (http://wso2.com) +# +# Licensed 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 +# ------------------------------------------------------------------------ + +# methods + +set -e + +ECHO=`which echo` +KUBECTL=`which kubectl` + +# methods +function echoBold () { + ${ECHO} $'\e[1m'"${1}"$'\e[0m' +} + +# persistent storage +echoBold 'Deleting persistent volume and volume claim...' +${KUBECTL} delete -f ../apim-gw/wso2apim-gateway-volume-claim.yaml +${KUBECTL} delete -f ../apim-analytics/wso2apim-analytics-volume-claims.yaml +${KUBECTL} delete -f ../volumes/persistent-volumes.yaml + +# WSO2 Identity Server +echoBold 'Deleting WSO2 API Manager pattern 2 deployment...' +${KUBECTL} delete -f ../apim-pubstore-tm/wso2apim-pubstore-tm-1-service.yaml +${KUBECTL} delete -f ../apim-pubstore-tm/wso2apim-pubstore-tm-2-service.yaml +${KUBECTL} delete -f ../apim-pubstore-tm/wso2apim-service.yaml +${KUBECTL} delete -f ../apim-km/wso2apim-km-service.yaml +${KUBECTL} delete -f ../apim-gw/wso2apim-gateway-service.yaml +${KUBECTL} delete -f ../apim-analytics/wso2apim-analytics-service.yaml + +${KUBECTL} delete -f ../apim-gw/wso2apim-gateway-deployment.yaml +${KUBECTL} delete -f ../apim-analytics/wso2apim-analytics-deployment.yaml +${KUBECTL} delete -f ../apim-pubstore-tm/wso2apim-pubstore-tm-1-deployment.yaml +${KUBECTL} delete -f ../apim-pubstore-tm/wso2apim-pubstore-tm-2-deployment.yaml +sleep 90s + +# MySQL +echoBold 'Deleting the MySQL deployment...' +${KUBECTL} delete -f ../extras/rdbms/mysql/mysql-service.yaml +${KUBECTL} delete -f ../extras/rdbms/mysql/mysql-deployment.yaml +${KUBECTL} delete -f ../extras/rdbms/mysql/mysql-persistent-volume-claim.yaml +${KUBECTL} delete -f ../extras/rdbms/volumes/persistent-volumes.yaml +sleep 50s + +# delete the created Kubernetes Namespace +${KUBECTL} delete namespace wso2 + +# switch the context to default namespace +${KUBECTL} config set-context $(kubectl config current-context) --namespace=default + +echoBold 'Finished' diff --git a/pattern-2/volumes/persistent-volumes.yaml b/pattern-2/volumes/persistent-volumes.yaml new file mode 100644 index 00000000..aef6d48f --- /dev/null +++ b/pattern-2/volumes/persistent-volumes.yaml @@ -0,0 +1,64 @@ +# Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +# +# Licensed 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. + +apiVersion: v1 +kind: PersistentVolume +metadata: + name: wso2apim-gateway-server-pv + labels: + purpose: apim-shared-server +spec: + capacity: + storage: 1Gi + accessModes: + - ReadWriteMany + persistentVolumeReclaimPolicy: Retain + nfs: + server: + path: "" + +--- +apiVersion: v1 +kind: PersistentVolume +metadata: + name: wso2apim-analytics-data-pv + labels: + purpose: apim-analytics-data +spec: + capacity: + storage: 20Gi + accessModes: + - ReadWriteOnce + persistentVolumeReclaimPolicy: Retain + nfs: + server: + path: "" + +--- + +apiVersion: v1 +kind: PersistentVolume +metadata: + name: wso2apim-analytics-pv + labels: + purpose: apim-analytics +spec: + capacity: + storage: 1Gi + accessModes: + - ReadWriteOnce + persistentVolumeReclaimPolicy: Retain + nfs: + server: + path: "" diff --git a/pattern-2/artifacts/apim-gateway/wso2apim-manager-worker-service.yaml b/rbac/rbac.yaml similarity index 56% rename from pattern-2/artifacts/apim-gateway/wso2apim-manager-worker-service.yaml rename to rbac/rbac.yaml index b1b8ac76..f5f30945 100644 --- a/pattern-2/artifacts/apim-gateway/wso2apim-manager-worker-service.yaml +++ b/rbac/rbac.yaml @@ -12,26 +12,28 @@ # See the License for the specific language governing permissions and # limitations under the License. -apiVersion: v1 -kind: Service +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role metadata: - name: wso2apim-manager-worker - labels: - node: manager-worker - pattern: wso2apim-pattern-2 -spec: - ports: - # ports that this service should serve on - - - name: "http" - protocol: TCP - port: 9673 - - - name: "https" - protocol: TCP - port: 9443 - # label keys and values that must match in order to receive traffic for this service - selector: - node: manager-worker - clusterIP: None - sessionAffinity: ClientIP \ No newline at end of file + namespace: wso2 + name: endpoints-reader-role +rules: +- apiGroups: [""] + verbs: ["get", "list"] + resources: ["endpoints"] + +--- + +apiVersion: rbac.authorization.k8s.io/v1beta1 +kind: RoleBinding +metadata: + name: wso2-endpoints-reader-role-binding + namespace: wso2 +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: endpoints-reader-role +subjects: + - kind: ServiceAccount + name: wso2svc-account + namespace: wso2