GluuFederation / community-edition-setup

Scripts and templates to automate deployment and configuration of the Gluu Server Community Edition
https://gluu.org/docs/ce
MIT License
188 stars 58 forks source link

fix: change column type of oxDocument.document #930

Closed iromli closed 2 years ago

iromli commented 2 years ago

When using MySQL, this is how oxDocument.document column described:

mysql> show columns in oxDocument where Field = 'document';
+----------+-------------+------+-----+---------+-------+
| Field    | Type        | Null | Key | Default | Extra |
+----------+-------------+------+-----+---------+-------+
| document | varchar(64) | YES  |     | NULL    |       |
+----------+-------------+------+-----+---------+-------+

Unfortunately, varchar(64) is not sufficient for oxDocument.document as this column may holds big string, i.e. SAML metadata.

To reproduce the issue:

  1. deploy Gluu Server
  2. in oxTrust UI, go to JSON Configuration > Store Provider Configuration, and select DB in Document store Type dropdown.
  3. restart oxTrust
  4. add Trust Relationship
  5. check error in oxTrust logs

    Caught MysqlDataTruncation for insert into gluu.oxDocument (creationDate, description, displayName, document, inum, oxEnabled, oxModuleProperty, objectClass, dn, doc_id)
devrimyatar commented 2 years ago

I looked sample metadata, it's length is more than 4.5K, so it will be TEXT type