├── .gitignore ├── LICENSE ├── README.md ├── conf ├── common │ ├── authenticators.xml │ └── master-datasources.xml ├── mysql │ └── my.cnf ├── wso2am │ ├── master-datasources.xml │ └── registry.xml ├── wso2dss │ ├── master-datasources.xml │ └── registry.xml ├── wso2esb │ ├── master-datasources.xml │ └── registry.xml ├── wso2greg │ ├── master-datasources.xml │ └── registry.xml └── wso2is │ ├── carbon.xml │ ├── master-datasources.xml │ ├── registry.xml │ ├── sso-idp-config.xml │ └── user-mgt.xml ├── docker-compose.yml ├── lib └── mysql-connector-java-5.1.38-bin.jar └── scripts ├── env.bash └── mysql ├── greg-init.sql └── is-init.sql /.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | 203 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## compose-wso2 2 | 3 | compose-wso2 sets up a collection of dockerized WSO2 components with a shared governance registry and SSO capability. 4 | 5 | ### Description 6 | 7 | These are the components included: 8 | 9 | 1. API Manager 10 | 2. Data Service Server 11 | 3. Enterprise Service Bus 12 | 4. Governance Registry 13 | 5. Identity Server 14 | 15 | Before you get started with a `docker-compose up`, note that: 16 | 17 | 1. The WSO2 container images are quite large, ranging from 750MB to a whooping 1.0GB. 18 | 2. The first run of `docker-compose up` takes a few minutes as the service images are pulled from my AWS S3 buckets, and the Governance Registry is started with the `-Dsetup` flag in order to initialize all the database tables. Try run `docker-compose pull` prior to running `docker-compose up`. 19 | 3. This project utilizes [Compose's networking feature](https://docs.docker.com/compose/networking/) to facilitate inter-containers networking communication. 20 | 4. To support [web browser-based SSO with WSO2 Identity Server](https://docs.wso2.com/display/IS510/Configuring+SAML2+Single-Sign-On+Across+Different+WSO2+Products), a new entry for the Identity Server hostname (`wso2identity`) must be added to your `/etc/hosts` file. Refer to the [Usage](#usage) section for more information. 21 | 5. In the rest of this README, the `$DOCKER_HOST_IP` variable refers either to the value of `docker-machine ip ` if you are using Docker machine, or just `localhost` if you aren't using Docker machine. 22 | 23 | ### Usage 24 | 25 | 1. Set up the default environmental variables and change the `WSO2_GATEWAY` variable to your `$DOCKER_HOST_IP`: `source scripts/env.bash` 26 | 2. Update your `/etc/hosts` file with the following line: `<$WSO2_GATEWAY> wso2identity` where `$WSO2_GATEWAY` has the same value as defined in your `scripts/env.bash` script. 27 | 3. Pull services: `docker-compose pull ` 28 | 4. Run services: `docker-compose --x-networking up ` 29 | 5. Scale services: `docker-compose scale ` 30 | 6. View logs: `docker-compose logs ` 31 | 32 | ### Web Admin Consoles 33 | 34 | The exposed ports of each component can be changed using the `scripts/env.bash` script. 35 | 36 | Components | URL 37 | ---------------------- | ----------------------------- 38 | Identity Server | https://$DOCKER_HOST_IP:9443 39 | API Manager | https://$DOCKER_HOST_IP:9444 40 | Enterprise Service Bus | https://$DOCKER_HOST_IP:9445 41 | Data Service Server | https://$DOCKER_HOST_IP:9446 42 | Governance Registry | https://$DOCKER_HOST_IP:9447/carbon 43 | 44 | ### Governance Registry Persistance 45 | 46 | The [Governance Registry](http://wso2.com/products/governance-registry/) is used to provide a shared governance partition backed by a MySQL database, as documented [here](https://docs.wso2.com/display/ESB490/Governance+Partition+in+a+Remote+Registry). The database `registrydb` is created by the `scripts/mysql/greg-init.sql` script on-start. 47 | 48 | To test the shared governance partition set-up, navigate to the `/_system/governance` registry from any of the web consoles. Add or modify some resources, and expect the changes to be seen in the web consoles of other components. Note that caching is disabled in the `registry.xml` file of each component. 49 | 50 | There are two others adjustments I had to make to get this to work: 51 | 52 | 1. Override the default MySQL `sql-mode` using the `conf/mysql/my.cnf` script to remove the [`NO_ZERO_IN_DATE`](http://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#sqlmode_no_zero_in_date) and [`NO_ZERO_DATE`](http://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#sqlmode_no_zero_date) restrictions. WSO2 uses `DEFAULT 0` in some of their timestamp queries. 53 | 2. Disable SSL by setting the `useSSL` parameter in the JDBC connection string as seen in the `conf//master-datasources.xml` scripts. 54 | 55 | ### Single Sign-On 56 | 57 | The [Identity Server](http://wso2.com/products/identity-server/) is configured to support web browser-based SSO across all the components based on the steps described [here](https://docs.wso2.com/display/IS510/Configuring+SAML2+Single-Sign-On+Across+Different+WSO2+Products). A MySQL database is used as the [backing data source to store registry and user manager data](https://docs.wso2.com/display/IS510/Setting+up+MySQL). The database `identitydb` is created by the `scripts/mysql/is-init.sql` script on-start. 58 | 59 | Instead of defining the service provider for each component via the administrator console, I specified them in the `sso-idp-config.xml` file in accordance to this [example](https://docs.wso2.com/display/IS510/Configuring+a+SP+and+IdP+Using+Configuration+Files). There is an issue with logout where the Identity Server throws an `ERROR {org.wso2.carbon.identity.sso.saml.processors.LogoutRequestProcessor} - No Established Sessions corresponding to Session Indexes provided.` exception. 60 | 61 | Since I am using Docker machine, I have to add the Identity Server hostname (`wso2identity`) to my `/etc/hosts` file. Refer to [Usage](#usage) section on the updates necessary for the `/etc/hosts` file. Otherwise, by default, all the Identity Server SSO web applications will redirect SAML requests back to `localhost`. 62 | 63 | The following is a list of SSO-related TODOs: 64 | 65 | 1. Fix logout issue. 66 | 2. Replace the default embedded LDAP server with a Docker container as the primary user store. 67 | 68 | ### Supported Environmental Variables 69 | 70 | The default versions and port numbers of the WSO2 components, MySQL credentials and other environmental variables are defined in the `scripts/env.bash` script. 71 | 72 | The following is the list of environmental variables that you will need to change to cater to your environment: 73 | 74 | Variables | Description 75 | ------------------- | -------------------------------- 76 | COMPOSE_PROJECT_NAME| Sets the project name. Refer Compose [documentation](https://docs.docker.com/compose/reference/overview/#compose-project-name) for more information. 77 | WSO2_GATEWAY | This should be set to either the IP address of your Docker machine, or `localhost` if you aren't using Docker machine. 78 | APIM_VERSION | Version of the API Manager 79 | APIM_HTTPS_PORT | Exposed HTTPS port of the API Manager 80 | APIM_HTTP_PORT | Exposed HTTP port of the API Manager 81 | DSS_VERSION | Version of the Data Service Server 82 | DSS_HTTPS_PORT | Exposed HTTPS port of the Data Service Server 83 | DSS_HTTP_PORT | Exposed HTTP port of the Data Service Server 84 | ESB_VERSION | Version of the Enterprise Service Bus 85 | ESB_HTTPS_PORT | Exposed HTTPS port of the Enterprise Service Bus 86 | ESB_HTTP_PORT | Exposed HTTP port of the Enterprise Service Bus 87 | GREG_VERSION | Version of the Governance Registry 88 | GREG_HTTPS_PORT | Exposed HTTPS port of the Governance Registry 89 | GREG_HTTP_PORT | Exposed HTTPS port of the Governance Registry 90 | IS_VERSION | Version of the Identity Server 91 | IS_HTTPS_PORT | Exposed HTTPS port of the Identity Server 92 | IS_HTTP_PORT | Exposed HTTP port of the Identity Server 93 | MYSQL_VERSION | Version of the MySQL database 94 | MYSQL_ROOT_PASSWORD | MySQL root password 95 | 96 | ### Override MySQL Configurations 97 | 98 | The default MySQL configurations can be overridden by adding custom configuration files, suffixed with the `.cnf` extension, to the `conf/mysql` folder. For more information, see the MySQL official repository on [dockerhub](https://hub.docker.com/_/mysql/). 99 | -------------------------------------------------------------------------------- /conf/common/authenticators.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 18 | 19 | 23 | 24 | 25 | 26 | 27 | 5 28 | 29 | 30 | 31 | 32 | 10 33 | 34 | /carbon/admin/login.jsp 35 | urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified 36 | 37 | $SSO_SERVICE_PROVIDER 38 | $IS_SAML_SSO_URL 39 | $ACS_URL 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 57 | 58 | 62 | 63 | 64 | 65 | 73 | 74 | -------------------------------------------------------------------------------- /conf/common/master-datasources.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader 4 | 5 | 6 | 7 | 8 | WSO2_CARBON_DB 9 | The datasource used for registry and user manager 10 | 11 | jdbc/WSO2CarbonDB 12 | 13 | 14 | 15 | jdbc:h2:repository/database/WSO2CARBON_DB;DB_CLOSE_ON_EXIT=FALSE;LOCK_TIMEOUT=60000 16 | wso2carbon 17 | wso2carbon 18 | org.h2.Driver 19 | 50 20 | 60000 21 | true 22 | SELECT 1 23 | 30000 24 | false 25 | 26 | 27 | 28 | 29 | 30 | WSO2_CARBON_DB_GREG 31 | The datasource used for registry and user manager 32 | 33 | jdbc/WSO2CarbonDB_GREG 34 | 35 | 36 | 37 | jdbc:mysql://wso2_mysql_1:3306/registrydb?useSSL=false 38 | root 39 | password 40 | com.mysql.jdbc.Driver 41 | 80 42 | 60000 43 | true 44 | SELECT 1 45 | 30000 46 | 47 | 48 | 49 | 50 | 51 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /conf/mysql/my.cnf: -------------------------------------------------------------------------------- 1 | [mysqld] 2 | sql-mode="ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" 3 | -------------------------------------------------------------------------------- /conf/wso2am/master-datasources.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader 4 | 5 | 6 | 7 | 8 | WSO2_CARBON_DB 9 | The datasource used for registry and user manager 10 | 11 | jdbc/WSO2CarbonDB 12 | 13 | 14 | 15 | jdbc:h2:repository/database/WSO2CARBON_DB;DB_CLOSE_ON_EXIT=FALSE;LOCK_TIMEOUT=60000 16 | wso2carbon 17 | wso2carbon 18 | org.h2.Driver 19 | 50 20 | 60000 21 | true 22 | SELECT 1 23 | 30000 24 | false 25 | 26 | 27 | 28 | 29 | 30 | WSO2AM_DB 31 | The datasource used for API Manager database 32 | 33 | jdbc/WSO2AM_DB 34 | 35 | 36 | 37 | jdbc:h2:repository/database/WSO2AM_DB;DB_CLOSE_ON_EXIT=FALSE 38 | wso2carbon 39 | wso2carbon 40 | false 41 | org.h2.Driver 42 | 50 43 | 60000 44 | true 45 | SELECT 1 46 | 30000 47 | 48 | 49 | 50 | 51 | 52 | WSO2_CARBON_DB_GREG 53 | The datasource used for registry and user manager 54 | 55 | jdbc/WSO2CarbonDB_GREG 56 | 57 | 58 | 59 | jdbc:mysql://wso2_mysql_1:3306/registrydb?useSSL=false 60 | root 61 | password 62 | com.mysql.jdbc.Driver 63 | 80 64 | 60000 65 | true 66 | SELECT 1 67 | 30000 68 | 69 | 70 | 71 | 72 | 73 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /conf/wso2am/registry.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | wso2registry 7 | false 8 | false 9 | / 10 | 11 | 12 | 13 | 14 | jdbc/WSO2CarbonDB 15 | 16 | 17 | 18 | 19 | 20 | 21 | .* 22 | 23 | 24 | 25 | 26 | 27 | 29 | 30 | .* 31 | 32 | 33 | 34 | 35 | 36 | 37 | 39 | true 40 | 41 | /trunk/schemas/ 42 | 43 | 44 | /trunk/wsdls/ 45 | 46 | 47 | /trunk/policies/ 48 | 49 | 50 | 51 | application/wsdl+xml 52 | 53 | 54 | 55 | 56 | 57 | 58 | application/wsdl+xml 59 | application/xsd+xml 60 | 50 61 | true 62 | 70 | 3 71 | 72 | /trunk/schemas/ 73 | 74 | 75 | /trunk/wsdls/ 76 | 77 | 78 | application/vnd.wso2.governance-archive 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 1.0.0-SNAPSHOT 87 | true 88 | 89 | dev 90 | qa 91 | live 92 | 93 | 94 | application/vnd.wso2-service+xml 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | application/vnd.wso2-service+xml 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | /_system/governance/event/topics/registry/notifications/.* 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | Created 121 | Tested 122 | Deployed 123 | 124 | 125 | application/vnd.wso2-smart-link 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | /trunk/policies/ 134 | 135 | 136 | application/policy+xml 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | true 145 | 146 | /trunk/schemas/ 147 | 148 | 149 | application/x-xsd+xml 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | application/vnd.wso2-hyperlink 158 | 159 | 160 | 161 | 162 | 163 | 164 | application/vnd.wso2.endpoint 165 | 166 | /trunk/endpoints/ 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | application/vnd.wso2-uri+xml 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | .* 183 | 184 | 185 | 186 | 187 | 188 | 189 | .* 190 | 191 | 192 | 193 | 194 | 195 | 196 | workflow-config 197 | 198 | 199 | 200 | 206 | 207 | 208 | 209 | 216 | 217 | 218 | 219 | jdbc/WSO2CarbonDB_GREG 220 | 221 | 222 | 223 | instanceid 224 | remote_registry 225 | root@jdbc:mysql://wso2_mysql_1:3306/registrydb 226 | false 227 | false 228 | / 229 | 230 | 231 | 232 | 233 | instanceid 234 | /_system/governance 235 | 236 | 237 | 238 | 239 | 60 240 | 2 241 | 242 | 50 243 | 244 | 10 245 | 246 | /_system/local/repository/components/org.wso2.carbon.registry/indexing/lastaccesstime 247 | 248 | 249 | 254 | 257 | 258 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | true 280 | true 281 | true 282 | true 283 | 284 | /trunk/services/ 285 | 286 | 287 | 288 | 289 | false 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 305 | 306 | 310 | 311 | 314 | 315 | 321 | 322 | 323 | 324 | 331 | 332 | 333 | -------------------------------------------------------------------------------- /conf/wso2dss/master-datasources.xml: -------------------------------------------------------------------------------- 1 | ../common/master-datasources.xml -------------------------------------------------------------------------------- /conf/wso2dss/registry.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 18 | 19 | 20 | 24 | 25 | wso2registry 26 | false 27 | false 28 | / 29 | 30 | 31 | jdbc/WSO2CarbonDB 32 | 33 | 34 | 69 | 70 | 71 | 72 | jdbc/WSO2CarbonDB_GREG 73 | 74 | 75 | 76 | instanceid 77 | remote_registry 78 | root@jdbc:mysql://wso2_mysql_1:3306/registrydb 79 | false 80 | false 81 | / 82 | 83 | 84 | 85 | instanceid 86 | /_system/governance 87 | 88 | 89 | false 90 | 91 | 93 | 94 | true 95 | true 96 | true 97 | true 98 | 99 | 100 | -------------------------------------------------------------------------------- /conf/wso2esb/master-datasources.xml: -------------------------------------------------------------------------------- 1 | ../common/master-datasources.xml -------------------------------------------------------------------------------- /conf/wso2esb/registry.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 18 | 19 | 20 | 24 | 25 | wso2registry 26 | false 27 | false 28 | / 29 | 30 | 31 | jdbc/WSO2CarbonDB 32 | 33 | 34 | 35 | true 36 | 35 37 | 3 38 | 39 | 50 40 | 41 | 50 42 | 43 | /_system/local/repository/components/org.wso2.carbon.registry/indexing/lastaccesstime 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 98 | 99 | 100 | jdbc/WSO2CarbonDB_GREG 101 | 102 | 103 | 104 | instanceid 105 | remote_registry 106 | root@jdbc:mysql://wso2_mysql_1:3306/registrydb 107 | false 108 | false 109 | / 110 | 111 | 112 | 113 | instanceid 114 | /_system/governance 115 | 116 | 117 | false 118 | 119 | 121 | 122 | true 123 | true 124 | true 125 | true 126 | 127 | 128 | -------------------------------------------------------------------------------- /conf/wso2greg/master-datasources.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader 4 | 5 | 6 | 7 | WSO2_CARBON_DB 8 | The datasource used for registry and user manager 9 | 10 | jdbc/WSO2CarbonDB 11 | 12 | 13 | 14 | jdbc:mysql://wso2_mysql_1:3306/registrydb?useSSL=false 15 | root 16 | password 17 | com.mysql.jdbc.Driver 18 | 80 19 | 60000 20 | true 21 | SELECT 1 22 | 30000 23 | 24 | 25 | 26 | 27 | 28 | WSO2AM_DB 29 | The datasource used for API Manager database 30 | 31 | jdbc/WSO2AM_DB 32 | 33 | 34 | 35 | jdbc:h2:repository/database/WSO2AM_DB;DB_CLOSE_ON_EXIT=FALSE;LOCK_TIMEOUT=60000 36 | wso2carbon 37 | wso2carbon 38 | org.h2.Driver 39 | 50 40 | 60000 41 | true 42 | SELECT 1 43 | 30000 44 | 45 | 46 | 47 | 48 | 49 | WSO2BAM_DATASOURCE 50 | The datasource used for analyzer data 51 | 52 | 53 | jdbc:h2:repository/database/samples/BAM_STATS_DB;AUTO_SERVER=TRUE 54 | wso2carbon 55 | wso2carbon 56 | org.h2.Driver 57 | 50 58 | 60000 59 | true 60 | SELECT 1 61 | 30000 62 | 63 | 64 | 65 | 66 | 67 | JAGH2 68 | The datasource used for by the Jaggery Storage Manager 69 | 70 | jdbc/test 71 | 72 | 73 | 74 | jdbc:h2:repository/database/ES_STORAGE;DB_CLOSE_ON_EXIT=FALSE;LOCK_TIMEOUT=60000 75 | sa 76 | 77 | org.h2.Driver 78 | 50 79 | 60000 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /conf/wso2greg/registry.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | wso2registry 7 | false 8 | false 9 | / 10 | 11 | 12 | 13 | 14 | jdbc/WSO2CarbonDB 15 | 16 | 17 | 18 | 19 | 20 | 21 | .* 22 | 23 | 24 | 25 | 26 | 27 | 29 | 30 | .* 31 | 32 | 33 | 34 | 35 | 36 | 37 | 39 | true 40 | true 41 | 42 | 43 | /trunk/schemas/ 44 | 45 | 46 | /trunk/wsdls/ 47 | 48 | 49 | /trunk/policies/ 50 | 51 | 52 | 53 | 54 | application/wsdl+xml 55 | 56 | 57 | 58 | 59 | 60 | 61 | application/wsdl+xml 62 | application/xsd+xml 63 | 50 64 | true 65 | true 66 | 75 | 3 76 | 77 | 78 | 79 | /trunk/schemas/ 80 | 81 | 82 | /trunk/wsdls/ 83 | 84 | 85 | /trunk/wadls/ 86 | 87 | 88 | 89 | application/vnd.wso2.governance-archive 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | /apimgt/applicationdata/api-docs/ 99 | 100 | 101 | /apimgt/applicationdata/provider/ 102 | 103 | 104 | /trunk/endpoints/ 105 | 106 | 107 | application/swagger+json 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 1.0.0-SNAPSHOT 117 | true 118 | 119 | dev 120 | qa 121 | live 122 | 123 | 124 | application/vnd.wso2-service+xml 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 1.0.0-SNAPSHOT 133 | true 134 | 135 | dev 136 | qa 137 | live 138 | 139 | 140 | application/vnd.wso2-soap-service+xml 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | /_system/governance/.* 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | application/vnd.wso2-service+xml 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | /_system/governance/event/topics/registry/notifications/.* 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | Created 175 | Tested 176 | Deployed 177 | 178 | 179 | application/vnd.wso2-smart-link 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | /trunk/policies/ 188 | 189 | 190 | application/policy+xml 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | true 199 | 200 | /trunk/schemas/ 201 | 202 | 203 | application/x-xsd+xml 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | application/vnd.wso2-hyperlink 212 | 213 | 214 | 215 | 216 | 217 | 218 | application/vnd.wso2-endpoint+xml 219 | true 220 | 221 | 222 | /trunk/endpoints/ 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | application/vnd.wso2-uri+xml 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | /trunk/wadls/ 241 | 242 | 243 | /trunk/schemas/ 244 | 245 | 246 | 247 | application/wadl+xml 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | .* 256 | 257 | 258 | 259 | 260 | 261 | 262 | .* 263 | 264 | 265 | 266 | 267 | 268 | application* 269 | 270 | 271 | 272 | 278 | 279 | 280 | 281 | 288 | 289 | 290 | 291 | 298 | 299 | 300 | 301 | 305 | 306 | 307 | 308 | 309 | true 310 | 35 311 | 3 312 | 313 | 50 314 | 315 | 50 316 | 317 | /_system/local/repository/components/org.wso2.carbon.registry/indexing/lastaccesstime 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | true 346 | true 347 | true 348 | true 349 | 350 | /trunk/services/ 351 | 352 | 353 | 354 | 355 | false 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 371 | 372 | 373 | admin 374 | admin 375 | 376 | 377 | 380 | 381 | 387 | 388 | 389 | 390 | 391 | 396 | 406 | 407 | 408 | 409 | 410 | -------------------------------------------------------------------------------- /conf/wso2is/carbon.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 18 | 19 | 25 | 26 | 27 | 30 | WSO2 Identity Server 31 | 32 | 35 | IS 36 | 37 | 40 | 5.0.0 41 | 42 | 48 | wso2identity 49 | 50 | 53 | wso2identity 54 | 55 | 60 | local:/${carbon.context}/services/ 61 | 64 | 68 | 69 | 70 | 76 | 77 | IdentityServer 78 | 79 | 80 | 81 | 82 | 83 | 86 | org.wso2.carbon 87 | 88 | 91 | / 92 | 93 | 94 | 95 | 96 | 100 | 15 101 | 102 | 103 | 104 | 105 | 108 | 109 | 110 | 114 | 0 115 | 116 | 117 | 118 | 119 | 9999 120 | 121 | 11111 122 | 123 | 124 | 125 | 126 | 127 | 10389 128 | 129 | 8000 130 | 131 | 132 | 135 | 136 | 137 | 10500 138 | 139 | 140 | 141 | 144 | 145 | 148 | org.wso2.carbon.tomcat.jndi.CarbonJavaURLContextFactory 149 | 152 | 153 | 156 | 166 | 169 | 170 | 171 | 172 | java 173 | 174 | 177 | 178 | 179 | 183 | 184 | 185 | 186 | 191 | false 192 | 193 | 196 | false 197 | 198 | 199 | 600 200 | 201 | 206 | 207 | false 208 | false 209 | 210 | 211 | 214 | 215 | 226 | ${carbon.home}/repository/deployment/server/ 227 | 228 | 232 | 15 233 | 234 | 245 | ${carbon.home}/repository/conf/axis2/axis2.xml 246 | 247 | 252 | 30000 253 | 254 | 258 | ${carbon.home}/repository/deployment/client/ 259 | 261 | ${carbon.home}/repository/conf/axis2/axis2_client.xml 262 | 263 | true 264 | 265 | 268 | 269 | 270 | 271 | 272 | 276 | 277 | 278 | admin 279 | Default Administrator Role 280 | 281 | 282 | user 283 | Default User Role 284 | 285 | 286 | 287 | 290 | 291 | 292 | 295 | 296 | 300 | 301 | 302 | ${carbon.home}/repository/resources/security/wso2carbon.jks 303 | 304 | JKS 305 | 306 | wso2carbon 307 | 308 | wso2carbon 309 | 310 | wso2carbon 311 | 312 | 313 | 316 | 317 | 318 | ${carbon.home}/repository/resources/security/wso2carbon.jks 319 | 320 | JKS 321 | 322 | wso2carbon 323 | 324 | wso2carbon 325 | 326 | wso2carbon 327 | 328 | 329 | 333 | 334 | 335 | ${carbon.home}/repository/resources/security/client-truststore.jks 336 | 337 | JKS 338 | 339 | wso2carbon 340 | 341 | 342 | 347 | 348 | 353 | 354 | 358 | 359 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 381 | UserManager 382 | 383 | 384 | false 385 | 386 | 390 | org.wso2.carbon.identity.sts.store.DBTokenStore 391 | 392 | 393 | generic_sts_menu 394 | manage_saml_sso 395 | oauth_menu 396 | scim_menu 397 | 398 | 399 | 402 | ${carbon.home}/tmp/work 403 | 404 | 407 | 408 | 409 | 414 | true 415 | 416 | 419 | 10 420 | 421 | 427 | 30 428 | 429 | 430 | 436 | 437 | 440 | 100 441 | 442 | 443 | 444 | keystore 445 | certificate 446 | * 447 | 448 | org.wso2.carbon.ui.transports.fileupload.AnyFileUploadExecutor 449 | 450 | 451 | 452 | 453 | jarZip 454 | 455 | org.wso2.carbon.ui.transports.fileupload.JarZipUploadExecutor 456 | 457 | 458 | 459 | dbs 460 | 461 | org.wso2.carbon.ui.transports.fileupload.DBSFileUploadExecutor 462 | 463 | 464 | 465 | tools 466 | 467 | org.wso2.carbon.ui.transports.fileupload.ToolsFileUploadExecutor 468 | 469 | 470 | 471 | toolsAny 472 | 473 | org.wso2.carbon.ui.transports.fileupload.ToolsAnyFileUploadExecutor 474 | 475 | 476 | 477 | 489 | 490 | 491 | info 492 | org.wso2.carbon.core.transports.util.InfoProcessor 493 | 494 | 495 | wsdl 496 | org.wso2.carbon.core.transports.util.Wsdl11Processor 497 | 498 | 499 | wsdl2 500 | org.wso2.carbon.core.transports.util.Wsdl20Processor 501 | 502 | 503 | xsd 504 | org.wso2.carbon.core.transports.util.XsdProcessor 505 | 506 | 507 | 508 | 512 | 513 | false 514 | false 515 | true 516 | svn 517 | http://svnrepo.example.com/repos/ 518 | username 519 | password 520 | true 521 | 522 | 523 | 527 | 532 | 533 | 534 | 540 | 541 | 545 | 546 | 547 | 548 | 549 | 553 | ${require.carbon.servlet} 554 | 555 | 572 | 587 | 588 | true 589 | 590 | 591 | 592 | 593 | 596 | 597 | default repository 598 | ${p2.repo.url} 599 | 600 | 601 | 604 | 605 | 606 | 608 | 609 | true 610 | 611 | 613 | 614 | 620 | 621 | true 622 | 623 | 624 | -------------------------------------------------------------------------------- /conf/wso2is/master-datasources.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader 5 | 6 | 7 | 8 | 9 | 10 | WSO2_CARBON_DB 11 | The datasource used for registry and user manager 12 | 13 | jdbc/WSO2CarbonDB 14 | 15 | 16 | 17 | jdbc:h2:repository/database/WSO2CARBON_DB;DB_CLOSE_ON_EXIT=FALSE;LOCK_TIMEOUT=60000 18 | wso2carbon 19 | wso2carbon 20 | org.h2.Driver 21 | 50 22 | 60000 23 | true 24 | SELECT 1 25 | 30000 26 | 27 | 28 | 29 | 30 | 31 | WSO2_CARBON_DB_GREG 32 | The datasource used for registry and user manager 33 | 34 | jdbc/WSO2CarbonDB_GREG 35 | 36 | 37 | 38 | jdbc:mysql://wso2_mysql_1:3306/registrydb?useSSL=false 39 | root 40 | password 41 | com.mysql.jdbc.Driver 42 | 80 43 | 60000 44 | true 45 | SELECT 1 46 | 30000 47 | 48 | 49 | 50 | 51 | 52 | WSO2_CARBON_DB_IDENTITY 53 | The datasource used for IAM 54 | 55 | jdbc/WSO2CarbonDBIdentity 56 | 57 | 58 | 59 | jdbc:mysql://wso2_mysql_1:3306/identitydb?useSSL=false 60 | isadmin 61 | password 62 | com.mysql.jdbc.Driver 63 | 80 64 | 60000 65 | true 66 | SELECT 1 67 | 30000 68 | 69 | 70 | 71 | 72 | 73 | 106 | 107 | 108 | 109 | 110 | -------------------------------------------------------------------------------- /conf/wso2is/registry.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 18 | 19 | 20 | 24 | 25 | wso2registry 26 | false 27 | false 28 | / 29 | 30 | 31 | jdbc/WSO2CarbonDB 32 | 33 | 34 | 35 | 36 | application/xacml-policy+xml 37 | 38 | 39 | 74 | 75 | 76 | jdbc/WSO2CarbonDB_GREG 77 | 78 | 79 | 80 | instanceid 81 | remote_registry 82 | root@jdbc:mysql://wso2_mysql_1:3306/registrydb 83 | false 84 | false 85 | / 86 | 87 | 88 | 89 | instanceid 90 | /_system/governance 91 | 92 | true 93 | 94 | 96 | 97 | true 98 | true 99 | true 100 | true 101 | 102 | 103 | -------------------------------------------------------------------------------- /conf/wso2is/sso-idp-config.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | 21 | wso2.my.dashboard 22 | https://localhost:9443/dashboard/acs 23 | true 24 | true 25 | false 26 | false 27 | 28 | http://wso2.org/claims/role 29 | http://wso2.org/claims/emailaddress 30 | 31 | false 32 | 33 | true 34 | 35 | carbonServer 36 | 37 | 38 | 39 | 40 | 41 | $APIM_SSO_SERVICE_PROVIDER 42 | $APIM_SSO_ACS_URL 43 | true 44 | true 45 | false 46 | false 47 | 48 | http://wso2.org/claims/role 49 | http://wso2.org/claims/emailaddress 50 | 51 | true 52 | 53 | true 54 | 55 | carbonServer 56 | 57 | 58 | 59 | 60 | 61 | $ESB_SSO_SERVICE_PROVIDER 62 | $ESB_SSO_ACS_URL 63 | true 64 | true 65 | false 66 | false 67 | 68 | http://wso2.org/claims/role 69 | http://wso2.org/claims/emailaddress 70 | 71 | true 72 | 73 | true 74 | 75 | carbonServer 76 | 77 | 78 | 79 | 80 | 81 | $DSS_SSO_SERVICE_PROVIDER 82 | $DSS_SSO_ACS_URL 83 | true 84 | true 85 | false 86 | false 87 | 88 | http://wso2.org/claims/role 89 | http://wso2.org/claims/emailaddress 90 | 91 | true 92 | 93 | true 94 | 95 | carbonServer 96 | 97 | 98 | 99 | 100 | 101 | $GREG_SSO_SERVICE_PROVIDER 102 | $GREG_SSO_ACS_URL 103 | true 104 | true 105 | false 106 | false 107 | 108 | http://wso2.org/claims/role 109 | http://wso2.org/claims/emailaddress 110 | 111 | true 112 | 113 | true 114 | 115 | carbonServer 116 | 117 | 118 | 119 | 120 | 121 | -------------------------------------------------------------------------------- /conf/wso2is/user-mgt.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 20 | true 21 | admin 22 | 23 | admin 24 | admin 25 | 26 | everyone 27 | jdbc/WSO2CarbonDBIdentity 28 | 29 | 31 | 71 | 72 | 74 | 97 | 98 | 101 | 132 | 133 | 142 | 185 | 186 | 189 | 229 | 230 | 236 | 237 | org.wso2.carbon.user.core.tenant.CommonHybridLDAPTenantManager 238 | WSO2.ORG 239 | false 240 | false 241 | ldap://localhost:${Ports.EmbeddedLDAP.LDAPServerPort} 242 | uid=admin,ou=system 243 | admin 244 | SHA 245 | (objectClass=person) 246 | identityPerson 247 | ou=Users,dc=wso2,dc=org 248 | (&(objectClass=person)(uid=?)) 249 | uid 250 | ^[\S]{5,30}$ 251 | ^[\\S]{5,30}$ 252 | ^[\\S]{2,30}/[\\S]{2,30}$ 253 | ^[\S]{3,30}$ 254 | [a-zA-Z0-9._-|//]{3,30}$ 255 | ^[\S]{3,30}$ 256 | [a-zA-Z0-9._-|//]{3,30}$ 257 | true 258 | true 259 | true 260 | ou=Groups,dc=wso2,dc=org 261 | (objectClass=groupOfNames) 262 | groupOfNames 263 | (&(objectClass=groupOfNames)(cn=?)) 264 | cn 265 | cn 266 | ou=SharedGroups,dc=wso2,dc=org 267 | groupOfNames 268 | (objectClass=groupOfNames) 269 | (&(objectClass=groupOfNames)(cn=?)) 270 | (objectClass=organizationalUnit) 271 | ou 272 | organizationalUnit 273 | member 274 | true 275 | uid={0},ou=Users,dc=wso2,dc=org 276 | cn={0},ou=Groups,dc=wso2,dc=org 277 | true 278 | 100 279 | 100 280 | 281 | 282 | 290 | 306 | 307 | 309 | /permission 310 | true 311 | 312 | 313 | 314 | 315 | 344 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | is: 2 | image: isim/wso2is:$IS_VERSION 3 | hostname: wso2identity 4 | ports: 5 | - $IS_HTTPS_PORT:9443 6 | - $IS_HTTP_PORT:9763 7 | volumes: 8 | - ./conf/wso2is/master-datasources.xml:/opt/wso2is-$IS_VERSION/repository/conf/datasources/master-datasources.xml 9 | - ./conf/wso2is/carbon.xml:/opt/wso2is-$IS_VERSION/repository/conf/carbon.xml 10 | - ./conf/wso2is/registry.xml:/opt/wso2is-$IS_VERSION/repository/conf/registry.xml 11 | - ./conf/wso2is/user-mgt.xml:/opt/wso2is-$IS_VERSION/repository/conf/user-mgt.xml 12 | - ./conf/wso2is/sso-idp-config.xml:/opt/wso2is-$IS_VERSION/repository/conf/security/sso-idp-config.xml 13 | - ./lib/mysql-connector-java-5.1.38-bin.jar:/opt/wso2is-$IS_VERSION/repository/components/lib/mysql-connector-java-5.1.38-bin.jar 14 | 15 | apim: 16 | image: isim/wso2apim:$APIM_VERSION 17 | ports: 18 | - $APIM_HTTPS_PORT:9443 19 | - $APIM_HTTP_PORT:9763 20 | volumes: 21 | - ./conf/wso2am/master-datasources.xml:/opt/wso2am-$APIM_VERSION/repository/conf/datasources/master-datasources.xml 22 | - ./conf/wso2am/registry.xml:/opt/wso2am-$APIM_VERSION/repository/conf/registry.xml 23 | - ./conf/wso2am/authenticators.xml:/opt/wso2am-$APIM_VERSION/repository/conf/security/authenticators.xml 24 | - ./lib/mysql-connector-java-5.1.38-bin.jar:/opt/wso2am-$APIM_VERSION/repository/components/lib/mysql-connector-java-5.1.38-bin.jar 25 | 26 | esb: 27 | image: isim/wso2esb:$ESB_VERSION 28 | ports: 29 | - $ESB_HTTPS_PORT:9443 30 | - $ESB_HTTP_PORT:9763 31 | volumes: 32 | - ./conf/wso2esb/master-datasources.xml:/opt/wso2esb-$ESB_VERSION/repository/conf/datasources/master-datasources.xml 33 | - ./conf/wso2esb/registry.xml:/opt/wso2esb-$ESB_VERSION/repository/conf/registry.xml 34 | - ./conf/wso2esb/authenticators.xml:/opt/wso2esb-$ESB_VERSION/repository/conf/security/authenticators.xml 35 | - ./lib/mysql-connector-java-5.1.38-bin.jar:/opt/wso2esb-$ESB_VERSION/repository/components/lib/mysql-connector-java-5.1.38-bin.jar 36 | 37 | dss: 38 | image: isim/wso2dss:$DSS_VERSION 39 | ports: 40 | - $DSS_HTTPS_PORT:9443 41 | - $DSS_HTTP_PORT:9763 42 | volumes: 43 | - ./conf/wso2dss/master-datasources.xml:/opt/wso2dss-$DSS_VERSION/repository/conf/datasources/master-datasources.xml 44 | - ./conf/wso2dss/registry.xml:/opt/wso2dss-$DSS_VERSION/repository/conf/registry.xml 45 | - ./conf/wso2dss/authenticators.xml:/opt/wso2dss-$DSS_VERSION/repository/conf/security/authenticators.xml 46 | - ./lib/mysql-connector-java-5.1.38-bin.jar:/opt/wso2dss-$DSS_VERSION/repository/components/lib/mysql-connector-java-5.1.38-bin.jar 47 | 48 | greg: 49 | image: isim/wso2greg:$GREG_VERSION 50 | command: -Dsetup 51 | ports: 52 | - $GREG_HTTPS_PORT:9443 53 | - $GREG_HTTP_PORT:9763 54 | volumes: 55 | - ./conf/wso2greg/master-datasources.xml:/opt/wso2greg-$GREG_VERSION/repository/conf/datasources/master-datasources.xml 56 | - ./conf/wso2greg/authenticators.xml:/opt/wso2greg-$GREG_VERSION/repository/conf/security/authenticators.xml 57 | - ./conf/wso2greg/registry.xml:/opt/wso2greg-$GREG_VERSION/repository/conf/registry.xml 58 | - ./lib/mysql-connector-java-5.1.38-bin.jar:/opt/wso2greg-$GREG_VERSION/repository/components/lib/mysql-connector-java-5.1.38-bin.jar 59 | 60 | mysql: 61 | image: mysql:$MYSQL_VERSION 62 | environment: 63 | - MYSQL_ROOT_PASSWORD=$MYSQL_ROOT_PASSWORD 64 | volumes: 65 | - ./scripts/mysql:/docker-entrypoint-initdb.d 66 | - ./conf/mysql/:/etc/mysql/conf.d 67 | - /var/lib/mysql 68 | -------------------------------------------------------------------------------- /lib/mysql-connector-java-5.1.38-bin.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ihcsim/compose-wso2/69fc490d7bdb0830389e1bf34fa57cd42541edd0/lib/mysql-connector-java-5.1.38-bin.jar -------------------------------------------------------------------------------- /scripts/env.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script defines all the environmental variables used in this project. 4 | # It also replaces the inlined parameters in some configuration file templates with the appropriate values. 5 | 6 | export COMPOSE_PROJECT_NAME=wso2 7 | export WSO2_GATEWAY=192.168.99.100 8 | 9 | export IS_VERSION=5.0.0 10 | export IS_HTTPS_PORT=9443 11 | export IS_HTTP_PORT=9763 12 | export IS_SAML_SSO_URL=https://$WSO2_GATEWAY:$IS_HTTPS_PORT/samlsso 13 | 14 | export APIM_VERSION=1.9.1 15 | export APIM_HTTPS_PORT=9444 16 | export APIM_HTTP_PORT=9764 17 | export APIM_SSO_SERVICE_PROVIDER=service-provider-apim 18 | export APIM_SSO_ACS_URL=https://$WSO2_GATEWAY:$APIM_HTTPS_PORT/acs 19 | 20 | export ESB_VERSION=4.9.0 21 | export ESB_HTTPS_PORT=9445 22 | export ESB_HTTP_PORT=9765 23 | export ESB_SSO_SERVICE_PROVIDER=service-provider-esb 24 | export ESB_SSO_ACS_URL=https://$WSO2_GATEWAY:$ESB_HTTPS_PORT/acs 25 | 26 | export DSS_VERSION=3.5.0 27 | export DSS_HTTPS_PORT=9446 28 | export DSS_HTTP_PORT=9766 29 | export DSS_SSO_SERVICE_PROVIDER=service-provider-dss 30 | export DSS_SSO_ACS_URL=https://$WSO2_GATEWAY:$DSS_HTTPS_PORT/acs 31 | 32 | export GREG_VERSION=5.1.0 33 | export GREG_HTTPS_PORT=9447 34 | export GREG_HTTP_PORT=9767 35 | export GREG_SSO_SERVICE_PROVIDER=service-provider-greg 36 | export GREG_SSO_ACS_URL=https://$WSO2_GATEWAY:$GREG_HTTPS_PORT/acs 37 | export GREG_REMOTE_URL=https://$WSO2_GATEWAY:$GREG_HTTPS_PORT/registry 38 | 39 | export MYSQL_VERSION=5.7.10 40 | export MYSQL_ROOT_PASSWORD=password 41 | 42 | # This function will copy the conf/common/authenticators.xml template to each component with the inlined parameters replaced 43 | # with appropriate values for each component. 44 | authenticatorConfig(){ 45 | basedir=`basename "$1"` 46 | 47 | if [ "$basedir" != "common" ] && [ "$basedir" != "mysql" ] && [ "$basedir" != "wso2is" ]; then 48 | cp conf/common/authenticators.xml conf/$basedir/authenticators.xml 49 | case "$basedir" in 50 | wso2am ) 51 | sp=$APIM_SSO_SERVICE_PROVIDER 52 | acs_url=$APIM_SSO_ACS_URL 53 | ;; 54 | wso2esb ) 55 | sp=$ESB_SSO_SERVICE_PROVIDER 56 | acs_url=$ESB_SSO_ACS_URL 57 | ;; 58 | wso2dss ) 59 | sp=$DSS_SSO_SERVICE_PROVIDER 60 | acs_url=$DSS_SSO_ACS_URL 61 | ;; 62 | wso2greg ) 63 | sp=$GREG_SSO_SERVICE_PROVIDER 64 | acs_url=$GREG_SSO_ACS_URL 65 | ;; 66 | esac 67 | sed -i "" \ 68 | -e "s/\$SSO_SERVICE_PROVIDER/$sp/g" \ 69 | -e "s|\$ACS_URL|$acs_url|g" \ 70 | -e "s|\$IS_SAML_SSO_URL|$IS_SAML_SSO_URL|g" \ 71 | conf/$basedir/authenticators.xml 72 | fi 73 | } 74 | 75 | for dir in conf/*; do 76 | if [ -d "$dir" ]; then 77 | authenticatorConfig "$dir" 78 | fi 79 | done 80 | 81 | find conf -type f -name '*.xml' -exec sed -i "" \ 82 | -e "s/\$WSO2_GATEWAY/$WSO2_GATEWAY/g" \ 83 | -e "s/\$APIM_SSO_SERVICE_PROVIDER/$APIM_SSO_SERVICE_PROVIDER/g" \ 84 | -e "s|\$APIM_SSO_ACS_URL|$APIM_SSO_ACS_URL|g" \ 85 | -e "s/\$ESB_SSO_SERVICE_PROVIDER/$ESB_SSO_SERVICE_PROVIDER/g" \ 86 | -e "s|\$ESB_SSO_ACS_URL|$ESB_SSO_ACS_URL|g" \ 87 | -e "s/\$DSS_SSO_SERVICE_PROVIDER/$DSS_SSO_SERVICE_PROVIDER/g" \ 88 | -e "s|\$DSS_SSO_ACS_URL|$DSS_SSO_ACS_URL|g" \ 89 | -e "s/\$GREG_SSO_SERVICE_PROVIDER/$GREG_SSO_SERVICE_PROVIDER/g" \ 90 | -e "s|\$GREG_SSO_ACS_URL|$GREG_SSO_ACS_URL|g" \ 91 | -e "s|\$GREG_REMOTE_URL|$GREG_REMOTE_URL|g" \ 92 | {} \; 93 | -------------------------------------------------------------------------------- /scripts/mysql/greg-init.sql: -------------------------------------------------------------------------------- 1 | CREATE DATABASE IF NOT EXISTS registrydb; 2 | -------------------------------------------------------------------------------- /scripts/mysql/is-init.sql: -------------------------------------------------------------------------------- 1 | CREATE DATABASE IF NOT EXISTS identitydb; 2 | 3 | GRANT ALL ON identitydb.* TO isadmin@'%' IDENTIFIED BY "password"; 4 | 5 | FLUSH PRIVILEGES; 6 | 7 | USE identitydb; 8 | 9 | CREATE TABLE IF NOT EXISTS REG_CLUSTER_LOCK ( 10 | REG_LOCK_NAME VARCHAR (20), 11 | REG_LOCK_STATUS VARCHAR (20), 12 | REG_LOCKED_TIME TIMESTAMP, 13 | REG_TENANT_ID INTEGER DEFAULT 0, 14 | PRIMARY KEY (REG_LOCK_NAME) 15 | )ENGINE INNODB; 16 | 17 | CREATE TABLE IF NOT EXISTS REG_LOG ( 18 | REG_LOG_ID INTEGER AUTO_INCREMENT, 19 | REG_PATH VARCHAR (750), 20 | REG_USER_ID VARCHAR (31) NOT NULL, 21 | REG_LOGGED_TIME TIMESTAMP NOT NULL, 22 | REG_ACTION INTEGER NOT NULL, 23 | REG_ACTION_DATA VARCHAR (500), 24 | REG_TENANT_ID INTEGER DEFAULT 0, 25 | PRIMARY KEY (REG_LOG_ID, REG_TENANT_ID) 26 | )ENGINE INNODB; 27 | 28 | -- The REG_PATH_VALUE should be less than 767 bytes, and hence was fixed at 750. 29 | -- See CARBON-5917. 30 | 31 | CREATE TABLE IF NOT EXISTS REG_PATH( 32 | REG_PATH_ID INTEGER NOT NULL AUTO_INCREMENT, 33 | REG_PATH_VALUE VARCHAR(750) NOT NULL, 34 | REG_PATH_PARENT_ID INTEGER, 35 | REG_TENANT_ID INTEGER DEFAULT 0, 36 | CONSTRAINT PK_REG_PATH PRIMARY KEY(REG_PATH_ID, REG_TENANT_ID) 37 | )ENGINE INNODB; 38 | 39 | CREATE INDEX REG_PATH_IND_BY_PATH_VALUE USING HASH ON REG_PATH(REG_PATH_VALUE, REG_TENANT_ID); 40 | CREATE INDEX REG_PATH_IND_BY_PATH_PARENT_ID USING HASH ON REG_PATH(REG_PATH_PARENT_ID, REG_TENANT_ID); 41 | 42 | CREATE TABLE IF NOT EXISTS REG_CONTENT ( 43 | REG_CONTENT_ID INTEGER NOT NULL AUTO_INCREMENT, 44 | REG_CONTENT_DATA LONGBLOB, 45 | REG_TENANT_ID INTEGER DEFAULT 0, 46 | CONSTRAINT PK_REG_CONTENT PRIMARY KEY(REG_CONTENT_ID, REG_TENANT_ID) 47 | )ENGINE INNODB; 48 | 49 | CREATE TABLE IF NOT EXISTS REG_CONTENT_HISTORY ( 50 | REG_CONTENT_ID INTEGER NOT NULL, 51 | REG_CONTENT_DATA LONGBLOB, 52 | REG_DELETED SMALLINT, 53 | REG_TENANT_ID INTEGER DEFAULT 0, 54 | CONSTRAINT PK_REG_CONTENT_HISTORY PRIMARY KEY(REG_CONTENT_ID, REG_TENANT_ID) 55 | )ENGINE INNODB; 56 | 57 | CREATE TABLE IF NOT EXISTS REG_RESOURCE ( 58 | REG_PATH_ID INTEGER NOT NULL, 59 | REG_NAME VARCHAR(256), 60 | REG_VERSION INTEGER NOT NULL AUTO_INCREMENT, 61 | REG_MEDIA_TYPE VARCHAR(500), 62 | REG_CREATOR VARCHAR(31) NOT NULL, 63 | REG_CREATED_TIME TIMESTAMP NOT NULL DEFAULT 0, 64 | REG_LAST_UPDATOR VARCHAR(31), 65 | REG_LAST_UPDATED_TIME TIMESTAMP NOT NULL DEFAULT 0, 66 | REG_DESCRIPTION VARCHAR(1000), 67 | REG_CONTENT_ID INTEGER, 68 | REG_TENANT_ID INTEGER DEFAULT 0, 69 | REG_UUID VARCHAR(100) NOT NULL, 70 | CONSTRAINT PK_REG_RESOURCE PRIMARY KEY(REG_VERSION, REG_TENANT_ID) 71 | )ENGINE INNODB; 72 | 73 | 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); 74 | 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); 75 | CREATE INDEX REG_RESOURCE_IND_BY_NAME USING HASH ON REG_RESOURCE(REG_NAME, REG_TENANT_ID); 76 | CREATE INDEX REG_RESOURCE_IND_BY_PATH_ID_NAME USING HASH ON REG_RESOURCE(REG_PATH_ID, REG_NAME, REG_TENANT_ID); 77 | 78 | CREATE TABLE IF NOT EXISTS REG_RESOURCE_HISTORY ( 79 | REG_PATH_ID INTEGER NOT NULL, 80 | REG_NAME VARCHAR(256), 81 | REG_VERSION INTEGER NOT NULL, 82 | REG_MEDIA_TYPE VARCHAR(500), 83 | REG_CREATOR VARCHAR(31) NOT NULL, 84 | REG_CREATED_TIME TIMESTAMP NOT NULL, 85 | REG_LAST_UPDATOR VARCHAR(31), 86 | REG_LAST_UPDATED_TIME TIMESTAMP NOT NULL, 87 | REG_DESCRIPTION VARCHAR(1000), 88 | REG_CONTENT_ID INTEGER, 89 | REG_DELETED SMALLINT, 90 | REG_TENANT_ID INTEGER DEFAULT 0, 91 | REG_UUID VARCHAR(100) NOT NULL, 92 | CONSTRAINT PK_REG_RESOURCE_HISTORY PRIMARY KEY(REG_VERSION, REG_TENANT_ID) 93 | )ENGINE INNODB; 94 | 95 | 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); 96 | 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); 97 | CREATE INDEX REG_RESOURCE_HISTORY_IND_BY_NAME USING HASH ON REG_RESOURCE_HISTORY(REG_NAME, REG_TENANT_ID); 98 | CREATE INDEX REG_RESOURCE_HISTORY_IND_BY_PATH_ID_NAME USING HASH ON REG_RESOURCE(REG_PATH_ID, REG_NAME, REG_TENANT_ID); 99 | 100 | CREATE TABLE IF NOT EXISTS REG_COMMENT ( 101 | REG_ID INTEGER NOT NULL AUTO_INCREMENT, 102 | REG_COMMENT_TEXT VARCHAR(500) NOT NULL, 103 | REG_USER_ID VARCHAR(31) NOT NULL, 104 | REG_COMMENTED_TIME TIMESTAMP NOT NULL, 105 | REG_TENANT_ID INTEGER DEFAULT 0, 106 | CONSTRAINT PK_REG_COMMENT PRIMARY KEY(REG_ID, REG_TENANT_ID) 107 | )ENGINE INNODB; 108 | 109 | CREATE TABLE IF NOT EXISTS REG_RESOURCE_COMMENT ( 110 | REG_COMMENT_ID INTEGER NOT NULL, 111 | REG_VERSION INTEGER, 112 | REG_PATH_ID INTEGER, 113 | REG_RESOURCE_NAME VARCHAR(256), 114 | REG_TENANT_ID INTEGER DEFAULT 0 115 | )ENGINE INNODB; 116 | 117 | 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); 118 | 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); 119 | 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); 120 | CREATE INDEX REG_RESOURCE_COMMENT_IND_BY_VERSION USING HASH ON REG_RESOURCE_COMMENT(REG_VERSION, REG_TENANT_ID); 121 | 122 | CREATE TABLE IF NOT EXISTS REG_RATING ( 123 | REG_ID INTEGER NOT NULL AUTO_INCREMENT, 124 | REG_RATING INTEGER NOT NULL, 125 | REG_USER_ID VARCHAR(31) NOT NULL, 126 | REG_RATED_TIME TIMESTAMP NOT NULL, 127 | REG_TENANT_ID INTEGER DEFAULT 0, 128 | CONSTRAINT PK_REG_RATING PRIMARY KEY(REG_ID, REG_TENANT_ID) 129 | )ENGINE INNODB; 130 | 131 | CREATE TABLE IF NOT EXISTS REG_RESOURCE_RATING ( 132 | REG_RATING_ID INTEGER NOT NULL, 133 | REG_VERSION INTEGER, 134 | REG_PATH_ID INTEGER, 135 | REG_RESOURCE_NAME VARCHAR(256), 136 | REG_TENANT_ID INTEGER DEFAULT 0 137 | )ENGINE INNODB; 138 | 139 | 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); 140 | 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); 141 | 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); 142 | CREATE INDEX REG_RESOURCE_RATING_IND_BY_VERSION USING HASH ON REG_RESOURCE_RATING(REG_VERSION, REG_TENANT_ID); 143 | 144 | 145 | CREATE TABLE IF NOT EXISTS REG_TAG ( 146 | REG_ID INTEGER NOT NULL AUTO_INCREMENT, 147 | REG_TAG_NAME VARCHAR(500) NOT NULL, 148 | REG_USER_ID VARCHAR(31) NOT NULL, 149 | REG_TAGGED_TIME TIMESTAMP NOT NULL, 150 | REG_TENANT_ID INTEGER DEFAULT 0, 151 | CONSTRAINT PK_REG_TAG PRIMARY KEY(REG_ID, REG_TENANT_ID) 152 | )ENGINE INNODB; 153 | 154 | CREATE TABLE IF NOT EXISTS REG_RESOURCE_TAG ( 155 | REG_TAG_ID INTEGER NOT NULL, 156 | REG_VERSION INTEGER, 157 | REG_PATH_ID INTEGER, 158 | REG_RESOURCE_NAME VARCHAR(256), 159 | REG_TENANT_ID INTEGER DEFAULT 0 160 | )ENGINE INNODB; 161 | 162 | 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); 163 | 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); 164 | 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); 165 | CREATE INDEX REG_RESOURCE_TAG_IND_BY_VERSION USING HASH ON REG_RESOURCE_TAG(REG_VERSION, REG_TENANT_ID); 166 | 167 | CREATE TABLE IF NOT EXISTS REG_PROPERTY ( 168 | REG_ID INTEGER NOT NULL AUTO_INCREMENT, 169 | REG_NAME VARCHAR(100) NOT NULL, 170 | REG_VALUE VARCHAR(1000), 171 | REG_TENANT_ID INTEGER DEFAULT 0, 172 | CONSTRAINT PK_REG_PROPERTY PRIMARY KEY(REG_ID, REG_TENANT_ID) 173 | )ENGINE INNODB; 174 | 175 | CREATE TABLE IF NOT EXISTS REG_RESOURCE_PROPERTY ( 176 | REG_PROPERTY_ID INTEGER NOT NULL, 177 | REG_VERSION INTEGER, 178 | REG_PATH_ID INTEGER, 179 | REG_RESOURCE_NAME VARCHAR(256), 180 | REG_TENANT_ID INTEGER DEFAULT 0 181 | )ENGINE INNODB; 182 | 183 | 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); 184 | 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); 185 | 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); 186 | CREATE INDEX REG_RESOURCE_PROPERTY_IND_BY_VERSION USING HASH ON REG_RESOURCE_PROPERTY(REG_VERSION, REG_TENANT_ID); 187 | 188 | -- CREATE TABLE IF NOT EXISTS REG_ASSOCIATIONS ( 189 | -- SRC_PATH_ID INTEGER, 190 | -- SRC_RESOURCE_NAME VARCHAR(256), 191 | -- SRC_VERSION INTEGER, 192 | -- TGT_PATH_ID INTEGER, 193 | -- TGT_RESOURCE_NAME VARCHAR(256), 194 | -- TGT_VERSION INTEGER 195 | -- )ENGINE INNODB; 196 | -- 197 | -- ALTER TABLE REG_ASSOCIATIONS ADD CONSTRAINT REG_ASSOCIATIONS_FK_BY_SRC_PATH_ID FOREIGN KEY (SRC_PATH_ID) REFERENCES REG_PATH (PATH_ID); 198 | -- ALTER TABLE REG_ASSOCIATIONS ADD CONSTRAINT REG_ASSOCIATIONS_FK_BY_TGT_PATH_ID FOREIGN KEY (TGT_PATH_ID) REFERENCES REG_PATH (PATH_ID); 199 | -- CREATE INDEX REG_ASSOCIATIONS_IND_BY_SRC_VERSION ON REG_ASSOCIATIONS(SRC_VERSION); 200 | -- CREATE INDEX REG_ASSOCIATIONS_IND_BY_TGT_VERSION ON REG_ASSOCIATIONS(TGT_VERSION); 201 | -- CREATE INDEX REG_ASSOCIATIONS_IND_BY_SRC_RESOURCE_NAME ON REG_ASSOCIATIONS(SRC_RESOURCE_NAME); 202 | -- CREATE INDEX REG_ASSOCIATIONS_IND_BY_TGT_RESOURCE_NAME ON REG_ASSOCIATIONS(TGT_RESOURCE_NAME); 203 | 204 | 205 | 206 | CREATE TABLE IF NOT EXISTS REG_ASSOCIATION ( 207 | REG_ASSOCIATION_ID INTEGER AUTO_INCREMENT, 208 | REG_SOURCEPATH VARCHAR (750) NOT NULL, 209 | REG_TARGETPATH VARCHAR (750) NOT NULL, 210 | REG_ASSOCIATION_TYPE VARCHAR (2000) NOT NULL, 211 | REG_TENANT_ID INTEGER DEFAULT 0, 212 | PRIMARY KEY (REG_ASSOCIATION_ID, REG_TENANT_ID) 213 | )ENGINE INNODB; 214 | 215 | CREATE TABLE IF NOT EXISTS REG_SNAPSHOT ( 216 | REG_SNAPSHOT_ID INTEGER NOT NULL AUTO_INCREMENT, 217 | REG_PATH_ID INTEGER NOT NULL, 218 | REG_RESOURCE_NAME VARCHAR(255), 219 | REG_RESOURCE_VIDS LONGBLOB NOT NULL, 220 | REG_TENANT_ID INTEGER DEFAULT 0, 221 | CONSTRAINT PK_REG_SNAPSHOT PRIMARY KEY(REG_SNAPSHOT_ID, REG_TENANT_ID) 222 | )ENGINE INNODB; 223 | 224 | 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); 225 | 226 | 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); 227 | 228 | 229 | -- ################################ 230 | -- USER MANAGER TABLES 231 | -- ################################ 232 | 233 | CREATE TABLE UM_TENANT ( 234 | UM_ID INTEGER NOT NULL AUTO_INCREMENT, 235 | UM_DOMAIN_NAME VARCHAR(255) NOT NULL, 236 | UM_EMAIL VARCHAR(255), 237 | UM_ACTIVE BOOLEAN DEFAULT FALSE, 238 | UM_CREATED_DATE TIMESTAMP NOT NULL, 239 | UM_USER_CONFIG LONGBLOB, 240 | PRIMARY KEY (UM_ID), 241 | UNIQUE(UM_DOMAIN_NAME) 242 | )ENGINE INNODB; 243 | 244 | CREATE TABLE UM_DOMAIN( 245 | UM_DOMAIN_ID INTEGER NOT NULL AUTO_INCREMENT, 246 | UM_DOMAIN_NAME VARCHAR(255), 247 | UM_TENANT_ID INTEGER DEFAULT 0, 248 | PRIMARY KEY (UM_DOMAIN_ID, UM_TENANT_ID) 249 | )ENGINE INNODB; 250 | 251 | CREATE UNIQUE INDEX INDEX_UM_TENANT_UM_DOMAIN_NAME 252 | ON UM_TENANT (UM_DOMAIN_NAME); 253 | 254 | CREATE TABLE UM_USER ( 255 | UM_ID INTEGER NOT NULL AUTO_INCREMENT, 256 | UM_USER_NAME VARCHAR(255) NOT NULL, 257 | UM_USER_PASSWORD VARCHAR(255) NOT NULL, 258 | UM_SALT_VALUE VARCHAR(31), 259 | UM_REQUIRE_CHANGE BOOLEAN DEFAULT FALSE, 260 | UM_CHANGED_TIME TIMESTAMP NOT NULL, 261 | UM_TENANT_ID INTEGER DEFAULT 0, 262 | PRIMARY KEY (UM_ID, UM_TENANT_ID), 263 | UNIQUE(UM_USER_NAME, UM_TENANT_ID) 264 | )ENGINE INNODB; 265 | 266 | CREATE TABLE UM_SYSTEM_USER ( 267 | UM_ID INTEGER NOT NULL AUTO_INCREMENT, 268 | UM_USER_NAME VARCHAR(255) NOT NULL, 269 | UM_USER_PASSWORD VARCHAR(255) NOT NULL, 270 | UM_SALT_VALUE VARCHAR(31), 271 | UM_REQUIRE_CHANGE BOOLEAN DEFAULT FALSE, 272 | UM_CHANGED_TIME TIMESTAMP NOT NULL, 273 | UM_TENANT_ID INTEGER DEFAULT 0, 274 | PRIMARY KEY (UM_ID, UM_TENANT_ID), 275 | UNIQUE(UM_USER_NAME, UM_TENANT_ID) 276 | )ENGINE INNODB; 277 | 278 | CREATE TABLE UM_ROLE ( 279 | UM_ID INTEGER NOT NULL AUTO_INCREMENT, 280 | UM_ROLE_NAME VARCHAR(255) NOT NULL, 281 | UM_TENANT_ID INTEGER DEFAULT 0, 282 | UM_SHARED_ROLE BOOLEAN DEFAULT FALSE, 283 | PRIMARY KEY (UM_ID, UM_TENANT_ID), 284 | UNIQUE(UM_ROLE_NAME, UM_TENANT_ID) 285 | )ENGINE INNODB; 286 | 287 | 288 | CREATE TABLE UM_MODULE( 289 | UM_ID INTEGER NOT NULL AUTO_INCREMENT, 290 | UM_MODULE_NAME VARCHAR(100), 291 | UNIQUE(UM_MODULE_NAME), 292 | PRIMARY KEY(UM_ID) 293 | )ENGINE INNODB; 294 | 295 | CREATE TABLE UM_MODULE_ACTIONS( 296 | UM_ACTION VARCHAR(255) NOT NULL, 297 | UM_MODULE_ID INTEGER NOT NULL, 298 | PRIMARY KEY(UM_ACTION, UM_MODULE_ID), 299 | FOREIGN KEY (UM_MODULE_ID) REFERENCES UM_MODULE(UM_ID) ON DELETE CASCADE 300 | )ENGINE INNODB; 301 | 302 | CREATE TABLE UM_PERMISSION ( 303 | UM_ID INTEGER NOT NULL AUTO_INCREMENT, 304 | UM_RESOURCE_ID VARCHAR(255) NOT NULL, 305 | UM_ACTION VARCHAR(255) NOT NULL, 306 | UM_TENANT_ID INTEGER DEFAULT 0, 307 | UM_MODULE_ID INTEGER DEFAULT 0, 308 | PRIMARY KEY (UM_ID, UM_TENANT_ID) 309 | )ENGINE INNODB; 310 | 311 | CREATE INDEX INDEX_UM_PERMISSION_UM_RESOURCE_ID_UM_ACTION ON UM_PERMISSION (UM_RESOURCE_ID, UM_ACTION, UM_TENANT_ID); 312 | 313 | CREATE TABLE UM_ROLE_PERMISSION ( 314 | UM_ID INTEGER NOT NULL AUTO_INCREMENT, 315 | UM_PERMISSION_ID INTEGER NOT NULL, 316 | UM_ROLE_NAME VARCHAR(255) NOT NULL, 317 | UM_IS_ALLOWED SMALLINT NOT NULL, 318 | UM_TENANT_ID INTEGER DEFAULT 0, 319 | UM_DOMAIN_ID INTEGER, 320 | UNIQUE (UM_PERMISSION_ID, UM_ROLE_NAME, UM_TENANT_ID, UM_DOMAIN_ID), 321 | FOREIGN KEY (UM_PERMISSION_ID, UM_TENANT_ID) REFERENCES UM_PERMISSION(UM_ID, UM_TENANT_ID), 322 | FOREIGN KEY (UM_DOMAIN_ID, UM_TENANT_ID) REFERENCES UM_DOMAIN(UM_DOMAIN_ID, UM_TENANT_ID) ON DELETE CASCADE, 323 | PRIMARY KEY (UM_ID, UM_TENANT_ID) 324 | )ENGINE INNODB; 325 | 326 | -- REMOVED UNIQUE (UM_PERMISSION_ID, UM_ROLE_ID) 327 | CREATE TABLE UM_USER_PERMISSION ( 328 | UM_ID INTEGER NOT NULL AUTO_INCREMENT, 329 | UM_PERMISSION_ID INTEGER NOT NULL, 330 | UM_USER_NAME VARCHAR(255) NOT NULL, 331 | UM_IS_ALLOWED SMALLINT NOT NULL, 332 | UM_TENANT_ID INTEGER DEFAULT 0, 333 | FOREIGN KEY (UM_PERMISSION_ID, UM_TENANT_ID) REFERENCES UM_PERMISSION(UM_ID, UM_TENANT_ID), 334 | PRIMARY KEY (UM_ID, UM_TENANT_ID) 335 | )ENGINE INNODB; 336 | 337 | -- REMOVED UNIQUE (UM_PERMISSION_ID, UM_USER_ID) 338 | CREATE TABLE UM_USER_ROLE ( 339 | UM_ID INTEGER NOT NULL AUTO_INCREMENT, 340 | UM_ROLE_ID INTEGER NOT NULL, 341 | UM_USER_ID INTEGER NOT NULL, 342 | UM_TENANT_ID INTEGER DEFAULT 0, 343 | UNIQUE (UM_USER_ID, UM_ROLE_ID, UM_TENANT_ID), 344 | FOREIGN KEY (UM_ROLE_ID, UM_TENANT_ID) REFERENCES UM_ROLE(UM_ID, UM_TENANT_ID), 345 | FOREIGN KEY (UM_USER_ID, UM_TENANT_ID) REFERENCES UM_USER(UM_ID, UM_TENANT_ID), 346 | PRIMARY KEY (UM_ID, UM_TENANT_ID) 347 | )ENGINE INNODB; 348 | 349 | CREATE TABLE UM_SHARED_USER_ROLE( 350 | UM_ROLE_ID INTEGER NOT NULL, 351 | UM_USER_ID INTEGER NOT NULL, 352 | UM_USER_TENANT_ID INTEGER NOT NULL, 353 | UM_ROLE_TENANT_ID INTEGER NOT NULL, 354 | UNIQUE(UM_USER_ID,UM_ROLE_ID,UM_USER_TENANT_ID, UM_ROLE_TENANT_ID), 355 | FOREIGN KEY(UM_ROLE_ID,UM_ROLE_TENANT_ID) REFERENCES UM_ROLE(UM_ID,UM_TENANT_ID) ON DELETE CASCADE, 356 | FOREIGN KEY(UM_USER_ID,UM_USER_TENANT_ID) REFERENCES UM_USER(UM_ID,UM_TENANT_ID) ON DELETE CASCADE 357 | )ENGINE INNODB; 358 | 359 | CREATE TABLE UM_ACCOUNT_MAPPING( 360 | UM_ID INTEGER NOT NULL AUTO_INCREMENT, 361 | UM_USER_NAME VARCHAR(255) NOT NULL, 362 | UM_TENANT_ID INTEGER NOT NULL, 363 | UM_USER_STORE_DOMAIN VARCHAR(100), 364 | UM_ACC_LINK_ID INTEGER NOT NULL, 365 | UNIQUE(UM_USER_NAME, UM_TENANT_ID, UM_USER_STORE_DOMAIN, UM_ACC_LINK_ID), 366 | FOREIGN KEY (UM_TENANT_ID) REFERENCES UM_TENANT(UM_ID) ON DELETE CASCADE, 367 | PRIMARY KEY (UM_ID) 368 | )ENGINE INNODB; 369 | 370 | 371 | CREATE TABLE UM_USER_ATTRIBUTE ( 372 | UM_ID INTEGER NOT NULL AUTO_INCREMENT, 373 | UM_ATTR_NAME VARCHAR(255) NOT NULL, 374 | UM_ATTR_VALUE VARCHAR(1024), 375 | UM_PROFILE_ID VARCHAR(255), 376 | UM_USER_ID INTEGER, 377 | UM_TENANT_ID INTEGER DEFAULT 0, 378 | FOREIGN KEY (UM_USER_ID, UM_TENANT_ID) REFERENCES UM_USER(UM_ID, UM_TENANT_ID), 379 | PRIMARY KEY (UM_ID, UM_TENANT_ID) 380 | )ENGINE INNODB; 381 | 382 | 383 | 384 | CREATE TABLE UM_DIALECT( 385 | UM_ID INTEGER NOT NULL AUTO_INCREMENT, 386 | UM_DIALECT_URI VARCHAR(255) NOT NULL, 387 | UM_TENANT_ID INTEGER DEFAULT 0, 388 | UNIQUE(UM_DIALECT_URI, UM_TENANT_ID), 389 | PRIMARY KEY (UM_ID, UM_TENANT_ID) 390 | )ENGINE INNODB; 391 | 392 | CREATE TABLE UM_CLAIM( 393 | UM_ID INTEGER NOT NULL AUTO_INCREMENT, 394 | UM_DIALECT_ID INTEGER NOT NULL, 395 | UM_CLAIM_URI VARCHAR(255) NOT NULL, 396 | UM_DISPLAY_TAG VARCHAR(255), 397 | UM_DESCRIPTION VARCHAR(255), 398 | UM_MAPPED_ATTRIBUTE_DOMAIN VARCHAR(255), 399 | UM_MAPPED_ATTRIBUTE VARCHAR(255), 400 | UM_REG_EX VARCHAR(255), 401 | UM_SUPPORTED SMALLINT, 402 | UM_REQUIRED SMALLINT, 403 | UM_DISPLAY_ORDER INTEGER, 404 | UM_CHECKED_ATTRIBUTE SMALLINT, 405 | UM_READ_ONLY SMALLINT, 406 | UM_TENANT_ID INTEGER DEFAULT 0, 407 | UNIQUE(UM_DIALECT_ID, UM_CLAIM_URI, UM_TENANT_ID,UM_MAPPED_ATTRIBUTE_DOMAIN), 408 | FOREIGN KEY(UM_DIALECT_ID, UM_TENANT_ID) REFERENCES UM_DIALECT(UM_ID, UM_TENANT_ID), 409 | PRIMARY KEY (UM_ID, UM_TENANT_ID) 410 | )ENGINE INNODB; 411 | 412 | 413 | CREATE TABLE UM_PROFILE_CONFIG( 414 | UM_ID INTEGER NOT NULL AUTO_INCREMENT, 415 | UM_DIALECT_ID INTEGER NOT NULL, 416 | UM_PROFILE_NAME VARCHAR(255), 417 | UM_TENANT_ID INTEGER DEFAULT 0, 418 | FOREIGN KEY(UM_DIALECT_ID, UM_TENANT_ID) REFERENCES UM_DIALECT(UM_ID, UM_TENANT_ID), 419 | PRIMARY KEY (UM_ID, UM_TENANT_ID) 420 | )ENGINE INNODB; 421 | 422 | 423 | CREATE TABLE UM_HYBRID_ROLE( 424 | UM_ID INTEGER NOT NULL AUTO_INCREMENT, 425 | UM_ROLE_NAME VARCHAR(255), 426 | UM_TENANT_ID INTEGER DEFAULT 0, 427 | PRIMARY KEY (UM_ID, UM_TENANT_ID) 428 | )ENGINE INNODB; 429 | 430 | CREATE TABLE UM_HYBRID_USER_ROLE( 431 | UM_ID INTEGER NOT NULL AUTO_INCREMENT, 432 | UM_USER_NAME VARCHAR(255), 433 | UM_ROLE_ID INTEGER NOT NULL, 434 | UM_TENANT_ID INTEGER DEFAULT 0, 435 | UM_DOMAIN_ID INTEGER, 436 | UNIQUE (UM_USER_NAME, UM_ROLE_ID, UM_TENANT_ID, UM_DOMAIN_ID), 437 | FOREIGN KEY (UM_ROLE_ID, UM_TENANT_ID) REFERENCES UM_HYBRID_ROLE(UM_ID, UM_TENANT_ID), 438 | FOREIGN KEY (UM_DOMAIN_ID, UM_TENANT_ID) REFERENCES UM_DOMAIN(UM_DOMAIN_ID, UM_TENANT_ID) ON DELETE CASCADE, 439 | PRIMARY KEY (UM_ID, UM_TENANT_ID) 440 | )ENGINE INNODB; 441 | 442 | CREATE TABLE UM_SYSTEM_ROLE( 443 | UM_ID INTEGER NOT NULL AUTO_INCREMENT, 444 | UM_ROLE_NAME VARCHAR(255), 445 | UM_TENANT_ID INTEGER DEFAULT 0, 446 | PRIMARY KEY (UM_ID, UM_TENANT_ID) 447 | )ENGINE INNODB; 448 | 449 | CREATE TABLE UM_SYSTEM_USER_ROLE( 450 | UM_ID INTEGER NOT NULL AUTO_INCREMENT, 451 | UM_USER_NAME VARCHAR(255), 452 | UM_ROLE_ID INTEGER NOT NULL, 453 | UM_TENANT_ID INTEGER DEFAULT 0, 454 | UNIQUE (UM_USER_NAME, UM_ROLE_ID, UM_TENANT_ID), 455 | FOREIGN KEY (UM_ROLE_ID, UM_TENANT_ID) REFERENCES UM_SYSTEM_ROLE(UM_ID, UM_TENANT_ID), 456 | PRIMARY KEY (UM_ID, UM_TENANT_ID) 457 | )ENGINE INNODB; 458 | 459 | 460 | CREATE TABLE UM_HYBRID_REMEMBER_ME( 461 | UM_ID INTEGER NOT NULL AUTO_INCREMENT, 462 | UM_USER_NAME VARCHAR(255) NOT NULL, 463 | UM_COOKIE_VALUE VARCHAR(1024), 464 | UM_CREATED_TIME TIMESTAMP, 465 | UM_TENANT_ID INTEGER DEFAULT 0, 466 | PRIMARY KEY (UM_ID, UM_TENANT_ID) 467 | )ENGINE INNODB; 468 | --------------------------------------------------------------------------------