Skip to content

Commit

Permalink
FIXUP: PR fixes #2: examples for encode/decode formats, etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
victorr committed Oct 15, 2021
1 parent 5cb8ee1 commit 24e80a0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
28 changes: 15 additions & 13 deletions website/content/api-docs/secret/transform.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ configuration endpoints, and will be removed in a future release.
```json
{
"type": "fpe",
"template": "example-template",
"template": "builtin/creditcardnumber",
"tweak_source": "internal",
"allowed_roles": ["example-role"]
}
Expand Down Expand Up @@ -237,7 +237,7 @@ transformation exists, it will be updated with the new attributes.

```json
{
"template": "example-template",
"template": "builtin/creditcardnumber",
"tweak_source": "internal",
"allowed_roles": ["example-role"]
}
Expand Down Expand Up @@ -381,7 +381,7 @@ $ curl \
{
"data": {
"allowed_roles": ["example-role"],
"templates": ["example-template"],
"templates": ["builtin/creditcardnumber"],
"tweak_source": "internal",
"type": "fpe"
}
Expand Down Expand Up @@ -455,8 +455,8 @@ template exists, it will be updated with the new attributes.
request URL.

- `type` `(string: <required>)` -
Specifies the type of pattern matching to perform. The ony type currently supported
by this backend is `regex`.
Specifies the type of pattern matching to perform. The only type currently
supported by this backend is `regex`.

- `pattern` `(string: <required>)` -
Specifies the pattern used to match a particular value. For regex type
Expand All @@ -469,12 +469,14 @@ template exists, it will be updated with the new attributes.
encoding and decoding operations.

- `encode_format` `(string)` -
The regular expression template to use to format encoded values. This is only
used during FPE transformations.
The regular expression template to use to format encoded values. For example,
this can be used to normalize the encoded output. This is only used during FPE
transformations.

- `decode_formats` `(key-value-map: {})` -
An optional map of regular expression templates that can be used to customize
decoded output. This is only used during FPE transformations.
decoded output. For example, this can be used to decode only the last four
digits of a credit card number. This is only used during FPE transformations.

### Sample Payload

Expand Down Expand Up @@ -953,7 +955,7 @@ This endpoint encodes the provided value using a named role.
7-byte value that is then base64 encoded.

- `reference` `(string: "")` -
Only valid on batch requests using 'batch_input' below. A user supplied
Only valid on batch requests using 'batch_input' below. A user-supplied
string that will be present on the corresponding item in the batch
response, to assist in correlating inputs with outputs.

Expand Down Expand Up @@ -1094,7 +1096,7 @@ This endpoint decodes the provided value using a named role.
source. The tweak must be a 7-byte value that is then base64 encoded.

- `reference` `(string: "")` -
Only valid on batch requests using 'batch_input' below. A user supplied
Only valid on batch requests using 'batch_input' below. A user-supplied
string that will be present on the corresponding item in the batch
response, to assist in correlating inputs with outputs.

Expand Down Expand Up @@ -1242,7 +1244,7 @@ Only valid for tokenization transformations.
must be specified.

- `reference` `(string: "")` -
Only valid on batch requests using 'batch_input' below. A user supplied
Only valid on batch requests using 'batch_input' below. A user-supplied
string that will be present on the corresponding item in the batch
response, to assist in correlating inputs with outputs.

Expand Down Expand Up @@ -1317,7 +1319,7 @@ transformations.
must be specified.

- `reference` `(string: "")` -
Only valid on batch requests using 'batch_input' below. A user supplied
Only valid on batch requests using 'batch_input' below. A user-supplied
string that will be present on the corresponding item in the batch
response, to assist in correlating inputs with outputs.

Expand Down Expand Up @@ -1391,7 +1393,7 @@ Only valid for tokenization transformations.
must be specified.

- `reference` `(string: "")` -
Only valid on batch requests using 'batch_input' below. A user supplied
Only valid on batch requests using 'batch_input' below. A user-supplied
string that will be present on the corresponding item in the batch
response, to assist in correlating inputs with outputs.

Expand Down
3 changes: 2 additions & 1 deletion website/content/docs/secrets/transform/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ values.
A transformation must be provided if the role contains more than one
transformation. A tweak must be provided if the tweak source for the
transformation is "supplied" or "generated". A decode format can optionally
be provided.
be provided, if none is provided, the decoded output will be formatted to
match the template's pattern as in the previous example.

## Roles, Transformations, Templates, and Alphabets

Expand Down

0 comments on commit 24e80a0

Please sign in to comment.