Skip to content

Commit cc3a76a

Browse files
authored
Merge pull request #1631 from felixfontein/updatekeys-shamir
updatekeys subcommand: rename GroupQuorum to ShamirThreshold
2 parents 4d85fd3 + ac08560 commit cc3a76a

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

cmd/sops/main.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -696,12 +696,12 @@ func main() {
696696
failedCounter := 0
697697
for _, path := range c.Args() {
698698
err := updatekeys.UpdateKeys(updatekeys.Opts{
699-
InputPath: path,
700-
GroupQuorum: c.Int("shamir-secret-sharing-threshold"),
701-
KeyServices: keyservices(c),
702-
Interactive: !c.Bool("yes"),
703-
ConfigPath: configPath,
704-
InputType: c.String("input-type"),
699+
InputPath: path,
700+
ShamirThreshold: c.Int("shamir-secret-sharing-threshold"),
701+
KeyServices: keyservices(c),
702+
Interactive: !c.Bool("yes"),
703+
ConfigPath: configPath,
704+
InputType: c.String("input-type"),
705705
})
706706

707707
if c.NArg() == 1 {

cmd/sops/subcommand/updatekeys/updatekeys.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
// Opts represents key operation options and config
1616
type Opts struct {
1717
InputPath string
18-
GroupQuorum int
18+
ShamirThreshold int
1919
KeyServices []keyservice.KeyServiceClient
2020
DecryptionOrder []string
2121
Interactive bool
@@ -70,8 +70,8 @@ func updateFile(opts Opts) error {
7070
// TODO: use conf.ShamirThreshold instead of tree.Metadata.ShamirThreshold in the next line?
7171
// Or make this configurable?
7272
var shamirThreshold = tree.Metadata.ShamirThreshold
73-
if opts.GroupQuorum != 0 {
74-
shamirThreshold = opts.GroupQuorum
73+
if opts.ShamirThreshold != 0 {
74+
shamirThreshold = opts.ShamirThreshold
7575
}
7676
shamirThreshold = min(shamirThreshold, len(conf.KeyGroups))
7777
var shamirThresholdWillChange = tree.Metadata.ShamirThreshold != shamirThreshold

0 commit comments

Comments
 (0)