Hi, I got a error in crypt module. (use 1.1.0, 1.1...
# exposed
d
Hi, I got a error in crypt module. (use 1.1.0, 1.1.1). When I use Exposed 1.0.0, it is OK I add some test code in existing testing.
Copy code
@Test
fun testEncryptedColumnsWithDao() {
    withTables(TestTable) {
        val varcharValue = "varchar"
        val binaryValue = "binary".toByteArray()
        val entity = ETest.new {
            varchar = varcharValue
            binary = binaryValue
        }
        assertEquals(varcharValue, entity.varchar)
        assertEquals(binaryValue, entity.binary)
        TestTable.selectAll().first().let {
            assertEquals(varcharValue, it[TestTable.varchar])
            assertEquals(String(binaryValue), String(it[TestTable.binary]))
        }

        // Success        
        val e1 = ETest.findById(entity.id)!!
        assertEquals(varcharValue, e1.varchar)
        assertEquals(binaryValue.contentToString(), e1.binary.contentToString())
        
       
        TestTable.selectAll().first().let {
            // Fail by call twice for decrypt (decrypt for already decrypted value)
            val e2 = ETest.wrapRow(it)
            assertEquals(varcharValue, e2.varchar)
            assertEquals(binaryValue.contentToString(), e2.binary.contentToString())
        }
    }
}
c
Hi @debop Thanks for reporting this regression. I'll take a look into it now & get back to you. Could you please confirm whether you have by any chance opened a ticket for this already on YouTrack? Just want to make sure I haven't missed it before I create a new one.
d
No, I reported it here first.
c
Thanks for confirming. EXPOSED-1000 has been logged and a fix is now under review. Thanks for reporting so quickly so we could address this asap. Fix will be in the upcoming end-of-month release.
👍 1