Skip to content

Commit

Permalink
fix(vault): vault_format support for online restore and gql (#5745)
Browse files Browse the repository at this point in the history
(cherry picked from commit 13f630b)
  • Loading branch information
parasssh committed Jun 29, 2020
1 parent 73a9ddd commit 0190a4d
Show file tree
Hide file tree
Showing 5 changed files with 349 additions and 286 deletions.
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

0 comments on commit 0190a4d

Please sign in to comment.