# cram makes matching escape-containing lines with regexps a bit ugly
$ cauthtool kring --list
- client.admin
- \\t key: AQAK7yxNeF\+nHBAA0SgSdbs8IkJrxroDeJ6SwQ== \(esc\) (re)
- \\tauid: 18446744073709551615 \(esc\) (re)
+ [client.admin]
+ \tkey = AQAK7yxNeF+nHBAA0SgSdbs8IkJrxroDeJ6SwQ== (esc)
+ \tauid = 18446744073709551615 (esc)
# TODO is this nice?
$ cauthtool --cap osd 'broken' kring
- $ cauthtool kring --list|grep caps:
- \tcaps: [osd] broken (esc)
+ $ cauthtool kring --list|grep -P '^\tcaps '
+ \tcaps osd = "broken" (esc)
# TODO is this nice?
$ cauthtool --cap xyzzy 'broken' kring
- $ cauthtool kring --list|grep caps:
- \tcaps: [xyzzy] broken (esc)
+ $ cauthtool kring --list|grep -P '^\tcaps '
+ \tcaps xyzzy = "broken" (esc)
creating kring
$ cauthtool --cap osd 'allow rx pool=swimming' kring
- $ cauthtool kring --list|grep caps:
- \tcaps: [osd] allow rx pool=swimming (esc)
+ $ cauthtool kring --list|grep -P '^\tcaps '
+ \tcaps osd = "allow rx pool=swimming" (esc)
# TODO it seems --cap overwrites all previous caps; is this wanted?
$ cauthtool --cap mds 'allow' kring
- $ cauthtool kring --list|grep caps:
- \tcaps: [mds] allow (esc)
+ $ cauthtool kring --list|grep -P '^\tcaps '
+ \tcaps mds = "allow" (esc)
creating kring
$ cauthtool --cap osd 'allow rx pool=swimming' kring
- $ cauthtool kring --list|grep caps:
- \tcaps: [osd] allow rx pool=swimming (esc)
+ $ cauthtool kring --list|grep -P '^\tcaps '
+ \tcaps osd = "allow rx pool=swimming" (esc)
# cram makes matching escape-containing lines with regexps a bit ugly
$ cauthtool kring --list
- client.admin
- \\t key: [a-zA-Z0-9+/]+=* \(esc\) (re)
- \\tauid: [0-9]{20} \(esc\) (re)
+ [client.admin]
+ \\tkey = [a-zA-Z0-9+/]+=* \(esc\) (re)
+ \\tauid = [0-9]{20} \(esc\) (re)
# synonym
$ cauthtool kring -l
- client.admin
- \\t key: [a-zA-Z0-9+/]+=* \(esc\) (re)
- \\tauid: [0-9]{20} \(esc\) (re)
+ [client.admin]
+ \\tkey = [a-zA-Z0-9+/]+=* \(esc\) (re)
+ \\tauid = [0-9]{20} \(esc\) (re)
$ touch empty
$ cauthtool --list empty
- \d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d+ [0-9a-f]{12} auth: parse error at line 2: (re)
- \d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d+ [0-9a-f]{12} auth:[ ] (re)
- error reading file empty
- [1]
$ cauthtool -l empty
- \d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d+ [0-9a-f]{12} auth: parse error at line 2: (re)
- \d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d+ [0-9a-f]{12} auth:[ ] (re)
- error reading file empty
- [1]
To display the contents of the keyring:
$ cauthtool -l keyring.bin
- client.foo
- \\t key: [a-zA-Z0-9+/]+=* \(esc\) (re)
- \\tauid: [0-9]{20} \(esc\) (re)
- \tcaps: [mds] allow (esc)
- \tcaps: [mon] allow r (esc)
- \tcaps: [osd] allow rw pool=data (esc)
+ [client.foo]
+ \\tkey = [a-zA-Z0-9+/]+=* \(esc\) (re)
+ \\tauid = [0-9]{20} \(esc\) (re)
+ \tcaps mds = "allow" (esc)
+ \tcaps mon = "allow r" (esc)
+ \tcaps osd = "allow rw pool=data" (esc)