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

updatekeys subcommand: rename GroupQuorum to ShamirThreshold #1631

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
12 changes: 6 additions & 6 deletions cmd/sops/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -643,12 +643,12 @@ func main() {
failedCounter := 0
for _, path := range c.Args() {
err := updatekeys.UpdateKeys(updatekeys.Opts{
InputPath: path,
GroupQuorum: c.Int("shamir-secret-sharing-threshold"),
KeyServices: keyservices(c),
Interactive: !c.Bool("yes"),
ConfigPath: configPath,
InputType: c.String("input-type"),
InputPath: path,
ShamirThreshold: c.Int("shamir-secret-sharing-threshold"),
KeyServices: keyservices(c),
Interactive: !c.Bool("yes"),
ConfigPath: configPath,
InputType: c.String("input-type"),
})

if c.NArg() == 1 {
Expand Down
6 changes: 3 additions & 3 deletions cmd/sops/subcommand/updatekeys/updatekeys.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
// Opts represents key operation options and config
type Opts struct {
InputPath string
GroupQuorum int
ShamirThreshold int
KeyServices []keyservice.KeyServiceClient
DecryptionOrder []string
Interactive bool
Expand Down Expand Up @@ -70,8 +70,8 @@ func updateFile(opts Opts) error {
// TODO: use conf.ShamirThreshold instead of tree.Metadata.ShamirThreshold in the next line?
// Or make this configurable?
var shamirThreshold = tree.Metadata.ShamirThreshold
if opts.GroupQuorum != 0 {
shamirThreshold = opts.GroupQuorum
if opts.ShamirThreshold != 0 {
shamirThreshold = opts.ShamirThreshold
}
shamirThreshold = min(shamirThreshold, len(conf.KeyGroups))
var shamirThresholdWillChange = tree.Metadata.ShamirThreshold != shamirThreshold
Expand Down
Loading