Jiri Simsa | 3f4e92d | 2015-03-24 21:26:37 -0700 | [diff] [blame] | 1 | // 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 Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 5 | // This file was auto-generated via go generate. |
| 6 | // DO NOT UPDATE MANUALLY |
| 7 | |
| 8 | /* |
Todd Wang | 6ed3b6c | 2015-04-08 14:37:04 -0700 | [diff] [blame] | 9 | Command principal creates and manages Vanadium principals and blessings. |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 10 | |
| 11 | All objects are printed using base64-VOM-encoding. |
| 12 | |
| 13 | Usage: |
| 14 | principal <command> |
| 15 | |
| 16 | The 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 Sivakumar | d1cc6e0 | 2015-03-16 13:58:49 -0700 | [diff] [blame] | 20 | seekblessings Seek blessings from a web-based Vanadium blessing service |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 21 | 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 Sivakumar | 32c8e75 | 2015-03-31 19:26:28 -0700 | [diff] [blame] | 27 | set Mutate the principal's blessings. |
| 28 | get Read the principal's blessings. |
Asim Shankar | 562b230 | 2015-04-27 13:52:43 -0700 | [diff] [blame] | 29 | recognize Add to the set of identity providers recognized by this |
| 30 | principal |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 31 | help Display help for commands or topics |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 32 | |
| 33 | The 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 |
Jiri Simsa | 26f1c4d | 2015-08-09 17:49:40 -0700 | [diff] [blame] | 44 | -metadata=<just specify -metadata to activate> |
| 45 | Displays metadata for the program and exits. |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 46 | -stderrthreshold=2 |
| 47 | logs at or above this threshold go to stderr |
| 48 | -v=0 |
| 49 | log level for V logs |
Asim Shankar | f32d24d | 2015-04-01 16:34:26 -0700 | [diff] [blame] | 50 | -v23.credentials= |
| 51 | directory to use for storing security credentials |
| 52 | -v23.i18n-catalogue= |
| 53 | 18n catalogue files to load, comma separated |
Asim Shankar | 8196c1e | 2015-04-08 22:42:18 -0700 | [diff] [blame] | 54 | -v23.namespace.root=[/(dev.v.io/role/vprod/service/mounttabled)@ns.dev.v.io:8101] |
Asim Shankar | f32d24d | 2015-04-01 16:34:26 -0700 | [diff] [blame] | 55 | local namespace root; can be repeated to provided multiple roots |
| 56 | -v23.permissions.file=map[] |
Adam Sadovsky | a4d4a69 | 2015-04-20 11:36:49 -0700 | [diff] [blame] | 57 | specify a perms file as <name>:<permsfile> |
Asim Shankar | f32d24d | 2015-04-01 16:34:26 -0700 | [diff] [blame] | 58 | -v23.permissions.literal= |
Adam Sadovsky | a4d4a69 | 2015-04-20 11:36:49 -0700 | [diff] [blame] | 59 | explicitly specify the runtime perms as a JSON-encoded access.Permissions. |
Asim Shankar | f32d24d | 2015-04-01 16:34:26 -0700 | [diff] [blame] | 60 | Overrides all --v23.permissions.file flags. |
| 61 | -v23.proxy= |
| 62 | object name of proxy service to use to export services across network |
| 63 | boundaries |
| 64 | -v23.tcp.address= |
| 65 | address to listen on |
| 66 | -v23.tcp.protocol=wsh |
| 67 | protocol to listen with |
| 68 | -v23.vtrace.cache-size=1024 |
| 69 | The number of vtrace traces to store in memory. |
| 70 | -v23.vtrace.collect-regexp= |
| 71 | Spans and annotations that match this regular expression will trigger trace |
| 72 | collection. |
| 73 | -v23.vtrace.dump-on-shutdown=true |
| 74 | If true, dump all stored traces on runtime shutdown. |
| 75 | -v23.vtrace.sample-rate=0 |
| 76 | Rate (from 0.0 to 1.0) to sample vtrace traces. |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 77 | -vmodule= |
Cosmos Nicolaou | 6c36388 | 2015-06-02 11:51:27 -0700 | [diff] [blame] | 78 | comma-separated list of pattern=N settings for filename-filtered logging |
| 79 | -vpath= |
| 80 | comma-separated list of pattern=N settings for file pathname-filtered logging |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 81 | |
Todd Wang | 1144045 | 2015-05-29 18:05:29 -0700 | [diff] [blame] | 82 | Principal create - Create a new principal and persist it into a directory |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 83 | |
| 84 | Creates a new principal with a single self-blessed blessing and writes it out to |
| 85 | the provided directory. The same directory can then be used to set the |
Asim Shankar | 59b8b69 | 2015-03-30 01:23:36 -0700 | [diff] [blame] | 86 | V23_CREDENTIALS environment variable for other vanadium applications. |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 87 | |
| 88 | The operation fails if the directory already contains a principal. In this case |
| 89 | the --overwrite flag can be provided to clear the directory and write out the |
| 90 | new principal. |
| 91 | |
| 92 | Usage: |
| 93 | principal create [flags] <directory> <blessing> |
| 94 | |
Todd Wang | f1550cf | 2015-05-11 10:58:41 -0700 | [diff] [blame] | 95 | <directory> is the directory to which the new principal will be persisted. |
| 96 | |
| 97 | <blessing> is the self-blessed blessing that the principal will be setup to use |
| 98 | by default. |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 99 | |
| 100 | The principal create flags are: |
| 101 | -overwrite=false |
| 102 | If true, any existing principal data in the directory will be overwritten |
| 103 | |
Todd Wang | 1144045 | 2015-05-29 18:05:29 -0700 | [diff] [blame] | 104 | Principal fork - Fork a new principal from the principal that this tool is running as and persist it into a directory |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 105 | |
| 106 | Creates a new principal with a blessing from the principal specified by the |
| 107 | environment that this tool is running in, and writes it out to the provided |
| 108 | directory. The blessing that will be extended is the default one from the |
| 109 | blesser's store, or specified by the --with flag. Expiration on the blessing are |
| 110 | controlled via the --for flag. Additional caveats on the blessing are controlled |
| 111 | with the --caveat flag. The blessing is marked as default and shareable with all |
| 112 | peers on the new principal's blessing store. |
| 113 | |
| 114 | The operation fails if the directory already contains a principal. In this case |
| 115 | the --overwrite flag can be provided to clear the directory and write out the |
| 116 | forked principal. |
| 117 | |
| 118 | Usage: |
| 119 | principal fork [flags] <directory> <extension> |
| 120 | |
Todd Wang | f1550cf | 2015-05-11 10:58:41 -0700 | [diff] [blame] | 121 | <directory> is the directory to which the forked principal will be persisted. |
| 122 | |
| 123 | <extension> is the extension under which the forked principal is blessed. |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 124 | |
| 125 | The principal fork flags are: |
| 126 | -caveat=[] |
| 127 | "package/path".CaveatName:VDLExpressionParam to attach to this blessing |
Asim Shankar | a0bba46 | 2015-02-20 22:50:51 -0800 | [diff] [blame] | 128 | -for=0 |
| 129 | Duration of blessing validity (zero implies no expiration caveat) |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 130 | -overwrite=false |
| 131 | If true, any existing principal data in the directory will be overwritten |
Suharsh Sivakumar | ed5be1d | 2015-04-01 17:45:35 -0700 | [diff] [blame] | 132 | -require-caveats=true |
Asim Shankar | a0bba46 | 2015-02-20 22:50:51 -0800 | [diff] [blame] | 133 | If false, allow blessing without any caveats. This is typically not advised |
| 134 | as the principal wielding the blessing will be almost as powerful as its |
| 135 | blesser |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 136 | -with= |
| 137 | Path to file containing blessing to extend |
| 138 | |
Todd Wang | 1144045 | 2015-05-29 18:05:29 -0700 | [diff] [blame] | 139 | Principal seekblessings - Seek blessings from a web-based Vanadium blessing service |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 140 | |
Suharsh Sivakumar | d1cc6e0 | 2015-03-16 13:58:49 -0700 | [diff] [blame] | 141 | Seeks blessings from a web-based Vanadium blesser which requires the caller to |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 142 | first authenticate with Google using OAuth. Simply run the command to see what |
| 143 | happens. |
| 144 | |
| 145 | The blessings are sought for the principal specified by the environment that |
| 146 | this tool is running in. |
| 147 | |
Suharsh Sivakumar | ed5be1d | 2015-04-01 17:45:35 -0700 | [diff] [blame] | 148 | The blessings obtained are set as default, unless the --set-default flag is set |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 149 | to true, and are also set for sharing with all peers, unless a more specific |
Suharsh Sivakumar | ed5be1d | 2015-04-01 17:45:35 -0700 | [diff] [blame] | 150 | peer pattern is provided using the --for-peer flag. |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 151 | |
| 152 | Usage: |
| 153 | principal seekblessings [flags] |
| 154 | |
| 155 | The principal seekblessings flags are: |
Suharsh Sivakumar | ed5be1d | 2015-04-01 17:45:35 -0700 | [diff] [blame] | 156 | -add-to-roots=true |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 157 | If true, the root certificate of the blessing will be added to the |
| 158 | principal's set of recognized root certificates |
| 159 | -browser=true |
| 160 | If false, the seekblessings command will not open the browser and only print |
| 161 | the url to visit. |
Suharsh Sivakumar | ed5be1d | 2015-04-01 17:45:35 -0700 | [diff] [blame] | 162 | -for-peer=... |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 163 | If non-empty, the blessings obtained will be marked for peers matching this |
| 164 | pattern in the store |
Suharsh Sivakumar | 3388401 | 2015-03-25 13:27:55 -0700 | [diff] [blame] | 165 | -from=https://dev.v.io/auth/google |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 166 | URL to use to begin the seek blessings process |
Suharsh Sivakumar | ed5be1d | 2015-04-01 17:45:35 -0700 | [diff] [blame] | 167 | -set-default=true |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 168 | If true, the blessings obtained will be set as the default blessing in the |
| 169 | store |
| 170 | |
Todd Wang | 1144045 | 2015-05-29 18:05:29 -0700 | [diff] [blame] | 171 | Principal recvblessings - Receive blessings sent by another principal and use them as the default |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 172 | |
| 173 | Allow another principal (likely a remote process) to bless this one. |
| 174 | |
| 175 | This command sets up the invoker (this process) to wait for a blessing from |
| 176 | another invocation of this tool (remote process) and prints out the command to |
| 177 | be run as the remote principal. |
| 178 | |
Suharsh Sivakumar | ed5be1d | 2015-04-01 17:45:35 -0700 | [diff] [blame] | 179 | The received blessings are set as default, unless the --set-default flag is set |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 180 | to true, and are also set for sharing with all peers, unless a more specific |
Suharsh Sivakumar | ed5be1d | 2015-04-01 17:45:35 -0700 | [diff] [blame] | 181 | peer pattern is provided using the --for-peer flag. |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 182 | |
| 183 | TODO(ashankar,cnicolaou): Make this next paragraph possible! Requires the |
| 184 | ability to obtain the proxied endpoint. |
| 185 | |
| 186 | Typically, this command should require no arguments. However, if the sender and |
| 187 | receiver are on different network domains, it may make sense to use the |
Asim Shankar | f32d24d | 2015-04-01 16:34:26 -0700 | [diff] [blame] | 188 | --v23.proxy flag: |
| 189 | principal --v23.proxy=proxy recvblessings |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 190 | |
| 191 | The command to be run at the sender is of the form: |
Suharsh Sivakumar | ed5be1d | 2015-04-01 17:45:35 -0700 | [diff] [blame] | 192 | principal bless --remote-key=KEY --remote-token=TOKEN ADDRESS EXTENSION |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 193 | |
Suharsh Sivakumar | ed5be1d | 2015-04-01 17:45:35 -0700 | [diff] [blame] | 194 | The --remote-key flag is used to by the sender to "authenticate" the receiver, |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 195 | ensuring it blesses the intended recipient and not any attacker that may have |
| 196 | taken over the address. |
| 197 | |
Suharsh Sivakumar | ed5be1d | 2015-04-01 17:45:35 -0700 | [diff] [blame] | 198 | The --remote-token flag is used by the sender to authenticate itself to the |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 199 | receiver. This helps ensure that the receiver rejects blessings from senders who |
| 200 | just happened to guess the network address of the 'recvblessings' invocation. |
| 201 | |
Suharsh Sivakumar | ed5be1d | 2015-04-01 17:45:35 -0700 | [diff] [blame] | 202 | If the --remote-arg-file flag is provided to recvblessings, the remote key, |
Suharsh Sivakumar | ab21eb0 | 2015-04-01 12:58:20 -0700 | [diff] [blame] | 203 | remote token and object address of this principal will be written to the |
| 204 | specified location. This file can be supplied to bless: |
Suharsh Sivakumar | ed5be1d | 2015-04-01 17:45:35 -0700 | [diff] [blame] | 205 | principal bless --remote-arg-file FILE EXTENSION |
Suharsh Sivakumar | ab21eb0 | 2015-04-01 12:58:20 -0700 | [diff] [blame] | 206 | |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 207 | Usage: |
| 208 | principal recvblessings [flags] |
| 209 | |
| 210 | The principal recvblessings flags are: |
Suharsh Sivakumar | ed5be1d | 2015-04-01 17:45:35 -0700 | [diff] [blame] | 211 | -for-peer=... |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 212 | If non-empty, the blessings received will be marked for peers matching this |
| 213 | pattern in the store |
Suharsh Sivakumar | ed5be1d | 2015-04-01 17:45:35 -0700 | [diff] [blame] | 214 | -remote-arg-file= |
Suharsh Sivakumar | ab21eb0 | 2015-04-01 12:58:20 -0700 | [diff] [blame] | 215 | If non-empty, the remote key, remote token, and principal will be written to |
| 216 | the specified file in a JSON object. This can be provided to 'principal bless |
Suharsh Sivakumar | 4bbe8ed | 2015-04-09 14:21:44 -0700 | [diff] [blame] | 217 | --remote-arg-file FILE EXTENSION' |
Suharsh Sivakumar | ed5be1d | 2015-04-01 17:45:35 -0700 | [diff] [blame] | 218 | -set-default=true |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 219 | If true, the blessings received will be set as the default blessing in the |
| 220 | store |
| 221 | |
Todd Wang | 1144045 | 2015-05-29 18:05:29 -0700 | [diff] [blame] | 222 | Principal dump - Dump out information about the principal |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 223 | |
| 224 | Prints out information about the principal specified by the environment that |
| 225 | this tool is running in. |
| 226 | |
| 227 | Usage: |
Robin Thellend | 5396eae | 2015-04-13 09:57:06 -0700 | [diff] [blame] | 228 | principal dump [flags] |
| 229 | |
| 230 | The principal dump flags are: |
| 231 | -s=false |
Suharsh Sivakumar | 2b22fc1 | 2015-04-15 19:38:04 -0700 | [diff] [blame] | 232 | If true, show only the default blessing names |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 233 | |
Todd Wang | 1144045 | 2015-05-29 18:05:29 -0700 | [diff] [blame] | 234 | Principal dumpblessings - Dump out information about the provided blessings |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 235 | |
| 236 | Prints out information about the blessings (typically obtained from this tool) |
| 237 | encoded in the provided file. |
| 238 | |
| 239 | Usage: |
| 240 | principal dumpblessings <file> |
| 241 | |
| 242 | <file> is the path to a file containing blessings typically obtained from this |
| 243 | tool. - is used for STDIN. |
| 244 | |
Todd Wang | 1144045 | 2015-05-29 18:05:29 -0700 | [diff] [blame] | 245 | Principal blessself - Generate a self-signed blessing |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 246 | |
| 247 | Returns a blessing with name <name> and self-signed by the principal specified |
| 248 | by the environment that this tool is running in. Optionally, the blessing can be |
| 249 | restricted with an expiry caveat specified using the --for flag. Additional |
| 250 | caveats can be added with the --caveat flag. |
| 251 | |
| 252 | Usage: |
| 253 | principal blessself [flags] [<name>] |
| 254 | |
| 255 | <name> is the name used to create the self-signed blessing. If not specified, a |
| 256 | name will be generated based on the hostname of the machine and the name of the |
| 257 | user running this command. |
| 258 | |
| 259 | The principal blessself flags are: |
| 260 | -caveat=[] |
| 261 | "package/path".CaveatName:VDLExpressionParam to attach to this blessing |
| 262 | -for=0 |
Asim Shankar | a0bba46 | 2015-02-20 22:50:51 -0800 | [diff] [blame] | 263 | Duration of blessing validity (zero implies no expiration) |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 264 | |
Todd Wang | 1144045 | 2015-05-29 18:05:29 -0700 | [diff] [blame] | 265 | Principal bless - Bless another principal |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 266 | |
| 267 | Bless another principal. |
| 268 | |
| 269 | The blesser is obtained from the runtime this tool is using. The blessing that |
| 270 | will be extended is the default one from the blesser's store, or specified by |
| 271 | the --with flag. Expiration on the blessing are controlled via the --for flag. |
| 272 | Additional caveats are controlled with the --caveat flag. |
| 273 | |
| 274 | For example, let's say a principal "alice" wants to bless another principal |
| 275 | "bob" as "alice/friend", the invocation would be: |
Asim Shankar | 59b8b69 | 2015-03-30 01:23:36 -0700 | [diff] [blame] | 276 | V23_CREDENTIALS=<path to alice> principal bless <path to bob> friend |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 277 | and this will dump the blessing to STDOUT. |
| 278 | |
Suharsh Sivakumar | ed5be1d | 2015-04-01 17:45:35 -0700 | [diff] [blame] | 279 | With the --remote-key and --remote-token flags, this command can be used to |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 280 | bless a principal on a remote machine as well. In this case, the blessing is not |
| 281 | dumped to STDOUT but sent to the remote end. Use 'principal help recvblessings' |
| 282 | for more details on that. |
| 283 | |
Suharsh Sivakumar | ed5be1d | 2015-04-01 17:45:35 -0700 | [diff] [blame] | 284 | When --remote-arg-file is specified, only the blessing extension is required, as |
Suharsh Sivakumar | ab21eb0 | 2015-04-01 12:58:20 -0700 | [diff] [blame] | 285 | all other arguments will be extracted from the specified file. |
| 286 | |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 287 | Usage: |
Asim Shankar | 2a32dd2 | 2015-05-29 15:45:22 -0700 | [diff] [blame] | 288 | principal bless [flags] [<principal to bless>] [<extension>] |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 289 | |
| 290 | <principal to bless> represents the principal to be blessed (i.e., whose public |
| 291 | key will be provided with a name). This can be either: (a) The directory |
| 292 | containing credentials for that principal, OR (b) The filename (- for STDIN) |
| 293 | containing any other blessings of that |
| 294 | principal, |
| 295 | OR (c) The object name produced by the 'recvblessings' command of this tool |
Suharsh Sivakumar | ed5be1d | 2015-04-01 17:45:35 -0700 | [diff] [blame] | 296 | running on behalf of another principal (if the --remote-key and |
| 297 | --remote-token flags are specified). |
| 298 | OR (d) None (if the --remote-arg-file flag is specified, only <extension> should |
Suharsh Sivakumar | ab21eb0 | 2015-04-01 12:58:20 -0700 | [diff] [blame] | 299 | be provided |
| 300 | to bless). |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 301 | |
| 302 | <extension> is the string extension that will be applied to create the blessing. |
| 303 | |
| 304 | The principal bless flags are: |
| 305 | -caveat=[] |
| 306 | "package/path".CaveatName:VDLExpressionParam to attach to this blessing |
Asim Shankar | a0bba46 | 2015-02-20 22:50:51 -0800 | [diff] [blame] | 307 | -for=0 |
| 308 | Duration of blessing validity (zero implies no expiration caveat) |
Suharsh Sivakumar | ed5be1d | 2015-04-01 17:45:35 -0700 | [diff] [blame] | 309 | -remote-arg-file= |
Suharsh Sivakumar | ab21eb0 | 2015-04-01 12:58:20 -0700 | [diff] [blame] | 310 | File containing bless arguments written by 'principal recvblessings |
Suharsh Sivakumar | ed5be1d | 2015-04-01 17:45:35 -0700 | [diff] [blame] | 311 | -remote-arg-file FILE EXTENSION' command. This can be provided to bless in |
Suharsh Sivakumar | 4bbe8ed | 2015-04-09 14:21:44 -0700 | [diff] [blame] | 312 | place of --remote-key, --remote-token, and <principal> |
Suharsh Sivakumar | ed5be1d | 2015-04-01 17:45:35 -0700 | [diff] [blame] | 313 | -remote-key= |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 314 | Public key of the remote principal to bless (obtained from the |
| 315 | 'recvblessings' command run by the remote principal |
Suharsh Sivakumar | ed5be1d | 2015-04-01 17:45:35 -0700 | [diff] [blame] | 316 | -remote-token= |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 317 | Token provided by principal running the 'recvblessings' command |
Suharsh Sivakumar | ed5be1d | 2015-04-01 17:45:35 -0700 | [diff] [blame] | 318 | -require-caveats=true |
Asim Shankar | a0bba46 | 2015-02-20 22:50:51 -0800 | [diff] [blame] | 319 | If false, allow blessing without any caveats. This is typically not advised |
| 320 | as the principal wielding the blessing will be almost as powerful as its |
| 321 | blesser |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 322 | -with= |
| 323 | Path to file containing blessing to extend |
| 324 | |
Todd Wang | 1624bf9 | 2015-04-22 16:53:57 -0700 | [diff] [blame] | 325 | Principal set |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 326 | |
Suharsh Sivakumar | 32c8e75 | 2015-03-31 19:26:28 -0700 | [diff] [blame] | 327 | Commands to mutate the blessings of the principal. |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 328 | |
Suharsh Sivakumar | 32c8e75 | 2015-03-31 19:26:28 -0700 | [diff] [blame] | 329 | All input blessings are expected to be serialized using base64-VOM-encoding. See |
| 330 | 'principal get'. |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 331 | |
| 332 | Usage: |
Suharsh Sivakumar | 32c8e75 | 2015-03-31 19:26:28 -0700 | [diff] [blame] | 333 | principal set <command> |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 334 | |
Suharsh Sivakumar | 32c8e75 | 2015-03-31 19:26:28 -0700 | [diff] [blame] | 335 | The principal set commands are: |
| 336 | default Set provided blessings as default |
| 337 | forpeer Set provided blessings for peer |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 338 | |
Todd Wang | 1144045 | 2015-05-29 18:05:29 -0700 | [diff] [blame] | 339 | Principal set default - Set provided blessings as default |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 340 | |
| 341 | Sets the provided blessings as default in the BlessingStore specified by the |
| 342 | environment that this tool is running in. |
| 343 | |
Suharsh Sivakumar | 32c8e75 | 2015-03-31 19:26:28 -0700 | [diff] [blame] | 344 | It is an error to call 'set default' with blessings whose public key does not |
| 345 | match the public key of the principal specified by the environment. |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 346 | |
| 347 | Usage: |
Suharsh Sivakumar | 32c8e75 | 2015-03-31 19:26:28 -0700 | [diff] [blame] | 348 | principal set default [flags] <file> |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 349 | |
| 350 | <file> is the path to a file containing a blessing typically obtained from this |
| 351 | tool. - is used for STDIN. |
| 352 | |
Suharsh Sivakumar | 32c8e75 | 2015-03-31 19:26:28 -0700 | [diff] [blame] | 353 | The principal set default flags are: |
Suharsh Sivakumar | ed5be1d | 2015-04-01 17:45:35 -0700 | [diff] [blame] | 354 | -add-to-roots=true |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 355 | If true, the root certificate of the blessing will be added to the |
| 356 | principal's set of recognized root certificates |
| 357 | |
Todd Wang | 1144045 | 2015-05-29 18:05:29 -0700 | [diff] [blame] | 358 | Principal set forpeer - Set provided blessings for peer |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 359 | |
| 360 | Marks the provided blessings to be shared with the provided peers on the |
| 361 | BlessingStore specified by the environment that this tool is running in. |
| 362 | |
| 363 | 'set b pattern' marks the intention to reveal b to peers who present blessings |
| 364 | of their own matching 'pattern'. |
| 365 | |
| 366 | 'set nil pattern' can be used to remove the blessings previously associated with |
| 367 | the pattern (by a prior 'set' command). |
| 368 | |
Suharsh Sivakumar | 32c8e75 | 2015-03-31 19:26:28 -0700 | [diff] [blame] | 369 | It is an error to call 'set forpeer' with blessings whose public key does not |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 370 | match the public key of this principal specified by the environment. |
| 371 | |
| 372 | Usage: |
Suharsh Sivakumar | 32c8e75 | 2015-03-31 19:26:28 -0700 | [diff] [blame] | 373 | principal set forpeer [flags] <file> <pattern> |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 374 | |
| 375 | <file> is the path to a file containing a blessing typically obtained from this |
| 376 | tool. - is used for STDIN. |
| 377 | |
| 378 | <pattern> is the BlessingPattern used to identify peers with whom this blessing |
| 379 | can be shared with. |
| 380 | |
Suharsh Sivakumar | 32c8e75 | 2015-03-31 19:26:28 -0700 | [diff] [blame] | 381 | The principal set forpeer flags are: |
Suharsh Sivakumar | ed5be1d | 2015-04-01 17:45:35 -0700 | [diff] [blame] | 382 | -add-to-roots=true |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 383 | If true, the root certificate of the blessing will be added to the |
| 384 | principal's set of recognized root certificates |
| 385 | |
Todd Wang | 1624bf9 | 2015-04-22 16:53:57 -0700 | [diff] [blame] | 386 | Principal get |
Suharsh Sivakumar | 32c8e75 | 2015-03-31 19:26:28 -0700 | [diff] [blame] | 387 | |
| 388 | Commands to inspect the blessings of the principal. |
| 389 | |
| 390 | All blessings are printed to stdout using base64-VOM-encoding. |
| 391 | |
| 392 | Usage: |
| 393 | principal get <command> |
| 394 | |
| 395 | The principal get commands are: |
Suharsh Sivakumar | 4bbe8ed | 2015-04-09 14:21:44 -0700 | [diff] [blame] | 396 | default Return blessings marked as default |
| 397 | forpeer Return blessings marked for the provided peer |
Suharsh Sivakumar | 2b22fc1 | 2015-04-15 19:38:04 -0700 | [diff] [blame] | 398 | publickey Prints the public key of the principal. |
Suharsh Sivakumar | 4bbe8ed | 2015-04-09 14:21:44 -0700 | [diff] [blame] | 399 | recognizedroots Return recognized blessings, and their associated public key. |
| 400 | peermap Shows the map from peer pattern to which blessing name to |
| 401 | present. |
Suharsh Sivakumar | 32c8e75 | 2015-03-31 19:26:28 -0700 | [diff] [blame] | 402 | |
Todd Wang | 1144045 | 2015-05-29 18:05:29 -0700 | [diff] [blame] | 403 | Principal get default - Return blessings marked as default |
Suharsh Sivakumar | 32c8e75 | 2015-03-31 19:26:28 -0700 | [diff] [blame] | 404 | |
| 405 | Returns blessings that are marked as default in the BlessingStore specified by |
Suharsh Sivakumar | 2b22fc1 | 2015-04-15 19:38:04 -0700 | [diff] [blame] | 406 | the environment that this tool is running in. Providing --names will print the |
| 407 | default blessings' chain names. Providing --rootkey <chain_name> will print the |
| 408 | root key of the certificate chain with chain_name. Providing --caveats |
| 409 | <chain_name> will print the caveats on the certificate chain with chain_name. |
Suharsh Sivakumar | 32c8e75 | 2015-03-31 19:26:28 -0700 | [diff] [blame] | 410 | |
| 411 | Usage: |
Suharsh Sivakumar | 4bbe8ed | 2015-04-09 14:21:44 -0700 | [diff] [blame] | 412 | principal get default [flags] |
| 413 | |
| 414 | The principal get default flags are: |
Suharsh Sivakumar | 2b22fc1 | 2015-04-15 19:38:04 -0700 | [diff] [blame] | 415 | -caveats= |
| 416 | Shows the caveats on the provided certificate chain name. |
| 417 | -names=false |
Suharsh Sivakumar | 4bbe8ed | 2015-04-09 14:21:44 -0700 | [diff] [blame] | 418 | If true, shows the value of the blessing name to be presented to the peer |
Suharsh Sivakumar | 2b22fc1 | 2015-04-15 19:38:04 -0700 | [diff] [blame] | 419 | -rootkey= |
| 420 | Shows the value of the root key of the provided certificate chain name. |
Suharsh Sivakumar | 32c8e75 | 2015-03-31 19:26:28 -0700 | [diff] [blame] | 421 | |
Todd Wang | 1144045 | 2015-05-29 18:05:29 -0700 | [diff] [blame] | 422 | Principal get forpeer - Return blessings marked for the provided peer |
Suharsh Sivakumar | 32c8e75 | 2015-03-31 19:26:28 -0700 | [diff] [blame] | 423 | |
| 424 | Returns blessings that are marked for the provided peer in the BlessingStore |
Suharsh Sivakumar | 2b22fc1 | 2015-04-15 19:38:04 -0700 | [diff] [blame] | 425 | specified by the environment that this tool is running in. Providing --names |
| 426 | will print the blessings' chain names. Providing --rootkey <chain_name> will |
| 427 | print the root key of the certificate chain with chain_name. Providing --caveats |
| 428 | <chain_name> will print the caveats on the certificate chain with chain_name. |
Suharsh Sivakumar | 32c8e75 | 2015-03-31 19:26:28 -0700 | [diff] [blame] | 429 | |
| 430 | Usage: |
Suharsh Sivakumar | 4bbe8ed | 2015-04-09 14:21:44 -0700 | [diff] [blame] | 431 | principal get forpeer [flags] [<peer_1> ... <peer_k>] |
Suharsh Sivakumar | 32c8e75 | 2015-03-31 19:26:28 -0700 | [diff] [blame] | 432 | |
| 433 | <peer_1> ... <peer_k> are the (human-readable string) blessings bound to the |
| 434 | peer. The returned blessings are marked with a pattern that is matched by at |
| 435 | least one of these. If no arguments are specified, store.forpeer returns the |
| 436 | blessings that are marked for all peers (i.e., blessings set on the store with |
| 437 | the "..." pattern). |
| 438 | |
Suharsh Sivakumar | 4bbe8ed | 2015-04-09 14:21:44 -0700 | [diff] [blame] | 439 | The principal get forpeer flags are: |
Suharsh Sivakumar | 2b22fc1 | 2015-04-15 19:38:04 -0700 | [diff] [blame] | 440 | -caveats= |
| 441 | Shows the caveats on the provided certificate chain name. |
| 442 | -names=false |
Suharsh Sivakumar | 4bbe8ed | 2015-04-09 14:21:44 -0700 | [diff] [blame] | 443 | If true, shows the value of the blessing name to be presented to the peer |
Suharsh Sivakumar | 2b22fc1 | 2015-04-15 19:38:04 -0700 | [diff] [blame] | 444 | -rootkey= |
| 445 | Shows the value of the root key of the provided certificate chain name. |
| 446 | |
Todd Wang | 1624bf9 | 2015-04-22 16:53:57 -0700 | [diff] [blame] | 447 | Principal get publickey |
Suharsh Sivakumar | 2b22fc1 | 2015-04-15 19:38:04 -0700 | [diff] [blame] | 448 | |
| 449 | Prints out the public key of the principal specified by the environment that |
| 450 | this tool is running in. |
| 451 | |
Asim Shankar | de6fda5 | 2015-04-22 21:20:24 -0700 | [diff] [blame] | 452 | The key is printed as a base64 encoded bytes of the DER-format representation of |
Asim Shankar | 562b230 | 2015-04-27 13:52:43 -0700 | [diff] [blame] | 453 | the key (suitable to be provided as an argument to the 'recognize' command for |
Asim Shankar | 1213ab2 | 2015-04-23 10:11:07 -0700 | [diff] [blame] | 454 | example). |
Asim Shankar | de6fda5 | 2015-04-22 21:20:24 -0700 | [diff] [blame] | 455 | |
Asim Shankar | 1213ab2 | 2015-04-23 10:11:07 -0700 | [diff] [blame] | 456 | With --pretty, a 16-byte fingerprint of the key instead. This format is easier |
| 457 | for humans to read and is used in output of other commands in this program, but |
Asim Shankar | 562b230 | 2015-04-27 13:52:43 -0700 | [diff] [blame] | 458 | is not suitable as an argument to the 'recognize' command. |
Asim Shankar | de6fda5 | 2015-04-22 21:20:24 -0700 | [diff] [blame] | 459 | |
Suharsh Sivakumar | 2b22fc1 | 2015-04-15 19:38:04 -0700 | [diff] [blame] | 460 | Usage: |
Asim Shankar | de6fda5 | 2015-04-22 21:20:24 -0700 | [diff] [blame] | 461 | principal get publickey [flags] |
| 462 | |
| 463 | The principal get publickey flags are: |
| 464 | -pretty=false |
| 465 | If true, print the key out in a more human-readable but lossy representation. |
Suharsh Sivakumar | 4bbe8ed | 2015-04-09 14:21:44 -0700 | [diff] [blame] | 466 | |
Todd Wang | 1624bf9 | 2015-04-22 16:53:57 -0700 | [diff] [blame] | 467 | Principal get recognizedroots |
Suharsh Sivakumar | 4bbe8ed | 2015-04-09 14:21:44 -0700 | [diff] [blame] | 468 | |
| 469 | Shows list of blessing names that the principal recognizes, and their associated |
| 470 | public key. If the principal is operating as a client, contacted servers must |
| 471 | appear on this list. If the principal is operating as a server, clients must |
| 472 | present blessings derived from this list. |
| 473 | |
| 474 | Usage: |
| 475 | principal get recognizedroots |
| 476 | |
Todd Wang | 1624bf9 | 2015-04-22 16:53:57 -0700 | [diff] [blame] | 477 | Principal get peermap |
Suharsh Sivakumar | 4bbe8ed | 2015-04-09 14:21:44 -0700 | [diff] [blame] | 478 | |
| 479 | Shows the map from peer pattern to which blessing name to present. If the |
| 480 | principal operates as a server, it presents its default blessing to all peers. |
| 481 | If the principal operates as a client, it presents the map value associated with |
| 482 | the peer it contacts. |
| 483 | |
| 484 | Usage: |
| 485 | principal get peermap |
| 486 | |
Todd Wang | 1144045 | 2015-05-29 18:05:29 -0700 | [diff] [blame] | 487 | Principal recognize - Add to the set of identity providers recognized by this principal |
Asim Shankar | 562b230 | 2015-04-27 13:52:43 -0700 | [diff] [blame] | 488 | |
| 489 | Adds an identity provider to the set of recognized roots public keys for this |
| 490 | principal. |
| 491 | |
| 492 | It accepts either a single argument (which points to a file containing a |
| 493 | blessing) or two arguments (a name and a base64-encoded DER-encoded public key). |
| 494 | |
| 495 | For example, to make the principal in credentials directory A recognize the root |
| 496 | of the default blessing in credentials directory B: |
| 497 | principal -v23.credentials=B bless A some_extension | |
| 498 | principal -v23.credentials=A recognize - |
| 499 | The extension 'some_extension' has no effect in the command above. |
| 500 | |
| 501 | Or to make the principal in credentials directory A recognize the base64-encoded |
| 502 | public key KEY for blessing pattern P: |
| 503 | principal -v23.credentials=A recognize P KEY |
| 504 | |
| 505 | Usage: |
| 506 | principal recognize <key|blessing> [<blessing pattern>] |
| 507 | |
| 508 | <blessing> is the path to a file containing a blessing typically obtained from |
| 509 | this tool. - is used for STDIN. |
| 510 | |
| 511 | <key> is a base64-encoded, DER-encoded public key. |
| 512 | |
| 513 | <blessing pattern> is the blessing pattern for which <key> should be recognized. |
| 514 | |
Todd Wang | 1144045 | 2015-05-29 18:05:29 -0700 | [diff] [blame] | 515 | Principal help - Display help for commands or topics |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 516 | |
| 517 | Help with no args displays the usage of the parent command. |
| 518 | |
| 519 | Help with args displays the usage of the specified sub-command or help topic. |
| 520 | |
| 521 | "help ..." recursively displays help for all commands and topics. |
| 522 | |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 523 | Usage: |
| 524 | principal help [flags] [command/topic ...] |
| 525 | |
| 526 | [command/topic ...] optionally identifies a specific sub-command or help topic. |
| 527 | |
| 528 | The principal help flags are: |
Todd Wang | 1624bf9 | 2015-04-22 16:53:57 -0700 | [diff] [blame] | 529 | -style=compact |
| 530 | The formatting style for help output: |
| 531 | compact - Good for compact cmdline output. |
| 532 | full - Good for cmdline output, shows all global flags. |
| 533 | godoc - Good for godoc processing. |
| 534 | Override the default by setting the CMDLINE_STYLE environment variable. |
Todd Wang | f1550cf | 2015-05-11 10:58:41 -0700 | [diff] [blame] | 535 | -width=<terminal width> |
| 536 | Format output to this target width in runes, or unlimited if width < 0. |
| 537 | Defaults to the terminal width if available. Override the default by setting |
| 538 | the CMDLINE_WIDTH environment variable. |
Suharsh Sivakumar | 1d61f64 | 2015-02-17 20:56:14 -0800 | [diff] [blame] | 539 | */ |
| 540 | package main |