Skip to content

Commit

Permalink
plumb policy-override flag to the CLI (#5826)
Browse files Browse the repository at this point in the history
  • Loading branch information
meirish authored Nov 20, 2018
1 parent c1160de commit 6bbd397
Showing 1 changed file with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions command/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,17 @@ type BaseCommand struct {
flags *FlagSets
flagsOnce sync.Once

flagAddress string
flagCACert string
flagCAPath string
flagClientCert string
flagClientKey string
flagNamespace string
flagNS string
flagTLSServerName string
flagTLSSkipVerify bool
flagWrapTTL time.Duration
flagAddress string
flagCACert string
flagCAPath string
flagClientCert string
flagClientKey string
flagNamespace string
flagNS string
flagPolicyOverride bool
flagTLSServerName string
flagTLSSkipVerify bool
flagWrapTTL time.Duration

flagFormat string
flagField string
Expand Down Expand Up @@ -135,6 +136,9 @@ func (c *BaseCommand) Client() (*api.Client, error) {
if c.flagNamespace != notSetValue {
client.SetNamespace(namespace.Canonicalize(c.flagNamespace))
}
if c.flagPolicyOverride {
client.SetPolicyOverride(c.flagPolicyOverride)
}

c.client = client

Expand Down Expand Up @@ -293,6 +297,14 @@ func (c *BaseCommand) flagSet(bit FlagSetBit) *FlagSets {
"transmissions to and from the Vault server.",
})

f.BoolVar(&BoolVar{
Name: "policy-override",
Target: &c.flagPolicyOverride,
Default: false,
Usage: "Override a Sentinel policy that has a soft-mandatory " +
"enforcement_level specified",
})

f.DurationVar(&DurationVar{
Name: "wrap-ttl",
Target: &c.flagWrapTTL,
Expand Down

0 comments on commit 6bbd397

Please sign in to comment.