Skip to content

Cherry-pick v20.07: fix(vault): vault_format support for online restore and gql (#5745) #5758

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

Merged
merged 1 commit into from
Jul 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
11 changes: 8 additions & 3 deletions graphql/admin/endpoints_ee.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const adminTypes = `

"""
Vault server address where the key is stored. This server must be accessible
by all alphas in the group.
by all alphas in the group. Default "http://localhost:8200".
"""
vaultAddr: String

Expand All @@ -93,15 +93,20 @@ const adminTypes = `
vaultSecretIDFile: String

"""
Vault kv store path where the key lives.
Vault kv store path where the key lives. Default "secret/data/dgraph".
"""
vaultPath: String

"""
Vault kv store field whose value is the key.
Vault kv store field whose value is the key. Default "enc_key".
"""
vaultField: String

"""
Vault kv store field's format. Must be "base64" or "raw". Default "base64".
"""
vaultFormat: String

"""
Access key credential for the destination.
"""
Expand Down
2 changes: 2 additions & 0 deletions graphql/admin/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ type restoreInput struct {
VaultSecretIDFile string
VaultPath string
VaultField string
VaultFormat string
}

func resolveRestore(ctx context.Context, m schema.Mutation) (*resolve.Resolved, bool) {
Expand All @@ -61,6 +62,7 @@ func resolveRestore(ctx context.Context, m schema.Mutation) (*resolve.Resolved,
VaultSecretidFile: input.VaultSecretIDFile,
VaultPath: input.VaultPath,
VaultField: input.VaultField,
VaultFormat: input.VaultFormat,
}
err = worker.ProcessRestoreRequest(context.Background(), &req)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions protos/pb.proto
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ message RestoreRequest {
string vault_secretid_file = 12;
string vault_path = 13;
string vault_field = 14;
string vault_format = 15;
}

message Proposal {
Expand Down
Loading