storj/pkg/cfgstruct/flags.go
Jeff Wendling 15e74c8c3d uplink share subcommand (#1924)
* cmd/uplink: add share command to restrict an api key

This commit is an early bit of work to just implement restricting
macaroon api keys from the command line. It does not convert
api keys to be macaroons in general.

It also does not apply the path restriction caveats appropriately
yet because it does not encrypt them.

* cmd/uplink: fix path encryption for shares

It should now properly encrypt the path prefixes when adding
caveats to a macaroon.

* fix up linting problems

* print summary of caveat and require iso8601

* make clone part more clear
2019-05-14 12:15:12 -06:00

27 lines
887 B
Go

// Copyright (C) 2019 Storj Labs, Inc.
// See LICENSE for copying information.
package cfgstruct
import (
"time"
"github.com/spf13/pflag"
)
// FlagSet is an interface that matches *pflag.FlagSet
type FlagSet interface {
BoolVar(p *bool, name string, value bool, usage string)
IntVar(p *int, name string, value int, usage string)
Int64Var(p *int64, name string, value int64, usage string)
UintVar(p *uint, name string, value uint, usage string)
Uint64Var(p *uint64, name string, value uint64, usage string)
DurationVar(p *time.Duration, name string, value time.Duration, usage string)
Float64Var(p *float64, name string, value float64, usage string)
StringVar(p *string, name string, value string, usage string)
StringArrayVar(p *[]string, name string, value []string, usage string)
Var(val pflag.Value, name string, usage string)
}
var _ FlagSet = (*pflag.FlagSet)(nil)