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

transparent encryption on server side #285

Merged
merged 36 commits into from
Dec 17, 2018
Merged

transparent encryption on server side #285

merged 36 commits into from
Dec 17, 2018

Conversation

Lagovas
Copy link
Collaborator

@Lagovas Lagovas commented Nov 21, 2018

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:

@vixentael vixentael added the core label Nov 22, 2018
@Lagovas
Copy link
Collaborator Author

Lagovas commented Dec 6, 2018

in sqlparser was touched next files:

  • ast.go
  • dependency/sqltypes/value.go
  • github_test.go
  • parse_test.go
  • sql.y
  • token.go
    Other files was leaved unchanged (only updated import paths)

// in postgresql mode timeout used to stop listening connection in background goroutine
// and it's normal behaviour
continue
if pgProxy.TLSCh != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saves from crash?

Copy link
Collaborator Author

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

column_name

Copy link
Collaborator

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())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it old?

Copy link
Collaborator Author

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 {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

onDup? duplicate key?

Copy link
Collaborator Author

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() {
Copy link
Collaborator

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?

Copy link
Collaborator Author

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

@vixentael
Copy link
Collaborator

Looks awesome to me!

@Lagovas Lagovas merged commit cfd0c46 into cossacklabs:master Dec 17, 2018
@Lagovas Lagovas deleted the lagovas/transparent-encryption branch December 17, 2018 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants