-
Notifications
You must be signed in to change notification settings - Fork 128
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
transparent encryption on server side #285
transparent encryption on server side #285
Conversation
in
|
// in postgresql mode timeout used to stop listening connection in background goroutine | ||
// and it's normal behaviour | ||
continue | ||
if pgProxy.TLSCh != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saves from crash?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
avoid the second usage of this error after established TLS
- data | ||
- raw_data | ||
encrypted: | ||
- name: data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
column_name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
column
return string(query[:len(query)-1]), nil | ||
packet.logger.Debugln("GetParseQuery success") | ||
return parse.QueryString(), nil | ||
//query, err := FetchQueryFromParse(packet.descriptionBuf.Bytes()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it old?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. will remove
} | ||
} | ||
|
||
if len(insert.OnDup) > 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
onDup? duplicate key?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what to do if database recognize duplication. it's like update on duplicate or upsert.
changed := false | ||
for _, expr := range exprs { | ||
// recognize table name of column | ||
if expr.Name.Qualifier.IsEmpty() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
first table is default table?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. if multi-table update then if column without any table as prefix then work as it column from first table in the list
Looks awesome to me! |
IMPORTANT not completed PR. I will add integration tests (now only unit-tests exists and I manually tested on local machine). But because it will huge part too, I decided to create PR before it for review less part of code and review general logic. I will push integration tests later before merging and one more review
features:
insert
/update
queries with encryption settings from config file (which key use to encrypt per table+column)insert
statements without list of columns before values (insert into table (col1, col2, col3)