Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pg_query integration #691

Merged
merged 20 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update with master
  • Loading branch information
Zhaars committed Sep 17, 2024
commit b43a0f713724c1352e0517601dc7351bfe8cdb54
252 changes: 0 additions & 252 deletions encryptor/dbDataCoder.go

This file was deleted.

6 changes: 5 additions & 1 deletion encryptor/postgresql/dbDataCoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ type PgQueryDBDataCoder struct{}
// literals.
func (*PgQueryDBDataCoder) Decode(aConst *pg_query.A_Const, setting config.ColumnEncryptionSetting) ([]byte, error) {
if sval := aConst.GetSval(); sval != nil {
// simple strings should be handled as is
// this behavior depends on the user's choice in encryptor config
// if the user selects something other than ByteaOID, Aсra will process the data as-is,
// this means the user is responsible for providing the correct data type
// for example, if user selects "str", he should provide a string data, not a byte array (like a hex string in forma /x33...).
// otherwise, Acra will use the data as it is, and converting it to the corresponded type may fail during the read from DB
typeID := setting.GetDBDataTypeID()
if typeID != 0 && typeID != pgtype.ByteaOID {
return []byte(sval.GetSval()), nil
Expand Down