diff --git a/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/db2.sql b/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/db2.sql index b029ed8dd200..bdadae86c31c 100644 --- a/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/db2.sql +++ b/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/db2.sql @@ -1836,6 +1836,70 @@ CREATE TABLE IDN_OAUTH_PAR ( PARAMETERS CLOB(1M) ) / +CREATE TABLE IDN_SAML2_SERVICE_PROVIDER ( + ID INTEGER NOT NULL, + ISSUER VARCHAR(255) NOT NULL, + DEFAULT_ASSERTION_CONSUMER_URL VARCHAR(2048) NOT NULL, + NAME_ID_FORMAT VARCHAR(255) NOT NULL, + CERT_ALIAS VARCHAR(255), + REQ_SIG_VALIDATION CHAR(1), + SIGN_RESPONSE CHAR(1) NOT NULL, + SIGN_ASSERTIONS CHAR(1) NOT NULL, + SIGNING_ALGO VARCHAR(255) NOT NULL, + DIGEST_ALGO VARCHAR(255) NOT NULL, + ENCRYPT_ASSERTION CHAR(1), + ASSERTION_ENCRYPTION_ALGO VARCHAR(255), + KEY_ENCRYPTION_ALGO VARCHAR(255), + ATTR_PROFILE_ENABLED CHAR(1) NOT NULL, + ATTR_SERVICE_INDEX VARCHAR(255), + SLO_PROFILE_ENABLED CHAR(1) NOT NULL, + SLO_METHOD VARCHAR(255), + SLO_RESPONSE_URL VARCHAR(2048), + SLO_REQUEST_URL VARCHAR(2048), + IDP_INIT_SSO_ENABLED CHAR(1), + IDP_INIT_SLO_ENABLED CHAR(1), + QUERY_REQUEST_PROFILE_ENABLED CHAR(1) NOT NULL, + ECP_ENABLED CHAR(1) NOT NULL, + ARTIFACT_BINDING_ENABLED CHAR(1) NOT NULL, + ARTIFACT_RESOLVE_REQ_SIG_VALIDATION CHAR(1), + IDP_ENTITY_ID_ALIAS VARCHAR(255), + ISSUER_QUALIFIER VARCHAR(255), + SUPPORTED_ASSERTION_QUERY_REQUEST_TYPES VARCHAR(255), + TENANT_ID INTEGER, + PRIMARY KEY (ID) +) +/ +CREATE SEQUENCE IDN_SAML2_SERVICE_PROVIDER_SEQ START WITH 1 INCREMENT BY 1 NOCACHE +/ +CREATE TRIGGER IDN_SAML2_SERVICE_PROVIDER_TRIG NO CASCADE + BEFORE INSERT + ON IDN_SAML2_SERVICE_PROVIDER + REFERENCING NEW AS NEW + FOR EACH ROW MODE DB2SQL + BEGIN ATOMIC + SET (NEW.ID) = (NEXTVAL FOR IDN_SAML2_SERVICE_PROVIDER_SEQ); + END +/ +CREATE TABLE IDN_SAML2_SP_PROPERTIES ( + ID INTEGER NOT NULL, + PROPERTY_NAME VARCHAR(255) NOT NULL, + PROPERTY_VALUE VARCHAR(2048) NOT NULL, + SP_ID INTEGER NOT NULL, + PRIMARY KEY (ID), + FOREIGN KEY (SP_ID) REFERENCES IDN_SAML2_SERVICE_PROVIDER(ID) ON DELETE CASCADE +) +/ +CREATE SEQUENCE IDN_SAML2_SP_PROPERTIES_SEQ START WITH 1 INCREMENT BY 1 NOCACHE +/ +CREATE TRIGGER IDN_SAML2_SP_PROPERTIES_TRIG NO CASCADE + BEFORE INSERT + ON IDN_SAML2_SP_PROPERTIES + REFERENCING NEW AS NEW + FOR EACH ROW MODE DB2SQL + BEGIN ATOMIC + SET (NEW.ID) = (NEXTVAL FOR IDN_SAML2_SP_PROPERTIES_SEQ); + END +/ CREATE TABLE IDN_ORG_USER_INVITATION ( ID INTEGER NOT NULL, @@ -2327,3 +2391,11 @@ CREATE INDEX IDX_IDN_RULE_UUID_TID ON IDN_RULE (UUID, TENANT_ID) / CREATE INDEX IDX_IDN_RULE_REF_RID_TID ON IDN_RULE_REFERENCES (RULE_ID, TENANT_ID) / + +--SAML-- +CREATE INDEX IDX_SAML2_SP_ISSUER ON IDN_SAML2_SERVICE_PROVIDER (ISSUER, TENANT_ID); +/ +CREATE INDEX IDX_SAML2_SP_TENANT_ID ON IDN_SAML2_SERVICE_PROVIDER (TENANT_ID); +/ +CREATE INDEX IDX_SAML2_SP_PROPERTIES ON IDN_SAML2_SP_PROPERTIES (SP_ID); +/ diff --git a/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/h2.sql b/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/h2.sql index 56efa70a1507..bec95ca07272 100644 --- a/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/h2.sql +++ b/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/h2.sql @@ -1569,7 +1569,7 @@ CREATE INDEX IDX_IDN_CERTIFICATE_UUID_TID ON IDN_CERTIFICATE (UUID, TENANT_ID); CREATE INDEX IDX_IDN_RULE_UUID_TID ON IDN_RULE (UUID, TENANT_ID); CREATE INDEX IDX_IDN_RULE_REF_RID_TID ON IDN_RULE_REFERENCES (RULE_ID, TENANT_ID); ---SAML-- +-- SAML -- CREATE INDEX IDX_SAML2_SP_ISSUER ON IDN_SAML2_SERVICE_PROVIDER (ISSUER, TENANT_ID); CREATE INDEX IDX_SAML2_SP_TENANT_ID ON IDN_SAML2_SERVICE_PROVIDER (TENANT_ID); CREATE INDEX IDX_SAML2_SP_PROPERTIES ON IDN_SAML2_SP_PROPERTIES (SP_ID); diff --git a/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/mssql.sql b/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/mssql.sql index 199d5d9d2404..17c2dc2cb715 100644 --- a/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/mssql.sql +++ b/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/mssql.sql @@ -1355,6 +1355,50 @@ CREATE TABLE IDN_OAUTH_PAR ( PRIMARY KEY (REQ_URI_REF) ); +IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[IDN_SAML2_SERVICE_PROVIDER]') AND TYPE IN (N'U')) +CREATE TABLE IDN_SAML2_SERVICE_PROVIDER ( + ID INTEGER NOT NULL IDENTITY, + ISSUER VARCHAR(255) NOT NULL, + DEFAULT_ASSERTION_CONSUMER_URL VARCHAR(2048) NOT NULL, + NAME_ID_FORMAT VARCHAR(255) NOT NULL, + CERT_ALIAS VARCHAR(255), + REQ_SIG_VALIDATION BIT, + SIGN_RESPONSE BIT NOT NULL, + SIGN_ASSERTIONS BIT NOT NULL, + SIGNING_ALGO VARCHAR(255) NOT NULL, + DIGEST_ALGO VARCHAR(255) NOT NULL, + ENCRYPT_ASSERTION BIT, + ASSERTION_ENCRYPTION_ALGO VARCHAR(255), + KEY_ENCRYPTION_ALGO VARCHAR(255), + ATTR_PROFILE_ENABLED BIT NOT NULL, + ATTR_SERVICE_INDEX VARCHAR(255), + SLO_PROFILE_ENABLED BIT NOT NULL, + SLO_METHOD VARCHAR(255), + SLO_RESPONSE_URL VARCHAR(2048), + SLO_REQUEST_URL VARCHAR(2048), + IDP_INIT_SSO_ENABLED BIT, + IDP_INIT_SLO_ENABLED BIT, + QUERY_REQUEST_PROFILE_ENABLED BIT NOT NULL, + ECP_ENABLED BIT NOT NULL, + ARTIFACT_BINDING_ENABLED BIT NOT NULL, + ARTIFACT_RESOLVE_REQ_SIG_VALIDATION BIT, + IDP_ENTITY_ID_ALIAS VARCHAR(255), + ISSUER_QUALIFIER VARCHAR(255), + SUPPORTED_ASSERTION_QUERY_REQUEST_TYPES VARCHAR(255), + TENANT_ID INTEGER, + PRIMARY KEY (ID) +); + +IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[IDN_SAML2_SP_PROPERTIES]') AND TYPE IN (N'U')) +CREATE TABLE IDN_SAML2_SP_PROPERTIES ( + ID INTEGER NOT NULL IDENTITY, + PROPERTY_NAME VARCHAR(255) NOT NULL, + PROPERTY_VALUE VARCHAR(2048) NOT NULL, + SP_ID INTEGER NOT NULL, + PRIMARY KEY (ID), + FOREIGN KEY (SP_ID) REFERENCES IDN_SAML2_SERVICE_PROVIDER (ID) ON DELETE CASCADE +); + IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[IDN_ORG_USER_INVITATION]') AND TYPE IN (N'U')) CREATE TABLE IDN_ORG_USER_INVITATION ( ID INTEGER IDENTITY(1,1) NOT NULL, @@ -1680,6 +1724,11 @@ CREATE INDEX IDX_IDN_CERTIFICATE_UUID_TID ON IDN_CERTIFICATE (UUID, TENANT_ID); CREATE INDEX IDX_IDN_RULE_UUID_TID ON IDN_RULE (UUID, TENANT_ID); CREATE INDEX IDX_IDN_RULE_REF_RID_TID ON IDN_RULE_REFERENCES (RULE_ID, TENANT_ID); +-- SAML -- +CREATE INDEX IDX_SAML2_SP_ISSUER ON IDN_SAML2_SERVICE_PROVIDER (ISSUER, TENANT_ID); +CREATE INDEX IDX_SAML2_SP_TENANT_ID ON IDN_SAML2_SERVICE_PROVIDER (TENANT_ID); +CREATE INDEX IDX_SAML2_SP_PROPERTIES ON IDN_SAML2_SP_PROPERTIES (SP_ID); + GO -- Trigger IDN_CLAIM delete by dialect on IDN_CLAIM_DIALECT deletion -- diff --git a/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/mysql-cluster.sql b/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/mysql-cluster.sql index e53f3c0f542f..d38b03395834 100644 --- a/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/mysql-cluster.sql +++ b/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/mysql-cluster.sql @@ -1382,6 +1382,48 @@ CREATE TABLE IF NOT EXISTS IDN_OAUTH_PAR ( PARAMETERS MEDIUMTEXT ) ENGIN NDB; +CREATE TABLE IF NOT EXISTS IDN_SAML2_SERVICE_PROVIDER ( + ID INTEGER NOT NULL AUTO_INCREMENT, + ISSUER VARCHAR(255) NOT NULL, + DEFAULT_ASSERTION_CONSUMER_URL VARCHAR(2048) NOT NULL, + NAME_ID_FORMAT VARCHAR(255) NOT NULL, + CERT_ALIAS VARCHAR(255), + REQ_SIG_VALIDATION BOOLEAN, + SIGN_RESPONSE BOOLEAN NOT NULL, + SIGN_ASSERTIONS BOOLEAN NOT NULL, + SIGNING_ALGO VARCHAR(255) NOT NULL, + DIGEST_ALGO VARCHAR(255) NOT NULL, + ENCRYPT_ASSERTION BOOLEAN, + ASSERTION_ENCRYPTION_ALGO VARCHAR(255), + KEY_ENCRYPTION_ALGO VARCHAR(255), + ATTR_PROFILE_ENABLED BOOLEAN NOT NULL, + ATTR_SERVICE_INDEX VARCHAR(255), + SLO_PROFILE_ENABLED BOOLEAN NOT NULL, + SLO_METHOD VARCHAR(255), + SLO_RESPONSE_URL VARCHAR(2048), + SLO_REQUEST_URL VARCHAR(2048), + IDP_INIT_SSO_ENABLED BOOLEAN, + IDP_INIT_SLO_ENABLED BOOLEAN, + QUERY_REQUEST_PROFILE_ENABLED BOOLEAN NOT NULL, + ECP_ENABLED BOOLEAN NOT NULL, + ARTIFACT_BINDING_ENABLED BOOLEAN NOT NULL, + ARTIFACT_RESOLVE_REQ_SIG_VALIDATION BOOLEAN, + IDP_ENTITY_ID_ALIAS VARCHAR(255), + ISSUER_QUALIFIER VARCHAR(255), + SUPPORTED_ASSERTION_QUERY_REQUEST_TYPES VARCHAR(255), + TENANT_ID INTEGER, + PRIMARY KEY (ID) +) ENGINE NDB; + +CREATE TABLE IF NOT EXISTS IDN_SAML2_SP_PROPERTIES ( + ID INTEGER NOT NULL AUTO_INCREMENT, + PROPERTY_NAME VARCHAR(255) NOT NULL, + PROPERTY_VALUE VARCHAR(2048) NOT NULL, + SP_ID INTEGER NOT NULL, + PRIMARY KEY (ID), + FOREIGN KEY (SP_ID) REFERENCES IDN_SAML2_SERVICE_PROVIDER(ID) ON DELETE CASCADE +) ENGINE NDB; + CREATE TABLE IDN_ORG_USER_INVITATION ( ID INTEGER NOT NULL AUTO_INCREMENT, INVITATION_ID VARCHAR(40) NOT NULL, @@ -1718,3 +1760,8 @@ CREATE INDEX IDX_IDN_CERTIFICATE_UUID_TID ON IDN_CERTIFICATE (UUID, TENANT_ID); -- RULES -- CREATE INDEX IDX_IDN_RULE_UUID_TID ON IDN_RULE (UUID, TENANT_ID); CREATE INDEX IDX_IDN_RULE_REF_RID_TID ON IDN_RULE_REFERENCES (RULE_ID, TENANT_ID); + +-- SAML -- +CREATE INDEX IDX_SAML2_SP_ISSUER ON IDN_SAML2_SERVICE_PROVIDER (ISSUER, TENANT_ID); +CREATE INDEX IDX_SAML2_SP_TENANT_ID ON IDN_SAML2_SERVICE_PROVIDER (TENANT_ID); +CREATE INDEX IDX_SAML2_SP_PROPERTIES ON IDN_SAML2_SP_PROPERTIES (SP_ID); diff --git a/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/mysql.sql b/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/mysql.sql index 6a1eb37a6492..f47d9dba0ac5 100644 --- a/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/mysql.sql +++ b/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/mysql.sql @@ -1247,6 +1247,48 @@ CREATE TABLE IF NOT EXISTS IDN_OAUTH_PAR ( PARAMETERS MEDIUMTEXT )DEFAULT CHARACTER SET latin1 ENGINE INNODB; +CREATE TABLE IF NOT EXISTS IDN_SAML2_SERVICE_PROVIDER ( + ID INTEGER NOT NULL AUTO_INCREMENT, + ISSUER VARCHAR(255) NOT NULL, + DEFAULT_ASSERTION_CONSUMER_URL VARCHAR(2048) NOT NULL, + NAME_ID_FORMAT VARCHAR(255) NOT NULL, + CERT_ALIAS VARCHAR(255), + REQ_SIG_VALIDATION BOOLEAN, + SIGN_RESPONSE BOOLEAN NOT NULL, + SIGN_ASSERTIONS BOOLEAN NOT NULL, + SIGNING_ALGO VARCHAR(255) NOT NULL, + DIGEST_ALGO VARCHAR(255) NOT NULL, + ENCRYPT_ASSERTION BOOLEAN, + ASSERTION_ENCRYPTION_ALGO VARCHAR(255), + KEY_ENCRYPTION_ALGO VARCHAR(255), + ATTR_PROFILE_ENABLED BOOLEAN NOT NULL, + ATTR_SERVICE_INDEX VARCHAR(255), + SLO_PROFILE_ENABLED BOOLEAN NOT NULL, + SLO_METHOD VARCHAR(255), + SLO_RESPONSE_URL VARCHAR(2048), + SLO_REQUEST_URL VARCHAR(2048), + IDP_INIT_SSO_ENABLED BOOLEAN, + IDP_INIT_SLO_ENABLED BOOLEAN, + QUERY_REQUEST_PROFILE_ENABLED BOOLEAN NOT NULL, + ECP_ENABLED BOOLEAN NOT NULL, + ARTIFACT_BINDING_ENABLED BOOLEAN NOT NULL, + ARTIFACT_RESOLVE_REQ_SIG_VALIDATION BOOLEAN, + IDP_ENTITY_ID_ALIAS VARCHAR(255), + ISSUER_QUALIFIER VARCHAR(255), + SUPPORTED_ASSERTION_QUERY_REQUEST_TYPES VARCHAR(255), + TENANT_ID INTEGER, + PRIMARY KEY (ID) +) DEFAULT CHARACTER SET latin1 ENGINE INNODB; + +CREATE TABLE IF NOT EXISTS IDN_SAML2_SP_PROPERTIES ( + ID INTEGER NOT NULL AUTO_INCREMENT, + PROPERTY_NAME VARCHAR(255) NOT NULL, + PROPERTY_VALUE VARCHAR(2048) NOT NULL, + SP_ID INTEGER NOT NULL, + PRIMARY KEY (ID), + FOREIGN KEY (SP_ID) REFERENCES IDN_SAML2_SERVICE_PROVIDER (ID) ON DELETE CASCADE +) DEFAULT CHARACTER SET latin1 ENGINE INNODB; + CREATE TABLE IDN_ORG_USER_INVITATION ( ID INTEGER NOT NULL AUTO_INCREMENT, INVITATION_ID VARCHAR(40) NOT NULL, @@ -1554,3 +1596,8 @@ CREATE INDEX IDX_IDN_CERTIFICATE_UUID_TID ON IDN_CERTIFICATE (UUID, TENANT_ID); -- RULES -- CREATE INDEX IDX_IDN_RULE_UUID_TID ON IDN_RULE (UUID, TENANT_ID); CREATE INDEX IDX_IDN_RULE_REF_RID_TID ON IDN_RULE_REFERENCES (RULE_ID, TENANT_ID); + +--SAML-- +CREATE INDEX IDX_SAML2_SP_ISSUER ON IDN_SAML2_SERVICE_PROVIDER (ISSUER, TENANT_ID); +CREATE INDEX IDX_SAML2_SP_TENANT_ID ON IDN_SAML2_SERVICE_PROVIDER (TENANT_ID); +CREATE INDEX IDX_SAML2_SP_PROPERTIES ON IDN_SAML2_SP_PROPERTIES (SP_ID); diff --git a/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/oracle.sql b/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/oracle.sql index 9e127808dceb..e7ec8b10665f 100644 --- a/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/oracle.sql +++ b/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/oracle.sql @@ -2016,6 +2016,70 @@ CREATE TABLE IDN_OAUTH_PAR ( PARAMETERS CLOB ) / +CREATE TABLE IDN_SAML2_SERVICE_PROVIDER ( + ID INTEGER NOT NULL, + ISSUER VARCHAR2(255) NOT NULL, + DEFAULT_ASSERTION_CONSUMER_URL VARCHAR2(2048) NOT NULL, + NAME_ID_FORMAT VARCHAR2(255) NOT NULL, + CERT_ALIAS VARCHAR2(255), + REQ_SIG_VALIDATION CHAR(1), + SIGN_RESPONSE CHAR(1) NOT NULL, + SIGN_ASSERTIONS CHAR(1) NOT NULL, + SIGNING_ALGO VARCHAR2(255) NOT NULL, + DIGEST_ALGO VARCHAR2(255) NOT NULL, + ENCRYPT_ASSERTION CHAR(1), + ASSERTION_ENCRYPTION_ALGO VARCHAR2(255), + KEY_ENCRYPTION_ALGO VARCHAR2(255), + ATTR_PROFILE_ENABLED CHAR(1) NOT NULL, + ATTR_SERVICE_INDEX VARCHAR2(255), + SLO_PROFILE_ENABLED CHAR(1) NOT NULL, + SLO_METHOD VARCHAR2(255), + SLO_RESPONSE_URL VARCHAR2(2048), + SLO_REQUEST_URL VARCHAR2(2048), + IDP_INIT_SSO_ENABLED CHAR(1), + IDP_INIT_SLO_ENABLED CHAR(1), + QUERY_REQUEST_PROFILE_ENABLED CHAR(1) NOT NULL, + ECP_ENABLED CHAR(1) NOT NULL, + ARTIFACT_BINDING_ENABLED CHAR(1) NOT NULL, + ARTIFACT_RESOLVE_REQ_SIG_VALIDATION CHAR(1), + IDP_ENTITY_ID_ALIAS VARCHAR2(255), + ISSUER_QUALIFIER VARCHAR2(255), + SUPPORTED_ASSERTION_QUERY_REQUEST_TYPES VARCHAR2(255), + TENANT_ID INTEGER, + PRIMARY KEY (ID) +) +/ +CREATE SEQUENCE IDN_SAML2_SERVICE_PROVIDER_SEQ START WITH 1 INCREMENT BY 1 NOCACHE +/ +CREATE OR REPLACE TRIGGER IDN_SAML2_SERVICE_PROVIDER_TRIG + BEFORE INSERT + ON IDN_SAML2_SERVICE_PROVIDER + REFERENCING NEW AS NEW + FOR EACH ROW + BEGIN + SELECT IDN_SAML2_SERVICE_PROVIDER_SEQ.nextval INTO :NEW.ID FROM dual; + END +/ +CREATE TABLE IDN_SAML2_SP_PROPERTIES ( + ID INTEGER NOT NULL, + PROPERTY_NAME VARCHAR2(255) NOT NULL, + PROPERTY_VALUE VARCHAR2(2048) NOT NULL, + SP_ID INTEGER NOT NULL, + PRIMARY KEY (ID), + FOREIGN KEY (SP_ID) REFERENCES IDN_SAML2_SERVICE_PROVIDER(ID) ON DELETE CASCADE +) +/ +CREATE SEQUENCE IDN_SAML2_SP_PROPERTIES_SEQ START WITH 1 INCREMENT BY 1 NOCACHE +/ +CREATE OR REPLACE TRIGGER IDN_SAML2_SP_PROPERTIES_TRIG + BEFORE INSERT + ON IDN_SAML2_SP_PROPERTIES + REFERENCING NEW AS NEW + FOR EACH ROW + BEGIN + SELECT IDN_SAML2_SP_PROPERTIES_SEQ.nextval INTO :NEW.ID FROM dual; + END +/ CREATE TABLE IDN_ORG_USER_INVITATION ( ID INTEGER NOT NULL, INVITATION_ID VARCHAR(40) NOT NULL, @@ -2386,3 +2450,11 @@ CREATE INDEX IDX_IDN_RULE_UUID_TID ON IDN_RULE (UUID, TENANT_ID) / CREATE INDEX IDX_IDN_RULE_REF_RID_TID ON IDN_RULE_REFERENCES (RULE_ID, TENANT_ID) / + +-- SAML -- +CREATE INDEX IDX_SAML2_SP_ISSUER ON IDN_SAML2_SERVICE_PROVIDER (ISSUER, TENANT_ID); +/ +CREATE INDEX IDX_SAML2_SP_TENANT_ID ON IDN_SAML2_SERVICE_PROVIDER (TENANT_ID); +/ +CREATE INDEX IDX_SAML2_SP_PROPERTIES ON IDN_SAML2_SP_PROPERTIES (SP_ID); +/ diff --git a/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/oracle_rac.sql b/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/oracle_rac.sql index 9b90807829d4..dfe9b7ed4bfa 100644 --- a/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/oracle_rac.sql +++ b/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/oracle_rac.sql @@ -1849,6 +1849,70 @@ CREATE TABLE IDN_OAUTH_PAR ( PARAMETERS CLOB ) / +CREATE TABLE IDN_SAML2_SERVICE_PROVIDER ( + ID INTEGER NOT NULL, + ISSUER VARCHAR(255) NOT NULL, + DEFAULT_ASSERTION_CONSUMER_URL VARCHAR(2048) NOT NULL, + NAME_ID_FORMAT VARCHAR(255) NOT NULL, + CERT_ALIAS VARCHAR(255), + REQ_SIG_VALIDATION CHAR(1), + SIGN_RESPONSE CHAR(1) NOT NULL, + SIGN_ASSERTIONS CHAR(1) NOT NULL, + SIGNING_ALGO VARCHAR(255) NOT NULL, + DIGEST_ALGO VARCHAR(255) NOT NULL, + ENCRYPT_ASSERTION CHAR(1), + ASSERTION_ENCRYPTION_ALGO VARCHAR(255), + KEY_ENCRYPTION_ALGO VARCHAR(255), + ATTR_PROFILE_ENABLED CHAR(1) NOT NULL, + ATTR_SERVICE_INDEX VARCHAR(255), + SLO_PROFILE_ENABLED CHAR(1) NOT NULL, + SLO_METHOD VARCHAR(255), + SLO_RESPONSE_URL VARCHAR(2048), + SLO_REQUEST_URL VARCHAR(2048), + IDP_INIT_SSO_ENABLED CHAR(1), + IDP_INIT_SLO_ENABLED CHAR(1), + QUERY_REQUEST_PROFILE_ENABLED CHAR(1) NOT NULL, + ECP_ENABLED CHAR(1) NOT NULL, + ARTIFACT_BINDING_ENABLED CHAR(1) NOT NULL, + ARTIFACT_RESOLVE_REQ_SIG_VALIDATION CHAR(1), + IDP_ENTITY_ID_ALIAS VARCHAR(255), + ISSUER_QUALIFIER VARCHAR(255), + SUPPORTED_ASSERTION_QUERY_REQUEST_TYPES VARCHAR(255), + TENANT_ID INTEGER, + PRIMARY KEY (ID) +) +/ +CREATE SEQUENCE IDN_SAML2_SERVICE_PROVIDER_SEQ START WITH 1 INCREMENT BY 1 NOCACHE +/ +CREATE OR REPLACE TRIGGER IDN_SAML2_SERVICE_PROVIDER_TRIG + BEFORE INSERT + ON IDN_SAML2_SERVICE_PROVIDER + REFERENCING NEW AS NEW + FOR EACH ROW + BEGIN + SELECT IDN_SAML2_SERVICE_PROVIDER_SEQ.nextval INTO :NEW.ID FROM dual; + END; +/ +CREATE TABLE IDN_SAML2_SP_PROPERTIES ( + ID INTEGER NOT NULL, + PROPERTY_NAME VARCHAR(255) NOT NULL, + PROPERTY_VALUE VARCHAR(2048) NOT NULL, + SP_ID INTEGER NOT NULL, + PRIMARY KEY (ID), + FOREIGN KEY (SP_ID) REFERENCES IDN_SAML2_SERVICE_PROVIDER(ID) ON DELETE CASCADE +) +/ +CREATE SEQUENCE IDN_SAML2_SP_PROPERTIES_SEQ START WITH 1 INCREMENT BY 1 NOCACHE +/ +CREATE OR REPLACE TRIGGER IDN_SAML2_SP_PROPERTIES_TRIG + BEFORE INSERT + ON IDN_SAML2_SP_PROPERTIES + REFERENCING NEW AS NEW + FOR EACH ROW + BEGIN + SELECT IDN_SAML2_SP_PROPERTIES_SEQ.nextval INTO :NEW.ID FROM dual; + END; +/ CREATE TABLE IDN_ORG_USER_INVITATION ( ID INTEGER NOT NULL, INVITATION_ID VARCHAR(40) NOT NULL, @@ -2290,3 +2354,11 @@ CREATE INDEX IDX_IDN_RULE_UUID_TID ON IDN_RULE (UUID, TENANT_ID) / CREATE INDEX IDX_IDN_RULE_REF_RID_TID ON IDN_RULE_REFERENCES (RULE_ID, TENANT_ID) / + +-- SAML -- +CREATE INDEX IDX_SAML2_SP_ISSUER ON IDN_SAML2_SERVICE_PROVIDER (ISSUER, TENANT_ID); +/ +CREATE INDEX IDX_SAML2_SP_TENANT_ID ON IDN_SAML2_SERVICE_PROVIDER (TENANT_ID); +/ +CREATE INDEX IDX_SAML2_SP_PROPERTIES ON IDN_SAML2_SP_PROPERTIES (SP_ID); +/ diff --git a/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/postgresql.sql b/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/postgresql.sql index 185115350c3b..c77e48cf25fc 100644 --- a/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/postgresql.sql +++ b/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/dbscripts/postgresql.sql @@ -1455,6 +1455,54 @@ CREATE TABLE IDN_OAUTH_PAR ( PARAMETERS TEXT ); +DROP TABLE IF EXISTS IDN_SAML2_SERVICE_PROVIDER; +DROP SEQUENCE IF EXISTS IDN_SAML2_SP_SEQ; +CREATE SEQUENCE IDN_SAML2_SP_SEQ; +CREATE TABLE IF NOT EXISTS IDN_SAML2_SERVICE_PROVIDER ( + ID INTEGER NOT NULL DEFAULT NEXTVAL('IDN_SAML2_SERVICE_PROVIDER_SEQ'), + ISSUER VARCHAR(255) NOT NULL, + DEFAULT_ASSERTION_CONSUMER_URL VARCHAR(2048) NOT NULL, + NAME_ID_FORMAT VARCHAR(255) NOT NULL, + CERT_ALIAS VARCHAR(255), + REQ_SIG_VALIDATION BOOLEAN, + SIGN_RESPONSE BOOLEAN NOT NULL, + SIGN_ASSERTIONS BOOLEAN NOT NULL, + SIGNING_ALGO VARCHAR(255) NOT NULL, + DIGEST_ALGO VARCHAR(255) NOT NULL, + ENCRYPT_ASSERTION BOOLEAN, + ASSERTION_ENCRYPTION_ALGO VARCHAR(255), + KEY_ENCRYPTION_ALGO VARCHAR(255), + ATTR_PROFILE_ENABLED BOOLEAN NOT NULL, + ATTR_SERVICE_INDEX VARCHAR(255), + SLO_PROFILE_ENABLED BOOLEAN NOT NULL, + SLO_METHOD VARCHAR(255), + SLO_RESPONSE_URL VARCHAR(2048), + SLO_REQUEST_URL VARCHAR(2048), + IDP_INIT_SSO_ENABLED BOOLEAN, + IDP_INIT_SLO_ENABLED BOOLEAN, + QUERY_REQUEST_PROFILE_ENABLED BOOLEAN NOT NULL, + ECP_ENABLED BOOLEAN NOT NULL, + ARTIFACT_BINDING_ENABLED BOOLEAN NOT NULL, + ARTIFACT_RESOLVE_REQ_SIG_VALIDATION BOOLEAN, + IDP_ENTITY_ID_ALIAS VARCHAR(255), + ISSUER_QUALIFIER VARCHAR(255), + SUPPORTED_ASSERTION_QUERY_REQUEST_TYPES VARCHAR(255), + TENANT_ID INTEGER, + PRIMARY KEY (ID) +); + +DROP TABLE IF EXISTS IDN_SAML2_SP_PROPERTIES; +DROP SEQUENCE IF EXISTS IDN_SAML2_SP_PROPERTY_SEQ; +CREATE SEQUENCE IDN_SAML2_SP_PROPERTY_SEQ; +CREATE TABLE IF NOT EXISTS IDN_SAML2_SP_PROPERTIES ( + ID INTEGER NOT NULL DEFAULT NEXTVAL('IDN_SAML2_SP_PROPERTIES_SEQ'), + PROPERTY_NAME VARCHAR(255) NOT NULL, + PROPERTY_VALUE VARCHAR(2048) NOT NULL, + SP_ID INTEGER NOT NULL, + PRIMARY KEY (ID), + FOREIGN KEY (SP_ID) REFERENCES IDN_SAML2_SERVICE_PROVIDER (ID) ON DELETE CASCADE +); + DROP TABLE IF EXISTS IDN_ORG_USER_INVITATION; DROP SEQUENCE IF EXISTS IDN_ORG_USER_INVITATION_SEQ; CREATE SEQUENCE IDN_ORG_USER_INVITATION_SEQ; @@ -1807,3 +1855,8 @@ CREATE INDEX IDX_IDN_CERTIFICATE_UUID_TID ON IDN_CERTIFICATE (UUID, TENANT_ID); -- RULES -- CREATE INDEX IDX_IDN_RULE_UUID_TID ON IDN_RULE (UUID, TENANT_ID); CREATE INDEX IDX_IDN_RULE_REF_RID_TID ON IDN_RULE_REFERENCES (RULE_ID, TENANT_ID); + +-- SAML -- +CREATE INDEX IDX_SAML2_SP_ISSUER ON IDN_SAML2_SERVICE_PROVIDER (ISSUER, TENANT_ID); +CREATE INDEX IDX_SAML2_SP_TENANT_ID ON IDN_SAML2_SERVICE_PROVIDER (TENANT_ID); +CREATE INDEX IDX_SAML2_SP_PROPERTIES ON IDN_SAML2_SP_PROPERTIES (SP_ID);