-
Notifications
You must be signed in to change notification settings - Fork 220
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
br: add encryption config to streaming backup #1255
Changes from 4 commits
c24f599
cde6415
462f885
48f62dd
6dfc2fa
e78cd5f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ import "kvrpcpb.proto"; | |
import "gogoproto/gogo.proto"; | ||
import "rustproto.proto"; | ||
import "brpb.proto"; | ||
import "encryptionpb.proto"; | ||
|
||
option (gogoproto.sizer_all) = true; | ||
option (gogoproto.marshaler_all) = true; | ||
|
@@ -394,6 +395,9 @@ message KVMeta { | |
|
||
// the compression type for the file. | ||
backup.CompressionType compression_type = 13; | ||
|
||
// encryption information of the kv file, not set if encryption is not enabled. | ||
encryptionpb.FileEncryptionInfo file_encryption_info = 19; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The largest tag number in this message is 13. Why 19? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good catch! fixed |
||
} | ||
|
||
|
||
|
@@ -425,8 +429,11 @@ message ApplyRequest { | |
// context represents region info and it used to build raft commands. | ||
kvrpcpb.Context context = 4; | ||
|
||
// cipher_info is used to decrypt kv file when download file. | ||
// plaintext data key to decrypt kv file if configured during log backup. | ||
backup.CipherInfo cipher_info = 11; | ||
|
||
// master keys config used to decrypt data keys in restore if configured during log backup. | ||
repeated encryptionpb.MasterKey master_keys = 14; | ||
} | ||
|
||
message ApplyResponse { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
#!/usr/bin/env bash | ||
|
||
check_protoc_version() { | ||
version=$(protoc --version) | ||
major=$(echo ${version} | sed -n -e 's/.*\([0-9]\{1,\}\)\.[0-9]\{1,\}\.[0-9]\{1,\}.*/\1/p') | ||
minor=$(echo ${version} | sed -n -e 's/.*[0-9]\{1,\}\.\([0-9]\{1,\}\)\.[0-9]\{1,\}.*/\1/p') | ||
version=$(protoc --version | awk '{print $NF}') | ||
major=$(echo ${version} | cut -d '.' -f 1) | ||
minor=$(echo ${version} | cut -d '.' -f 2) | ||
if [ "$major" -eq 3 ] && [ "$minor" -ge 8 ]; then | ||
return 0 | ||
fi | ||
# protobuf bumps the major version to 21 after 3. | ||
# https://github.com/protocolbuffers/protobuf/releases/tag/v21.7 | ||
if [ "$major" -ge 21 ]; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you! Now we no more need to download an old |
||
return 0 | ||
fi | ||
echo "protoc version not match, version 3.8.x+ is needed, current version: ${version}" | ||
return 1 | ||
} | ||
|
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.
Empty message, how to pass data keys?
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.
right, it's a placeholder as this proto is going to be serialized and stored as part of the metadata in external storage. The actual plaintext key is going to be passed back by user during restore so not get exposed if external storage is breached.