netauth entity kv

Manage KV storage on an entity

Synopsis

The KV subsystem allows NetAuth to store additional arbitrary metadata. Use of this system should be carefully balanced against the performance impact since this data is stored on entities directly, and as such can impact access times.

The KV system supports indexed keys, which are of the form key{index} and are sortable by the client. For example, if you had multiple phone numbers that you wanted to keep in order based on the order in which they are preferred. The following arrangement would accomplish this ordering:

phone{0}: 1 (555) 867-5309
phone{1}: 1 (555) 888-8888
phone{2}: 1 (555) 090-0461

If you wanted to change a single key, you could either upsert it which will insert or update as necessary, or you could remove it. To remove the key use either CLEARFUZZY or CLEAREXACT. The exact variant allows you to specify the exact key with index to clear, whereas the fuzzy version doesn't check the index before clearing (useful for bulk removing a key).

netauth entity kv <entity> <UPSERT|CLEARFUZZY|CLEAREXACT|READ> <key> [value] [flags]

Examples

$ netauth entity kv demo2 upsert phone{0} "1 (555) 867-5309"
$ netauth entity kv demo2 upsert phone{1} "1(555) 888-8888"
$ netauth entity kv demo2 upsert phone{2} "1(555) 090-0461"

$ netauth entity kv demo2 read phone
phone{0}: 1 (555) 867-5309
phone{1}: 1 (555) 888-8888
phone{2}: 1 (555) 090-0461

$ netauth entity kv demo2 clearexact phone{1}
$ netauth entity kv demo2 read phone
phone{0}: 1 (555) 867-5309
phone{2}: 1 (555) 090-0461

$ netauth entity kv demo2 clearfuzzy phone
$ neatuth entity kv demo2 read phone

Options

  -h, --help   help for kv

Options inherited from parent commands

      --config string   Use an alternate config file
      --entity string   Specify a non-default entity to make requests as
      --secret string   Specify the request secret on the command line

SEE ALSO

Auto generated by spf13/cobra on 3-Jun-2022