Skip to content

Commit

Permalink
Add IDN_SAML2_SERVICE_PROVIDER and IDN_SAML2_SP_PROPERTIES
Browse files Browse the repository at this point in the history
tables to dbscripts
  • Loading branch information
Osara-B committed Dec 17, 2024
1 parent 33847a3 commit 175e9d5
Show file tree
Hide file tree
Showing 8 changed files with 413 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -2275,3 +2339,11 @@ CREATE INDEX IDX_IDN_CERTIFICATE_ID_TID ON IDN_CERTIFICATE (ID, TENANT_ID)
/
CREATE INDEX IDX_IDN_CERTIFICATE_UUID_TID ON IDN_CERTIFICATE (UUID, 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);
/
Original file line number Diff line number Diff line change
Expand Up @@ -1657,7 +1657,7 @@ CREATE INDEX IDX_IDN_ACTION_ENDPOINT_AU_TI ON IDN_ACTION_ENDPOINT (ACTION_UUID,
CREATE INDEX IDX_IDN_CERTIFICATE_ID_TID ON IDN_CERTIFICATE (ID, TENANT_ID);
CREATE INDEX IDX_IDN_CERTIFICATE_UUID_TID ON IDN_CERTIFICATE (UUID, 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);
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -1644,6 +1688,11 @@ CREATE INDEX IDX_IDN_ACTION_ENDPOINT_AU_TI ON IDN_ACTION_ENDPOINT (ACTION_UUID,
CREATE INDEX IDX_IDN_CERTIFICATE_ID_TID ON IDN_CERTIFICATE (ID, TENANT_ID);
CREATE INDEX IDX_IDN_CERTIFICATE_UUID_TID ON IDN_CERTIFICATE (UUID, 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 --
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -1684,3 +1726,8 @@ CREATE INDEX IDX_IDN_ACTION_ENDPOINT_AU_TI ON IDN_ACTION_ENDPOINT (ACTION_UUID,
-- CERTIFICATE --
CREATE INDEX IDX_IDN_CERTIFICATE_ID_TID ON IDN_CERTIFICATE (ID, TENANT_ID);
CREATE INDEX IDX_IDN_CERTIFICATE_UUID_TID ON IDN_CERTIFICATE (UUID, 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);
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -1520,3 +1562,8 @@ CREATE INDEX IDX_IDN_ACTION_ENDPOINT_AU_TI ON IDN_ACTION_ENDPOINT (ACTION_UUID,
-- CERTIFICATE --
CREATE INDEX IDX_IDN_CERTIFICATE_ID_TID ON IDN_CERTIFICATE (ID, TENANT_ID);
CREATE INDEX IDX_IDN_CERTIFICATE_UUID_TID ON IDN_CERTIFICATE (UUID, 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);
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -2332,3 +2396,11 @@ CREATE INDEX IDX_IDN_CERTIFICATE_ID_TID ON IDN_CERTIFICATE (ID, TENANT_ID)
/
CREATE INDEX IDX_IDN_CERTIFICATE_UUID_TID ON IDN_CERTIFICATE (UUID, 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);
/
Loading

0 comments on commit 175e9d5

Please sign in to comment.