Skip to content

Commit

Permalink
feat: add token expires_at (#211)
Browse files Browse the repository at this point in the history
  • Loading branch information
lcschy committed Jul 29, 2022
1 parent c24f8f7 commit 69888cc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/types/models/tokens.ts
Expand Up @@ -51,6 +51,7 @@ interface Token<DataType = Primitive> extends TokenBase {
searchIndexes?: string[];
fingerprintExpression?: string;
mask?: TokenMask;
expiresAt?: string;
}

type CreateToken<DataType = Primitive> = Pick<
Expand All @@ -63,6 +64,7 @@ type CreateToken<DataType = Primitive> = Pick<
| 'searchIndexes'
| 'fingerprintExpression'
| 'mask'
| 'expiresAt'
> & {
deduplicateToken?: boolean;
id?: string;
Expand Down
2 changes: 2 additions & 0 deletions test/tokenize.test.ts
Expand Up @@ -65,6 +65,7 @@ describe('Tokenize', () => {
expiration_month: chance.integer(),
expiration_year: chance.integer(),
},
expiresAt: chance.date().toString(),
},
random_tokens: [
chance.string(),
Expand Down Expand Up @@ -102,6 +103,7 @@ describe('Tokenize', () => {
expiration_month: chance.integer(),
expiration_year: chance.integer(),
},
expiresAt: chance.date().toString(),
},
random_tokens: [
chance.guid(),
Expand Down
1 change: 1 addition & 0 deletions test/tokens.test.ts
Expand Up @@ -600,6 +600,7 @@ describe('Tokens', () => {
fingerprintExpression: _chance.string(),
deduplicateToken: _chance.bool(),
mask: _chance.string(),
expiresAt: _chance.date().toString(),
};
/* eslint-enable camelcase */

Expand Down

0 comments on commit 69888cc

Please sign in to comment.