Apply suggestions from code review

Co-authored-by: Blake Covarrubias <blake@covarrubi.as>
pull/12460/head
trujillo-adam 2022-03-01 09:25:21 -08:00 committed by GitHub
parent 7e98a0dc7b
commit 4331a29f95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 24 additions and 33 deletions

View File

@ -49,7 +49,7 @@ Refer to the [command line documentation](/command/acl/role) for details.
Make a `PUT` call to the `acl/role` endpoint and specify the role configuration in the payload to create roles. You can save the role definition in a JSON file or use escaped JSON in the call. In the following example call, the payload is defined externally. Make a `PUT` call to the `acl/role` endpoint and specify the role configuration in the payload to create roles. You can save the role definition in a JSON file or use escaped JSON in the call. In the following example call, the payload is defined externally.
```shell-session ```shell-session
$ curl -X PUT --data @payload.json http://127.0.0.1:8500/v1/acl/role $ curl --request PUT --data @payload.json http://127.0.0.1:8500/v1/acl/role
``` ```
Refer to the [API documentation](/api-docs/acl/roles) for details. Refer to the [API documentation](/api-docs/acl/roles) for details.
@ -77,7 +77,6 @@ You can specify a service identity when configuring roles or linking tokens to p
Use the following syntax to define a service identity: Use the following syntax to define a service identity:
<CodeTabs> <CodeTabs>
<CodeBlockConfig>
```json ```json
{ {
@ -90,8 +89,6 @@ Use the following syntax to define a service identity:
} }
``` ```
</CodeBlockConfig>
<CodeBlockConfig>
```hcl ```hcl
"ServiceIdentities" = { "ServiceIdentities" = {
@ -100,7 +97,6 @@ Use the following syntax to define a service identity:
} }
``` ```
</CodeBlockConfig>
</CodeTabs> </CodeTabs>
- `ServiceIdentities`: Declares a service identity block. - `ServiceIdentities`: Declares a service identity block.
@ -129,7 +125,6 @@ service_prefix "" {
node_prefix "" { node_prefix "" {
policy = "read" policy = "read"
} }
``` ```
Refer to the [rules reference](/docs/security/acl/acl-rules) for information about the rules in the policy. Refer to the [rules reference](/docs/security/acl/acl-rules) for information about the rules in the policy.
@ -142,20 +137,20 @@ The following role configuration contains service identities for the `web` and `
<CodeBlockConfig filename="example-role.hcl"> <CodeBlockConfig filename="example-role.hcl">
```hcl ```hcl
"Description" = "Showcases all input parameters" Description = "Showcases all input parameters"
"Name" = "example-role" Name = "example-role"
"Policies" = { Policies = {
"ID" = "783beef3-783f-f41f-7422-7087dc272765" ID = "783beef3-783f-f41f-7422-7087dc272765"
} }
"Policies" = { Policies = {
"Name" = "node-read" Name = "node-read"
} }
"ServiceIdentities" = { ServiceIdentities = {
"ServiceName" = "web" ServiceName = "web"
} }
"ServiceIdentities" = { ServiceIdentities = {
"Datacenters" = ["dc1"] Datacenters = ["dc1"]
"ServiceName" = "db" ServiceName = "db"
} }
``` ```
@ -256,7 +251,6 @@ You can specify the token linked to the policy in the [`acl_tokens_agent`](/docs
Use the following syntax to define a node identity: Use the following syntax to define a node identity:
<CodeTabs> <CodeTabs>
<CodeBlockConfig>
```json ```json
{ {
@ -269,17 +263,14 @@ Use the following syntax to define a node identity:
} }
``` ```
</CodeBlockConfig>
<CodeBlockConfig>
```hcl ```hcl
"NodeIdentities" = { NodeIdentities = {
"NodeName" = "<node name>" NodeName = "<node name>"
"Datacenters" = ["<datacenter name>"] Datacenters = ["<datacenter name>"]
} }
``` ```
</CodeBlockConfig>
</CodeTabs> </CodeTabs>
- `NodeIdentities`: Declares a node identity block. - `NodeIdentities`: Declares a node identity block.
@ -316,17 +307,17 @@ The following role configuration contains a node identity for `node-1`. Note tha
<CodeBlockConfig filename="example-role.hcl"> <CodeBlockConfig filename="example-role.hcl">
```hcl ```hcl
"Description" = "Showcases all input parameters" Description = "Showcases all input parameters"
"Name" = "example-role" Name = "example-role"
"NodeIdentities" = { NodeIdentities = {
"Datacenter" = "dc2" Datacenter = "dc2"
"NodeName" = "node-1", NodeName = "node-1",
} }
"Policies" = { Policies = {
"ID" = "783beef3-783f-f41f-7422-7087dc272765" ID = "783beef3-783f-f41f-7422-7087dc272765"
} }
"Policies" = { Policies = {
"Name" = "node-read" Name = "node-read"
} }
``` ```