MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / getAPIKeyFields

Function getAPIKeyFields

cmd/ttn-lw-cli/commands/flags.go:163–180  ·  view source on GitHub ↗
(flagSet *pflag.FlagSet)

Source from the content-addressed store, hash-verified

161}
162
163func getAPIKeyFields(flagSet *pflag.FlagSet) ([]ttnpb.Right, *time.Time, []string, error) {
164 rights := getRights(flagSet)
165 paths := []string{}
166 if len(rights) > 0 {
167 paths = append(paths, "rights")
168 }
169 expiryDate, err := getAPIKeyExpiry(flagSet)
170 if err != nil {
171 return nil, nil, nil, err
172 }
173 if flagSet.Changed("api-key-expiry") {
174 paths = append(paths, "expires_at")
175 }
176 if flagSet.Changed("name") {
177 paths = append(paths, "name")
178 }
179 return rights, expiryDate, paths, nil
180}
181
182var errNoIDs = errors.DefineInvalidArgument("no_ids", "no IDs set")
183

Callers 4

gateways_access.goFile · 0.85
users_access.goFile · 0.85

Calls 2

getRightsFunction · 0.85
getAPIKeyExpiryFunction · 0.85

Tested by

no test coverage detected