application-manager-new
Rasika Perera 8 years ago
commit 2825269e4b

@ -753,6 +753,13 @@
<filtered>true</filtered>
<fileMode>644</fileMode>
</file>
<file>
<source>../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/registry-event-broker.xml
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/conf/</outputDirectory>
<filtered>true</filtered>
<fileMode>644</fileMode>
</file>
<file>
<source>INSTALL.txt</source>
<outputDirectory>${pom.artifactId}-${pom.version}</outputDirectory>
@ -1188,6 +1195,15 @@
</outputDirectory>
<fileMode>755</fileMode>
</file>
<!--akka conf files-->
<file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/etc/bundle-config/com.typesafe.config/reference.conf
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/conf/etc/bundle-config/com.typesafe.config/
</outputDirectory>
<fileMode>644</fileMode>
</file>
<!--Analytics REST APIs WebApp -->
<file>
<source>

@ -21,7 +21,7 @@ product.version=1.0.0-SNAPSHOT
product.key=IOT
hotdeployment=true
hotupdate=true
carbon.version=4.4.3
carbon.version=4.4.9
default.server.role=IoTServer
cep.server.role=ComplexEventProcessor
das.server.role=DataAnalyticsServer

@ -162,7 +162,7 @@ set CARBON_CLASSPATH=.\lib;%CARBON_CLASSPATH%
set JAVA_ENDORSED=".\lib\endorsed";"%JAVA_HOME%\jre\lib\endorsed";"%JAVA_HOME%\lib\endorsed"
set CMD_LINE_ARGS=-Xbootclasspath/a:%CARBON_XBOOTCLASSPATH% -Xms256m -Xmx1024m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath="%CARBON_HOME%\repository\logs\heap-dump.hprof" -Dcom.sun.management.jmxremote -classpath %CARBON_CLASSPATH% %JAVA_OPTS% -Djava.endorsed.dirs=%JAVA_ENDORSED% -Dcarbon.registry.root=/ -Dcarbon.home="%CARBON_HOME%" -Dwso2.server.standalone=true -Djava.command="%JAVA_HOME%\bin\java" -Djava.opts="%JAVA_OPTS%" -Djava.io.tmpdir="%CARBON_HOME%\tmp" -Dcatalina.base="%CARBON_HOME%\lib\tomcat" -Dwso2.carbon.xml=%CARBON_HOME%\repository\conf\carbon.xml -Dwso2.registry.xml="%CARBON_HOME%\repository\conf\registry.xml" -Dwso2.user.mgt.xml="%CARBON_HOME%\repository\conf\user-mgt.xml" -Dwso2.transports.xml="%CARBON_HOME%\repository\conf\mgt-transports.xml" -Djava.util.logging.config.file="%CARBON_HOME%\repository\conf\etc\logging-bridge.properties" -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Dcarbon.config.dir.path="%CARBON_HOME%\repository\conf" -Dcomponents.repo="%CARBON_HOME%\repository\components" -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 -Dcarbon.classpath=%CARBON_CLASSPATH% -Dfile.encoding=UTF8
set CMD_LINE_ARGS=-Xbootclasspath/a:%CARBON_XBOOTCLASSPATH% -Xms256m -Xmx1024m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath="%CARBON_HOME%\repository\logs\heap-dump.hprof" -Dcom.sun.management.jmxremote -classpath %CARBON_CLASSPATH% %JAVA_OPTS% -Djava.endorsed.dirs=%JAVA_ENDORSED% -Dcarbon.registry.root=/ -Dcarbon.home="%CARBON_HOME%" -Dwso2.server.standalone=true -Djava.command="%JAVA_HOME%\bin\java" -Djava.opts="%JAVA_OPTS%" -Djava.io.tmpdir="%CARBON_HOME%\tmp" -Dcatalina.base="%CARBON_HOME%\lib\tomcat" -Dwso2.carbon.xml=%CARBON_HOME%\repository\conf\carbon.xml -Dwso2.registry.xml="%CARBON_HOME%\repository\conf\registry.xml" -Dwso2.user.mgt.xml="%CARBON_HOME%\repository\conf\user-mgt.xml" -Dwso2.transports.xml="%CARBON_HOME%\repository\conf\mgt-transports.xml" -Djava.util.logging.config.file="%CARBON_HOME%\repository\conf\etc\logging-bridge.properties" -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Dcarbon.config.dir.path="%CARBON_HOME%\repository\conf" -Dcomponents.repo="%CARBON_HOME%\repository\components" -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 -Dcarbon.classpath=%CARBON_CLASSPATH% -Dfile.encoding=UTF8 -Dorg.wso2.ignoreHostnameVerification=true
:runJava
echo JAVA_HOME environment variable is set to %JAVA_HOME%

@ -304,6 +304,7 @@ do
-Djava.net.preferIPv4Stack=true \
-Dcom.ibm.cacheLocalHost=true \
-DworkerNode=false \
-Dorg.wso2.ignoreHostnameVerification=true \
org.wso2.carbon.bootstrap.Bootstrap $*
status=$?
done

@ -1,22 +1,4 @@
<?xml version="1.0"?>
<!--
~ Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~
~ WSO2 Inc. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except
~ in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<APIManager>
<!--
JNDI name of the data source to be used by the API publisher, API store and API
@ -26,7 +8,7 @@
<DataSourceName>jdbc/WSO2AM_DB</DataSourceName>
<!-- This parameter is used when adding api management capability to other products like GReg, AS, DSS etc.-->
<GatewayType>Synapse</GatewayType>
<GatewayType>None</GatewayType>
<!-- This parameter is used to enable the securevault support when try to publish endpoint secured APIs. Values should be "true" or "false".
By default secure vault is disabled.-->
@ -94,7 +76,7 @@
jwt token, he needs to enable this parameter.
The DefaultClaimsRetriever class adds user claims from the default carbon user store.
-->
<ClaimsRetrieverImplClass>org.wso2.carbon.apimgt.impl.token.DefaultClaimsRetriever</ClaimsRetrieverImplClass>
<!--ClaimsRetrieverImplClass>org.wso2.carbon.apimgt.impl.token.DefaultClaimsRetriever</ClaimsRetrieverImplClass-->
<!--
The dialectURI under which the claimURIs that need to be appended to the
@ -102,17 +84,17 @@
same value is used in the keys for appending the default properties to the
JWT.
-->
<ConsumerDialectURI>http://wso2.org/claims</ConsumerDialectURI>
<!--ConsumerDialectURI>http://wso2.org/claims</ConsumerDialectURI-->
<!--
Signature algorithm. Accepts "SHA256withRSA" or "NONE". To disable signing explicitly specify "NONE".
-->
<SignatureAlgorithm>SHA256withRSA</SignatureAlgorithm>
<!--SignatureAlgorithm>SHA256withRSA</SignatureAlgorithm-->
<!--
Enable/Disable JWT generation. Default is false.
-->
<EnableTokenGeneration>true</EnableTokenGeneration>
<!--EnableTokenGeneration>false</EnableTokenGeneration-->
<!--
Remove OAuth headers from outgoing message or keep with it.
@ -310,12 +292,12 @@
-ThriftServerHost - Allows to configure a hostname for the thrift server. It uses the carbon hostname by default.
-->
<KeyValidatorClientType>WSClient</KeyValidatorClientType>
<KeyValidatorClientType>ThriftClient</KeyValidatorClientType>
<ThriftClientPort>10397</ThriftClientPort>
<ThriftClientConnectionTimeOut>10000</ThriftClientConnectionTimeOut>
<ThriftServerPort>10397</ThriftServerPort>
<!--ThriftServerHost>localhost</ThriftServerHost-->
<EnableThriftServer>false</EnableThriftServer>
<EnableThriftServer>true</EnableThriftServer>
<!--
Scope used for marking Application Tokens. If a token is generated with this scope, they will be treated as Application Access Tokens
@ -352,12 +334,19 @@
org.wso2.carbon.identity.oauth.tokenprocessor.EncryptionDecryptionPersistenceProcessor in the identity.xml -->
<EncryptPersistedTokens>false</EncryptPersistedTokens>
<ScopeWhitelist>
<Scope>device_scope</Scope>
</ScopeWhitelist>
</APIKeyValidator>
<APIKeyManager>
<KeyManagerClientImpl>org.wso2.carbon.apimgt.impl.AMDefaultKeyManagerImpl</KeyManagerClientImpl>
<Configuration>
<ServerURL>https://localhost:${mgt.transport.https.port}${carbon.context}services/</ServerURL>
<Username>${admin.username}</Username>
<Password>${admin.password}</Password>
<TokenURL>https://${carbon.local.ip}:${mgt.transport.https.port}/oauth2/token</TokenURL>
<RevokeURL>https://${carbon.local.ip}:${mgt.transport.https.port}/oauth2/revoke</RevokeURL>
</Configuration>
</APIKeyManager>
<!--
Settings related to managing API access tiers.
-->
@ -531,8 +520,7 @@
<!--The value of the Access-Control-Allow-Origin header. Default values are
API Store addresses, which is needed for swagger to function.-->
<Access-Control-Allow-Origin>https://localhost:9443,http://localhost:9763
</Access-Control-Allow-Origin>
<Access-Control-Allow-Origin>https://localhost:9443,http://localhost:9763</Access-Control-Allow-Origin>
<!--Configure Access-Control-Allow-Headers-->
<Access-Control-Allow-Headers>authorization,Access-Control-Allow-Origin,Content-Type</Access-Control-Allow-Headers>
@ -542,4 +530,4 @@
You can enable this and set preferable Logger name.
-->
<!--VelocityLogger>VELOCITY</VelocityLogger-->
</APIManager>
</APIManager>

@ -17,6 +17,8 @@ CREATE TABLE IF NOT EXISTS IDN_OAUTH_CONSUMER_APPS (
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',
CONSTRAINT CONSUMER_KEY_CONSTRAINT UNIQUE (CONSUMER_KEY),
PRIMARY KEY (ID)
);
@ -88,6 +90,8 @@ CREATE TABLE IF NOT EXISTS IDN_OAUTH2_AUTHORIZATION_CODE (
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
);
@ -199,7 +203,7 @@ CREATE TABLE IDN_AUTH_SESSION_STORE (
SESSION_OBJECT BLOB,
TIME_CREATED BIGINT,
TENANT_ID INTEGER DEFAULT -1,
PRIMARY KEY (SESSION_ID, SESSION_TYPE, TIME_CREATED, OPERATION)
PRIMARY KEY (SESSION_ID, SESSION_TYPE, TIME_CREATED, OPERATION)
);
CREATE TABLE IF NOT EXISTS SP_APP (
ID INTEGER NOT NULL AUTO_INCREMENT,
@ -331,6 +335,7 @@ CREATE TABLE IF NOT EXISTS IDP (
DISPLAY_NAME VARCHAR(255),
PRIMARY KEY (ID),
UNIQUE (TENANT_ID, NAME));
INSERT INTO IDP (TENANT_ID, NAME, HOME_REALM_ID) VALUES (-1234, 'LOCAL', 'localhost');
CREATE TABLE IF NOT EXISTS IDP_ROLE (
@ -410,8 +415,7 @@ CREATE TABLE IF NOT EXISTS IDP_AUTHENTICATOR_PROPERTY (
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
);
FOREIGN KEY (AUTHENTICATOR_ID) REFERENCES IDP_AUTHENTICATOR(ID) ON DELETE CASCADE);
INSERT INTO IDP_AUTHENTICATOR_PROPERTY (TENANT_ID, AUTHENTICATOR_ID, PROPERTY_KEY,PROPERTY_VALUE, IS_SECRET ) VALUES (-1234, 1 , 'IdPEntityId', 'localhost', '0');
INSERT INTO IDP_AUTHENTICATOR_PROPERTY (TENANT_ID, AUTHENTICATOR_ID, PROPERTY_KEY,PROPERTY_VALUE, IS_SECRET ) VALUES (-1234, 3 , 'IdPEntityId', 'localhost', '0');
@ -465,7 +469,6 @@ CREATE TABLE IF NOT EXISTS IDP_LOCAL_CLAIM (
UNIQUE (TENANT_ID, IDP_ID, CLAIM_URI),
FOREIGN KEY (IDP_ID) REFERENCES IDP(ID) ON DELETE CASCADE);
CREATE TABLE IF NOT EXISTS IDN_ASSOCIATED_ID (
ID INTEGER AUTO_INCREMENT,
IDP_USER_ID VARCHAR(255) NOT NULL,
@ -508,8 +511,8 @@ CREATE TABLE IF NOT EXISTS WF_REQUEST (
CREATE TABLE IF NOT EXISTS WF_BPS_PROFILE (
PROFILE_NAME VARCHAR(45),
HOST_URL_MANAGER VARCHAR(45),
HOST_URL_WORKER VARCHAR(45),
HOST_URL_MANAGER VARCHAR(255),
HOST_URL_WORKER VARCHAR(255),
USERNAME VARCHAR(45),
PASSWORD VARCHAR(255),
CALLBACK_HOST VARCHAR (45),
@ -613,6 +616,7 @@ CREATE TABLE IF NOT EXISTS AM_API (
API_VERSION VARCHAR(30),
CONTEXT VARCHAR(256),
CONTEXT_TEMPLATE VARCHAR(256),
API_TIER VARCHAR(256),
PRIMARY KEY(API_ID),
CREATED_BY VARCHAR(100),
CREATED_TIME TIMESTAMP,
@ -777,4 +781,209 @@ CREATE TABLE IF NOT EXISTS AM_API_DEFAULT_VERSION (
CREATE INDEX IDX_SUB_APP_ID ON AM_SUBSCRIPTION (APPLICATION_ID, SUBSCRIPTION_ID);
-- End of API-MGT Tables --
CREATE TABLE IF NOT EXISTS AM_ALERT_TYPES (
ALERT_TYPE_ID INTEGER AUTO_INCREMENT,
ALERT_TYPE_NAME VARCHAR(256) NOT NULL ,
STAKE_HOLDER VARCHAR(100) NOT NULL,
PRIMARY KEY (ALERT_TYPE_ID)
);
CREATE TABLE IF NOT EXISTS AM_ALERT_TYPES_VALUES (
ALERT_TYPE_ID INTEGER,
USER_NAME VARCHAR(256) NOT NULL ,
STAKE_HOLDER VARCHAR(100) NOT NULL ,
CONSTRAINT AM_ALERT_TYPES_VALUES_CONSTRAINT UNIQUE (ALERT_TYPE_ID,USER_NAME,STAKE_HOLDER)
);
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),
CONSTRAINT AM_ALERT_EMAILLIST_CONSTRAINT UNIQUE (EMAIL_LIST_ID,USER_NAME,STAKE_HOLDER)
);
CREATE TABLE IF NOT EXISTS AM_ALERT_EMAILLIST_DETAILS (
EMAIL_LIST_ID INTEGER,
EMAIL VARCHAR(255),
CONSTRAINT AM_ALERT_EMAILLIST_DETAILS_CONSTRAINT UNIQUE (EMAIL_LIST_ID,EMAIL)
);
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)
);
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)
);
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)
);
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)
);
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
);
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
);
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
);
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
);
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),
FOREIGN KEY (CONDITION_GROUP_ID) REFERENCES AM_CONDITION_GROUP (CONDITION_GROUP_ID) ON DELETE CASCADE ON UPDATE CASCADE);
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)
);
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));
CREATE TABLE `AM_BLOCK_CONDITIONS` (
`CONDITION_ID` int(11) NOT NULL AUTO_INCREMENT,
`TYPE` varchar(45) DEFAULT NULL,
`VALUE` varchar(45) DEFAULT NULL,
`ENABLED` varchar(45) DEFAULT NULL,
`DOMAIN` varchar(45) DEFAULT NULL,
`UUID` VARCHAR(256),
PRIMARY KEY (`CONDITION_ID`),
UNIQUE (UUID)
);
-- End of API-MGT Tables --

@ -19,6 +19,8 @@ CREATE TABLE IDN_OAUTH_CONSUMER_APPS (
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',
CONSTRAINT CONSUMER_KEY_CONSTRAINT UNIQUE (CONSUMER_KEY),
PRIMARY KEY (ID)
);
@ -97,6 +99,8 @@ CREATE TABLE IDN_OAUTH2_AUTHORIZATION_CODE (
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
);
@ -242,9 +246,8 @@ CREATE TABLE SP_APP (
SUBJECT_CLAIM_URI VARCHAR (512),
IS_SAAS_APP CHAR(1) DEFAULT '0',
IS_DUMB_MODE CHAR(1) DEFAULT '0',
PRIMARY KEY (ID));
ALTER TABLE SP_APP ADD CONSTRAINT APPLICATION_NAME_CONSTRAINT UNIQUE(APP_NAME, TENANT_ID);
PRIMARY KEY (ID),
CONSTRAINT APPLICATION_NAME_CONSTRAINT UNIQUE(APP_NAME, TENANT_ID));
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[SP_METADATA]') AND TYPE IN (N'U'))
CREATE TABLE SP_METADATA (
@ -267,9 +270,8 @@ CREATE TABLE SP_INBOUND_AUTH (
PROP_NAME VARCHAR (255),
PROP_VALUE VARCHAR (1024) ,
APP_ID INTEGER NOT NULL,
PRIMARY KEY (ID));
ALTER TABLE SP_INBOUND_AUTH ADD CONSTRAINT APPLICATION_ID_CONSTRAINT FOREIGN KEY (APP_ID) REFERENCES SP_APP (ID) ON DELETE CASCADE;
PRIMARY KEY (ID),
CONSTRAINT APPLICATION_ID_CONSTRAINT FOREIGN KEY (APP_ID) REFERENCES SP_APP (ID) ON DELETE CASCADE);
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[SP_AUTH_STEP]') AND TYPE IN (N'U'))
CREATE TABLE SP_AUTH_STEP (
@ -279,18 +281,16 @@ CREATE TABLE SP_AUTH_STEP (
APP_ID INTEGER NOT NULL,
IS_SUBJECT_STEP CHAR(1) DEFAULT '0',
IS_ATTRIBUTE_STEP CHAR(1) DEFAULT '0',
PRIMARY KEY (ID));
ALTER TABLE SP_AUTH_STEP ADD CONSTRAINT APPLICATION_ID_CONSTRAINT_STEP FOREIGN KEY (APP_ID) REFERENCES SP_APP (ID) ON DELETE CASCADE;
PRIMARY KEY (ID),
CONSTRAINT APPLICATION_ID_CONSTRAINT_STEP FOREIGN KEY (APP_ID) REFERENCES SP_APP (ID) ON DELETE CASCADE);
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[SP_FEDERATED_IDP]') AND TYPE IN (N'U'))
CREATE TABLE SP_FEDERATED_IDP (
ID INTEGER NOT NULL,
TENANT_ID INTEGER NOT NULL,
AUTHENTICATOR_ID INTEGER NOT NULL,
PRIMARY KEY (ID, AUTHENTICATOR_ID));
ALTER TABLE SP_FEDERATED_IDP ADD CONSTRAINT STEP_ID_CONSTRAINT FOREIGN KEY (ID) REFERENCES SP_AUTH_STEP (ID) ON DELETE CASCADE;
PRIMARY KEY (ID, AUTHENTICATOR_ID),
CONSTRAINT STEP_ID_CONSTRAINT FOREIGN KEY (ID) REFERENCES SP_AUTH_STEP (ID) ON DELETE CASCADE);
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[SP_CLAIM_MAPPING]') AND TYPE IN (N'U'))
CREATE TABLE SP_CLAIM_MAPPING (
@ -301,9 +301,8 @@ CREATE TABLE SP_CLAIM_MAPPING (
APP_ID INTEGER NOT NULL,
IS_REQUESTED VARCHAR(128) DEFAULT '0',
DEFAULT_VALUE VARCHAR(255),
PRIMARY KEY (ID));
ALTER TABLE SP_CLAIM_MAPPING ADD CONSTRAINT CLAIMID_APPID_CONSTRAINT FOREIGN KEY (APP_ID) REFERENCES SP_APP (ID) ON DELETE CASCADE;
PRIMARY KEY (ID),
CONSTRAINT CLAIMID_APPID_CONSTRAINT FOREIGN KEY (APP_ID) REFERENCES SP_APP (ID) ON DELETE CASCADE);
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[SP_ROLE_MAPPING]') AND TYPE IN (N'U'))
CREATE TABLE SP_ROLE_MAPPING (
@ -311,10 +310,9 @@ CREATE TABLE SP_ROLE_MAPPING (
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));
ALTER TABLE SP_ROLE_MAPPING ADD CONSTRAINT ROLEID_APPID_CONSTRAINT FOREIGN KEY (APP_ID) REFERENCES SP_APP (ID) ON DELETE CASCADE;
APP_ID INTEGER NOT NULL,
PRIMARY KEY (ID),
CONSTRAINT ROLEID_APPID_CONSTRAINT FOREIGN KEY (APP_ID) REFERENCES SP_APP (ID) ON DELETE CASCADE);
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[SP_REQ_PATH_AUTHENTICATOR]') AND TYPE IN (N'U'))
CREATE TABLE SP_REQ_PATH_AUTHENTICATOR (
@ -322,9 +320,8 @@ CREATE TABLE SP_REQ_PATH_AUTHENTICATOR (
TENANT_ID INTEGER NOT NULL,
AUTHENTICATOR_NAME VARCHAR (255) NOT NULL ,
APP_ID INTEGER NOT NULL,
PRIMARY KEY (ID));
ALTER TABLE SP_REQ_PATH_AUTHENTICATOR ADD CONSTRAINT REQ_AUTH_APPID_CONSTRAINT FOREIGN KEY (APP_ID) REFERENCES SP_APP (ID) ON DELETE CASCADE;
PRIMARY KEY (ID),
CONSTRAINT REQ_AUTH_APPID_CONSTRAINT FOREIGN KEY (APP_ID) REFERENCES SP_APP (ID) ON DELETE CASCADE);
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[SP_PROVISIONING_CONNECTOR]') AND TYPE IN (N'U'))
CREATE TABLE SP_PROVISIONING_CONNECTOR (
@ -335,9 +332,8 @@ CREATE TABLE SP_PROVISIONING_CONNECTOR (
APP_ID INTEGER NOT NULL,
IS_JIT_ENABLED CHAR(1) NOT NULL DEFAULT '0',
BLOCKING CHAR(1) NOT NULL DEFAULT '0',
PRIMARY KEY (ID));
ALTER TABLE SP_PROVISIONING_CONNECTOR ADD CONSTRAINT PRO_CONNECTOR_APPID_CONSTRAINT FOREIGN KEY (APP_ID) REFERENCES SP_APP (ID) ON DELETE CASCADE;
PRIMARY KEY (ID),
CONSTRAINT PRO_CONNECTOR_APPID_CONSTRAINT FOREIGN KEY (APP_ID) REFERENCES SP_APP (ID) ON DELETE CASCADE);
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[IDP]') AND TYPE IN (N'U'))
CREATE TABLE IDP (
@ -361,7 +357,7 @@ CREATE TABLE IDP (
IS_FEDERATION_HUB CHAR(1) NOT NULL DEFAULT '0',
IS_LOCAL_CLAIM_DIALECT CHAR(1) NOT NULL DEFAULT '0',
PRIMARY KEY (ID),
DISPLAY_NAME VARCHAR(255),
DISPLAY_NAME VARCHAR(255),
UNIQUE (TENANT_ID, NAME));
INSERT INTO IDP (TENANT_ID, NAME, HOME_REALM_ID) VALUES (-1234, 'LOCAL', 'localhost');
@ -555,13 +551,11 @@ CREATE TABLE WF_REQUEST (
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[WF_BPS_PROFILE]') AND TYPE IN (N'U'))
CREATE TABLE WF_BPS_PROFILE (
PROFILE_NAME VARCHAR(45),
HOST_URL_MANAGER VARCHAR(45),
HOST_URL_WORKER VARCHAR(45),
HOST_URL_MANAGER VARCHAR(255),
HOST_URL_WORKER VARCHAR(255),
USERNAME VARCHAR(45),
PASSWORD VARCHAR(255),
CALLBACK_HOST VARCHAR (45),
CALLBACK_USERNAME VARCHAR (45),
CALLBACK_PASSWORD VARCHAR (255),
TENANT_ID INTEGER DEFAULT -1,
PRIMARY KEY (PROFILE_NAME, TENANT_ID)
);
@ -625,6 +619,7 @@ CREATE TABLE WF_WORKFLOW_REQUEST_RELATION(
FOREIGN KEY (REQUEST_ID) REFERENCES WF_REQUEST(UUID)ON DELETE CASCADE
);
-- Start of API-Mgt Tables --
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[AM_SUBSCRIBER]') AND TYPE IN (N'U'))
@ -674,6 +669,7 @@ CREATE TABLE AM_API (
API_VERSION VARCHAR(30),
CONTEXT VARCHAR(256),
CONTEXT_TEMPLATE VARCHAR(256),
API_TIER VARCHAR(256),
CREATED_BY VARCHAR(100),
CREATED_TIME DATETIME,
UPDATED_BY VARCHAR(100),
@ -865,4 +861,243 @@ CREATE TABLE AM_API_DEFAULT_VERSION (
);
CREATE INDEX IDX_SUB_APP_ID ON AM_SUBSCRIPTION (APPLICATION_ID, SUBSCRIPTION_ID);
CREATE INDEX IDX_SUB_APP_ID ON AM_SUBSCRIPTION (APPLICATION_ID, SUBSCRIPTION_ID);
CREATE TABLE AM_ALERT_TYPES (
ALERT_TYPE_ID INTEGER NOT NULL IDENTITY,
ALERT_TYPE_NAME VARCHAR(255) NOT NULL ,
STAKE_HOLDER VARCHAR(10) NOT NULL,
PRIMARY KEY (ALERT_TYPE_ID)
);
CREATE TABLE AM_ALERT_TYPES_VALUES (
ALERT_TYPE_ID INTEGER,
USER_NAME VARCHAR(255) NOT NULL ,
STAKE_HOLDER VARCHAR(100) NOT NULL ,
CONSTRAINT AM_ALERT_TYPES_VALUES_CONST UNIQUE (ALERT_TYPE_ID,USER_NAME,STAKE_HOLDER)
);
CREATE TABLE AM_ALERT_EMAILLIST (
EMAIL_LIST_ID INTEGER NOT NULL IDENTITY,
USER_NAME VARCHAR(255) NOT NULL ,
STAKE_HOLDER VARCHAR(100) NOT NULL ,
CONSTRAINT AM_ALERT_EMAILLIST_CONST UNIQUE (EMAIL_LIST_ID,USER_NAME,STAKE_HOLDER),
PRIMARY KEY (EMAIL_LIST_ID)
);
CREATE TABLE AM_ALERT_EMAILLIST_DETAILS (
EMAIL_LIST_ID INTEGER,
EMAIL VARCHAR(255),
CONSTRAINT AM_ALERT_EMAILLIST_DETAILS_CONST UNIQUE (EMAIL_LIST_ID,EMAIL)
);
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 --
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[AM_POLICY_SUBSCRIPTION]') AND TYPE IN (N'U'))
CREATE TABLE AM_POLICY_SUBSCRIPTION (
POLICY_ID INTEGER IDENTITY(1,1),
NAME VARCHAR(512) NOT NULL,
DISPLAY_NAME VARCHAR(512) NULL DEFAULT NULL,
TENANT_ID INTEGER NOT NULL,
DESCRIPTION VARCHAR(1024) NULL DEFAULT NULL,
QUOTA_TYPE VARCHAR(25) NOT NULL,
QUOTA INTEGER NOT NULL,
QUOTA_UNIT VARCHAR(10) NULL,
UNIT_TIME INTEGER NOT NULL,
TIME_UNIT VARCHAR(25) NOT NULL,
RATE_LIMIT_COUNT INTEGER NULL DEFAULT NULL,
RATE_LIMIT_TIME_UNIT VARCHAR(25) NULL DEFAULT NULL,
IS_DEPLOYED BIT NOT NULL DEFAULT 0,
CUSTOM_ATTRIBUTES VARBINARY(MAX) DEFAULT NULL,
STOP_ON_QUOTA_REACH BIT NOT NULL DEFAULT 0,
BILLING_PLAN VARCHAR(20) NOT NULL,
UUID VARCHAR(256),
PRIMARY KEY (POLICY_ID),
UNIQUE (NAME, TENANT_ID),
UNIQUE (UUID)
);
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[AM_POLICY_APPLICATION]') AND TYPE IN (N'U'))
CREATE TABLE AM_POLICY_APPLICATION (
POLICY_ID INTEGER IDENTITY(1,1),
NAME VARCHAR(512) NOT NULL,
DISPLAY_NAME VARCHAR(512) NULL DEFAULT NULL,
TENANT_ID INTEGER NOT NULL,
DESCRIPTION VARCHAR(1024) NULL DEFAULT NULL,
QUOTA_TYPE VARCHAR(25) NOT NULL,
QUOTA INTEGER NOT NULL,
QUOTA_UNIT VARCHAR(10) NULL DEFAULT NULL,
UNIT_TIME INTEGER NOT NULL,
TIME_UNIT VARCHAR(25) NOT NULL,
IS_DEPLOYED BIT NOT NULL DEFAULT 0,
CUSTOM_ATTRIBUTES VARBINARY(MAX) DEFAULT NULL,
UUID VARCHAR(256),
PRIMARY KEY (POLICY_ID),
UNIQUE (NAME, TENANT_ID),
UNIQUE (UUID)
);
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[AM_POLICY_HARD_THROTTLING]') AND TYPE IN (N'U'))
CREATE TABLE AM_POLICY_HARD_THROTTLING (
POLICY_ID INTEGER IDENTITY(1,1),
NAME VARCHAR(512) NOT NULL,
TENANT_ID INTEGER NOT NULL,
DESCRIPTION VARCHAR(1024) NULL DEFAULT NULL,
QUOTA_TYPE VARCHAR(25) NOT NULL,
QUOTA INTEGER NOT NULL,
QUOTA_UNIT VARCHAR(10) NULL DEFAULT NULL,
UNIT_TIME INTEGER NOT NULL,
TIME_UNIT VARCHAR(25) NOT NULL,
IS_DEPLOYED BIT NOT NULL DEFAULT 0,
PRIMARY KEY (POLICY_ID),
UNIQUE (NAME, TENANT_ID)
);
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[AM_API_THROTTLE_POLICY]') AND TYPE IN (N'U'))
CREATE TABLE AM_API_THROTTLE_POLICY (
POLICY_ID INTEGER IDENTITY(1,1),
NAME VARCHAR(512) NOT NULL,
DISPLAY_NAME VARCHAR(512) NULL DEFAULT NULL,
TENANT_ID INTEGER 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 BIT NOT NULL DEFAULT 0,
UUID VARCHAR(256),
PRIMARY KEY (POLICY_ID),
UNIQUE (NAME, TENANT_ID),
UNIQUE (UUID)
);
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[AM_CONDITION_GROUP]') AND TYPE IN (N'U'))
CREATE TABLE AM_CONDITION_GROUP (
CONDITION_GROUP_ID INTEGER IDENTITY(1,1),
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
);
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[AM_QUERY_PARAMETER_CONDITION]') AND TYPE IN (N'U'))
CREATE TABLE AM_QUERY_PARAMETER_CONDITION (
QUERY_PARAMETER_ID INTEGER IDENTITY(1,1),
CONDITION_GROUP_ID INTEGER NOT NULL,
PARAMETER_NAME VARCHAR(255) DEFAULT NULL,
PARAMETER_VALUE VARCHAR(255) DEFAULT NULL,
IS_PARAM_MAPPING BIT 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
);
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[AM_HEADER_FIELD_CONDITION]') AND TYPE IN (N'U'))
CREATE TABLE AM_HEADER_FIELD_CONDITION (
HEADER_FIELD_ID INTEGER IDENTITY(1,1),
CONDITION_GROUP_ID INTEGER NOT NULL,
HEADER_FIELD_NAME VARCHAR(255) DEFAULT NULL,
HEADER_FIELD_VALUE VARCHAR(255) DEFAULT NULL,
IS_HEADER_FIELD_MAPPING BIT 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
);
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[AM_JWT_CLAIM_CONDITION]') AND TYPE IN (N'U'))
CREATE TABLE AM_JWT_CLAIM_CONDITION (
JWT_CLAIM_ID INTEGER IDENTITY(1,1),
CONDITION_GROUP_ID INTEGER NOT NULL,
CLAIM_URI VARCHAR(512) DEFAULT NULL,
CLAIM_ATTRIB VARCHAR(1024) DEFAULT NULL,
IS_CLAIM_MAPPING BIT 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
);
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[AM_IP_CONDITION]') AND TYPE IN (N'U'))
CREATE TABLE AM_IP_CONDITION (
AM_IP_CONDITION_ID INTEGER IDENTITY(1,1),
STARTING_IP VARCHAR(45) NULL,
ENDING_IP VARCHAR(45) NULL,
SPECIFIC_IP VARCHAR(45) NULL,
WITHIN_IP_RANGE BIT DEFAULT 1,
CONDITION_GROUP_ID INT NULL,
PRIMARY KEY (AM_IP_CONDITION_ID),
FOREIGN KEY (CONDITION_GROUP_ID)
REFERENCES AM_CONDITION_GROUP (CONDITION_GROUP_ID) ON DELETE CASCADE ON UPDATE CASCADE);
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[AM_POLICY_GLOBAL]') AND TYPE IN (N'U'))
CREATE TABLE AM_POLICY_GLOBAL (
POLICY_ID INTEGER IDENTITY(1,1),
NAME VARCHAR(512) NOT NULL,
KEY_TEMPLATE VARCHAR(512) NOT NULL,
TENANT_ID INTEGER NOT NULL,
DESCRIPTION VARCHAR(1024) NULL DEFAULT NULL,
SIDDHI_QUERY VARBINARY(MAX) DEFAULT NULL,
IS_DEPLOYED BIT NOT NULL DEFAULT 0,
UUID VARCHAR(256),
PRIMARY KEY (POLICY_ID),
UNIQUE (UUID)
);
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[AM_THROTTLE_TIER_PERMISSIONS]') AND TYPE IN (N'U'))
CREATE TABLE AM_THROTTLE_TIER_PERMISSIONS (
THROTTLE_TIER_PERMISSIONS_ID INTEGER IDENTITY(1,1),
TIER VARCHAR(50) NULL,
PERMISSIONS_TYPE VARCHAR(50) NULL,
ROLES VARCHAR(512) NULL,
TENANT_ID INTEGER NULL,
PRIMARY KEY (THROTTLE_TIER_PERMISSIONS_ID));
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[AM_BLOCK_CONDITIONS]') AND TYPE IN (N'U'))
CREATE TABLE AM_BLOCK_CONDITIONS (
CONDITION_ID INTEGER IDENTITY(1,1),
TYPE varchar(45) DEFAULT NULL,
VALUE varchar(45) DEFAULT NULL,
ENABLED varchar(45) DEFAULT NULL,
DOMAIN varchar(45) DEFAULT NULL,
UUID VARCHAR(256),
PRIMARY KEY (CONDITION_ID),
UNIQUE (UUID)
);
-- End of API-MGT Tables --
--Permance 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--

@ -18,6 +18,8 @@ CREATE TABLE IF NOT EXISTS IDN_OAUTH_CONSUMER_APPS (
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',
CONSTRAINT CONSUMER_KEY_CONSTRAINT UNIQUE (CONSUMER_KEY),
PRIMARY KEY (ID)
)ENGINE INNODB;
@ -89,6 +91,8 @@ CREATE TABLE IF NOT EXISTS IDN_OAUTH2_AUTHORIZATION_CODE (
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;
@ -517,7 +521,7 @@ CREATE TABLE IF NOT EXISTS FIDO_DEVICE_STORE (
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),
@ -532,8 +536,8 @@ CREATE TABLE IF NOT EXISTS WF_REQUEST (
CREATE TABLE IF NOT EXISTS WF_BPS_PROFILE (
PROFILE_NAME VARCHAR(45),
HOST_URL_MANAGER VARCHAR(45),
HOST_URL_WORKER VARCHAR(45),
HOST_URL_MANAGER VARCHAR(255),
HOST_URL_WORKER VARCHAR(255),
USERNAME VARCHAR(45),
PASSWORD VARCHAR(255),
CALLBACK_HOST VARCHAR (45),
@ -627,7 +631,7 @@ CREATE TABLE IF NOT EXISTS AM_APPLICATION (
CREATED_TIME TIMESTAMP,
UPDATED_BY VARCHAR(100),
UPDATED_TIME TIMESTAMP,
UUID VARCHAR(256),
UUID VARCHAR(254),
FOREIGN KEY(SUBSCRIBER_ID) REFERENCES AM_SUBSCRIBER(SUBSCRIBER_ID) ON UPDATE CASCADE ON DELETE RESTRICT,
PRIMARY KEY(APPLICATION_ID),
UNIQUE (NAME,SUBSCRIBER_ID),
@ -641,6 +645,7 @@ CREATE TABLE IF NOT EXISTS AM_API (
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),
@ -672,7 +677,7 @@ CREATE TABLE IF NOT EXISTS AM_SUBSCRIPTION (
CREATED_TIME TIMESTAMP,
UPDATED_BY VARCHAR(100),
UPDATED_TIME TIMESTAMP,
UUID VARCHAR(256),
UUID VARCHAR(254),
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),
@ -682,7 +687,7 @@ CREATE TABLE IF NOT EXISTS AM_SUBSCRIPTION (
CREATE TABLE IF NOT EXISTS AM_SUBSCRIPTION_KEY_MAPPING (
SUBSCRIPTION_ID INTEGER,
ACCESS_TOKEN VARCHAR(255),
KEY_TYPE VARCHAR(512) NOT NULL,
KEY_TYPE VARCHAR(255) 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;
@ -690,7 +695,7 @@ CREATE TABLE IF NOT EXISTS AM_SUBSCRIPTION_KEY_MAPPING (
CREATE TABLE IF NOT EXISTS AM_APPLICATION_KEY_MAPPING (
APPLICATION_ID INTEGER,
CONSUMER_KEY VARCHAR(255),
KEY_TYPE VARCHAR(512) NOT NULL,
KEY_TYPE VARCHAR(255) 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,
@ -789,17 +794,246 @@ CREATE TABLE IF NOT EXISTS AM_APPLICATION_REGISTRATION (
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 (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,
DEFAULT_VERSION_ID INT AUTO_INCREMENT,
API_NAME VARCHAR(256) NOT NULL ,
API_PROVIDER VARCHAR(256) NOT NULL ,
DEFAULT_API_VERSION VARCHAR(30) ,
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 ,
CONSTRAINT AM_ALERT_TYPES_VALUES_CONSTRAINT UNIQUE (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),
CONSTRAINT AM_ALERT_EMAILLIST_CONSTRAINT UNIQUE (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),
CONSTRAINT AM_ALERT_EMAILLIST_DETAILS_CONSTRAINT UNIQUE (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(255) 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(254),
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(255) 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(254),
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(255) 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(255) 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(254),
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(255) 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(254),
PRIMARY KEY (POLICY_ID),
UNIQUE (UUID)
)ENGINE INNODB;
CREATE INDEX IDX_SUB_APP_ID ON AM_SUBSCRIPTION (APPLICATION_ID, SUBSCRIPTION_ID);
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(45) DEFAULT NULL,
`ENABLED` varchar(45) DEFAULT NULL,
`DOMAIN` varchar(45) DEFAULT NULL,
`UUID` VARCHAR(254),
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--

@ -24,6 +24,8 @@ CREATE TABLE IDN_OAUTH_CONSUMER_APPS (
OAUTH_VERSION VARCHAR2 (128),
CALLBACK_URL VARCHAR2 (1024),
GRANT_TYPES VARCHAR (1024),
PKCE_MANDATORY CHAR(1) DEFAULT '0',
PKCE_SUPPORT_PLAIN CHAR(1) DEFAULT '0',
CONSTRAINT CONSUMER_KEY_CONSTRAINT UNIQUE (CONSUMER_KEY),
PRIMARY KEY (ID))
/
@ -102,6 +104,8 @@ CREATE TABLE IDN_OAUTH2_AUTHORIZATION_CODE (
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)
/
@ -341,7 +345,7 @@ CREATE OR REPLACE TRIGGER SP_AUTH_STEP_TRIG
SELECT SP_AUTH_STEP_SEQ.nextval INTO :NEW.ID FROM dual;
END;
/
ALTER TABLE SP_AUTH_STEP ADD CONSTRAINT APPLICATION_ID_CONSTRAINT_STEP FOREIGN KEY (APP_ID) REFERENCES SP_APP (ID) ON DELETE CASCADE
ALTER TABLE SP_AUTH_STEP ADD CONSTRAINT APPLICATION_ID_CONST_STEP FOREIGN KEY (APP_ID) REFERENCES SP_APP (ID) ON DELETE CASCADE
/
CREATE TABLE SP_FEDERATED_IDP (
ID INTEGER NOT NULL,
@ -436,7 +440,7 @@ CREATE OR REPLACE TRIGGER SP_PROV_CONNECTOR_TRIG
SELECT SP_PROV_CONNECTOR_SEQ.nextval INTO :NEW.ID FROM dual;
END;
/
ALTER TABLE SP_PROVISIONING_CONNECTOR ADD CONSTRAINT PRO_CONNECTOR_APPID_CONSTRAINT FOREIGN KEY (APP_ID) REFERENCES SP_APP (ID) ON DELETE CASCADE
ALTER TABLE SP_PROVISIONING_CONNECTOR ADD CONSTRAINT PRO_CONNECTOR_APPID_CONST FOREIGN KEY (APP_ID) REFERENCES SP_APP (ID) ON DELETE CASCADE
/
CREATE TABLE IDP (
ID INTEGER,
@ -788,8 +792,8 @@ CREATE TABLE WF_REQUEST (
CREATE TABLE WF_BPS_PROFILE (
PROFILE_NAME VARCHAR2(45),
HOST_URL_MANAGER VARCHAR2(45),
HOST_URL_WORKER VARCHAR2(45),
HOST_URL_MANAGER VARCHAR2(255),
HOST_URL_WORKER VARCHAR2(255),
USERNAME VARCHAR2(45),
PASSWORD VARCHAR2(255),
CALLBACK_HOST VARCHAR2 (45),
@ -867,7 +871,7 @@ CREATE TABLE WF_WORKFLOW_REQUEST_RELATION(
-- End of IDENTITY Tables--
-- Start of API-MGT Tables--
CREATE TABLE AM_SUBSCRIBER (
CREATE TABLE AM_SUBSCRIBER (
SUBSCRIBER_ID INTEGER,
USER_ID VARCHAR2(50) NOT NULL,
TENANT_ID INTEGER NOT NULL,
@ -936,6 +940,7 @@ CREATE TABLE AM_API (
API_VERSION VARCHAR2(30),
CONTEXT VARCHAR2(256),
CONTEXT_TEMPLATE VARCHAR2(256),
API_TIER VARCHAR(256),
CREATED_BY VARCHAR2(100),
CREATED_TIME DATE,
UPDATED_BY VARCHAR2(100),
@ -1071,7 +1076,6 @@ CREATE TABLE AM_APP_KEY_DOMAIN_MAPPING (
CONSUMER_KEY VARCHAR(255),
AUTHZ_DOMAIN VARCHAR(255) DEFAULT 'ALL',
PRIMARY KEY (CONSUMER_KEY,AUTHZ_DOMAIN)
)
/
@ -1258,3 +1262,386 @@ CREATE OR REPLACE TRIGGER AM_API_DEFAULT_VERSION_TRG
/
CREATE INDEX IDX_SUB_APP_ID ON AM_SUBSCRIPTION (APPLICATION_ID, SUBSCRIPTION_ID)
/
CREATE TABLE AM_ALERT_TYPES (
ALERT_TYPE_ID INTEGER,
ALERT_TYPE_NAME VARCHAR(255) NOT NULL ,
STAKE_HOLDER VARCHAR(100) NOT NULL,
PRIMARY KEY (ALERT_TYPE_ID))
/
CREATE SEQUENCE AM_ALERT_TYPES_SEQ START WITH 1 INCREMENT BY 1 NOCACHE
/
CREATE OR REPLACE TRIGGER AM_ALERT_TYPES_TRIG
BEFORE INSERT
ON AM_ALERT_TYPES
REFERENCING NEW AS NEW
FOR EACH ROW
BEGIN
SELECT AM_ALERT_TYPES_SEQ.nextval INTO :NEW.ALERT_TYPE_ID FROM dual;
END;
/
CREATE TABLE AM_ALERT_TYPES_VALUES (
ALERT_TYPE_ID INTEGER,
USER_NAME VARCHAR(255) NOT NULL ,
STAKE_HOLDER VARCHAR(100) NOT NULL ,
CONSTRAINT AM_ALERT_TYPES_VALUES_CONST UNIQUE (ALERT_TYPE_ID,USER_NAME,STAKE_HOLDER))
/
CREATE TABLE AM_ALERT_EMAILLIST (
EMAIL_LIST_ID INTEGER,
USER_NAME VARCHAR(255) NOT NULL ,
STAKE_HOLDER VARCHAR(100) NOT NULL ,
CONSTRAINT AM_ALERT_EMAILLIST_CONST UNIQUE (EMAIL_LIST_ID,USER_NAME,STAKE_HOLDER),
PRIMARY KEY (EMAIL_LIST_ID))
/
CREATE SEQUENCE AM_ALERT_EMAILLIST_SEQ START WITH 1 INCREMENT BY 1 NOCACHE
/
CREATE OR REPLACE TRIGGER AM_ALERT_EMAILLIST_TRIG
BEFORE INSERT
ON AM_ALERT_EMAILLIST
REFERENCING NEW AS NEW
FOR EACH ROW
BEGIN
SELECT AM_ALERT_EMAILLIST_SEQ.nextval INTO :NEW.EMAIL_LIST_ID FROM dual;
END;
/
CREATE TABLE AM_ALERT_EMAILLIST_DETAILS (
EMAIL_LIST_ID INTEGER,
EMAIL VARCHAR(255),
CONSTRAINT AM_ALERT_EMAIL_LIST_DET_CONST UNIQUE (EMAIL_LIST_ID,EMAIL))
/
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 AM_POLICY_SUBSCRIPTION (
POLICY_ID INTEGER NOT NULL,
NAME VARCHAR2(512) NOT NULL,
DISPLAY_NAME VARCHAR2(512) DEFAULT NULL NULL,
TENANT_ID INTEGER NOT NULL,
DESCRIPTION VARCHAR2(1024) DEFAULT NULL NULL,
QUOTA_TYPE VARCHAR2(25) NOT NULL,
QUOTA INTEGER NOT NULL,
QUOTA_UNIT VARCHAR2(10) NULL,
UNIT_TIME INTEGER NOT NULL,
TIME_UNIT VARCHAR2(25) NOT NULL,
RATE_LIMIT_COUNT INTEGER DEFAULT NULL NULL,
RATE_LIMIT_TIME_UNIT VARCHAR2(25) DEFAULT NULL NULL,
IS_DEPLOYED INTEGER DEFAULT 0 NOT NULL,
CUSTOM_ATTRIBUTES BLOB DEFAULT NULL,
STOP_ON_QUOTA_REACH INTEGER DEFAULT 0 NOT NULL,
BILLING_PLAN VARCHAR2(20),
UUID VARCHAR2(256),
PRIMARY KEY (POLICY_ID),
CONSTRAINT SUBSCRIPTION_NAME_TENANT UNIQUE (NAME, TENANT_ID),
UNIQUE (UUID)
)
/
-- Generate ID using sequence and trigger
CREATE SEQUENCE AM_POLICY_SUBSCRIPTION_seq START WITH 1 INCREMENT BY 1
/
CREATE OR REPLACE TRIGGER AM_POLICY_SUBSCRIPTION_seq_tr
BEFORE INSERT ON AM_POLICY_SUBSCRIPTION FOR EACH ROW
WHEN (NEW.POLICY_ID IS NULL)
BEGIN
SELECT AM_POLICY_SUBSCRIPTION_seq.NEXTVAL INTO :NEW.POLICY_ID FROM DUAL;
END;
/
CREATE TABLE AM_POLICY_APPLICATION (
POLICY_ID INTEGER NOT NULL,
NAME VARCHAR2(512) NOT NULL,
DISPLAY_NAME VARCHAR2(512) DEFAULT NULL NULL,
TENANT_ID INTEGER NOT NULL,
DESCRIPTION VARCHAR2(1024) DEFAULT NULL NULL,
QUOTA_TYPE VARCHAR2(25) NOT NULL,
QUOTA INTEGER NOT NULL,
QUOTA_UNIT VARCHAR2(10) DEFAULT NULL NULL,
UNIT_TIME INTEGER NOT NULL,
TIME_UNIT VARCHAR2(25) NOT NULL,
IS_DEPLOYED INTEGER DEFAULT 0 NOT NULL,
CUSTOM_ATTRIBUTES BLOB DEFAULT NULL,
UUID VARCHAR2(256),
PRIMARY KEY (POLICY_ID),
CONSTRAINT AM_POLICY_APP_NAME_TENANT UNIQUE (NAME, TENANT_ID),
UNIQUE (UUID)
)
/
-- Generate ID using sequence and trigger
CREATE SEQUENCE AM_POLICY_APPLICATION_seq START WITH 1 INCREMENT BY 1
/
CREATE OR REPLACE TRIGGER AM_POLICY_APPLICATION_seq_tr
BEFORE INSERT ON AM_POLICY_APPLICATION FOR EACH ROW
WHEN (NEW.POLICY_ID IS NULL)
BEGIN
SELECT AM_POLICY_APPLICATION_seq.NEXTVAL INTO :NEW.POLICY_ID FROM DUAL;
END;
/
CREATE TABLE AM_API_THROTTLE_POLICY (
POLICY_ID INTEGER NOT NULL,
NAME VARCHAR2(512) NOT NULL,
DISPLAY_NAME VARCHAR2(512) DEFAULT NULL NULL,
TENANT_ID INTEGER NOT NULL,
DESCRIPTION VARCHAR2 (1024),
DEFAULT_QUOTA_TYPE VARCHAR2(25) NOT NULL,
DEFAULT_QUOTA INTEGER NOT NULL,
DEFAULT_QUOTA_UNIT VARCHAR2(10) NULL,
DEFAULT_UNIT_TIME INTEGER NOT NULL,
DEFAULT_TIME_UNIT VARCHAR2(25) NOT NULL,
APPLICABLE_LEVEL VARCHAR2(25) NOT NULL,
IS_DEPLOYED INTEGER DEFAULT 0 NOT NULL,
UUID VARCHAR2(256),
PRIMARY KEY (POLICY_ID),
CONSTRAINT API_POLICY_NAME_TENANT UNIQUE (NAME, TENANT_ID),
UNIQUE (UUID)
)
/
-- Generate ID using sequence and trigger
CREATE SEQUENCE AM_API_THROTTLE_POLICY_seq START WITH 1 INCREMENT BY 1
/
CREATE OR REPLACE TRIGGER AM_API_THROTTLE_POLICY_seq_tr
BEFORE INSERT ON AM_API_THROTTLE_POLICY FOR EACH ROW
WHEN (NEW.POLICY_ID IS NULL)
BEGIN
SELECT AM_API_THROTTLE_POLICY_seq.NEXTVAL INTO :NEW.POLICY_ID FROM DUAL;
END;
/
CREATE TABLE AM_CONDITION_GROUP (
CONDITION_GROUP_ID INTEGER NOT NULL,
POLICY_ID INTEGER NOT NULL,
QUOTA_TYPE VARCHAR2(25),
QUOTA INTEGER NOT NULL,
QUOTA_UNIT VARCHAR2(10) DEFAULT NULL NULL,
UNIT_TIME INTEGER NOT NULL,
TIME_UNIT VARCHAR2(25) NOT NULL,
DESCRIPTION VARCHAR2(1024) DEFAULT NULL NULL,
PRIMARY KEY (CONDITION_GROUP_ID),
FOREIGN KEY (POLICY_ID) REFERENCES AM_API_THROTTLE_POLICY(POLICY_ID) ON DELETE CASCADE
)
/
-- Generate ID using sequence and trigger
CREATE SEQUENCE AM_CONDITION_GROUP_seq START WITH 1 INCREMENT BY 1
/
CREATE OR REPLACE TRIGGER AM_CONDITION_GROUP_seq_tr
BEFORE INSERT ON AM_CONDITION_GROUP FOR EACH ROW
WHEN (NEW.CONDITION_GROUP_ID IS NULL)
BEGIN
SELECT AM_CONDITION_GROUP_seq.NEXTVAL INTO :NEW.CONDITION_GROUP_ID FROM DUAL;
END;
/
CREATE TABLE AM_QUERY_PARAMETER_CONDITION (
QUERY_PARAMETER_ID INTEGER NOT NULL,
CONDITION_GROUP_ID INTEGER NOT NULL,
PARAMETER_NAME VARCHAR2(255) DEFAULT NULL,
PARAMETER_VALUE VARCHAR2(255) DEFAULT NULL,
IS_PARAM_MAPPING CHAR(1) DEFAULT 1,
PRIMARY KEY (QUERY_PARAMETER_ID),
FOREIGN KEY (CONDITION_GROUP_ID) REFERENCES AM_CONDITION_GROUP(CONDITION_GROUP_ID) ON DELETE CASCADE
)
/
-- Generate ID using sequence and trigger
CREATE SEQUENCE QUERY_PARAMETER_CONDITION_seq START WITH 1 INCREMENT BY 1
/
CREATE OR REPLACE TRIGGER QUERY_PARAMETER_CONDITION_tr
BEFORE INSERT ON AM_QUERY_PARAMETER_CONDITION FOR EACH ROW
WHEN (NEW.QUERY_PARAMETER_ID IS NULL)
BEGIN
SELECT QUERY_PARAMETER_CONDITION_seq.NEXTVAL INTO :NEW.QUERY_PARAMETER_ID FROM DUAL;
END;
/
CREATE TABLE AM_HEADER_FIELD_CONDITION (
HEADER_FIELD_ID INTEGER NOT NULL,
CONDITION_GROUP_ID INTEGER NOT NULL,
HEADER_FIELD_NAME VARCHAR2(255) DEFAULT NULL,
HEADER_FIELD_VALUE VARCHAR2(255) DEFAULT NULL,
IS_HEADER_FIELD_MAPPING CHAR(1) DEFAULT 1,
PRIMARY KEY (HEADER_FIELD_ID),
FOREIGN KEY (CONDITION_GROUP_ID) REFERENCES AM_CONDITION_GROUP(CONDITION_GROUP_ID) ON DELETE CASCADE
)
/
-- Generate ID using sequence and trigger
CREATE SEQUENCE AM_HEADER_FIELD_CONDITION_seq START WITH 1 INCREMENT BY 1
/
CREATE OR REPLACE TRIGGER AM_HEADER_FIELD_CONDITION_tr
BEFORE INSERT ON AM_HEADER_FIELD_CONDITION FOR EACH ROW
WHEN (NEW.HEADER_FIELD_ID IS NULL)
BEGIN
SELECT AM_HEADER_FIELD_CONDITION_seq.NEXTVAL INTO :NEW.HEADER_FIELD_ID FROM DUAL;
END;
/
CREATE TABLE AM_JWT_CLAIM_CONDITION (
JWT_CLAIM_ID INTEGER NOT NULL,
CONDITION_GROUP_ID INTEGER NOT NULL,
CLAIM_URI VARCHAR2(512) DEFAULT NULL,
CLAIM_ATTRIB VARCHAR2(1024) DEFAULT NULL,
IS_CLAIM_MAPPING CHAR(1) DEFAULT 1,
PRIMARY KEY (JWT_CLAIM_ID),
FOREIGN KEY (CONDITION_GROUP_ID) REFERENCES AM_CONDITION_GROUP(CONDITION_GROUP_ID) ON DELETE CASCADE
)
/
-- Generate ID using sequence and trigger
CREATE SEQUENCE AM_JWT_CLAIM_CONDITION_seq START WITH 1 INCREMENT BY 1
/
CREATE OR REPLACE TRIGGER AM_JWT_CLAIM_CONDITION_seq_tr
BEFORE INSERT ON AM_JWT_CLAIM_CONDITION FOR EACH ROW
WHEN (NEW.JWT_CLAIM_ID IS NULL)
BEGIN
SELECT AM_JWT_CLAIM_CONDITION_seq.NEXTVAL INTO :NEW.JWT_CLAIM_ID FROM DUAL;
END;
/
CREATE TABLE AM_IP_CONDITION (
AM_IP_CONDITION_ID INTEGER NOT NULL,
STARTING_IP VARCHAR2(45) NULL,
ENDING_IP VARCHAR2(45) NULL,
SPECIFIC_IP VARCHAR2(45) NULL,
WITHIN_IP_RANGE CHAR(1) DEFAULT 1,
CONDITION_GROUP_ID INTEGER NULL,
PRIMARY KEY (AM_IP_CONDITION_ID)
, CONSTRAINT fk_AM_IP_CONDITION_1 FOREIGN KEY (CONDITION_GROUP_ID)
REFERENCES AM_CONDITION_GROUP (CONDITION_GROUP_ID) ON DELETE CASCADE )
/
-- Generate ID using sequence and trigger
CREATE SEQUENCE AM_IP_CONDITION_seq START WITH 1 INCREMENT BY 1
/
CREATE OR REPLACE TRIGGER AM_IP_CONDITION_seq_tr
BEFORE INSERT ON AM_IP_CONDITION FOR EACH ROW
WHEN (NEW.AM_IP_CONDITION_ID IS NULL)
BEGIN
SELECT AM_IP_CONDITION_seq.NEXTVAL INTO :NEW.AM_IP_CONDITION_ID FROM DUAL;
END;
/
CREATE INDEX fk_AM_IP_CONDITION_1_idx ON AM_IP_CONDITION (CONDITION_GROUP_ID ASC)
/
CREATE TABLE AM_POLICY_GLOBAL (
POLICY_ID INTEGER NOT NULL,
NAME VARCHAR2(512) NOT NULL,
KEY_TEMPLATE VARCHAR2(512) NOT NULL,
TENANT_ID INTEGER NOT NULL,
DESCRIPTION VARCHAR2(1024) DEFAULT NULL NULL,
SIDDHI_QUERY BLOB DEFAULT NULL,
IS_DEPLOYED INTEGER DEFAULT 0 NOT NULL,
UUID VARCHAR2(256),
PRIMARY KEY (POLICY_ID),
UNIQUE (UUID)
)
/
-- Generate ID using sequence and trigger
CREATE SEQUENCE AM_POLICY_GLOBAL_seq START WITH 1 INCREMENT BY 1
/
CREATE OR REPLACE TRIGGER AM_POLICY_GLOBAL_seq_tr
BEFORE INSERT ON AM_POLICY_GLOBAL FOR EACH ROW
WHEN (NEW.POLICY_ID IS NULL)
BEGIN
SELECT AM_POLICY_GLOBAL_seq.NEXTVAL INTO :NEW.POLICY_ID FROM DUAL;
END;
/
CREATE TABLE AM_THROTTLE_TIER_PERMISSIONS (
THROTTLE_TIER_PERMISSIONS_ID INTEGER NOT NULL,
TIER VARCHAR2(50) NULL,
PERMISSIONS_TYPE VARCHAR2(50) NULL,
ROLES VARCHAR2(512) NULL,
TENANT_ID INTEGER NULL,
PRIMARY KEY (THROTTLE_TIER_PERMISSIONS_ID))
/
-- Generate ID using sequence and trigger
CREATE SEQUENCE THROTTLE_TIER_PERMISSIONS_seq START WITH 1 INCREMENT BY 1
/
CREATE OR REPLACE TRIGGER THROTTLE_TIER_PERMISSIONS_tr
BEFORE INSERT ON AM_THROTTLE_TIER_PERMISSIONS FOR EACH ROW
WHEN (NEW.THROTTLE_TIER_PERMISSIONS_ID IS NULL)
BEGIN
SELECT THROTTLE_TIER_PERMISSIONS_seq.NEXTVAL INTO :NEW.THROTTLE_TIER_PERMISSIONS_ID FROM DUAL;
END;
/
CREATE TABLE AM_BLOCK_CONDITIONS (
CONDITION_ID INTEGER NOT NULL,
TYPE varchar2(45) DEFAULT NULL,
VALUE varchar2(45) DEFAULT NULL,
ENABLED varchar2(45) DEFAULT NULL,
DOMAIN varchar2(45) DEFAULT NULL,
UUID VARCHAR2(256),
PRIMARY KEY (CONDITION_ID),
UNIQUE (UUID)
)
/
-- Generate ID using sequence and trigger
CREATE SEQUENCE AM_BLOCK_CONDITIONS_seq START WITH 1 INCREMENT BY 1
/
CREATE OR REPLACE TRIGGER AM_BLOCK_CONDITIONS_seq_tr
BEFORE INSERT ON AM_BLOCK_CONDITIONS FOR EACH ROW
WHEN (NEW.CONDITION_ID IS NULL)
BEGIN
SELECT AM_BLOCK_CONDITIONS_seq.NEXTVAL INTO :NEW.CONDITION_ID FROM DUAL;
END;
/
-- End of API-MGT Tables --
--permance 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--

@ -23,6 +23,8 @@ CREATE TABLE IDN_OAUTH_CONSUMER_APPS (
OAUTH_VERSION VARCHAR2 (128),
CALLBACK_URL VARCHAR2 (1024),
GRANT_TYPES VARCHAR (1024),
PKCE_MANDATORY CHAR(1) DEFAULT '0',
PKCE_SUPPORT_PLAIN CHAR(1) DEFAULT '0',
CONSTRAINT CONSUMER_KEY_CONSTRAINT UNIQUE (CONSUMER_KEY),
PRIMARY KEY (ID))
/
@ -101,6 +103,8 @@ CREATE TABLE IDN_OAUTH2_AUTHORIZATION_CODE (
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)
/
@ -471,6 +475,7 @@ CREATE OR REPLACE TRIGGER IDP_TRIG
SELECT IDP_SEQ.nextval INTO :NEW.ID FROM dual;
END;
/
INSERT INTO IDP (TENANT_ID, NAME, HOME_REALM_ID) VALUES (-1234, 'LOCAL', 'localhost')
/
CREATE TABLE IDP_ROLE (
@ -784,8 +789,8 @@ CREATE TABLE WF_REQUEST (
CREATE TABLE WF_BPS_PROFILE (
PROFILE_NAME VARCHAR2(45),
HOST_URL_MANAGER VARCHAR2(45),
HOST_URL_WORKER VARCHAR2(45),
HOST_URL_MANAGER VARCHAR2(255),
HOST_URL_WORKER VARCHAR2(255),
USERNAME VARCHAR2(45),
PASSWORD VARCHAR2(255),
CALLBACK_HOST VARCHAR2 (45),
@ -933,6 +938,7 @@ CREATE TABLE AM_API (
API_VERSION VARCHAR2(30),
CONTEXT VARCHAR2(256),
CONTEXT_TEMPLATE VARCHAR2(256),
API_TIER VARCHAR(256),
CREATED_BY VARCHAR2(100),
CREATED_TIME DATE,
UPDATED_BY VARCHAR2(100),
@ -1255,3 +1261,387 @@ CREATE OR REPLACE TRIGGER AM_API_DEFAULT_VERSION_TRG
/
CREATE INDEX IDX_SUB_APP_ID ON AM_SUBSCRIPTION (APPLICATION_ID, SUBSCRIPTION_ID)
/
CREATE TABLE AM_ALERT_TYPES (
ALERT_TYPE_ID INTEGER,
ALERT_TYPE_NAME VARCHAR(255) NOT NULL ,
STAKE_HOLDER VARCHAR(100) NOT NULL,
PRIMARY KEY (ALERT_TYPE_ID))
/
CREATE SEQUENCE AM_ALERT_TYPES_SEQ START WITH 1 INCREMENT BY 1 NOCACHE
/
CREATE OR REPLACE TRIGGER AM_ALERT_TYPES_TRIG
BEFORE INSERT
ON AM_ALERT_TYPES
REFERENCING NEW AS NEW
FOR EACH ROW
BEGIN
SELECT AM_ALERT_TYPES_SEQ.nextval INTO :NEW.ALERT_TYPE_ID FROM dual;
END;
/
CREATE TABLE AM_ALERT_TYPES_VALUES (
ALERT_TYPE_ID INTEGER,
USER_NAME VARCHAR(255) NOT NULL ,
STAKE_HOLDER VARCHAR(100) NOT NULL ,
CONSTRAINT AM_ALERT_TYPES_VALUES_CONST UNIQUE (ALERT_TYPE_ID,USER_NAME,STAKE_HOLDER))
/
CREATE TABLE AM_ALERT_EMAILLIST (
EMAIL_LIST_ID INTEGER,
USER_NAME VARCHAR(255) NOT NULL ,
STAKE_HOLDER VARCHAR(100) NOT NULL ,
CONSTRAINT AM_ALERT_EMAILLIST_CONST UNIQUE (EMAIL_LIST_ID,USER_NAME,STAKE_HOLDER),
PRIMARY KEY (EMAIL_LIST_ID))
/
CREATE SEQUENCE AM_ALERT_EMAILLIST_SEQ START WITH 1 INCREMENT BY 1 NOCACHE
/
CREATE OR REPLACE TRIGGER AM_ALERT_EMAILLIST_TRIG
BEFORE INSERT
ON AM_ALERT_EMAILLIST
REFERENCING NEW AS NEW
FOR EACH ROW
BEGIN
SELECT AM_ALERT_EMAILLIST_SEQ.nextval INTO :NEW.EMAIL_LIST_ID FROM dual;
END;
/
CREATE TABLE AM_ALERT_EMAILLIST_DETAILS (
EMAIL_LIST_ID INTEGER,
EMAIL VARCHAR(255),
CONSTRAINT AM_ALERT_EMAIL_LIST_DET_CONST UNIQUE (EMAIL_LIST_ID,EMAIL))
/
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 AM_POLICY_SUBSCRIPTION (
POLICY_ID INTEGER NOT NULL,
NAME VARCHAR2(512) NOT NULL,
DISPLAY_NAME VARCHAR2(512) DEFAULT NULL NULL,
TENANT_ID INTEGER NOT NULL,
DESCRIPTION VARCHAR2(1024) DEFAULT NULL NULL,
QUOTA_TYPE VARCHAR2(25) NOT NULL,
QUOTA INTEGER NOT NULL,
QUOTA_UNIT VARCHAR2(10) NULL,
UNIT_TIME INTEGER NOT NULL,
TIME_UNIT VARCHAR2(25) NOT NULL,
RATE_LIMIT_COUNT INTEGER DEFAULT NULL NULL,
RATE_LIMIT_TIME_UNIT VARCHAR2(25) DEFAULT NULL NULL,
IS_DEPLOYED INTEGER DEFAULT 0 NOT NULL,
CUSTOM_ATTRIBUTES BLOB DEFAULT NULL,
STOP_ON_QUOTA_REACH INTEGER DEFAULT 0 NOT NULL,
BILLING_PLAN VARCHAR2(20),
UUID VARCHAR2(256),
PRIMARY KEY (POLICY_ID),
CONSTRAINT SUBSCRIPTION_NAME_TENANT UNIQUE (NAME, TENANT_ID),
UNIQUE (UUID)
)
/
-- Generate ID using sequence and trigger
CREATE SEQUENCE AM_POLICY_SUBSCRIPTION_seq START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
/
CREATE OR REPLACE TRIGGER AM_POLICY_SUBSCRIPTION_seq_tr
BEFORE INSERT ON AM_POLICY_SUBSCRIPTION FOR EACH ROW
WHEN (NEW.POLICY_ID IS NULL)
BEGIN
SELECT AM_POLICY_SUBSCRIPTION_seq.NEXTVAL INTO :NEW.POLICY_ID FROM DUAL;
END;
/
CREATE TABLE AM_POLICY_APPLICATION (
POLICY_ID INTEGER NOT NULL,
NAME VARCHAR2(512) NOT NULL,
DISPLAY_NAME VARCHAR2(512) DEFAULT NULL NULL,
TENANT_ID INTEGER NOT NULL,
DESCRIPTION VARCHAR2(1024) DEFAULT NULL NULL,
QUOTA_TYPE VARCHAR2(25) NOT NULL,
QUOTA INTEGER NOT NULL,
QUOTA_UNIT VARCHAR2(10) DEFAULT NULL NULL,
UNIT_TIME INTEGER NOT NULL,
TIME_UNIT VARCHAR2(25) NOT NULL,
IS_DEPLOYED INTEGER DEFAULT 0 NOT NULL,
CUSTOM_ATTRIBUTES BLOB DEFAULT NULL,
UUID VARCHAR2(256),
PRIMARY KEY (POLICY_ID),
CONSTRAINT AM_POLICY_APP_NAME_TENANT UNIQUE (NAME, TENANT_ID),
UNIQUE (UUID)
)
/
-- Generate ID using sequence and trigger
CREATE SEQUENCE AM_POLICY_APPLICATION_seq START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
/
CREATE OR REPLACE TRIGGER AM_POLICY_APPLICATION_seq_tr
BEFORE INSERT ON AM_POLICY_APPLICATION FOR EACH ROW
WHEN (NEW.POLICY_ID IS NULL)
BEGIN
SELECT AM_POLICY_APPLICATION_seq.NEXTVAL INTO :NEW.POLICY_ID FROM DUAL;
END;
/
CREATE TABLE AM_API_THROTTLE_POLICY (
POLICY_ID INTEGER NOT NULL,
NAME VARCHAR2(512) NOT NULL,
DISPLAY_NAME VARCHAR2(512) DEFAULT NULL NULL,
TENANT_ID INTEGER NOT NULL,
DESCRIPTION VARCHAR2 (1024),
DEFAULT_QUOTA_TYPE VARCHAR2(25) NOT NULL,
DEFAULT_QUOTA INTEGER NOT NULL,
DEFAULT_QUOTA_UNIT VARCHAR2(10) NULL,
DEFAULT_UNIT_TIME INTEGER NOT NULL,
DEFAULT_TIME_UNIT VARCHAR2(25) NOT NULL,
APPLICABLE_LEVEL VARCHAR2(25) NOT NULL,
IS_DEPLOYED INTEGER DEFAULT 0 NOT NULL,
UUID VARCHAR2(256),
PRIMARY KEY (POLICY_ID),
CONSTRAINT API_POLICY_NAME_TENANT UNIQUE (NAME, TENANT_ID),
UNIQUE (UUID)
)
/
-- Generate ID using sequence and trigger
CREATE SEQUENCE AM_API_THROTTLE_POLICY_seq START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
/
CREATE OR REPLACE TRIGGER AM_API_THROTTLE_POLICY_seq_tr
BEFORE INSERT ON AM_API_THROTTLE_POLICY FOR EACH ROW
WHEN (NEW.POLICY_ID IS NULL)
BEGIN
SELECT AM_API_THROTTLE_POLICY_seq.NEXTVAL INTO :NEW.POLICY_ID FROM DUAL;
END;
/
CREATE TABLE AM_CONDITION_GROUP (
CONDITION_GROUP_ID INTEGER NOT NULL,
POLICY_ID INTEGER NOT NULL,
QUOTA_TYPE VARCHAR2(25),
QUOTA INTEGER NOT NULL,
QUOTA_UNIT VARCHAR2(10) DEFAULT NULL NULL,
UNIT_TIME INTEGER NOT NULL,
TIME_UNIT VARCHAR2(25) NOT NULL,
DESCRIPTION VARCHAR2(1024) DEFAULT NULL NULL,
PRIMARY KEY (CONDITION_GROUP_ID),
FOREIGN KEY (POLICY_ID) REFERENCES AM_API_THROTTLE_POLICY(POLICY_ID) ON DELETE CASCADE
)
/
-- Generate ID using sequence and trigger
CREATE SEQUENCE AM_CONDITION_GROUP_seq START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
/
CREATE OR REPLACE TRIGGER AM_CONDITION_GROUP_seq_tr
BEFORE INSERT ON AM_CONDITION_GROUP FOR EACH ROW
WHEN (NEW.CONDITION_GROUP_ID IS NULL)
BEGIN
SELECT AM_CONDITION_GROUP_seq.NEXTVAL INTO :NEW.CONDITION_GROUP_ID FROM DUAL;
END;
/
CREATE TABLE AM_QUERY_PARAMETER_CONDITION (
QUERY_PARAMETER_ID INTEGER NOT NULL,
CONDITION_GROUP_ID INTEGER NOT NULL,
PARAMETER_NAME VARCHAR2(255) DEFAULT NULL,
PARAMETER_VALUE VARCHAR2(255) DEFAULT NULL,
IS_PARAM_MAPPING CHAR(1) DEFAULT 1,
PRIMARY KEY (QUERY_PARAMETER_ID),
FOREIGN KEY (CONDITION_GROUP_ID) REFERENCES AM_CONDITION_GROUP(CONDITION_GROUP_ID) ON DELETE CASCADE
)
/
-- Generate ID using sequence and trigger
CREATE SEQUENCE QUERY_PARAMETER_CONDITION_seq START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
/
CREATE OR REPLACE TRIGGER QUERY_PARAMETER_CONDITION_tr
BEFORE INSERT ON AM_QUERY_PARAMETER_CONDITION FOR EACH ROW
WHEN (NEW.QUERY_PARAMETER_ID IS NULL)
BEGIN
SELECT AM_QUERY_PARAMETER_CONDITION_seq.NEXTVAL INTO :NEW.QUERY_PARAMETER_ID FROM DUAL;
END;
/
CREATE TABLE AM_HEADER_FIELD_CONDITION (
HEADER_FIELD_ID INTEGER NOT NULL,
CONDITION_GROUP_ID INTEGER NOT NULL,
HEADER_FIELD_NAME VARCHAR2(255) DEFAULT NULL,
HEADER_FIELD_VALUE VARCHAR2(255) DEFAULT NULL,
IS_HEADER_FIELD_MAPPING CHAR(1) DEFAULT 1,
PRIMARY KEY (HEADER_FIELD_ID),
FOREIGN KEY (CONDITION_GROUP_ID) REFERENCES AM_CONDITION_GROUP(CONDITION_GROUP_ID) ON DELETE CASCADE
)
/
-- Generate ID using sequence and trigger
CREATE SEQUENCE AM_HEADER_FIELD_CONDITION_seq START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
/
CREATE OR REPLACE TRIGGER AM_HEADER_FIELD_CONDITION_tr
BEFORE INSERT ON AM_HEADER_FIELD_CONDITION FOR EACH ROW
WHEN (NEW.HEADER_FIELD_ID IS NULL)
BEGIN
SELECT AM_HEADER_FIELD_CONDITION_seq.NEXTVAL INTO :NEW.HEADER_FIELD_ID FROM DUAL;
END;
/
CREATE TABLE AM_JWT_CLAIM_CONDITION (
JWT_CLAIM_ID INTEGER NOT NULL,
CONDITION_GROUP_ID INTEGER NOT NULL,
CLAIM_URI VARCHAR2(512) DEFAULT NULL,
CLAIM_ATTRIB VARCHAR2(1024) DEFAULT NULL,
IS_CLAIM_MAPPING CHAR(1) DEFAULT 1,
PRIMARY KEY (JWT_CLAIM_ID),
FOREIGN KEY (CONDITION_GROUP_ID) REFERENCES AM_CONDITION_GROUP(CONDITION_GROUP_ID) ON DELETE CASCADE
)
/
-- Generate ID using sequence and trigger
CREATE SEQUENCE AM_JWT_CLAIM_CONDITION_seq START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
/
CREATE OR REPLACE TRIGGER AM_JWT_CLAIM_CONDITION_seq_tr
BEFORE INSERT ON AM_JWT_CLAIM_CONDITION FOR EACH ROW
WHEN (NEW.JWT_CLAIM_ID IS NULL)
BEGIN
SELECT AM_JWT_CLAIM_CONDITION_seq.NEXTVAL INTO :NEW.JWT_CLAIM_ID FROM DUAL;
END;
/
CREATE TABLE AM_IP_CONDITION (
AM_IP_CONDITION_ID INTEGER NOT NULL,
STARTING_IP VARCHAR2(45) NULL,
ENDING_IP VARCHAR2(45) NULL,
SPECIFIC_IP VARCHAR2(45) NULL,
WITHIN_IP_RANGE CHAR(1) DEFAULT 1,
CONDITION_GROUP_ID INTEGER NULL,
PRIMARY KEY (AM_IP_CONDITION_ID)
, CONSTRAINT fk_AM_IP_CONDITION_1 FOREIGN KEY (CONDITION_GROUP_ID)
REFERENCES AM_CONDITION_GROUP (CONDITION_GROUP_ID) ON DELETE CASCADE )
/
-- Generate ID using sequence and trigger
CREATE SEQUENCE AM_IP_CONDITION_seq START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
/
CREATE OR REPLACE TRIGGER AM_IP_CONDITION_seq_tr
BEFORE INSERT ON AM_IP_CONDITION FOR EACH ROW
WHEN (NEW.AM_IP_CONDITION_ID IS NULL)
BEGIN
SELECT AM_IP_CONDITION_seq.NEXTVAL INTO :NEW.AM_IP_CONDITION_ID FROM DUAL;
END;
/
CREATE INDEX fk_AM_IP_CONDITION_1_idx ON AM_IP_CONDITION (CONDITION_GROUP_ID ASC)
/
CREATE TABLE AM_POLICY_GLOBAL (
POLICY_ID INTEGER NOT NULL,
NAME VARCHAR2(512) NOT NULL,
KEY_TEMPLATE VARCHAR2(512) NOT NULL,
TENANT_ID INTEGER NOT NULL,
DESCRIPTION VARCHAR2(1024) DEFAULT NULL NULL,
SIDDHI_QUERY BLOB DEFAULT NULL,
IS_DEPLOYED INTEGER DEFAULT 0 NOT NULL,
UUID VARCHAR2(256),
PRIMARY KEY (POLICY_ID),
UNIQUE (UUID)
)
/
-- Generate ID using sequence and trigger
CREATE SEQUENCE AM_POLICY_GLOBAL_seq START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
/
CREATE OR REPLACE TRIGGER AM_POLICY_GLOBAL_seq_tr
BEFORE INSERT ON AM_POLICY_GLOBAL FOR EACH ROW
WHEN (NEW.POLICY_ID IS NULL)
BEGIN
SELECT AM_POLICY_GLOBAL_seq.NEXTVAL INTO :NEW.POLICY_ID FROM DUAL;
END;
/
CREATE TABLE AM_THROTTLE_TIER_PERMISSIONS (
THROTTLE_TIER_PERMISSIONS_ID INTEGER NOT NULL,
TIER VARCHAR2(50) NULL,
PERMISSIONS_TYPE VARCHAR2(50) NULL,
ROLES VARCHAR2(512) NULL,
TENANT_ID INTEGER NULL,
PRIMARY KEY (THROTTLE_TIER_PERMISSIONS_ID))
/
-- Generate ID using sequence and trigger
CREATE SEQUENCE THROTTLE_TIER_PERMISSIONS_seq START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
/
CREATE OR REPLACE TRIGGER THROTTLE_TIER_PERMISSIONS_tr
BEFORE INSERT ON AM_THROTTLE_TIER_PERMISSIONS FOR EACH ROW
WHEN (NEW.THROTTLE_TIER_PERMISSIONS_ID IS NULL)
BEGIN
SELECT THROTTLE_TIER_PERMISSIONS_seq.NEXTVAL INTO :NEW.THROTTLE_TIER_PERMISSIONS_ID FROM DUAL;
END;
/
CREATE TABLE AM_BLOCK_CONDITIONS (
CONDITION_ID INTEGER NOT NULL,
TYPE varchar2(45) DEFAULT NULL,
VALUE varchar2(45) DEFAULT NULL,
ENABLED varchar2(45) DEFAULT NULL,
DOMAIN varchar2(45) DEFAULT NULL,
UUID VARCHAR2(256),
PRIMARY KEY (CONDITION_ID),
UNIQUE (UUID)
)
/
-- Generate ID using sequence and trigger
CREATE SEQUENCE AM_BLOCK_CONDITIONS_seq START WITH 1 INCREMENT BY 1 CACHE 20 ORDER
/
CREATE OR REPLACE TRIGGER AM_BLOCK_CONDITIONS_seq_tr
BEFORE INSERT ON AM_BLOCK_CONDITIONS FOR EACH ROW
WHEN (NEW.CONDITION_ID IS NULL)
BEGIN
SELECT AM_BLOCK_CONDITIONS_seq.NEXTVAL INTO :NEW.CONDITION_ID FROM DUAL;
END;
/
-- End of API-MGT Tables --
--permance 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--

@ -23,6 +23,8 @@ CREATE TABLE IDN_OAUTH_CONSUMER_APPS (
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',
CONSTRAINT CONSUMER_KEY_CONSTRAINT UNIQUE (CONSUMER_KEY),
PRIMARY KEY (ID)
);
@ -98,6 +100,8 @@ CREATE TABLE IDN_OAUTH2_AUTHORIZATION_CODE (
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
);
@ -388,10 +392,11 @@ CREATE TABLE IDP (
PRIMARY KEY (ID),
UNIQUE (TENANT_ID, NAME));
INSERT INTO IDP (TENANT_ID, NAME, HOME_REALM_ID) VALUES (-1234, 'LOCAL', 'localhost');
DROP TABLE IF EXISTS IDP_ROLE;
DROP SEQUENCE IF EXISTS IDP_ROLE_SEQ;
INSERT INTO IDP (TENANT_ID, NAME, HOME_REALM_ID) VALUES (-1234, 'LOCAL', 'localhost');
CREATE SEQUENCE IDP_ROLE_SEQ;
CREATE TABLE IDP_ROLE (
ID INTEGER DEFAULT NEXTVAL('IDP_ROLE_SEQ'),
@ -604,13 +609,11 @@ CREATE TABLE WF_REQUEST (
DROP TABLE IF EXISTS WF_BPS_PROFILE;
CREATE TABLE WF_BPS_PROFILE (
PROFILE_NAME VARCHAR(45),
HOST_URL_MANAGER VARCHAR(45),
HOST_URL_WORKER VARCHAR(45),
HOST_URL_MANAGER VARCHAR(255),
HOST_URL_WORKER VARCHAR(255),
USERNAME VARCHAR(45),
PASSWORD VARCHAR(255),
CALLBACK_HOST VARCHAR (45),
CALLBACK_USERNAME VARCHAR (45),
CALLBACK_PASSWORD VARCHAR (255),
TENANT_ID INTEGER DEFAULT -1,
PRIMARY KEY (PROFILE_NAME, TENANT_ID)
);
@ -679,7 +682,7 @@ CREATE TABLE WF_WORKFLOW_REQUEST_RELATION(
-- End of IDENTITY Tables--
CREATE SEQUENCE AM_SUBSCRIBER_SEQUENCE START WITH 1 INCREMENT BY 1;
CREATE TABLE AM_SUBSCRIBER (
CREATE TABLE IF NOT EXISTS AM_SUBSCRIBER (
SUBSCRIBER_ID INTEGER DEFAULT nextval('am_subscriber_sequence'),
USER_ID VARCHAR(50) NOT NULL,
TENANT_ID INTEGER NOT NULL,
@ -695,7 +698,7 @@ CREATE TABLE AM_SUBSCRIBER (
;
CREATE SEQUENCE AM_APPLICATION_SEQUENCE START WITH 1 INCREMENT BY 1 ;
CREATE TABLE AM_APPLICATION (
CREATE TABLE IF NOT EXISTS AM_APPLICATION (
APPLICATION_ID INTEGER DEFAULT nextval('am_application_sequence'),
NAME VARCHAR(100),
SUBSCRIBER_ID INTEGER,
@ -717,24 +720,24 @@ CREATE TABLE AM_APPLICATION (
;
CREATE SEQUENCE AM_API_SEQUENCE START WITH 1 INCREMENT BY 1;
CREATE TABLE AM_API (
CREATE TABLE IF NOT EXISTS AM_API (
API_ID INTEGER DEFAULT nextval('am_api_sequence'),
API_PROVIDER VARCHAR(256),
API_NAME VARCHAR(256),
API_VERSION VARCHAR(30),
CONTEXT VARCHAR(256),
CONTEXT_TEMPLATE VARCHAR(256),
API_TIER VARCHAR(256),
CREATED_BY VARCHAR(100),
CREATED_TIME DATE,
UPDATED_BY VARCHAR(100),
UPDATED_TIME DATE,
PRIMARY KEY(API_ID),
UNIQUE (API_PROVIDER,API_NAME,API_VERSION)
)
;
);
CREATE SEQUENCE AM_API_URL_MAPPING_SEQUENCE START WITH 1 INCREMENT BY 1;
CREATE TABLE AM_API_URL_MAPPING (
CREATE TABLE IF NOT EXISTS AM_API_URL_MAPPING (
URL_MAPPING_ID INTEGER DEFAULT nextval('am_api_url_mapping_sequence'),
API_ID INTEGER NOT NULL,
HTTP_METHOD VARCHAR(20) NULL,
@ -747,7 +750,7 @@ CREATE TABLE AM_API_URL_MAPPING (
;
CREATE SEQUENCE AM_SUBSCRIPTION_SEQUENCE START WITH 1 INCREMENT BY 1;
CREATE TABLE AM_SUBSCRIPTION (
CREATE TABLE IF NOT EXISTS AM_SUBSCRIPTION (
SUBSCRIPTION_ID INTEGER DEFAULT nextval('am_subscription_sequence'),
TIER_ID VARCHAR(50),
API_ID INTEGER,
@ -767,7 +770,7 @@ CREATE TABLE AM_SUBSCRIPTION (
)
;
CREATE TABLE AM_SUBSCRIPTION_KEY_MAPPING (
CREATE TABLE IF NOT EXISTS AM_SUBSCRIPTION_KEY_MAPPING (
SUBSCRIPTION_ID INTEGER,
ACCESS_TOKEN VARCHAR(512),
KEY_TYPE VARCHAR(512) NOT NULL,
@ -808,7 +811,7 @@ CREATE TABLE IF NOT EXISTS AM_APPLICATION_REGISTRATION (
CREATE SEQUENCE AM_API_LC_EVENT_SEQUENCE START WITH 1 INCREMENT BY 1;
CREATE TABLE AM_API_LC_EVENT (
CREATE TABLE IF NOT EXISTS AM_API_LC_EVENT (
EVENT_ID INTEGER DEFAULT nextval('am_api_lc_event_sequence'),
API_ID INTEGER NOT NULL,
PREVIOUS_STATE VARCHAR(50),
@ -821,7 +824,7 @@ CREATE TABLE AM_API_LC_EVENT (
)
;
CREATE TABLE AM_APP_KEY_DOMAIN_MAPPING (
CREATE TABLE IF NOT EXISTS AM_APP_KEY_DOMAIN_MAPPING (
CONSUMER_KEY VARCHAR(255),
AUTHZ_DOMAIN VARCHAR(255) DEFAULT 'ALL',
PRIMARY KEY (CONSUMER_KEY,AUTHZ_DOMAIN)
@ -829,7 +832,7 @@ CREATE TABLE AM_APP_KEY_DOMAIN_MAPPING (
;
CREATE SEQUENCE AM_API_COMMENTS_SEQUENCE START WITH 1 INCREMENT BY 1;
CREATE TABLE AM_API_COMMENTS (
CREATE TABLE IF NOT EXISTS AM_API_COMMENTS (
COMMENT_ID INTEGER DEFAULT nextval('am_api_comments_sequence'),
COMMENT_TEXT VARCHAR(512),
COMMENTED_USER VARCHAR(255),
@ -841,7 +844,7 @@ CREATE TABLE AM_API_COMMENTS (
;
CREATE SEQUENCE AM_WORKFLOWS_SEQUENCE START WITH 1 INCREMENT BY 1;
CREATE TABLE AM_WORKFLOWS(
CREATE TABLE IF NOT EXISTS AM_WORKFLOWS(
WF_ID INTEGER DEFAULT nextval('am_workflows_sequence'),
WF_REFERENCE VARCHAR(255) NOT NULL,
WF_TYPE VARCHAR(255) NOT NULL,
@ -858,7 +861,7 @@ CREATE TABLE AM_WORKFLOWS(
;
CREATE SEQUENCE AM_API_RATINGS_SEQUENCE START WITH 1 INCREMENT BY 1;
CREATE TABLE AM_API_RATINGS (
CREATE TABLE IF NOT EXISTS AM_API_RATINGS (
RATING_ID INTEGER DEFAULT nextval('am_api_ratings_sequence'),
API_ID INTEGER,
RATING INTEGER,
@ -870,7 +873,7 @@ CREATE TABLE AM_API_RATINGS (
;
CREATE SEQUENCE AM_TIER_PERMISSIONS_SEQUENCE START WITH 1 INCREMENT BY 1;
CREATE TABLE AM_TIER_PERMISSIONS (
CREATE TABLE IF NOT EXISTS AM_TIER_PERMISSIONS (
TIER_PERMISSIONS_ID INTEGER DEFAULT nextval('am_tier_permissions_sequence'),
TIER VARCHAR(50) NOT NULL,
PERMISSIONS_TYPE VARCHAR(50) NOT NULL,
@ -880,7 +883,7 @@ CREATE TABLE AM_TIER_PERMISSIONS (
);
CREATE SEQUENCE AM_EXTERNAL_STORES_SEQUENCE START WITH 1 INCREMENT BY 1;
CREATE TABLE AM_EXTERNAL_STORES (
CREATE TABLE IF NOT EXISTS AM_EXTERNAL_STORES (
APISTORE_ID INTEGER DEFAULT nextval('am_external_stores_sequence'),
API_ID INTEGER,
STORE_ID VARCHAR(255) NOT NULL,
@ -892,7 +895,7 @@ CREATE TABLE AM_EXTERNAL_STORES (
)
;
DROP TABLE IF EXISTS AM_API_SCOPES;
CREATE TABLE IF NOT EXISTS AM_API_SCOPES (
API_ID INTEGER NOT NULL,
SCOPE_ID INTEGER NOT NULL,
@ -900,10 +903,9 @@ CREATE TABLE IF NOT EXISTS AM_API_SCOPES (
FOREIGN KEY (SCOPE_ID) REFERENCES IDN_OAUTH2_SCOPE (SCOPE_ID) ON DELETE CASCADE ON UPDATE CASCADE
);
DROP TABLE IF EXISTS AM_API_DEFAULT_VERSION;
DROP SEQUENCE IF EXISTS AM_API_DEFAULT_VERSION_PK_SEQ;
CREATE SEQUENCE AM_API_DEFAULT_VERSION_PK_SEQ;
CREATE TABLE AM_API_DEFAULT_VERSION (
CREATE TABLE IF NOT EXISTS AM_API_DEFAULT_VERSION (
DEFAULT_VERSION_ID INTEGER DEFAULT NEXTVAL('am_api_default_version_pk_seq'),
API_NAME VARCHAR(256) NOT NULL ,
API_PROVIDER VARCHAR(256) NOT NULL ,
@ -915,4 +917,246 @@ CREATE TABLE AM_API_DEFAULT_VERSION (
CREATE INDEX IDX_SUB_APP_ID ON AM_SUBSCRIPTION (APPLICATION_ID, SUBSCRIPTION_ID)
;
commit;
CREATE SEQUENCE AM_ALERT_TYPES_SEQ START WITH 1 INCREMENT BY 1;
CREATE TABLE IF NOT EXISTS AM_ALERT_TYPES (
ALERT_TYPE_ID INTEGER DEFAULT NEXTVAL('am_alert_types_seq'),
ALERT_TYPE_NAME VARCHAR(255) NOT NULL ,
STAKE_HOLDER VARCHAR(100) NOT NULL,
PRIMARY KEY (ALERT_TYPE_ID)
);
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 ,
CONSTRAINT AM_ALERT_TYPES_VALUES_CONST UNIQUE (ALERT_TYPE_ID,USER_NAME,STAKE_HOLDER)
);
CREATE SEQUENCE AM_ALERT_EMAILLIST_SEQ START WITH 1 INCREMENT BY 1;
CREATE TABLE IF NOT EXISTS AM_ALERT_EMAILLIST (
EMAIL_LIST_ID INTEGER DEFAULT NEXTVAL('am_alert_emaillist_seq'),
USER_NAME VARCHAR(255) NOT NULL ,
STAKE_HOLDER VARCHAR(100) NOT NULL ,
CONSTRAINT AM_ALERT_EMAILLIST_CONST UNIQUE (EMAIL_LIST_ID,USER_NAME,STAKE_HOLDER),
PRIMARY KEY (EMAIL_LIST_ID)
);
CREATE TABLE IF NOT EXISTS AM_ALERT_EMAILLIST_DETAILS (
EMAIL_LIST_ID INTEGER,
EMAIL VARCHAR(255),
CONSTRAINT AM_ALERT_EMAILLIST_DETAILS_CONST UNIQUE (EMAIL_LIST_ID,EMAIL)
);
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 SEQUENCE AM_POLICY_SUBSCRIPTION_SEQ START WITH 1 INCREMENT BY 1;
CREATE TABLE IF NOT EXISTS AM_POLICY_SUBSCRIPTION (
POLICY_ID INTEGER DEFAULT NEXTVAL('AM_POLICY_SUBSCRIPTION_SEQ'),
NAME VARCHAR(512) NOT NULL,
DISPLAY_NAME VARCHAR(512) NULL DEFAULT NULL,
TENANT_ID INTEGER NOT NULL,
DESCRIPTION VARCHAR(1024) NULL DEFAULT NULL,
QUOTA_TYPE VARCHAR(25) NOT NULL,
QUOTA INTEGER NOT NULL,
QUOTA_UNIT VARCHAR(10) NULL,
UNIT_TIME INTEGER NOT NULL,
TIME_UNIT VARCHAR(25) NOT NULL,
RATE_LIMIT_COUNT INTEGER NULL DEFAULT NULL,
RATE_LIMIT_TIME_UNIT VARCHAR(25) NULL DEFAULT NULL,
IS_DEPLOYED BOOLEAN NOT NULL DEFAULT '0',
CUSTOM_ATTRIBUTES BYTEA 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 (NAME, TENANT_ID),
UNIQUE (UUID)
);
CREATE SEQUENCE AM_POLICY_APPLICATION_SEQ START WITH 1 INCREMENT BY 1;
CREATE TABLE IF NOT EXISTS AM_POLICY_APPLICATION (
POLICY_ID INTEGER DEFAULT NEXTVAL('AM_POLICY_APPLICATION_SEQ'),
NAME VARCHAR(512) NOT NULL,
DISPLAY_NAME VARCHAR(512) NULL DEFAULT NULL,
TENANT_ID INTEGER NOT NULL,
DESCRIPTION VARCHAR(1024) NULL DEFAULT NULL,
QUOTA_TYPE VARCHAR(25) NOT NULL,
QUOTA INTEGER NOT NULL,
QUOTA_UNIT VARCHAR(10) NULL DEFAULT NULL,
UNIT_TIME INTEGER NOT NULL,
TIME_UNIT VARCHAR(25) NOT NULL,
IS_DEPLOYED BOOLEAN NOT NULL DEFAULT '0',
CUSTOM_ATTRIBUTES BYTEA DEFAULT NULL,
UUID VARCHAR(256),
PRIMARY KEY (POLICY_ID),
UNIQUE (NAME, TENANT_ID),
UNIQUE (UUID)
);
CREATE SEQUENCE AM_POLICY_HARD_THROTTLING_SEQ START WITH 1 INCREMENT BY 1;
CREATE TABLE IF NOT EXISTS AM_POLICY_HARD_THROTTLING (
POLICY_ID INTEGER DEFAULT NEXTVAL('AM_POLICY_HARD_THROTTLING_SEQ'),
NAME VARCHAR(512) NOT NULL,
TENANT_ID INTEGER NOT NULL,
DESCRIPTION VARCHAR(1024) NULL DEFAULT NULL,
QUOTA_TYPE VARCHAR(25) NOT NULL,
QUOTA INTEGER NOT NULL,
QUOTA_UNIT VARCHAR(10) NULL DEFAULT NULL,
UNIT_TIME INTEGER NOT NULL,
TIME_UNIT VARCHAR(25) NOT NULL,
IS_DEPLOYED BOOLEAN NOT NULL DEFAULT '0',
PRIMARY KEY (POLICY_ID),
UNIQUE (NAME, TENANT_ID)
);
CREATE SEQUENCE AM_API_THROTTLE_POLICY_SEQ START WITH 1 INCREMENT BY 1;
CREATE TABLE IF NOT EXISTS AM_API_THROTTLE_POLICY (
POLICY_ID INTEGER DEFAULT NEXTVAL('AM_API_THROTTLE_POLICY_SEQ'),
NAME VARCHAR(512) NOT NULL,
DISPLAY_NAME VARCHAR(512) NULL DEFAULT NULL,
TENANT_ID INTEGER 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 BOOLEAN NOT NULL DEFAULT '0',
UUID VARCHAR(256),
PRIMARY KEY (POLICY_ID),
UNIQUE (NAME, TENANT_ID),
UNIQUE (UUID)
);
CREATE SEQUENCE AM_CONDITION_GROUP_SEQ START WITH 1 INCREMENT BY 1;
CREATE TABLE IF NOT EXISTS AM_CONDITION_GROUP (
CONDITION_GROUP_ID INTEGER DEFAULT NEXTVAL('AM_CONDITION_GROUP_SEQ'),
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
);
CREATE SEQUENCE AM_QUERY_PARAMETER_CONDITION_SEQ START WITH 1 INCREMENT BY 1;
CREATE TABLE IF NOT EXISTS AM_QUERY_PARAMETER_CONDITION (
QUERY_PARAMETER_ID INTEGER DEFAULT NEXTVAL('AM_QUERY_PARAMETER_CONDITION_SEQ'),
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
);
CREATE SEQUENCE AM_HEADER_FIELD_CONDITION_SEQ START WITH 1 INCREMENT BY 1;
CREATE TABLE IF NOT EXISTS AM_HEADER_FIELD_CONDITION (
HEADER_FIELD_ID INTEGER DEFAULT NEXTVAL('AM_HEADER_FIELD_CONDITION_SEQ'),
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
);
CREATE SEQUENCE AM_JWT_CLAIM_CONDITION_SEQ START WITH 1 INCREMENT BY 1;
CREATE TABLE IF NOT EXISTS AM_JWT_CLAIM_CONDITION (
JWT_CLAIM_ID INTEGER DEFAULT NEXTVAL('AM_JWT_CLAIM_CONDITION_SEQ'),
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
);
CREATE SEQUENCE AM_IP_CONDITION_SEQ START WITH 1 INCREMENT BY 1;
CREATE TABLE IF NOT EXISTS AM_IP_CONDITION (
AM_IP_CONDITION_ID INTEGER DEFAULT NEXTVAL('AM_IP_CONDITION_SEQ'),
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),
FOREIGN KEY (CONDITION_GROUP_ID)
REFERENCES AM_CONDITION_GROUP (CONDITION_GROUP_ID) ON DELETE CASCADE ON UPDATE CASCADE);
CREATE SEQUENCE AM_POLICY_GLOBAL_SEQ START WITH 1 INCREMENT BY 1;
CREATE TABLE IF NOT EXISTS AM_POLICY_GLOBAL (
POLICY_ID INTEGER DEFAULT NEXTVAL('AM_POLICY_GLOBAL_SEQ'),
NAME VARCHAR(512) NOT NULL,
KEY_TEMPLATE VARCHAR(512) NOT NULL,
TENANT_ID INTEGER NOT NULL,
DESCRIPTION VARCHAR(1024) NULL DEFAULT NULL,
SIDDHI_QUERY BYTEA DEFAULT NULL,
IS_DEPLOYED BOOLEAN NOT NULL DEFAULT '0',
UUID VARCHAR(256),
PRIMARY KEY (POLICY_ID),
UNIQUE (UUID)
);
CREATE SEQUENCE AM_THROTTLE_TIER_PERMISSIONS_SEQ START WITH 1 INCREMENT BY 1;
CREATE TABLE IF NOT EXISTS AM_THROTTLE_TIER_PERMISSIONS (
THROTTLE_TIER_PERMISSIONS_ID INTEGER DEFAULT NEXTVAL('AM_THROTTLE_TIER_PERMISSIONS_SEQ'),
TIER VARCHAR(50) NULL,
PERMISSIONS_TYPE VARCHAR(50) NULL,
ROLES VARCHAR(512) NULL,
TENANT_ID INTEGER NULL,
PRIMARY KEY (THROTTLE_TIER_PERMISSIONS_ID));
CREATE SEQUENCE AM_BLOCK_CONDITIONS_SEQ START WITH 1 INCREMENT BY 1;
CREATE TABLE AM_BLOCK_CONDITIONS (
CONDITION_ID INTEGER DEFAULT NEXTVAL('AM_BLOCK_CONDITIONS_SEQ'),
TYPE varchar(45) DEFAULT NULL,
VALUE varchar(45) DEFAULT NULL,
ENABLED varchar(45) DEFAULT NULL,
DOMAIN varchar(45) DEFAULT NULL,
UUID VARCHAR(256),
PRIMARY KEY (CONDITION_ID),
UNIQUE (UUID)
);
-- 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--
commit;

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<?pde version="3.5"?>
<product name="Carbon Product" uid="carbon.product.id" id="carbon.product" application="carbon.application" version="4.4.3" useFeatures="true" includeLaunchers="true">
<product name="Carbon Product" uid="carbon.product.id" id="carbon.product" application="carbon.application" version="4.4.9" useFeatures="true" includeLaunchers="true">
<configIni use="default">
</configIni>
@ -13,7 +13,7 @@
</plugins>
<features>
<feature id="org.wso2.carbon.core.runtime" version="4.4.3"/>
<feature id="org.wso2.carbon.core.runtime" version="4.4.9"/>
</features>
<configurations>

File diff suppressed because it is too large Load Diff

@ -748,12 +748,12 @@
<version>${wss4j.security.common.version}</version>
</dependency>
<dependency>
<groupId>org.apache.ws.commons.axiom</groupId>
<groupId>org.apache.ws.commons.axiom.wso2</groupId>
<artifactId>axiom-api</artifactId>
<version>${axiom-api.version}</version>
</dependency>
<dependency>
<groupId>org.apache.ws.commons.axiom</groupId>
<groupId>org.apache.ws.commons.axiom.wso2</groupId>
<artifactId>axiom-impl</artifactId>
<version>${axiom-api.version}</version>
</dependency>
@ -793,8 +793,8 @@
<version>${bcpkix-jdk15on.version}</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<groupId>org.wso2.orbit.org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<version>${bcpkix-jdk15on.version}</version>
</dependency>
<dependency>
@ -1026,7 +1026,7 @@
<properties>
<!--Carbon kernel versions-->
<carbon.kernel.version>4.4.3</carbon.kernel.version>
<carbon.kernel.version>4.4.9</carbon.kernel.version>
<carbon.kernel.version.range>[4.4.0, 4.5.0)</carbon.kernel.version.range>
<carbon.p2.plugin.version>1.5.4</carbon.p2.plugin.version>
@ -1035,7 +1035,7 @@
<maven-buildnumber-plugin.version>1.3</maven-buildnumber-plugin.version>
<!--Jaggery -->
<jaggery.version>0.12.0</jaggery.version>
<jaggery.version>0.12.6</jaggery.version>
<jaggery.extensions.version>1.5.2</jaggery.extensions.version>
<jaggery.extensions.sso.version>1.5.2</jaggery.extensions.sso.version>
<jaggery.extensions.carbon.version>1.5.2</jaggery.extensions.carbon.version>
@ -1062,27 +1062,39 @@
<javax.ws.rs.version>1.1.1</javax.ws.rs.version>
<!-- Carbon Commons -->
<carbon.commons.version>4.4.9</carbon.commons.version>
<carbon.commons.version>4.5.4</carbon.commons.version>
<!-- Carbon Deployment -->
<carbon.deployment.version>4.6.0</carbon.deployment.version>
<carbon.deployment.version>4.7.0</carbon.deployment.version>
<!-- Carbon Identity -->
<carbon.identity.version>5.0.7</carbon.identity.version>
<carbon.identity.version.range>[5.0.7, 6.0.0)</carbon.identity.version.range>
<carbon.identity.framework.version>5.2.0</carbon.identity.framework.version>
<carbon.identity.framework.version.range>[5.2.0, 6.0.0)</carbon.identity.framework.version.range>
<identity.local.auth.basicauth.version>5.1.1</identity.local.auth.basicauth.version>
<identity.inbound.auth.openid.version>5.1.1</identity.inbound.auth.openid.version>
<identity.inbound.auth.saml.version>5.1.1</identity.inbound.auth.saml.version>
<identity.carbon.auth.saml2.version>5.1.2</identity.carbon.auth.saml2.version>
<identity.inbound.auth.oauth.version>5.1.2</identity.inbound.auth.oauth.version>
<identity.carbon.auth.mutual.ssl.version>5.1.1</identity.carbon.auth.mutual.ssl.version>
<identity.user.ws.version>5.1.2</identity.user.ws.version>
<identity.outbound.auth.requestpath.basicauth.version>5.1.1</identity.outbound.auth.requestpath.basicauth.version>
<identity.outbound.auth.requestpath.oauth.version>5.1.1</identity.outbound.auth.requestpath.oauth.version>
<identity.outbound.auth.samlsso.version>5.1.2</identity.outbound.auth.samlsso.version>
<!--JWT grant type extension feature-->
<identity.jwt.extension.version>1.0.2</identity.jwt.extension.version>
<!-- Carbon Multi-tenancy -->
<carbon.multitenancy.version>4.5.0</carbon.multitenancy.version>
<carbon.multitenancy.version>4.6.0</carbon.multitenancy.version>
<!-- Carbon Registry -->
<carbon.registry.version>4.4.8</carbon.registry.version>
<carbon.registry.version>4.5.6</carbon.registry.version>
<!-- Carbon Governance -->
<carbon.governance.version>4.5.8</carbon.governance.version>
<carbon.governance.version>4.6.4</carbon.governance.version>
<!-- Carbon Device Management -->
<carbon.device.mgt.version>1.2.2-SNAPSHOT</carbon.device.mgt.version>
<carbon.device.mgt.version.range>[1.1.3, 2.0.0)</carbon.device.mgt.version.range>
<carbon.device.mgt.version.range>[1.1.1, 2.0.0)</carbon.device.mgt.version.range>
<!-- IOT Device Management -->
<carbon.iot.device.mgt.version>1.0.0-SNAPSHOT</carbon.iot.device.mgt.version>
@ -1091,14 +1103,14 @@
<carbon.device.mgt.plugin.version>2.2.2-SNAPSHOT</carbon.device.mgt.plugin.version>
<!-- API Management -->
<carbon.api.mgt.version>5.0.5</carbon.api.mgt.version>
<orbit.version.pdfbox>1.8.10.wso2v2</orbit.version.pdfbox>
<carbon.api.mgt.version>6.0.5</carbon.api.mgt.version>
<carbon.api.mgt.version.range>(5.0.0,7.0.0]</carbon.api.mgt.version.range>
<!-- Carbon Mediation -->
<carbon.mediation.version>4.5.1</carbon.mediation.version>
<carbon.mediation.version>4.6.6</carbon.mediation.version>
<!-- Carbon Analytics Common (DAS) -->
<carbon.analytics.common.version>5.0.12-alpha</carbon.analytics.common.version>
<carbon.analytics.common.version>5.1.3</carbon.analytics.common.version>
<!-- Tomcat -->
<orbit.tomcat.version>7.0.59.wso2v1</orbit.tomcat.version>
@ -1113,23 +1125,24 @@
<axis2-transports.wso2.version>1.1.0-wso2v17</axis2-transports.wso2.version>
<!--DAS-->
<carbon.analytics.version>1.0.6-ALPHA</carbon.analytics.version>
<carbon.analytics.version>1.2.8</carbon.analytics.version>
<cipher.tool.version>1.0.0-wso2v3</cipher.tool.version>
<carbon.dashboard.version>1.0.18</carbon.dashboard.version>
<shindig.version>1.0.18</shindig.version>
<carbon.event-processing.version>2.0.13-alpha</carbon.event-processing.version>
<carbon.data.version>4.3.4</carbon.data.version>
<carbon.dashboard.version>2.0.2</carbon.dashboard.version>
<shindig.version>2.0.2</shindig.version>
<carbon.event-processing.version>2.1.4</carbon.event-processing.version>
<carbon.data.version>4.3.6</carbon.data.version>
<orbit.version.commons-httpclient>3.1.0.wso2v2</orbit.version.commons-httpclient>
<wss4j.security.version>1.6.17</wss4j.security.version>
<wss4j.security.common.version>2.0.0</wss4j.security.common.version>
<axiom-api.version>1.2.14</axiom-api.version>
<axiom-api.version>1.2.11.wso2v10</axiom-api.version>
<axiom.wso2.version>1.2.11.wso2v10</axiom.wso2.version>
<log4j.version>1.2.17</log4j.version>
<spring-web.version>3.0.5.RELEASE</spring-web.version>
<spring-ws-security.version>2.1.0.RELEASE</spring-ws-security.version>
<jaxws-rt.version>2.2.8</jaxws-rt.version>
<saaj-impl.version>1.3.18</saaj-impl.version>
<bcpkix-jdk15on.version>1.49</bcpkix-jdk15on.version>
<bcpkix-jdk15on.version>1.52.0.wso2v2</bcpkix-jdk15on.version>
<plexus-utils.version>3.0.21</plexus-utils.version>
<commons-codec.version>1.7</commons-codec.version>
<joda-time.version>2.2</joda-time.version>
@ -1137,17 +1150,18 @@
<jsr311-api.version>1.1.1</jsr311-api.version>
<google.gson.version>2.3.1</google.gson.version>
<!-- Caramel version-->
<caramel.version>1.0.1</caramel.version>
<!-- App manager version-->
<appmgt.feature.version>1.1.1</appmgt.feature.version>
<carbon.appmgt.version>1.1.1</carbon.appmgt.version>
<appmgt.feature.version>1.2.2</appmgt.feature.version>
<carbon.appmgt.version>1.2.2</carbon.appmgt.version>
<!-- Carbon Store version-->
<carbon.store.version>1.4.1</carbon.store.version>
<carbon.store.version>1.4.2</carbon.store.version>
<!-- Cipher tool version-->
<cipher.tool.version>1.0.0-wso2v3</cipher.tool.version>
<httpclient.version>4.3.1.wso2v2</httpclient.version>
<!--XMPP/MQTT Version-->
<smack.wso2.version>3.0.4.wso2v1</smack.wso2.version>
<smackx.wso2.version>3.0.4.wso2v1</smackx.wso2.version>
@ -1160,12 +1174,9 @@
<product.mb.version>3.1.2</product.mb.version>
<carbon.metrics.version>1.2.0</carbon.metrics.version>
<!--JWT grant type extension feature-->
<identity.jwt.extension.version>1.0.2</identity.jwt.extension.version>
<!--http client version-->
<httpclient.version>4.3.1.wso2v2</httpclient.version>
<httpclient.version.range>[4.3.1, 5.0.0)</httpclient.version.range>
<httpcore.version>4.3.3.wso2v1</httpcore.version>
<httpclient.version>4.5.2</httpclient.version>
<httpcore.version>4.4.1</httpcore.version>
<!--json version-->
<json-simple.version>1.1.wso2v1</json-simple.version>
<json.path.version>0.9.1</json.path.version>
@ -1174,7 +1185,7 @@
<eclipse.paho.version>1.0.2</eclipse.paho.version>
<!-- CDMF Analytics -->
<cdmf.analytics.version>1.0.0</cdmf.analytics.version>
<cdmf.analytics.version>1.0.1-SNAPSHOT</cdmf.analytics.version>
</properties>
<scm>

Loading…
Cancel
Save