Skip to content

Commit

Permalink
adding proxy support
Browse files Browse the repository at this point in the history
  • Loading branch information
tmunzer committed Jul 31, 2024
1 parent 4569d61 commit 54e5c4d
Show file tree
Hide file tree
Showing 4 changed files with 174 additions and 94 deletions.
37 changes: 29 additions & 8 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,41 @@ provider "mist" {
}
```

<!-- schema generated by tfplugindocs -->
## Schema
### Credentials

### Required
Users are encouraged to pass the API Token or the username and password via the
environment variables (see below). If authentication information are provided
in the provider configuration and in the environment variables, the Provider
configuration will be used.

- `host` (String) URL of the Mist Cloud, e.g. `api.mist.com`.
It is also possible to pass the Mist Cloud host with the environment variable `MIST_HOST`.
Please consider whether writing credentials to a configuration file is
acceptable in your environment.

### Proxy Support

HTTP, HTTPS, and SOCKS5 proxies are supported through the `MIST_PROXY` environment
variables or the `proxy` provider configuration attribute.

<!-- schema generated by tfplugindocs -->
## Schema

### Optional

- `api_timeout` (Number) Timeout in seconds for completing API transactions with the Mist Cloud. Omit for default value of 10 seconds. Value of 0 results in infinite timeout.
- `apitoken` (String, Sensitive) For API Token authentication, the Mist API Token.
The preferred approach is to pass the API Token as environment variables `MIST_API_TOKEN`.
- `host` (String) URL of the Mist Cloud, e.g. `api.mist.com`.
- `password` (String, Sensitive) For username/password authentication, the Mist Account password.
The preferred approach is to pass the API Token as environment variables `MIST_PASSWORD`.
- `proxy` (String) Requests use the configured proxy to reach the Mist Cloud.
The value may be either a complete URL or a `[username:password@]host[:port]`, in which case the `http` scheme is assumed. The schemes `http`, `https`, and `socks5` are supported.
- `username` (String) For username/password authentication, the Mist Account username.
The preferred approach is to pass the API Token as environment variables `MIST_USERNAME`.

### Environment Variables

| Varibale Name | Provider attribute | Type | Description |
| ---- | ---- | ---- | ---- |
| `MIST_HOST` | `host` | String | URL of the Mist Cloud, e.g. `api.mist.com`. See above for the list of supported Clouds.|
| `MIST_API_TOKEN` | `apitoken` | String | For API Token authentication, the Mist API Token. |
| `MIST_USERNAME` | `username` | String | For username/password authentication, the Mist Account password. |
| `MIST_PASSWORD` | `password` | String | For username/password authentication, the Mist Account password. |
| `MIST_PROXY` | `proxy` | String | Requests use the configured proxy to reach the Mist Cloud. The value may be either a complete URL or a `[username:password@]host[:port]`, in which case the `http` scheme is assumed. The schemes `http`, `https`, and `socks5` are supported. |
| `MIST_API_TIMEOUT` | `api_timeout` | Int | Timeout in seconds for completing API transactions with the Mist Cloud. Omit for default value of 10 seconds. Value of 0 results in infinite timeout. |
1 change: 1 addition & 0 deletions internal/provider/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const (
envUsername = "MIST_USERNAME"
envPassword = "MIST_PASSWORD"
envApiTimeout = "MIST_API_TIMEOUT"
envProxy = "MIST_PROXY"
docCategorySeparator = " --- "
docCategorySite = "Site" + docCategorySeparator
docCategoryOrg = "Org" + docCategorySeparator
Expand Down
Loading

0 comments on commit 54e5c4d

Please sign in to comment.