- README update
- Dependency updates
- README update
- Fix typo
- Support objects in assertions
- Export
Assertion
type
encrypt
and verify
now support passing in an object as a generic type parameter. This can be used to give you type safety on the token payload:
const baz = verify<{ foo: string }>(key, token);
baz.foo; // string
- Dependency updates
- Expose every file under
lib
in package.json (import { base64UrlEncode } from 'paseto-ts/lib/base64url'
, etc.)
- Dependency updates
- Fix binding of Crypto to getRandomValues under node
- Removed
globalThis
usage
- Changed
encrypt
function: acceptsgetRandomValues
option for Node < 19. - Changed
generateKeys
function: acceptsgetRandomValues
option for Node < 19.
A getRandomValues
function is required as an option for Node < 19.0.0. It should be a function that accepts a Uint8Array
and returns a Uint8Array
with random values:
const getRandomValues = (array: Uint8Array): Uint8Array => {
const bytes = crypto.randomBytes(array.length);
array.set(bytes);
return array;
};
- Refactored imports to use
.js
extension.
encrypt
accepts aPayload
object instead of string and Uint8Array.
- Added option to disable payload validation (
validatePayload: false
). - Uint8Array footers are now validated against
maxKeys
andmaxDepth
. - Added passing V4 test vectors.
- Initial release