Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use consistent naming and fix secret data structure in README #81

Merged
merged 2 commits into from
Sep 10, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 15 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,23 @@ To build the jar, run `./gradlew clean test assemble`
The CONFIG_DIR is typically /etc/go on Linux and C:\Program Files\Go Server\config on Windows.

```shell
java -jar gocd-file-based-secrets-plugin-$VERSION$.jar init -f secret.db
java -jar gocd-file-based-secrets-plugin-$VERSION$.jar init -f secrets.json
```
3. Add/Update a secret:
```shell
java -jar gocd-file-based-secrets-plugin-$VERSION$.jar add -f secret.db -n my-password -v
java -jar gocd-file-based-secrets-plugin-$VERSION$.jar add -f secrets.json -n my-password -v
```
4. Show the value of the secret:
```shell
java -jar gocd-file-based-secrets-plugin-$VERSION$.jar show -f secret.db -n my-password
java -jar gocd-file-based-secrets-plugin-$VERSION$.jar show -f secrets.json -n my-password
```
5. Show all secret keys:
```shell
java -jar gocd-file-based-secrets-plugin-$VERSION$.jar keys -f secret.db
java -jar gocd-file-based-secrets-plugin-$VERSION$.jar keys -f secrets.json
```
6. Remove a secret:
```shell
java -jar gocd-file-based-secrets-plugin-$VERSION$.jar remove -f secret.db -n my-password
java -jar gocd-file-based-secrets-plugin-$VERSION$.jar remove -f secrets.json -n my-password
```

## Configuration
Expand All @@ -55,7 +55,7 @@ The configuration can be added directly to the `config.xml` using the `<secretCo
<configuration>
<property>
<key>SecretsFilePath</key>
<value>/godata/config/secretsDatabase.json</value>
<value>/godata/config/secrets.json</value>
</property>
</configuration>
<rules>
Expand All @@ -78,7 +78,7 @@ The configuration can be added directly to the `config.xml` using the `<secretCo
<configuration>
<property>
<key>SecretsFilePath</key>
<value>/godata/config/secretsDatabase.json</value>
<value>/godata/config/secrets.json</value>
</property>
</configuration>
<rules>
Expand All @@ -92,7 +92,7 @@ The configuration can be added directly to the `config.xml` using the `<secretCo
<configuration>
<property>
<key>SecretsFilePath</key>
<value>/godata/config/secretsDatabase_env2.json</value>
<value>/godata/config/secrets_env2.json</value>
</property>
</configuration>
<rules>
Expand All @@ -107,12 +107,15 @@ The configuration can be added directly to the `config.xml` using the `<secretCo
A secret file is made of JSON, and has the following data structure:

```json
[
{ "key": "foo", "value": "bar" }
]
{
"secret_key": "...",
"secrets": {
"my-password": "AES:..."
}
}
```

The secret defined in the above example can be used as: `{{SECRET:[Env1Secrets][foo]}}` and will have the value `bar` at run-time.
The secret defined in the above example can be used as `{{SECRET:[Env1Secrets][my-password]}}` in environment variables or SCM materials.

## Troubleshooting

Expand Down