Skip to content

Commit 8422324

Browse files
Merge pull request #682 from hashicorp/repo-sync
Repo sync
2 parents 1022f64 + ef38c49 commit 8422324

File tree

17,094 files changed

+2073551
-8105
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

17,094 files changed

+2073551
-8105
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,6 @@ tfe-releases-repos.json
6161
scripts/prebuild/prebuild-arm-mac-binary
6262
scripts/prebuild/prebuild-x64-linux-binary
6363
scripts/prebuild/prebuild-arm-linux-binary
64+
65+
# GA to RC tool output files
66+
scripts/sync-ga-to-rc/output/*.txt

CODEOWNERS

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
/docs @hashicorp/vault-education-approvers @hashicorp/education
66

77
# Terraform documentation ownership
8-
/content/terraform-plugin-framework @hashicorp/terraform-devex @hashicorp/terraform-education
9-
/content/terraform-plugin-log @hashicorp/terraform-devex @hashicorp/terraform-education
10-
/content/terraform-plugin-mux @hashicorp/terraform-devex @hashicorp/terraform-education
11-
/content/terraform-plugin-sdk @hashicorp/terraform-devex @hashicorp/terraform-education
12-
/content/terraform-plugin-testing @hashicorp/terraform-devex @hashicorp/terraform-education
8+
/content/terraform-plugin-framework @hashicorp/terraform-core-plugins @hashicorp/terraform-education
9+
/content/terraform-plugin-log @hashicorp/terraform-core-plugins @hashicorp/terraform-education
10+
/content/terraform-plugin-mux @hashicorp/terraform-core-plugins @hashicorp/terraform-education
11+
/content/terraform-plugin-sdk @hashicorp/terraform-core-plugins @hashicorp/terraform-education
12+
/content/terraform-plugin-testing @hashicorp/terraform-core-plugins @hashicorp/terraform-education
1313
/content/terraform-docs-agents @hashicorp/team-hcpt-agent-engineering
1414
/content/terraform-mcp-server @hashicorp/team-docs-packer-and-terraform
1515
/content/terraform-migrate @hashicorp/team-docs-packer-and-terraform
@@ -22,8 +22,8 @@
2222
/content/terraform/*/docs/language/backend/s3.mdx @hashicorp/terraform-education @hashicorp/terraform-core @hashicorp/team-docs-packer-and-terraform @hashicorp/terraform-aws
2323

2424
/content/terraform-docs-common/ @hashicorp/team-docs-packer-and-terraform
25-
/content/terraform-docs-common/docs/plugin/ @hashicorp/terraform-devex
26-
/content/terraform-docs-common/data/plugin-nav-data.json @hashicorp/terraform-devex
25+
/content/terraform-docs-common/docs/plugin/ @hashicorp/terraform-core-plugins
26+
/content/terraform-docs-common/data/plugin-nav-data.json @hashicorp/terraform-core-plugins
2727

2828
/content/terraform-enterprise @hashicorp/team-docs-packer-and-terraform @hashicorp/ptfe-review
2929

@@ -37,18 +37,29 @@
3737
/content/well-architected-framework/ @hashicorp/well-architected-education-approvers
3838

3939
# HCP-docs documentation ownership
40-
/content/hcp-docs/* @hashicorp/education
40+
/content/hcp-docs/ @hashicorp/education
41+
/content/hcp-docs/img/docs/hcp-core/ @hashicorp/vault-education-approvers
4142

4243
# HCP Consul Docs
43-
/content/hcp-docs/content/docs/consul/* @hashicorp/consul-docs
44+
/content/hcp-docs/content/docs/consul/ @hashicorp/consul-docs
45+
/content/hcp-docs/img/docs/consul/ @hashicorp/consul-docs
4446

4547
# HCP Vault & HCP Vault Radar docs
4648
/content/hcp-docs/content/docs/vault* @hashicorp/vault-education-approvers
4749
/content/hcp-docs/content/partials/vault* @hashicorp/vault-education-approvers
50+
/content/hcp-docs/img/docs/vault* @hashicorp/vault-education-approvers
4851

4952
# HCP Boundary docs
50-
/content/hcp-docs/content/docs/boundary/* @hashicorp/boundary-education-approvers
53+
/content/hcp-docs/content/docs/boundary/ @hashicorp/boundary-education-approvers
54+
/content/hcp-docs/img/docs/boundary/ @hashicorp/boundary-education-approvers
5155

5256
#HCP IAM
53-
/content/hcp-docs/content/partials/hcp-administration/* @hashicorp/cloud-access-control @hashicorp/cloud-identity
54-
/content/hcp-docs/content/docs/hcp/iam/* @hashicorp/cloud-access-control @hashicorp/cloud-identity
57+
/content/hcp-docs/content/partials/hcp-administration/ @hashicorp/cloud-access-control @hashicorp/cloud-identity
58+
/content/hcp-docs/content/docs/hcp/iam/ @hashicorp/cloud-access-control @hashicorp/cloud-identity
59+
/content/hcp-docs/content/img/docs/hcp-core/ @hashicorp/cloud-access-control @hashicorp/cloud-identity
60+
61+
# Boundary
62+
/content/boundary/ @hashicorp/boundary-education-approvers @hashicorp/boundary
63+
64+
# Consul
65+
/content/consul/ @hashicorp/consul-docs @hashicorp/consul-selfmanage-maintainers
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
---
2+
layout: docs
3+
page_title: API
4+
sidebar_title: API
5+
description: |-
6+
Boundary's HTTP API standards
7+
---
8+
9+
# API
10+
11+
Boundary's API is a a JSON-based HTTP API that adheres to a set of standards that are rigidly followed. At its core, it is a standards-compliant JSON API for both input and output.
12+
13+
Before reading this page, it is useful to understand Boundary's [domain model](/docs/concepts/domain-model) to be aware of the terminology used here.
14+
15+
Boundary's API is also described via OpenAPI v2; the version corresponding to any tag of Boundary's source code can be found in Boundary's [GitHub repository](https://github.com/hashicorp/boundary/blob/main/internal/gen/controller.swagger.json).
16+
17+
Boundary's current API version is 1; all API paths begin with `/v1/`.
18+
19+
## Status Codes
20+
21+
- `2XX`: Boundary returns a code between `200` and `299` on success. Generally this is `200`, but implementations should be prepared to accept any `2XX` status code as indicating success. If a call returns a `2XX` code that is not `200`, it will follow well-understood semantics for those status codes.
22+
- `400`: Boundary returns `400` when a command cannot be completed due to invalid user input, except for a properly-formatted identifier that does not map to an existing resource, which will return a `404` as discussed below.
23+
- `401`: Boundary returns `401` if no authentication token is provided or if the provided token is invalid. A valid token that simply does not have permission for a resource will return a `403` instead. A token that is invalid or missing, but where the anonymous user (`u_anon`) is able to successfully perform the action, will not return a `401` but instead will return the result of the action.
24+
- `403`: Boundary returns `403` if a provided token was valid but does not have the grants required to perform the requested action.
25+
- `404`: Boundary returns `404` if a resource cannot be found. Note that this happens _prior_ to authentication/authorization checking in nearly all cases as the resource information (such as its scope, available actions, etc.) is a required part of that check. As a result, an action against a resource that does not exist will return a `404` instead of a `401` or `403`. While this could be considered an information leak, since IDs are randomly generated and this only discloses whether an ID is valid, it's tolerable as it allows for far simpler and more robust client implementation.
26+
- `405`: Boundary returns a `405` to indicate that the method (HTTP verb or custom action) is not implemented for the given resource.
27+
- `500`: Boundary returns `500` if an error occurred that is not (directly) tied to invalid user input. If a `500` is generated, information about the error will be logged to Boundary's server log but is not generally provided to the client.
28+
29+
## Path Layout
30+
31+
Boundary follows a predictable path layout. There are two fundamental types of URL paths, each supporting a different set of operations.
32+
33+
### Collections
34+
35+
Collections of resources are top level paths with plural English names for the resource, e.g. `/roles` and `/hosts`. Collections support the following operations:
36+
37+
- Creation of new resources within that collection
38+
- Listing of resources within that collection
39+
40+
All collection operations require supplying the enclosing resource. Depending on the collection type, this will be one of the following:
41+
42+
- A scope, indicating the scope in which an operation should take place. For instance, a POST to `/roles` would need to indicate whether the role should be created within the `global` scope or an org-level scope like `o_1234567890`.
43+
- A parent resource of the appropriate type. For instance, hosts and host sets are child resources of host catalogs. When creating a new host set within a host catalog, a POST to `/host-sets` would need to indicate the host catalog ID with which the host-set should be associated.
44+
45+
### Resources
46+
47+
Resources themselves are defined by ID specifiers within a collection path, e.g. `/roles/r_1234567890`. Resources support the following operations:
48+
49+
- Reading a resource's properties
50+
- Updating a resource's properties
51+
- Deleting a resource
52+
- Custom methods specific to a resource type
53+
54+
Depending on the resource type, various parameters may be available. Some are common across all resource types (e.g. `name` and `description`); others are available only for specific types. Further, some concrete-types of abstract resources include an opaque `attributes` JSON object with type-specific values.
55+
56+
For instance, an auth method is an abstract type; a `password` auth method is a concrete implementation of that type. When creating such an auth method, a `type` parameter will indicate that it should be the `password` type, while values specific to the `password` type auth method, such as minimum password length, will be contained within an `attributes` object.
57+
58+
## Methods
59+
60+
The following method conventions are used within Boundary's API:
61+
62+
### GET
63+
64+
`GET` is used for reading a resource or listing resources in a collection. The behavior depends on whether the `GET` is issued against a collection (`/roles`) or a singular resource (`/roles/r_1234567890`). In the former case it lists resources within the collection; in the latter it performs a read on that particular resource.
65+
66+
### POST
67+
68+
`POST` is used for creating a resource or performing custom actions against a resoruce. When creating a resource, `POST` is used against a collection (`/roles`). When performing a custom action, `POST` is used against a particular resource (`/roles/r_1234567890:set-principals`).
69+
70+
### PATCH
71+
72+
`PATCH` is used to update a resource's parameters. The following are behaviors to be aware of when using `PATCH`:
73+
74+
- In nearly all cases, a `version` parameter is required. This is used for check-and-set, to ensure that the update operation is being performed against a known resource. The version parameter is returned from a `GET` operation on the resource so the current version, along with the resource's other current values, can be looked up at any time.
75+
- Passing a JSON `null` for a parameter has the effect of reverting that parameter to its default. For some parameters (e.g. `name`) this will simply clear the value (as the default `name` for a resource is empty); for other parameters this will revert to the current defaults within Boundary.
76+
- All parameters specified as part of a `PATCH` operation will be considered to be parameters that should be updated.
77+
78+
### DELETE
79+
80+
`DELETE` is used for deleting a specific resource, and is only used against a particular resource path.
Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
---
2+
layout: docs
3+
page_title: CLI
4+
sidebar_title: CLI
5+
description: |-
6+
Boundary's CLI behavior
7+
---
8+
9+
# CLI
10+
11+
Boundary's CLI has predictable behavior throughout its various commands. This
12+
page details the common patterns in used in order to help users make better use
13+
of the CLI.
14+
15+
## Completion
16+
17+
Before detailing how parameters work, it's useful to note that Boundary's CLI
18+
supports autocompletion, which allows tab completion of commands, flags, and in
19+
some cases the parameters to those flags.
20+
21+
This can be installed via the CLI itself:
22+
23+
`boundary config autocomplete install`
24+
25+
If you want to install it manually, for Bash, the following line in a
26+
`~/.bash_profile` or similar file will work:
27+
28+
`complete -C /path/to/boundary boundary`
29+
30+
## Keyring Token storage
31+
32+
Boundary uses various mechanisms, depending on platform, to allow for secure
33+
storage of authentication tokens for later use. Each platform has a
34+
platform-specific option (which on Windows and macOS are the default);
35+
[pass](https://www.passwordstore.org/) is also available on all platforms. On
36+
all platforms, setting `-keyring-type` to `none` (or setting it via
37+
`BOUNDARY_KEYRING_TYPE`) disables storage and retrieval of the token.
38+
39+
Additionally, more than one token can be stored or retrieved at once via the
40+
`-token-name` flag or `BOUNDARY_TOKEN_NAME` env var. This allows for storing
41+
tokens used by different Boundary installations, or other needs.
42+
43+
### Windows
44+
45+
On Windows, the Windows credential store (`wincred`) is used.
46+
47+
Available keyring types:
48+
49+
* `wincred` (default)
50+
* `pass`
51+
* `none`
52+
53+
### macOS
54+
55+
On macOS, Keychain is used via `/usr/bin/security`. (Using this binary allows us
56+
to keep the Boundary binary statically linked, which we prefer.)
57+
58+
Available keyring types:
59+
60+
* `keychain` (default)
61+
* `pass`
62+
* `none`
63+
64+
### Other platforms
65+
66+
On all other platforms, the default is `pass`. However, if an implementation of
67+
the [freedesktop.org secret
68+
service](https://specifications.freedesktop.org/secret-service/latest/) is
69+
available (via `gnome-keyring`, `kwallet`, or others) it can be used.
70+
71+
Available keyring types:
72+
73+
* `pass` (default)
74+
* `secret-service`
75+
* `none`
76+
77+
## Mapping to Collections and Sub-Types
78+
79+
Generally speaking, Boundary's CLI commands map to the collections they operate
80+
on. For instance, when operating on roles, the command will be `boundary roles
81+
...`.
82+
83+
As a result, the patterns for reading, deleting, and listing are predictable:
84+
85+
* `boundary <collection> read`
86+
* `boundary <collection> delete`
87+
* `boundary <collection> list`
88+
89+
`read` and `delete` will always operate on a particular resource identifier, so
90+
will always take in an `-id` parameter. `list` operates on collections so will
91+
either take a `-scope-id` parameter or, depending on type, a higher level
92+
resource identifier, e.g. `-auth-method-id`.
93+
94+
Creating and updating resources may take an extra parameter if the resource type
95+
is abstract, that is, if the type cannot be operated on directly but must be
96+
operated on through an implementation. As an example, a role is not an abstract
97+
type, and does not have various implementations of it. As a result, a role can
98+
be operated on directly:
99+
100+
* `boundary roles create`
101+
* `boundary roles update`.
102+
103+
However, a target can be one of many types of targets, and a concrete
104+
implementation of a target is a `tcp` type of target. Therefore an extra
105+
parameter is required when creating or updating a target:
106+
107+
* `boundary targets tcp create`
108+
* `boundary targets tcp update`
109+
110+
This allows the CLI to perform proper presentation and validation of parameters
111+
and functions for the given type.
112+
113+
Similar to `read`, `update` operates on an existing target so will always take
114+
an `-id` parameter. Similar to `list`, `create` operates on a collection so will
115+
either take a `-scope-id` parameter or a parameter defining the parent resource.
116+
117+
## Parameter Handling
118+
119+
All parameters specified on the CLI are specified as a Go-style flag with a
120+
single dash, e.g. `-id`. The arguments to those flags can be specified via an
121+
equals sign, as in `-id=r_1234567890`, or a space, like `-id r_1234567890`.
122+
123+
To see available parameters, pass the `-h` flag to any command.
124+
125+
Flags are semi-position dependent. The flags must come _after_ the command
126+
definition, but are otherwise order independent.
127+
128+
For instance, the following are equivalent:
129+
130+
* `boundary roles create -scope-id global -name foo`
131+
* `boundary roles create -name foo -scope-id global`
132+
133+
But the following results in an error:
134+
135+
* `boundary roles -name foo -scope-id global create`
136+
137+
This applies to `-h` as well!
138+
139+
### Clearing/Defaulting Values
140+
141+
On the CLI, you can use `null` as a value to indicate to Boundary that you want
142+
to unset a value, reverting to Boundary's default. In many cases this default
143+
will be empty (e.g. for a `name` or `description` parameter) but in other cases
144+
it's not. For instance, for a password auth method's minimum password length,
145+
the default is not `0` but rather `8`. Additionally, attempting to set string
146+
values to the empty string `""` is usually not an allowed operation, since when
147+
set to a specific value it must be non-empty. Using `null` to clear a value
148+
ensures you'll revert to Boundary's recommended default.
149+
150+
~> `null` is used because of the fact that the API is JSON. Using `null` as the
151+
value causes the key for the parameter to be inserted into the eventual API
152+
call's JSON object but with the value set to the JSON `null`. This in turn
153+
informs the Controller that this value should be set to its default. Keep in
154+
mind that this is not a direct translation to database `NULL` semantics!
155+
156+
### Connection Options
157+
158+
Every command that results in an API call contains a set of flags that control
159+
connection options, which control TLS and other settings for the connection.
160+
161+
### Client Options
162+
163+
Every command that results in an API call contains a set of flags that control
164+
client options. Some notable options:
165+
166+
* `output-curl-string`: This will format the command that would have been run as
167+
a string using `curl` that can be used directly on the command line. This is a
168+
great way to discover how CLI functions map to API calls.
169+
170+
* `token-name`: When the CLI authenticates, it stores the token in the
171+
platform-specific OS credential store. By using the `token-name` parameter, more
172+
than one token can be stored at a time. Specifying this parameter at
173+
authentication time uses the given name as part of the key for storage;
174+
specifying it for any other command will cause the corresponding token to be
175+
used for that call.
176+
177+
* `recovery-config`: This is used to specify a configuration file that contains
178+
the information necessary to access a KMS configured to be used for the recovery
179+
workflow within a Boundary controller.
180+
181+
### Output Options
182+
183+
Nearly every command supports having its success output be formatted as JSON via
184+
`-format json`. For commands that result in an API call, the JSON output will be
185+
the exact output from the controller. If using the output of the CLI in scripts
186+
or as parameters to other tools, _always_ use formatted output. The default text
187+
output is meant for human users and the formatting or the information included
188+
within that output from the original JSON may change at any time.

0 commit comments

Comments
 (0)