diff --git a/jans-linux-setup/jans_setup/schema/jans_schema.json b/jans-linux-setup/jans_setup/schema/jans_schema.json index 207b1e61637..d8cb109b853 100644 --- a/jans-linux-setup/jans_setup/schema/jans_schema.json +++ b/jans-linux-setup/jans_setup/schema/jans_schema.json @@ -347,6 +347,7 @@ "names": [ "memberOf" ], + "multivalued": true, "oid": "jansAttr", "syntax": "1.3.6.1.4.1.1466.115.121.1.12", "x_origin": "Jans created attribute" @@ -885,6 +886,7 @@ "names": [ "jansReqURI" ], + "multivalued": true, "oid": "jansAttr", "substr": "caseIgnoreSubstringsMatch", "syntax": "1.3.6.1.4.1.1466.115.121.1.15", @@ -1621,7 +1623,7 @@ "names": [ "jansScrDn" ], - "multivalued": true, + "multivalued": true, "oid": "jansAttr", "syntax": "1.3.6.1.4.1.1466.115.121.1.12", "x_origin": "Jans created attribute" @@ -1654,6 +1656,7 @@ "names": [ "jansSmtpConf" ], + "multivalued": true, "oid": "jansAttr", "substr": "caseIgnoreSubstringsMatch", "syntax": "1.3.6.1.4.1.1466.115.121.1.15", @@ -1917,6 +1920,7 @@ "names": [ "jansUmaPermission" ], + "multivalued": true, "oid": "jansAttr", "substr": "caseIgnoreSubstringsMatch", "syntax": "1.3.6.1.4.1.1466.115.121.1.15", @@ -2506,6 +2510,7 @@ "names": [ "jansClaimRedirectURI" ], + "multivalued": true, "oid": "jansAttr", "substr": "caseIgnoreSubstringsMatch", "syntax": "1.3.6.1.4.1.1466.115.121.1.15", @@ -2668,6 +2673,7 @@ "names": [ "jansAuthorizedOrigins" ], + "multivalued": true, "oid": "jansAttr", "substr": "caseIgnoreSubstringsMatch", "syntax": "1.3.6.1.4.1.1466.115.121.1.15", @@ -2861,6 +2867,7 @@ "names": [ "jansAlias" ], + "multivalued": true, "oid": "jansAttr", "syntax": "1.3.6.1.4.1.1466.115.121.1.15", "x_origin": "Jans created attribute" diff --git a/jans-linux-setup/jans_setup/setup_app/installers/rdbm.py b/jans-linux-setup/jans_setup/setup_app/installers/rdbm.py index 95d9b1a00a3..fd400ace54f 100644 --- a/jans-linux-setup/jans_setup/setup_app/installers/rdbm.py +++ b/jans-linux-setup/jans_setup/setup_app/installers/rdbm.py @@ -33,9 +33,12 @@ def install(self): self.local_install() jans_schema_files = [] - + self.jans_attributes = [] for jans_schema_fn in ('jans_schema.json', 'custom_schema.json'): - jans_schema_files.append(os.path.join(Config.install_dir, 'schema', jans_schema_fn)) + schema_full_path = os.path.join(Config.install_dir, 'schema', jans_schema_fn) + jans_schema_files.append(schema_full_path) + schema_ = base.readJsonFile(schema_full_path) + self.jans_attributes += schema_.get('attributeTypes', []) self.create_tables(jans_schema_files) self.create_subtables() @@ -83,6 +86,12 @@ def local_install(self): def get_sql_col_type(self, attrname, table=None): + for attr_ in self.jans_attributes: + if attrname in attr_['names'] and attr_.get('multivalued'): + if Config.rdbm_type == 'spanner': + return 'ARRAY' + return 'JSON' + if attrname in self.dbUtils.sql_data_types: type_ = self.dbUtils.sql_data_types[attrname].get(Config.rdbm_type) or self.dbUtils.sql_data_types[attrname]['mysql'] if table in type_.get('tables', {}): diff --git a/jans-linux-setup/jans_setup/static/rdbm/sql_data_types.json b/jans-linux-setup/jans_setup/static/rdbm/sql_data_types.json index dc368d08814..bb6f4d224c4 100644 --- a/jans-linux-setup/jans_setup/static/rdbm/sql_data_types.json +++ b/jans-linux-setup/jans_setup/static/rdbm/sql_data_types.json @@ -542,17 +542,6 @@ "type": "STRING(MAX)" } }, - "jansReqURI": { - "mysql": { - "type": "TINYTEXT" - }, - "pgsql": { - "type": "TEXT" - }, - "spanner": { - "type": "STRING(MAX)" - } - }, "jansSectorIdentifierURI": { "mysql": { "type": "TINYTEXT" @@ -586,17 +575,6 @@ "type": "STRING(MAX)" } }, - "jansClaimRedirectURI": { - "mysql": { - "type": "TINYTEXT" - }, - "pgsql": { - "type": "TEXT" - }, - "spanner": { - "type": "STRING(MAX)" - } - }, "jansJwt": { "mysql": { "type": "TEXT" @@ -756,14 +734,6 @@ "type": "STRING(MAX)" } }, - "memberOf": { - "mysql": { - "type": "JSON" - }, - "spanner": { - "type": "ARRAY" - } - }, "tknCde": { "mysql": { "size": 80, @@ -774,14 +744,6 @@ "type": "STRING" } }, - "jansUmaPermission": { - "mysql": { - "type": "JSON" - }, - "spanner": { - "type": "ARRAY" - } - }, "jansScrError": { "mysql": { "type": "TEXT" @@ -833,14 +795,6 @@ "type": "STRING" } }, - "jansSmtpConf": { - "mysql": { - "type": "JSON" - }, - "spanner": { - "type": "ARRAY" - } - }, "jansResource": { "mysql": { "type": "TINYTEXT"