blob: 63218fe437a07d8237eab93fd12a953e6afe4e2e [file] [log] [blame]
Jiri Simsa3f4e92d2015-03-24 21:26:37 -07001// Copyright 2015 The Vanadium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -08005// This file was auto-generated via go generate.
6// DO NOT UPDATE MANUALLY
7
8/*
Todd Wang6ed3b6c2015-04-08 14:37:04 -07009Command principal creates and manages Vanadium principals and blessings.
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -080010
11All objects are printed using base64-VOM-encoding.
12
13Usage:
14 principal <command>
15
16The principal commands are:
17 create Create a new principal and persist it into a directory
18 fork Fork a new principal from the principal that this tool is
19 running as and persist it into a directory
Suharsh Sivakumard1cc6e02015-03-16 13:58:49 -070020 seekblessings Seek blessings from a web-based Vanadium blessing service
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -080021 recvblessings Receive blessings sent by another principal and use them as the
22 default
23 dump Dump out information about the principal
24 dumpblessings Dump out information about the provided blessings
25 blessself Generate a self-signed blessing
26 bless Bless another principal
Suharsh Sivakumar32c8e752015-03-31 19:26:28 -070027 set Mutate the principal's blessings.
28 get Read the principal's blessings.
Asim Shankar80277d02015-03-31 12:57:06 -070029 addtoroots Add to the set of identity providers recognized by this
30 principal
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -080031 help Display help for commands or topics
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -080032
33The global flags are:
34 -alsologtostderr=true
35 log to standard error as well as files
36 -log_backtrace_at=:0
37 when logging hits line file:N, emit a stack trace
38 -log_dir=
39 if non-empty, write log files to this directory
40 -logtostderr=false
41 log to standard error instead of files
42 -max_stack_buf_size=4292608
43 max size in bytes of the buffer to use for logging stack traces
44 -stderrthreshold=2
45 logs at or above this threshold go to stderr
46 -v=0
47 log level for V logs
Asim Shankarf32d24d2015-04-01 16:34:26 -070048 -v23.credentials=
49 directory to use for storing security credentials
50 -v23.i18n-catalogue=
51 18n catalogue files to load, comma separated
Asim Shankar8196c1e2015-04-08 22:42:18 -070052 -v23.namespace.root=[/(dev.v.io/role/vprod/service/mounttabled)@ns.dev.v.io:8101]
Asim Shankarf32d24d2015-04-01 16:34:26 -070053 local namespace root; can be repeated to provided multiple roots
54 -v23.permissions.file=map[]
Adam Sadovskya4d4a692015-04-20 11:36:49 -070055 specify a perms file as <name>:<permsfile>
Asim Shankarf32d24d2015-04-01 16:34:26 -070056 -v23.permissions.literal=
Adam Sadovskya4d4a692015-04-20 11:36:49 -070057 explicitly specify the runtime perms as a JSON-encoded access.Permissions.
Asim Shankarf32d24d2015-04-01 16:34:26 -070058 Overrides all --v23.permissions.file flags.
59 -v23.proxy=
60 object name of proxy service to use to export services across network
61 boundaries
62 -v23.tcp.address=
63 address to listen on
64 -v23.tcp.protocol=wsh
65 protocol to listen with
66 -v23.vtrace.cache-size=1024
67 The number of vtrace traces to store in memory.
68 -v23.vtrace.collect-regexp=
69 Spans and annotations that match this regular expression will trigger trace
70 collection.
71 -v23.vtrace.dump-on-shutdown=true
72 If true, dump all stored traces on runtime shutdown.
73 -v23.vtrace.sample-rate=0
74 Rate (from 0.0 to 1.0) to sample vtrace traces.
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -080075 -vmodule=
76 comma-separated list of pattern=N settings for file-filtered logging
77
Todd Wang1624bf92015-04-22 16:53:57 -070078Principal create
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -080079
80Creates a new principal with a single self-blessed blessing and writes it out to
81the provided directory. The same directory can then be used to set the
Asim Shankar59b8b692015-03-30 01:23:36 -070082V23_CREDENTIALS environment variable for other vanadium applications.
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -080083
84The operation fails if the directory already contains a principal. In this case
85the --overwrite flag can be provided to clear the directory and write out the
86new principal.
87
88Usage:
89 principal create [flags] <directory> <blessing>
90
91 <directory> is the directory to which the new principal will be persisted.
92 <blessing> is the self-blessed blessing that the principal will be setup to use by default.
93
94The principal create flags are:
95 -overwrite=false
96 If true, any existing principal data in the directory will be overwritten
97
Todd Wang1624bf92015-04-22 16:53:57 -070098Principal fork
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -080099
100Creates a new principal with a blessing from the principal specified by the
101environment that this tool is running in, and writes it out to the provided
102directory. The blessing that will be extended is the default one from the
103blesser's store, or specified by the --with flag. Expiration on the blessing are
104controlled via the --for flag. Additional caveats on the blessing are controlled
105with the --caveat flag. The blessing is marked as default and shareable with all
106peers on the new principal's blessing store.
107
108The operation fails if the directory already contains a principal. In this case
109the --overwrite flag can be provided to clear the directory and write out the
110forked principal.
111
112Usage:
113 principal fork [flags] <directory> <extension>
114
115 <directory> is the directory to which the forked principal will be persisted.
116 <extension> is the extension under which the forked principal is blessed.
117
118The principal fork flags are:
119 -caveat=[]
120 "package/path".CaveatName:VDLExpressionParam to attach to this blessing
Asim Shankara0bba462015-02-20 22:50:51 -0800121 -for=0
122 Duration of blessing validity (zero implies no expiration caveat)
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800123 -overwrite=false
124 If true, any existing principal data in the directory will be overwritten
Suharsh Sivakumared5be1d2015-04-01 17:45:35 -0700125 -require-caveats=true
Asim Shankara0bba462015-02-20 22:50:51 -0800126 If false, allow blessing without any caveats. This is typically not advised
127 as the principal wielding the blessing will be almost as powerful as its
128 blesser
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800129 -with=
130 Path to file containing blessing to extend
131
Todd Wang1624bf92015-04-22 16:53:57 -0700132Principal seekblessings
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800133
Suharsh Sivakumard1cc6e02015-03-16 13:58:49 -0700134Seeks blessings from a web-based Vanadium blesser which requires the caller to
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800135first authenticate with Google using OAuth. Simply run the command to see what
136happens.
137
138The blessings are sought for the principal specified by the environment that
139this tool is running in.
140
Suharsh Sivakumared5be1d2015-04-01 17:45:35 -0700141The blessings obtained are set as default, unless the --set-default flag is set
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800142to true, and are also set for sharing with all peers, unless a more specific
Suharsh Sivakumared5be1d2015-04-01 17:45:35 -0700143peer pattern is provided using the --for-peer flag.
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800144
145Usage:
146 principal seekblessings [flags]
147
148The principal seekblessings flags are:
Suharsh Sivakumared5be1d2015-04-01 17:45:35 -0700149 -add-to-roots=true
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800150 If true, the root certificate of the blessing will be added to the
151 principal's set of recognized root certificates
152 -browser=true
153 If false, the seekblessings command will not open the browser and only print
154 the url to visit.
Suharsh Sivakumared5be1d2015-04-01 17:45:35 -0700155 -for-peer=...
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800156 If non-empty, the blessings obtained will be marked for peers matching this
157 pattern in the store
Suharsh Sivakumar33884012015-03-25 13:27:55 -0700158 -from=https://dev.v.io/auth/google
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800159 URL to use to begin the seek blessings process
Suharsh Sivakumared5be1d2015-04-01 17:45:35 -0700160 -set-default=true
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800161 If true, the blessings obtained will be set as the default blessing in the
162 store
163
Todd Wang1624bf92015-04-22 16:53:57 -0700164Principal recvblessings
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800165
166Allow another principal (likely a remote process) to bless this one.
167
168This command sets up the invoker (this process) to wait for a blessing from
169another invocation of this tool (remote process) and prints out the command to
170be run as the remote principal.
171
Suharsh Sivakumared5be1d2015-04-01 17:45:35 -0700172The received blessings are set as default, unless the --set-default flag is set
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800173to true, and are also set for sharing with all peers, unless a more specific
Suharsh Sivakumared5be1d2015-04-01 17:45:35 -0700174peer pattern is provided using the --for-peer flag.
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800175
176TODO(ashankar,cnicolaou): Make this next paragraph possible! Requires the
177ability to obtain the proxied endpoint.
178
179Typically, this command should require no arguments. However, if the sender and
180receiver are on different network domains, it may make sense to use the
Asim Shankarf32d24d2015-04-01 16:34:26 -0700181--v23.proxy flag:
182 principal --v23.proxy=proxy recvblessings
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800183
184The command to be run at the sender is of the form:
Suharsh Sivakumared5be1d2015-04-01 17:45:35 -0700185 principal bless --remote-key=KEY --remote-token=TOKEN ADDRESS EXTENSION
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800186
Suharsh Sivakumared5be1d2015-04-01 17:45:35 -0700187The --remote-key flag is used to by the sender to "authenticate" the receiver,
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800188ensuring it blesses the intended recipient and not any attacker that may have
189taken over the address.
190
Suharsh Sivakumared5be1d2015-04-01 17:45:35 -0700191The --remote-token flag is used by the sender to authenticate itself to the
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800192receiver. This helps ensure that the receiver rejects blessings from senders who
193just happened to guess the network address of the 'recvblessings' invocation.
194
Suharsh Sivakumared5be1d2015-04-01 17:45:35 -0700195If the --remote-arg-file flag is provided to recvblessings, the remote key,
Suharsh Sivakumarab21eb02015-04-01 12:58:20 -0700196remote token and object address of this principal will be written to the
197specified location. This file can be supplied to bless:
Suharsh Sivakumared5be1d2015-04-01 17:45:35 -0700198 principal bless --remote-arg-file FILE EXTENSION
Suharsh Sivakumarab21eb02015-04-01 12:58:20 -0700199
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800200Usage:
201 principal recvblessings [flags]
202
203The principal recvblessings flags are:
Suharsh Sivakumared5be1d2015-04-01 17:45:35 -0700204 -for-peer=...
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800205 If non-empty, the blessings received will be marked for peers matching this
206 pattern in the store
Suharsh Sivakumared5be1d2015-04-01 17:45:35 -0700207 -remote-arg-file=
Suharsh Sivakumarab21eb02015-04-01 12:58:20 -0700208 If non-empty, the remote key, remote token, and principal will be written to
209 the specified file in a JSON object. This can be provided to 'principal bless
Suharsh Sivakumar4bbe8ed2015-04-09 14:21:44 -0700210 --remote-arg-file FILE EXTENSION'
Suharsh Sivakumared5be1d2015-04-01 17:45:35 -0700211 -set-default=true
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800212 If true, the blessings received will be set as the default blessing in the
213 store
214
Todd Wang1624bf92015-04-22 16:53:57 -0700215Principal dump
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800216
217Prints out information about the principal specified by the environment that
218this tool is running in.
219
220Usage:
Robin Thellend5396eae2015-04-13 09:57:06 -0700221 principal dump [flags]
222
223The principal dump flags are:
224 -s=false
Suharsh Sivakumar2b22fc12015-04-15 19:38:04 -0700225 If true, show only the default blessing names
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800226
Todd Wang1624bf92015-04-22 16:53:57 -0700227Principal dumpblessings
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800228
229Prints out information about the blessings (typically obtained from this tool)
230encoded in the provided file.
231
232Usage:
233 principal dumpblessings <file>
234
235<file> is the path to a file containing blessings typically obtained from this
236tool. - is used for STDIN.
237
Todd Wang1624bf92015-04-22 16:53:57 -0700238Principal blessself
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800239
240Returns a blessing with name <name> and self-signed by the principal specified
241by the environment that this tool is running in. Optionally, the blessing can be
242restricted with an expiry caveat specified using the --for flag. Additional
243caveats can be added with the --caveat flag.
244
245Usage:
246 principal blessself [flags] [<name>]
247
248<name> is the name used to create the self-signed blessing. If not specified, a
249name will be generated based on the hostname of the machine and the name of the
250user running this command.
251
252The principal blessself flags are:
253 -caveat=[]
254 "package/path".CaveatName:VDLExpressionParam to attach to this blessing
255 -for=0
Asim Shankara0bba462015-02-20 22:50:51 -0800256 Duration of blessing validity (zero implies no expiration)
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800257
Todd Wang1624bf92015-04-22 16:53:57 -0700258Principal bless
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800259
260Bless another principal.
261
262The blesser is obtained from the runtime this tool is using. The blessing that
263will be extended is the default one from the blesser's store, or specified by
264the --with flag. Expiration on the blessing are controlled via the --for flag.
265Additional caveats are controlled with the --caveat flag.
266
267For example, let's say a principal "alice" wants to bless another principal
268"bob" as "alice/friend", the invocation would be:
Asim Shankar59b8b692015-03-30 01:23:36 -0700269 V23_CREDENTIALS=<path to alice> principal bless <path to bob> friend
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800270and this will dump the blessing to STDOUT.
271
Suharsh Sivakumared5be1d2015-04-01 17:45:35 -0700272With the --remote-key and --remote-token flags, this command can be used to
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800273bless a principal on a remote machine as well. In this case, the blessing is not
274dumped to STDOUT but sent to the remote end. Use 'principal help recvblessings'
275for more details on that.
276
Suharsh Sivakumared5be1d2015-04-01 17:45:35 -0700277When --remote-arg-file is specified, only the blessing extension is required, as
Suharsh Sivakumarab21eb02015-04-01 12:58:20 -0700278all other arguments will be extracted from the specified file.
279
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800280Usage:
Suharsh Sivakumarab21eb02015-04-01 12:58:20 -0700281 principal bless [flags] [<principal to bless>] <extension>
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800282
283<principal to bless> represents the principal to be blessed (i.e., whose public
284key will be provided with a name). This can be either: (a) The directory
285containing credentials for that principal, OR (b) The filename (- for STDIN)
286containing any other blessings of that
287 principal,
288OR (c) The object name produced by the 'recvblessings' command of this tool
Suharsh Sivakumared5be1d2015-04-01 17:45:35 -0700289 running on behalf of another principal (if the --remote-key and
290 --remote-token flags are specified).
291OR (d) None (if the --remote-arg-file flag is specified, only <extension> should
Suharsh Sivakumarab21eb02015-04-01 12:58:20 -0700292be provided
293 to bless).
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800294
295<extension> is the string extension that will be applied to create the blessing.
296
297The principal bless flags are:
298 -caveat=[]
299 "package/path".CaveatName:VDLExpressionParam to attach to this blessing
Asim Shankara0bba462015-02-20 22:50:51 -0800300 -for=0
301 Duration of blessing validity (zero implies no expiration caveat)
Suharsh Sivakumared5be1d2015-04-01 17:45:35 -0700302 -remote-arg-file=
Suharsh Sivakumarab21eb02015-04-01 12:58:20 -0700303 File containing bless arguments written by 'principal recvblessings
Suharsh Sivakumared5be1d2015-04-01 17:45:35 -0700304 -remote-arg-file FILE EXTENSION' command. This can be provided to bless in
Suharsh Sivakumar4bbe8ed2015-04-09 14:21:44 -0700305 place of --remote-key, --remote-token, and <principal>
Suharsh Sivakumared5be1d2015-04-01 17:45:35 -0700306 -remote-key=
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800307 Public key of the remote principal to bless (obtained from the
308 'recvblessings' command run by the remote principal
Suharsh Sivakumared5be1d2015-04-01 17:45:35 -0700309 -remote-token=
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800310 Token provided by principal running the 'recvblessings' command
Suharsh Sivakumared5be1d2015-04-01 17:45:35 -0700311 -require-caveats=true
Asim Shankara0bba462015-02-20 22:50:51 -0800312 If false, allow blessing without any caveats. This is typically not advised
313 as the principal wielding the blessing will be almost as powerful as its
314 blesser
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800315 -with=
316 Path to file containing blessing to extend
317
Todd Wang1624bf92015-04-22 16:53:57 -0700318Principal set
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800319
Suharsh Sivakumar32c8e752015-03-31 19:26:28 -0700320Commands to mutate the blessings of the principal.
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800321
Suharsh Sivakumar32c8e752015-03-31 19:26:28 -0700322All input blessings are expected to be serialized using base64-VOM-encoding. See
323'principal get'.
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800324
325Usage:
Suharsh Sivakumar32c8e752015-03-31 19:26:28 -0700326 principal set <command>
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800327
Suharsh Sivakumar32c8e752015-03-31 19:26:28 -0700328The principal set commands are:
329 default Set provided blessings as default
330 forpeer Set provided blessings for peer
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800331
Todd Wang1624bf92015-04-22 16:53:57 -0700332Principal set default
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800333
334Sets the provided blessings as default in the BlessingStore specified by the
335environment that this tool is running in.
336
Suharsh Sivakumar32c8e752015-03-31 19:26:28 -0700337It is an error to call 'set default' with blessings whose public key does not
338match the public key of the principal specified by the environment.
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800339
340Usage:
Suharsh Sivakumar32c8e752015-03-31 19:26:28 -0700341 principal set default [flags] <file>
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800342
343<file> is the path to a file containing a blessing typically obtained from this
344tool. - is used for STDIN.
345
Suharsh Sivakumar32c8e752015-03-31 19:26:28 -0700346The principal set default flags are:
Suharsh Sivakumared5be1d2015-04-01 17:45:35 -0700347 -add-to-roots=true
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800348 If true, the root certificate of the blessing will be added to the
349 principal's set of recognized root certificates
350
Todd Wang1624bf92015-04-22 16:53:57 -0700351Principal set forpeer
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800352
353Marks the provided blessings to be shared with the provided peers on the
354BlessingStore specified by the environment that this tool is running in.
355
356'set b pattern' marks the intention to reveal b to peers who present blessings
357of their own matching 'pattern'.
358
359'set nil pattern' can be used to remove the blessings previously associated with
360the pattern (by a prior 'set' command).
361
Suharsh Sivakumar32c8e752015-03-31 19:26:28 -0700362It is an error to call 'set forpeer' with blessings whose public key does not
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800363match the public key of this principal specified by the environment.
364
365Usage:
Suharsh Sivakumar32c8e752015-03-31 19:26:28 -0700366 principal set forpeer [flags] <file> <pattern>
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800367
368<file> is the path to a file containing a blessing typically obtained from this
369tool. - is used for STDIN.
370
371<pattern> is the BlessingPattern used to identify peers with whom this blessing
372can be shared with.
373
Suharsh Sivakumar32c8e752015-03-31 19:26:28 -0700374The principal set forpeer flags are:
Suharsh Sivakumared5be1d2015-04-01 17:45:35 -0700375 -add-to-roots=true
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800376 If true, the root certificate of the blessing will be added to the
377 principal's set of recognized root certificates
378
Todd Wang1624bf92015-04-22 16:53:57 -0700379Principal get
Suharsh Sivakumar32c8e752015-03-31 19:26:28 -0700380
381Commands to inspect the blessings of the principal.
382
383All blessings are printed to stdout using base64-VOM-encoding.
384
385Usage:
386 principal get <command>
387
388The principal get commands are:
Suharsh Sivakumar4bbe8ed2015-04-09 14:21:44 -0700389 default Return blessings marked as default
390 forpeer Return blessings marked for the provided peer
Suharsh Sivakumar2b22fc12015-04-15 19:38:04 -0700391 publickey Prints the public key of the principal.
Suharsh Sivakumar4bbe8ed2015-04-09 14:21:44 -0700392 recognizedroots Return recognized blessings, and their associated public key.
393 peermap Shows the map from peer pattern to which blessing name to
394 present.
Suharsh Sivakumar32c8e752015-03-31 19:26:28 -0700395
Todd Wang1624bf92015-04-22 16:53:57 -0700396Principal get default
Suharsh Sivakumar32c8e752015-03-31 19:26:28 -0700397
398Returns blessings that are marked as default in the BlessingStore specified by
Suharsh Sivakumar2b22fc12015-04-15 19:38:04 -0700399the environment that this tool is running in. Providing --names will print the
400default blessings' chain names. Providing --rootkey <chain_name> will print the
401root key of the certificate chain with chain_name. Providing --caveats
402<chain_name> will print the caveats on the certificate chain with chain_name.
Suharsh Sivakumar32c8e752015-03-31 19:26:28 -0700403
404Usage:
Suharsh Sivakumar4bbe8ed2015-04-09 14:21:44 -0700405 principal get default [flags]
406
407The principal get default flags are:
Suharsh Sivakumar2b22fc12015-04-15 19:38:04 -0700408 -caveats=
409 Shows the caveats on the provided certificate chain name.
410 -names=false
Suharsh Sivakumar4bbe8ed2015-04-09 14:21:44 -0700411 If true, shows the value of the blessing name to be presented to the peer
Suharsh Sivakumar2b22fc12015-04-15 19:38:04 -0700412 -rootkey=
413 Shows the value of the root key of the provided certificate chain name.
Suharsh Sivakumar32c8e752015-03-31 19:26:28 -0700414
Todd Wang1624bf92015-04-22 16:53:57 -0700415Principal get forpeer
Suharsh Sivakumar32c8e752015-03-31 19:26:28 -0700416
417Returns blessings that are marked for the provided peer in the BlessingStore
Suharsh Sivakumar2b22fc12015-04-15 19:38:04 -0700418specified by the environment that this tool is running in. Providing --names
419will print the blessings' chain names. Providing --rootkey <chain_name> will
420print the root key of the certificate chain with chain_name. Providing --caveats
421<chain_name> will print the caveats on the certificate chain with chain_name.
Suharsh Sivakumar32c8e752015-03-31 19:26:28 -0700422
423Usage:
Suharsh Sivakumar4bbe8ed2015-04-09 14:21:44 -0700424 principal get forpeer [flags] [<peer_1> ... <peer_k>]
Suharsh Sivakumar32c8e752015-03-31 19:26:28 -0700425
426<peer_1> ... <peer_k> are the (human-readable string) blessings bound to the
427peer. The returned blessings are marked with a pattern that is matched by at
428least one of these. If no arguments are specified, store.forpeer returns the
429blessings that are marked for all peers (i.e., blessings set on the store with
430the "..." pattern).
431
Suharsh Sivakumar4bbe8ed2015-04-09 14:21:44 -0700432The principal get forpeer flags are:
Suharsh Sivakumar2b22fc12015-04-15 19:38:04 -0700433 -caveats=
434 Shows the caveats on the provided certificate chain name.
435 -names=false
Suharsh Sivakumar4bbe8ed2015-04-09 14:21:44 -0700436 If true, shows the value of the blessing name to be presented to the peer
Suharsh Sivakumar2b22fc12015-04-15 19:38:04 -0700437 -rootkey=
438 Shows the value of the root key of the provided certificate chain name.
439
Todd Wang1624bf92015-04-22 16:53:57 -0700440Principal get publickey
Suharsh Sivakumar2b22fc12015-04-15 19:38:04 -0700441
442Prints out the public key of the principal specified by the environment that
443this tool is running in.
444
Asim Shankarde6fda52015-04-22 21:20:24 -0700445The key is printed as a base64 encoded bytes of the DER-format representation of
446the key.
447
448If the --pretty flag is provided, then the key is printed in the XX:XX:...:XX
449format typically used in the output of other commands. This representation,
450while prettier, is lossy.
451
Suharsh Sivakumar2b22fc12015-04-15 19:38:04 -0700452Usage:
Asim Shankarde6fda52015-04-22 21:20:24 -0700453 principal get publickey [flags]
454
455The principal get publickey flags are:
456 -pretty=false
457 If true, print the key out in a more human-readable but lossy representation.
Suharsh Sivakumar4bbe8ed2015-04-09 14:21:44 -0700458
Todd Wang1624bf92015-04-22 16:53:57 -0700459Principal get recognizedroots
Suharsh Sivakumar4bbe8ed2015-04-09 14:21:44 -0700460
461Shows list of blessing names that the principal recognizes, and their associated
462public key. If the principal is operating as a client, contacted servers must
463appear on this list. If the principal is operating as a server, clients must
464present blessings derived from this list.
465
466Usage:
467 principal get recognizedroots
468
Todd Wang1624bf92015-04-22 16:53:57 -0700469Principal get peermap
Suharsh Sivakumar4bbe8ed2015-04-09 14:21:44 -0700470
471Shows the map from peer pattern to which blessing name to present. If the
472principal operates as a server, it presents its default blessing to all peers.
473If the principal operates as a client, it presents the map value associated with
474the peer it contacts.
475
476Usage:
477 principal get peermap
478
Todd Wang1624bf92015-04-22 16:53:57 -0700479Principal addtoroots
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800480
Asim Shankar80277d02015-03-31 12:57:06 -0700481Adds an identity provider to the set of recognized roots public keys for this
482principal.
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800483
Asim Shankar80277d02015-03-31 12:57:06 -0700484It accepts either a single argument (which points to a file containing a
485blessing) or two arguments (a name and a base64-encoded DER-encoded public key).
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800486
Asim Shankar80277d02015-03-31 12:57:06 -0700487For example, to make the principal in credentials directory A recognize the root
488of the default blessing in credentials directory B:
Asim Shankarf32d24d2015-04-01 16:34:26 -0700489 principal -v23.credentials=B bless A some_extension |
490 principal -v23.credentials=A addtoroots -
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800491The extension 'some_extension' has no effect in the command above.
492
Asim Shankarde6fda52015-04-22 21:20:24 -0700493Or to make the principal in credentials directory A recognize the base64-encoded
Asim Shankar80277d02015-03-31 12:57:06 -0700494public key KEY for blessing patterns P:
Asim Shankarf32d24d2015-04-01 16:34:26 -0700495 principal -v23.credentials=A addtoroots KEY P
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800496
Asim Shankar80277d02015-03-31 12:57:06 -0700497Usage:
498 principal addtoroots <key|blessing> [<blessing pattern>]
499
500<blessing> is the path to a file containing a blessing typically obtained from
501this tool. - is used for STDIN.
502
503<key> is a base64-encoded, DER-encoded public key.
504
505<blessing pattern> is the blessing pattern for which <key> should be recognized.
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800506
Todd Wang1624bf92015-04-22 16:53:57 -0700507Principal help
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800508
509Help with no args displays the usage of the parent command.
510
511Help with args displays the usage of the specified sub-command or help topic.
512
513"help ..." recursively displays help for all commands and topics.
514
Todd Wang1624bf92015-04-22 16:53:57 -0700515Output is formatted to a target width in runes, determined by checking the
516CMDLINE_WIDTH environment variable, falling back on the terminal width, falling
517back on 80 chars. By setting CMDLINE_WIDTH=x, if x > 0 the width is x, if x < 0
518the width is unlimited, and if x == 0 or is unset one of the fallbacks is used.
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800519
520Usage:
521 principal help [flags] [command/topic ...]
522
523[command/topic ...] optionally identifies a specific sub-command or help topic.
524
525The principal help flags are:
Todd Wang1624bf92015-04-22 16:53:57 -0700526 -style=compact
527 The formatting style for help output:
528 compact - Good for compact cmdline output.
529 full - Good for cmdline output, shows all global flags.
530 godoc - Good for godoc processing.
531 Override the default by setting the CMDLINE_STYLE environment variable.
Suharsh Sivakumar1d61f642015-02-17 20:56:14 -0800532*/
533package main