variables: document restrictions on path and size (#14687)

This commit is contained in:
Tim Gross 2022-09-26 11:40:53 -04:00 committed by GitHub
parent 1673714645
commit 62b1e2ef97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 0 deletions

View File

@ -150,6 +150,18 @@ The table below shows this endpoint's support for [blocking queries] and
0, the variable is only created if it does not already exist. This paradigm
allows check-and-set style updates.
## Restrictions
Variable paths are restricted to [RFC3986][] URL-safe characters that don't
conflict with the use of the characters `@` and `.` in template blocks. This
includes alphanumeric characters and the special characters `-`, `_`, `~`, and
`/`. Paths may be up to 128 bytes long. The following regex matches the allowed
paths: `^[a-zA-Z0-9-_~/]{1,128}$`
Variable items are restricted to 16KiB in size. This limit is calculated by
taking the sum of the length in bytes of all of the unencrypted keys and values
in the `Items` field.
### Sample Request
```shell-session
@ -287,3 +299,4 @@ the response will include only metadata and not the `Items` field:
[`nomad var`]: /docs/commands/var
[blocking queries]: /api-docs#blocking-queries
[required ACLs]: /api-docs#acls
[RFC3986]: https://www.rfc-editor.org/rfc/rfc3986#section-2

View File

@ -36,6 +36,17 @@ enabled, this command requires the `variables:write` capability for the
destination namespace and path. See the [ACL policy][] documentation for
details.
## Restrictions
Variable paths are restricted to [RFC3986][] URL-safe characters that don't
conflict with the use of the characters `@` and `.` in template blocks. This
includes alphanumeric characters and the special characters `-`, `_`, `~`, and
`/`. Paths may be up to 128 bytes long. The following regex matches the allowed
paths: `^[a-zA-Z0-9-_~/]{1,128}$`
Variable items are restricted to 16KiB in size. This limit is calculated by
taking the sum of the length in bytes of all of the unencrypted keys and values.
## General Options
@include 'general_options.mdx'
@ -90,3 +101,4 @@ $ echo "abcd1234" | vault var put secret/foo bar=-
[variable]: /docs/concepts/variables
[ACL Policy]: /docs/other-specifications/acl-policy#variables
[RFC3986]: https://www.rfc-editor.org/rfc/rfc3986#section-2