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