mirror of https://github.com/hashicorp/consul
docs: use hcl heredoc syntax for multi line strings in sentinel examples (#4930)
parent
2a8951fcc0
commit
b153f9be39
|
@ -27,9 +27,11 @@ Here's an example:
|
||||||
|
|
||||||
```text
|
```text
|
||||||
sentinel {
|
sentinel {
|
||||||
code = "import \"strings\"
|
code = <<EOF
|
||||||
main = rule { strings.has_suffix(value,\"foo\") }"
|
import "strings"
|
||||||
enforcementlevel = "soft-mandatory"
|
main = rule { strings.has_suffix(value,"foo") }
|
||||||
|
enforcementlevel = "soft-mandatory"
|
||||||
|
EOF
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -64,8 +66,10 @@ The following are some examples of ACL policies with Sentinel rules.
|
||||||
key "foo" {
|
key "foo" {
|
||||||
policy = "write"
|
policy = "write"
|
||||||
sentinel {
|
sentinel {
|
||||||
code = "import \"strings\"
|
code = <<EOF
|
||||||
main = rule { strings.has_suffix(value, \"bar\") }"
|
import "strings"
|
||||||
|
main = rule { strings.has_suffix(value, "bar") }
|
||||||
|
EOF
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
@ -76,8 +80,10 @@ key "foo" {
|
||||||
key "foo" {
|
key "foo" {
|
||||||
policy = "write"
|
policy = "write"
|
||||||
sentinel {
|
sentinel {
|
||||||
code = "import \"time\"
|
code = <<EOF
|
||||||
main = rule { time.hour > 8 and time.hour < 17 }"
|
import "time"
|
||||||
|
main = rule { time.hour > 8 and time.hour < 17 }
|
||||||
|
EOF
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in New Issue