Skip to content

Commit

Permalink
Merge pull request #110 from skyflowapi/SK-353/update-readme-redaction
Browse files Browse the repository at this point in the history
SK-353 update readme and samples for redaction in detokenize.
  • Loading branch information
yaswanth-pula-skyflow authored Jun 9, 2023
2 parents c1d42fd + 936452b commit 503a20e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

All notable changes to this project will be documented in this file.

## [1.10.0] - 2023-06-08
### Added
- `redaction` in detokenize interface.
### Changed
- Removed grace period logic for bearer token generation.
## [1.9.3] - 2023-03-17
### Changed
- Removed grace period logic for bearer token generation.
Expand Down
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -577,18 +577,28 @@ In order to retrieve data from your vault using tokens that you have previously
```javascript
data = {
records: [{
// Token for the record to be fetched.
token: 'string'
token: 'string', // Required, token for the record to be fetched.
redaction: Skyflow.RedactionType // Optional, redaction type to be applied to retrieved data, ex: Skyflow.RedactionType.PLAIN_TEXT
}]
}
```
`Skyflow.RedactionType` accept four values:
* `PLAIN_TEXT`
* `MASKED`
* `REDACTED`
* `DEFAULT`

Note:
- `redaction` defaults to Skyflow.RedactionType.PLAIN_TEXT.

An [example](https://github.com/skyflowapi/skyflow-node/blob/master/samples/vault-api/Detokenize.ts) of a detokenize call:

```javascript
const result = client.detokenize({
records: [
{
token: '4017-f72b-4f5c-9b-8e719',
redaction: Skyflow.RedactionType.PLAIN_TEXT
},
],
});
Expand Down Expand Up @@ -629,7 +639,7 @@ data = {
}]
};
```
`Skyflow.RedactionTypes` accept four values:
`Skyflow.RedactionType` accept four values:
* `PLAIN_TEXT`
* `MASKED`
* `REDACTED`
Expand Down
3 changes: 3 additions & 0 deletions samples/vault-api/Detokenize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,15 @@ const result = skyflow.detokenize({
records: [
{
token: '<TOKEN1>',
redaction: Skyflow.RedactionType.DEFAULT // optional
},
{
token: '<TOKEN2>',
redaction: Skyflow.RedactionType.MASKED // optional
},
{
token: '<TOKEN3>',
redaction: Skyflow.RedactionType.REDACTED // optional
},
{
token: '<TOKEN4>',
Expand Down

0 comments on commit 503a20e

Please sign in to comment.