Comments (10)
fixed the issue. pls merge in my pull-request
from typeorm-encrypted.
Is the issue that the transformer doesn't work if NULL values are provided?
from typeorm-encrypted.
well, yes and no. I use typeorm-encrypted with typeorm and mysql. And when there is null in column, typeorm sends '' (empty string) to the 'to' method. Then encryptor fails.
from typeorm-encrypted.
Hmmm so I just tested null
and undefined
values out for the transformer. It works as it should. Basically, any null
or undefined
value in the entity shouldn't be transformed. Empty strings should be transformed/encrypted.
Just to be sure, are you passing null
or undefined
as the value for that column in the entity? Also, If the to
method is receiving an empty string, then you're likely providing an empty string to the entity instead of null
or undefined
.
Otherwise, this could be an issue specifically with the MySQL handler in Typeorm
rather than typeorm-encrypted
.
I'll follow up with them as well... stay tuned :).
from typeorm-encrypted.
are you passing null or undefined
well, I am passing null, then save the entity with typeorm, then see the entity record in my sql with the NULL, then read the entity with typeorm and typeorm-encrypted gets '' into the to method. Yes probably it is typeorm + mysql issue, that it passes '' when there is actually NULL, but in any case typeorm-encrypted does not work on ''.
from typeorm-encrypted.
Oh, if it's on the read side, then that should be fine.
from typeorm-encrypted.
@andreo-k I added a couple of notes. Basically, on the save side, no changes are needed. On the read side, your change works.
from typeorm-encrypted.
@generalpiston I removed changes from 'save' side, pushed to same branch
from typeorm-encrypted.
Merged. Thanks @andreo-k . I'll create a new release too.
from typeorm-encrypted.
Version 0.5.6 has this patch @andreo-k .
from typeorm-encrypted.
Related Issues (20)
- Invalid IV length HOT 4
- [Question, help needed] How to properly retain encryption keys? HOT 3
- Create a CLI tool for adding or swapping keys to an encrypted column HOT 1
- Abandoned? HOT 1
- Doesnt work inside QueryBuilder HOT 4
- Exception occurres when use FindOperator. HOT 4
- It doesn't encrypt the default value of the column HOT 2
- Issue with finding values with encrypted data HOT 17
- fix issue HOT 1
- json supprot HOT 1
- Support for typeorm 0.3 HOT 8
- Return undefined instead of null
- Peer dependencies TypeORM HOT 1
- [Question] How is key rotation handled? HOT 5
- Document how to perform key rotation
- The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined HOT 1
- Like operator not supported
- typeorm encryption nopt working in case of unique true column HOT 3
- conditionally encryption columns HOT 3
- Decrypting data externally
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from typeorm-encrypted.