Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
volodymyrZotov committed Dec 12, 2023
1 parent b6f29b7 commit 65f8662
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
16 changes: 8 additions & 8 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ You must install [1Password CLI](https://developer.1password.com/docs/cli) on th

## Use with 1Password CLI

Minimum 1Password CLI version `v2.23.0` is required.
:warning: Minimum [1Password CLI version](https://app-updates.agilebits.com/product_history/CLI2) `v2.23.0` is required.

Retry mechanism is implemented when using the provider with 1Password CLI. The reason for having a retry mechanism is that 1Password doesn't allow parallel modification on the items located in the same vault.
Note that each retry fast forwards to the [service account rate limit](https://developer.1password.com/docs/service-accounts/rate-limits/) if use with service account.
Expand Down Expand Up @@ -65,8 +65,8 @@ provider "onepassword" {
}
```

Each of the configuration options can be set using env variables.
That's more secure way to do that as prevents from accidentally pushing sensitive values to the project repo.
You can set each of the configuration options using environment variables.
Environment variables are a more secure way to set configuration options because they prevent accidentally pushing sensitive values to the project repo.

- `OP_CONNECT_HOST` - The URL where your 1Password Connect API can be found.
- `OP_CONNECT_TOKEN` - A valid token for your 1Password Connect API.
Expand All @@ -79,8 +79,8 @@ That's more secure way to do that as prevents from accidentally pushing sensitiv

### Optional

- `account` (String) A valid account's sign-in address or ID to use biometrics unlock. Can also be sourced from OP_ACCOUNT environment variable. Provider will use 1Password CLI if set.
- `op_cli_path` (String) The path to the 1Password CLI binary. Can also be sourced from OP_CLI_PATH environment variable. Defaults to `op`.
- `service_account_token` (String) A valid 1Password service account token. Can also be sourced from OP_SERVICE_ACCOUNT_TOKEN environment variable. Provider will use 1Password CLI if set.
- `token` (String) A valid token for your 1Password Connect API. Can also be sourced from OP_CONNECT_TOKEN environment variable. Provider will use 1Password Connect server if set.
- `url` (String) The HTTP(S) URL where your 1Password Connect API can be found. Can also be sourced OP_CONNECT_HOST environment variable. Provider will use 1Password Connect server if set.
- `account` (String) A valid account's sign-in address or ID to use biometrics unlock. Can also be sourced from `OP_ACCOUNT` environment variable. Provider will use the 1Password CLI if set.
- `op_cli_path` (String) The path to the 1Password CLI binary. Can also be sourced from `OP_CLI_PATH` environment variable. Defaults to `op`.
- `service_account_token` (String) A valid 1Password service account token. Can also be sourced from `OP_SERVICE_ACCOUNT_TOKEN` environment variable. Provider will use the 1Password CLI if set.
- `token` (String) A valid token for your 1Password Connect server. Can also be sourced from `OP_CONNECT_TOKEN` environment variable. Provider will use 1Password Connect server if set.
- `url` (String) The HTTP(S) URL where your 1Password Connect server can be found. Can also be sourced `OP_CONNECT_HOST` environment variable. Provider will use 1Password Connect server if set.
10 changes: 5 additions & 5 deletions onepassword/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,31 +44,31 @@ func Provider() *schema.Provider {
Type: schema.TypeString,
Optional: true,
DefaultFunc: schema.EnvDefaultFunc("OP_CONNECT_HOST", nil),
Description: "The HTTP(S) URL where your 1Password Connect API can be found. Can also be sourced OP_CONNECT_HOST environment variable. Provider will use 1Password Connect server if set.",
Description: "The HTTP(S) URL where your 1Password Connect server can be found. Can also be sourced `OP_CONNECT_HOST` environment variable. Provider will use 1Password Connect server if set.",
},
"token": {
Type: schema.TypeString,
Optional: true,
DefaultFunc: schema.EnvDefaultFunc("OP_CONNECT_TOKEN", nil),
Description: "A valid token for your 1Password Connect API. Can also be sourced from OP_CONNECT_TOKEN environment variable. Provider will use 1Password Connect server if set.",
Description: "A valid token for your 1Password Connect server. Can also be sourced from `OP_CONNECT_TOKEN` environment variable. Provider will use 1Password Connect server if set.",
},
"service_account_token": {
Type: schema.TypeString,
Optional: true,
DefaultFunc: schema.EnvDefaultFunc("OP_SERVICE_ACCOUNT_TOKEN", nil),
Description: "A valid 1Password service account token. Can also be sourced from OP_SERVICE_ACCOUNT_TOKEN environment variable. Provider will use 1Password CLI if set.",
Description: "A valid 1Password service account token. Can also be sourced from `OP_SERVICE_ACCOUNT_TOKEN` environment variable. Provider will use the 1Password CLI if set.",
},
"account": {
Type: schema.TypeString,
Optional: true,
DefaultFunc: schema.EnvDefaultFunc("OP_ACCOUNT", nil),
Description: "A valid account's sign-in address or ID to use biometrics unlock. Can also be sourced from OP_ACCOUNT environment variable. Provider will use 1Password CLI if set.",
Description: "A valid account's sign-in address or ID to use biometrics unlock. Can also be sourced from `OP_ACCOUNT` environment variable. Provider will use the 1Password CLI if set.",
},
"op_cli_path": {
Type: schema.TypeString,
Optional: true,
DefaultFunc: schema.EnvDefaultFunc("OP_CLI_PATH", "op"),
Description: "The path to the 1Password CLI binary. Can also be sourced from OP_CLI_PATH environment variable. Defaults to `op`.",
Description: "The path to the 1Password CLI binary. Can also be sourced from `OP_CLI_PATH` environment variable. Defaults to `op`.",
},
},
DataSourcesMap: map[string]*schema.Resource{
Expand Down
6 changes: 3 additions & 3 deletions templates/index.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ You must install [1Password CLI](https://developer.1password.com/docs/cli) on th

## Use with 1Password CLI

Minimum 1Password CLI version `v2.23.0` is required.
:warning: Minimum [1Password CLI version](https://app-updates.agilebits.com/product_history/CLI2) `v2.23.0` is required.

Retry mechanism is implemented when using the provider with 1Password CLI. The reason for having a retry mechanism is that 1Password doesn't allow parallel modification on the items located in the same vault.
Note that each retry fast forwards to the [service account rate limit](https://developer.1password.com/docs/service-accounts/rate-limits/) if use with service account.
Expand Down Expand Up @@ -57,8 +57,8 @@ To use the provider with 1Password Connect you need to

{{tffile "examples/provider/provider.tf"}}

Each of the configuration options can be set using env variables.
That's more secure way to do that as prevents from accidentally pushing sensitive values to the project repo.
You can set each of the configuration options using environment variables.
Environment variables are a more secure way to set configuration options because they prevent accidentally pushing sensitive values to the project repo.

- `OP_CONNECT_HOST` - The URL where your 1Password Connect API can be found.
- `OP_CONNECT_TOKEN` - A valid token for your 1Password Connect API.
Expand Down

0 comments on commit 65f8662

Please sign in to comment.