Skip to content

Commit

Permalink
Docs: linking docs about parsing and secrets format together (#2962)
Browse files Browse the repository at this point in the history
* Adding link to doc about parsing in secrets.md

Signed-off-by: Yolan Romailler <[email protected]>

* Adding link to secrets.md in show docs

Signed-off-by: Yolan Romailler <[email protected]>

---------

Signed-off-by: Yolan Romailler <[email protected]>
  • Loading branch information
AnomalRoil authored Oct 5, 2024
1 parent 7f7bd2d commit 46799f5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
20 changes: 11 additions & 9 deletions docs/commands/show.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ If you notice any discrepancies please file a bug and we will try to fix it.
TODO: We need to specify the expectations around new lines.

* When no flag is set the `show` command will display the full content of the secret and will parse it to support key-value lookup and YAML entries.
If the `safecontent` option is set to `true` any secret fields (current default is only `password`) are replaced with a random number of '*' characters (length: 5-10).
If the `safecontent` option is set to `true` any secret fields (current default is only `password`) are replaced with a random number of '*' characters (length: 5-10).
Using the `--unsafe` flag will reveal these fields even if `safecontent` is enabled. `--password` takes precedence of `safecontent=true` as well and displays only the password.
* The `--noparsing` flag will disable all parsing of the output, this can help debugging YAML secrets for example, where `key: 0123` actually parses into octal for 83.
* The `--noparsing` flag will disable all parsing of the output, this can help debugging YAML secrets for example, where `key: 0123` actually parses into octal for 83.
* The `--clip` flag will copy the value of the `Password` field to the clipboard and doesn't display any part of the secret.
* The `--alsoclip` option will copy the value of the `Password` field but also display the secret content depending on the `safecontent` setting, i.e. obstructing the `Password` field if `safecontent` is `true` or just displaying it if not.
* The `--qr` flags operates complementary to other flags. It will *additionally* format the value of the `Password` entry as a QR code and display it. Other than that it will honor the other options, e.g. `gopass show --qr` will display the QR code *and* the whole secret content below. One special case is the `-o` flag, this flag doesn't make a lot of sense in combination, so if both `--qr` and `-o` are given only the QR code will be displayed.
Expand All @@ -52,15 +52,15 @@ TODO: We need to specify the expectations around new lines.

## Parsing and secrets

Secrets are stored on disk as provided, but are parsed upon display to provide extra features such as the ability
Secrets are stored on disk as provided, but are parsed upon display to provide extra features such as the ability
to show the value of a key using: `gopass show entry key`.

The secrets are split into 3 categories:
- the plain type, which is just a plain secret without key-value capabilities
- the plain type, which is just a plain secret without key-value capabilities
```
this is a plain secret
using multiple lines
and that's it
```
gets parsed to the same value
Expand All @@ -71,16 +71,16 @@ The secrets are split into 3 categories:
this is a KV secret
where: the first line is the password
and: the keys are separated from their value by :
and maybe we have a body text
below it
```
will be parsed into (with `safecontent` enabled):
```
and: the keys are separated from their value by :
where: the first line is the password
and maybe we have a body text
below it
```
Expand Down Expand Up @@ -119,7 +119,7 @@ name: John Smith
unsafe-keys: age,secret
```
will display (with safecontent enabled):
```
```
age: *****
name: John Smith
secret: *****
Expand All @@ -128,4 +128,6 @@ unsafe-keys: age,secret
```
unless it is called with `gopass show -n` that would disable parsing of the body, but still hide the password, or `gopass show -f` that would show everything that was hidden, including the password.

You can read more about secrets formats in its [documentation](docs/secrets.md).

Notice that if the option `parsing` is disabled in the config, then all secrets are handled as plain secrets.
1 change: 1 addition & 0 deletions docs/secrets.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Secrets

`gopass` supports different secret formats. This page documents the different formats.
You can read more about how secrets are shown and parsed in the documentation for the [`show` commands](docs/commands/show.md#parsing-and-secrets).

## Key-Value

Expand Down

0 comments on commit 46799f5

Please sign in to comment.